diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml new file mode 100644 index 00000000..ad5ee320 --- /dev/null +++ b/.github/workflows/bootstrap.yaml @@ -0,0 +1,58 @@ +name: Bootstrap + +on: + push: + branches: [bootstrap] + pull_request: + branches: [bootstrap] + +jobs: + build: + name: python ${{ matrix.python-version }} on ${{matrix.os}} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + include: + - {python-version: "3.10", os: ubuntu-latest} + + steps: + - uses: actions/checkout@v2 + - name: Set up python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Upgrade pip + run: | + python -m pip install --upgrade pip + - name: Install ebcc + run: | + python -m pip install wheel + python -m pip install -e .[dev] + - name: Install dependencies + run: | + python -m pip install git+https://github.com/obackhouse/albert@master + python -m pip install git+https://github.com/edeprince3/pdaggerq@master + python -m pip install git+https://github.com/obackhouse/drudge@master + python -m pip install git+https://github.com/obackhouse/gristmill@master + python -m pip install git+https://github.com/tschijnmo/DummyRDD@master + - name: Bootstrap + env: + PYTHONWARNINGS: "ignore" + run: | + git fetch --all + git pull origin bootstrap + git checkout bootstrap + chmod +x .github/workflows/bootstrap_all.sh + cd ebcc/codegen && ./../../.github/workflows/bootstrap_all.sh + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git checkout -b bootstrap_ci + git add *.py + git commit -m "Bootstrap via ${{ github.sha }}" + git push origin bootstrap_ci --force + - name: Run unit tests + run: | + python -m pip install pytest + pytest diff --git a/.github/workflows/bootstrap_all.sh b/.github/workflows/bootstrap_all.sh new file mode 100644 index 00000000..61f7a69f --- /dev/null +++ b/.github/workflows/bootstrap_all.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +for method in MPn; do + for n in 2 3; do + for i in rhf uhf ghf; do + echo "Bootstrapping $method ($i) (order=$n)" + python -W ignore bootstrap_${method}.py $i $n &> output_${method}_${i}_${n}.dat & + done + done +done + +for method in CCD CCSD QCISD CC2 DCD DCSD; do + for i in rhf uhf ghf; do + echo "Bootstrapping $method ($i)" + python -W ignore bootstrap_${method}.py $i &> output_${method}_${i}.dat & + done + for i in rhf uhf; do + echo "Bootstrapping DF-$method ($i)" + python -W ignore bootstrap_DF${method}.py $i &> output_DF${method}_${i}.dat & + done +done + +for method in CCSDwtwp; do + for i in rhf ghf; do + echo "Bootstrapping $method ($i)" + python -W ignore bootstrap_${method}.py $i &> output_${method}_${i}.dat & + done +done + +for method in CC3 CCSDT; do + for i in rhf uhf ghf; do + echo "Bootstrapping $method ($i)" + python -W ignore bootstrap_${method}.py $i &> output_${method}_${i}.dat & + done +done + +wait + +for method in MPn; do + for n in 2 3; do + for i in rhf uhf ghf; do + echo "Output for $method ($i) (order=$n)" + cat output_${method}_${i}_${n}.dat + done + done +done + +for method in CCD CCSD QCISD CC2 DCD DCSD; do + for i in rhf uhf ghf; do + echo "Output for $method ($i)" + cat output_${method}_${i}.dat + done + for i in rhf uhf; do + echo "Output for DF-$method ($i)" + cat output_DF${method}_${i}.dat + done +done + +for method in CCSDwtwp; do + for i in rhf ghf; do + echo "Output for $method ($i)" + cat output_${method}_${i}.dat + done +done + +for method in CC3 CCSDT; do + for i in rhf uhf ghf; do + echo "Output for $method ($i)" + cat output_${method}_${i}.dat + done +done diff --git a/ebcc/codegen/GCC2.py b/ebcc/codegen/GCC2.py deleted file mode 100644 index 264e3527..00000000 --- a/ebcc/codegen/GCC2.py +++ /dev/null @@ -1,1986 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T16:46:10.331394 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:46:10.579905. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(t2) - tmp0 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - e_cc = einsum(f.ov, (0, 1), t1, (0, 1), ()) - e_cc += einsum(v.oovv, (0, 1, 2, 3), tmp0, (0, 1, 2, 3), ()) * 0.25 - del tmp0 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:46:14.108530. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - """ - - tmp16 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp0 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp17 = einsum(tmp16, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) * -1 - del tmp16 - tmp4 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp8 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp23 = np.copy(v.oooo) - tmp23 += einsum(t1, (0, 1), tmp0, (2, 3, 4, 1), (4, 3, 0, 2)) * -1 - tmp11 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp13 = einsum(v.ovov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) - tmp18 = einsum(t1, (0, 1), tmp17, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - del tmp17 - tmp15 = einsum(t2, (0, 1, 2, 3), tmp4, (1, 4), (4, 0, 2, 3)) - tmp9 = einsum(t1, (0, 1), tmp8, (2, 3, 4, 1), (2, 0, 3, 4)) * -1 - del tmp8 - tmp5 = np.copy(t2) - tmp5 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - tmp24 = np.copy(v.ooov) * -1 - tmp24 += einsum(tmp23, (0, 1, 2, 3), t1, (0, 4), (2, 3, 1, 4)) * -1 - del tmp23 - tmp21 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 1), (4, 0, 2, 3)) - tmp7 = einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp20 = einsum(t2, (0, 1, 2, 3), f.vv, (4, 3), (0, 1, 4, 2)) - tmp22 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - tmp12 = einsum(t1, (0, 1), tmp11, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp11 - tmp14 = einsum(t1, (0, 1), tmp13, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp13 - tmp19 = np.copy(np.transpose(tmp15, (0, 1, 3, 2))) * -1 - del tmp15 - tmp19 += np.transpose(tmp18, (0, 1, 3, 2)) - del tmp18 - tmp10 = einsum(tmp9, (0, 1, 2, 3), t1, (2, 4), (1, 0, 4, 3)) * -1 - del tmp9 - tmp2 = np.copy(t2) * 0.5 - tmp2 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp3 = np.copy(f.ov) - tmp3 += einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp1 = np.copy(np.transpose(v.ovoo, (0, 2, 3, 1))) * -1 - tmp1 += np.transpose(tmp0, (0, 2, 1, 3)) * -1 - del tmp0 - tmp6 = np.copy(f.oo) - tmp6 += tmp4 - del tmp4 - tmp6 += einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp6 += einsum(tmp5, (0, 1, 2, 3), v.oovv, (4, 0, 2, 3), (4, 1)) * -0.5 - del tmp5 - t2new = einsum(tmp7, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) * -1 - del tmp7 - t2new += v.oovv - t2new += einsum(v.ooov, (0, 1, 2, 3), t1, (2, 4), (0, 1, 3, 4)) - t2new += tmp10 * -1 - t2new += np.transpose(tmp10, (0, 1, 3, 2)) - del tmp10 - t2new += tmp12 - t2new += np.transpose(tmp12, (0, 1, 3, 2)) * -1 - del tmp12 - t2new += tmp14 - t2new += np.transpose(tmp14, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp14, (1, 0, 2, 3)) * -1 - t2new += np.transpose(tmp14, (1, 0, 3, 2)) - del tmp14 - t2new += tmp19 - t2new += np.transpose(tmp19, (1, 0, 2, 3)) * -1 - del tmp19 - t2new += np.transpose(tmp20, (1, 0, 2, 3)) - t2new += np.transpose(tmp20, (1, 0, 3, 2)) * -1 - del tmp20 - t2new += np.transpose(tmp21, (0, 1, 3, 2)) - t2new += np.transpose(tmp21, (1, 0, 3, 2)) * -1 - del tmp21 - t2new += np.transpose(tmp22, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp22, (1, 0, 3, 2)) - del tmp22 - t2new += einsum(t1, (0, 1), tmp24, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp24 - t1new = np.copy(f.ov) - t1new += einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - t1new += einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) * -1 - t1new += einsum(tmp1, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) * 0.5 - del tmp1 - t1new += einsum(v.ovvv, (0, 1, 2, 3), tmp2, (0, 4, 2, 3), (4, 1)) - del tmp2 - t1new += einsum(tmp3, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - del tmp3 - t1new += einsum(t1, (0, 1), tmp6, (0, 2), (2, 1)) * -1 - del tmp6 - - return {f"t1new": t1new, f"t2new": t2new} - -def update_lams(f=None, l1=None, l2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:46:23.597177. - - Parameters - ---------- - f : array - Fock matrix. - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - l1new : array - Updated L1 residuals. - l2new : array - Updated L2 residuals. - """ - - tmp5 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp2 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp0 = einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp33 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp23 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp17 = einsum(t1, (0, 1), l1, (1, 2), (2, 0)) - tmp6 = np.copy(np.transpose(v.ovoo, (0, 2, 3, 1))) * -1 - tmp6 += np.transpose(tmp5, (0, 2, 1, 3)) * -1 - tmp21 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp7 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp26 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp26 += tmp2 - tmp10 = np.copy(v.ooov) - tmp10 += np.transpose(tmp5, (2, 1, 0, 3)) * 0.5 - tmp18 = einsum(t2, (0, 1, 2, 3), l2, (2, 3, 4, 1), (4, 0)) - tmp3 = einsum(t2, (0, 1, 2, 3), l2, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp4 = einsum(tmp0, (0, 1, 2, 3), t1, (4, 3), (1, 0, 2, 4)) - tmp34 = einsum(tmp33, (0, 1), l2, (2, 3, 4, 1), (0, 4, 2, 3)) - del tmp33 - tmp36 = einsum(l2, (0, 1, 2, 3), tmp23, (4, 3), (2, 4, 0, 1)) - tmp35 = einsum(tmp17, (0, 1), v.oovv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp29 = einsum(tmp0, (0, 1, 2, 3), f.ov, (2, 4), (0, 1, 4, 3)) - tmp31 = einsum(tmp6, (0, 1, 2, 3), l1, (4, 0), (1, 2, 4, 3)) - tmp30 = einsum(tmp21, (0, 1), l2, (2, 0, 3, 4), (3, 4, 2, 1)) - tmp44 = einsum(tmp7, (0, 1), t1, (2, 1), (2, 0)) - tmp25 = einsum(tmp0, (0, 1, 2, 3), v.ooov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp27 = einsum(l2, (0, 1, 2, 3), tmp26, (3, 4, 1, 5), (4, 2, 5, 0)) - del tmp26 - tmp42 = einsum(v.ovvv, (0, 1, 2, 3), l1, (1, 4), (4, 0, 2, 3)) - tmp41 = einsum(f.oo, (0, 1), l2, (2, 3, 4, 1), (0, 4, 2, 3)) - tmp39 = einsum(tmp7, (0, 1), tmp0, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp38 = einsum(l2, (0, 1, 2, 3), f.vv, (4, 1), (2, 3, 4, 0)) - tmp8 = np.copy(f.ov) - tmp8 += tmp7 - tmp9 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) - tmp9 += np.transpose(tmp2, (0, 1, 3, 2)) * -0.5 - tmp11 = np.copy(v.oooo) * -0.5 - tmp11 += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 5, 2, 3), (4, 5, 0, 1)) * -0.25 - tmp11 += einsum(t1, (0, 1), tmp10, (2, 3, 4, 1), (3, 2, 0, 4)) * -1 - tmp19 = np.copy(tmp17) * 2 - del tmp17 - tmp19 += tmp18 - del tmp18 - tmp14 = np.copy(np.transpose(tmp3, (1, 0, 3, 2))) * -0.5 - tmp14 += np.transpose(tmp4, (0, 1, 3, 2)) - tmp37 = np.copy(np.transpose(tmp34, (0, 1, 3, 2))) * -1 - del tmp34 - tmp37 += np.transpose(tmp35, (0, 1, 3, 2)) * -1 - del tmp35 - tmp37 += np.transpose(tmp36, (0, 1, 3, 2)) - del tmp36 - tmp32 = np.copy(tmp29) * -1 - del tmp29 - tmp32 += tmp30 - del tmp30 - tmp32 += np.transpose(tmp31, (1, 0, 2, 3)) - del tmp31 - tmp47 = np.copy(v.oooo) - tmp47 += einsum(t1, (0, 1), tmp10, (2, 3, 4, 1), (4, 0, 3, 2)) * -2 - del tmp10 - tmp46 = einsum(tmp5, (0, 1, 2, 3), tmp0, (0, 4, 2, 5), (4, 1, 5, 3)) * -1 - del tmp5 - tmp45 = einsum(l2, (0, 1, 2, 3), tmp44, (3, 4), (2, 4, 0, 1)) - del tmp44 - tmp28 = einsum(tmp7, (0, 1), l1, (2, 3), (3, 0, 2, 1)) - del tmp7 - tmp28 += tmp25 - del tmp25 - tmp28 += np.transpose(tmp27, (1, 0, 3, 2)) - del tmp27 - tmp43 = np.copy(np.transpose(tmp41, (0, 1, 3, 2))) * -1 - del tmp41 - tmp43 += np.transpose(tmp42, (0, 1, 3, 2)) - del tmp42 - tmp40 = np.copy(np.transpose(tmp38, (1, 0, 2, 3))) * -1 - del tmp38 - tmp40 += tmp39 - del tmp39 - tmp12 = np.copy(np.transpose(v.ovoo, (0, 2, 3, 1))) * -0.5 - tmp12 += einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (0, 4, 5, 1)) * -0.25 - tmp12 += einsum(tmp6, (0, 1, 2, 3), t2, (4, 1, 5, 3), (2, 4, 0, 5)) - del tmp6 - tmp12 += einsum(t2, (0, 1, 2, 3), tmp8, (4, 3), (4, 0, 1, 2)) * 0.5 - tmp12 += einsum(tmp9, (0, 1, 2, 3), t1, (4, 2), (1, 0, 4, 3)) * -1 - del tmp9 - tmp12 += einsum(tmp11, (0, 1, 2, 3), t1, (0, 4), (1, 3, 2, 4)) * -1 - del tmp11 - tmp13 = np.copy(v.ovvv) - tmp13 += einsum(v.vvvv, (0, 1, 2, 3), t1, (4, 1), (4, 0, 2, 3)) * -1 - tmp20 = np.copy(t1) * -1 - tmp20 += einsum(l1, (0, 1), t2, (2, 1, 3, 0), (2, 3)) * -1 - tmp20 += einsum(tmp0, (0, 1, 2, 3), t2, (1, 0, 4, 3), (2, 4)) * 0.5 - tmp20 += einsum(tmp19, (0, 1), t1, (0, 2), (1, 2)) * 0.5 - tmp16 = einsum(l1, (0, 1), t1, (1, 2), (0, 2)) * 2 - tmp16 += einsum(l2, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - tmp15 = einsum(l1, (0, 1), t2, (2, 3, 4, 0), (1, 2, 3, 4)) * 0.5 - tmp15 += einsum(tmp0, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - tmp15 += einsum(tmp14, (0, 1, 2, 3), t1, (0, 4), (1, 3, 2, 4)) * -0.5 - del tmp14 - tmp22 = np.copy(f.vv) - tmp22 += tmp21 * -1 - del tmp21 - tmp24 = np.copy(f.oo) * 2 - tmp24 += np.transpose(tmp23, (1, 0)) * 2 - del tmp23 - tmp24 += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - tmp24 += einsum(tmp8, (0, 1), t1, (2, 1), (2, 0)) * 2 - tmp1 = einsum(t2, (0, 1, 2, 3), l2, (4, 3, 5, 1), (5, 0, 4, 2)) - l2new = einsum(tmp0, (0, 1, 2, 3), v.ovvv, (2, 3, 4, 5), (4, 5, 0, 1)) - l2new += einsum(v.vvvv, (0, 1, 2, 3), l2, (2, 3, 4, 5), (0, 1, 4, 5)) * 0.5 - l2new += np.transpose(v.oovv, (2, 3, 0, 1)) - l2new += einsum(tmp4, (0, 1, 2, 3), v.oovv, (3, 2, 4, 5), (4, 5, 1, 0)) * 0.5 - l2new += np.transpose(tmp28, (2, 3, 0, 1)) - l2new += np.transpose(tmp28, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp28, (2, 3, 1, 0)) * -1 - l2new += np.transpose(tmp28, (3, 2, 1, 0)) - del tmp28 - l2new += np.transpose(tmp32, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp32, (3, 2, 0, 1)) - del tmp32 - l2new += np.transpose(tmp37, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp37, (3, 2, 1, 0)) - del tmp37 - l2new += einsum(l1, (0, 1), f.ov, (2, 3), (3, 0, 2, 1)) - l2new += einsum(l1, (0, 1), f.ov, (2, 3), (0, 3, 2, 1)) * -1 - l2new += einsum(f.ov, (0, 1), l1, (2, 3), (1, 2, 3, 0)) * -1 - l2new += einsum(l1, (0, 1), f.ov, (2, 3), (0, 3, 1, 2)) - l2new += np.transpose(tmp40, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp40, (3, 2, 0, 1)) - del tmp40 - l2new += np.transpose(tmp43, (2, 3, 0, 1)) - l2new += np.transpose(tmp43, (2, 3, 1, 0)) * -1 - del tmp43 - l2new += np.transpose(tmp45, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp45, (2, 3, 1, 0)) - del tmp45 - l2new += np.transpose(tmp46, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp46, (3, 2, 0, 1)) - l2new += np.transpose(tmp46, (2, 3, 1, 0)) - l2new += np.transpose(tmp46, (3, 2, 1, 0)) * -1 - del tmp46 - l2new += einsum(l2, (0, 1, 2, 3), tmp47, (2, 3, 4, 5), (0, 1, 4, 5)) * 0.5 - del tmp47 - l1new = einsum(tmp0, (0, 1, 2, 3), v.ovov, (2, 3, 1, 4), (4, 0)) * -1 - l1new += np.transpose(f.ov, (1, 0)) - l1new += einsum(v.ovvv, (0, 1, 2, 3), tmp1, (4, 0, 1, 3), (2, 4)) * -1 - del tmp1 - l1new += einsum(tmp0, (0, 1, 2, 3), tmp2, (1, 2, 3, 4), (4, 0)) - del tmp2, tmp0 - l1new += einsum(l1, (0, 1), v.ovov, (2, 0, 1, 3), (3, 2)) * -1 - l1new += einsum(v.ovoo, (0, 1, 2, 3), tmp3, (4, 0, 3, 2), (1, 4)) * 0.25 - del tmp3 - l1new += einsum(v.ooov, (0, 1, 2, 3), tmp4, (4, 2, 0, 1), (3, 4)) * -0.5 - del tmp4 - l1new += einsum(tmp12, (0, 1, 2, 3), l2, (4, 3, 1, 2), (4, 0)) - del tmp12 - l1new += einsum(tmp13, (0, 1, 2, 3), l2, (2, 3, 4, 0), (1, 4)) * -0.5 - del tmp13 - l1new += einsum(tmp15, (0, 1, 2, 3), v.oovv, (1, 2, 4, 3), (4, 0)) - del tmp15 - l1new += einsum(v.ovvv, (0, 1, 2, 3), tmp16, (1, 3), (2, 0)) * 0.5 - del tmp16 - l1new += einsum(tmp20, (0, 1), v.oovv, (2, 0, 3, 1), (3, 2)) * -1 - del tmp20 - l1new += einsum(v.ooov, (0, 1, 2, 3), tmp19, (2, 1), (3, 0)) * 0.5 - l1new += einsum(l1, (0, 1), tmp22, (0, 2), (2, 1)) - del tmp22 - l1new += einsum(l1, (0, 1), tmp24, (1, 2), (0, 2)) * -0.5 - del tmp24 - l1new += einsum(tmp8, (0, 1), tmp19, (2, 0), (1, 2)) * -0.5 - del tmp8, tmp19 - - return {f"l1new": l1new, f"l2new": l2new} - -def make_rdm1_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:46:24.279058. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm1 : array - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp1 = einsum(t1, (0, 1), l1, (1, 2), (2, 0)) - tmp0 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 0, 1), (2, 4)) - tmp2 = einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp3 = np.copy(tmp1) * 2 - tmp3 += tmp0 - rdm1.vv = einsum(l1, (0, 1), t1, (1, 2), (0, 2)) - rdm1.vv += einsum(l2, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) * 0.5 - rdm1.vo = np.copy(l1) - rdm1.ov = einsum(l1, (0, 1), t2, (2, 1, 3, 0), (2, 3)) - rdm1.ov += einsum(t2, (0, 1, 2, 3), tmp2, (1, 0, 4, 3), (4, 2)) * -0.5 - del tmp2 - rdm1.ov += t1 - rdm1.ov += einsum(tmp3, (0, 1), t1, (0, 2), (1, 2)) * -0.5 - del tmp3 - rdm1.oo = np.copy(delta.oo) - del delta - rdm1.oo += np.transpose(tmp0, (1, 0)) * -0.5 - del tmp0 - rdm1.oo += np.transpose(tmp1, (1, 0)) * -1 - del tmp1 - rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]]) - - return rdm1 - -def make_rdm2_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:46:35.023382. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm2 : array - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp1 = einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp4 = einsum(t1, (0, 1), l1, (1, 2), (2, 0)) - tmp3 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 0, 1), (2, 4)) - tmp19 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp5 = einsum(t2, (0, 1, 2, 3), l1, (3, 4), (4, 0, 1, 2)) - tmp2 = einsum(t1, (0, 1), tmp1, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp0 = einsum(t2, (0, 1, 2, 3), l2, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp12 = einsum(tmp1, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 2, 4, 5)) * -1 - tmp7 = einsum(t1, (0, 1), tmp4, (0, 2), (2, 1)) - tmp6 = einsum(l1, (0, 1), t2, (2, 1, 3, 0), (2, 3)) - tmp14 = np.copy(tmp4) * 2 - tmp14 += tmp3 - tmp22 = einsum(l2, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - tmp30 = einsum(l1, (0, 1), t1, (1, 2), (0, 2)) - tmp29 = einsum(tmp1, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - tmp36 = einsum(t1, (0, 1), tmp19, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp18 = einsum(t1, (0, 1), tmp5, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp20 = einsum(t2, (0, 1, 2, 3), tmp19, (1, 4, 3, 5), (4, 0, 5, 2)) - tmp13 = np.copy(np.transpose(tmp0, (1, 0, 3, 2))) * -0.5 - tmp13 += np.transpose(tmp2, (0, 1, 3, 2)) - tmp25 = einsum(tmp12, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - tmp8 = np.copy(tmp6) - tmp8 += tmp7 * -1 - del tmp7 - tmp10 = einsum(tmp3, (0, 1), t1, (0, 2), (1, 2)) - tmp9 = einsum(tmp1, (0, 1, 2, 3), t2, (1, 0, 4, 3), (2, 4)) - tmp15 = einsum(t1, (0, 1), tmp14, (0, 2), (2, 1)) * 0.5 - del tmp14 - tmp38 = einsum(t1, (0, 1), l2, (2, 3, 4, 0), (4, 2, 3, 1)) - tmp31 = np.copy(tmp30) - tmp31 += tmp22 * 0.5 - tmp33 = einsum(l1, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) - tmp34 = einsum(tmp1, (0, 1, 2, 3), t2, (1, 0, 4, 5), (2, 3, 4, 5)) * -1 - tmp35 = einsum(t1, (0, 1), tmp29, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - tmp37 = np.copy(tmp36) - tmp37 += einsum(tmp22, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -0.5 - tmp32 = np.copy(tmp30) * 2 - tmp32 += tmp22 - tmp24 = einsum(t2, (0, 1, 2, 3), tmp3, (1, 4), (0, 4, 2, 3)) - tmp21 = np.copy(tmp18) - del tmp18 - tmp21 += tmp20 - del tmp20 - tmp28 = einsum(tmp13, (0, 1, 2, 3), t1, (0, 4), (1, 3, 2, 4)) * -2 - tmp26 = np.copy(tmp25) - del tmp25 - tmp26 += einsum(tmp8, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -1 - tmp11 = np.copy(tmp9) - tmp11 += tmp10 - del tmp10 - tmp23 = einsum(tmp22, (0, 1), t2, (2, 3, 4, 0), (2, 3, 4, 1)) - del tmp22 - tmp27 = einsum(t2, (0, 1, 2, 3), tmp4, (1, 4), (4, 0, 2, 3)) - tmp17 = np.copy(np.transpose(tmp0, (1, 0, 3, 2))) * -1 - tmp17 += np.transpose(tmp2, (0, 1, 3, 2)) * 2 - tmp16 = np.copy(tmp6) * -1 - del tmp6 - tmp16 += tmp9 * 0.5 - del tmp9 - tmp16 += tmp15 - del tmp15 - rdm2.vvvv = einsum(t2, (0, 1, 2, 3), l2, (4, 5, 0, 1), (4, 5, 2, 3)) * 0.5 - rdm2.vvvv += einsum(tmp38, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - rdm2.vvvo = np.copy(np.transpose(tmp38, (2, 1, 3, 0))) - rdm2.vvov = np.copy(np.transpose(tmp38, (2, 1, 0, 3))) * -1 - del tmp38 - rdm2.vovv = np.copy(np.transpose(tmp33, (1, 0, 3, 2))) - rdm2.vovv += np.transpose(tmp34, (1, 0, 3, 2)) * 0.5 - rdm2.vovv += np.transpose(tmp35, (1, 0, 3, 2)) - rdm2.vovv += einsum(t1, (0, 1), tmp31, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.vovv += einsum(tmp31, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - rdm2.vovv += np.transpose(tmp36, (1, 0, 2, 3)) - rdm2.vovv += np.transpose(tmp36, (1, 0, 3, 2)) * -1 - del tmp36 - rdm2.ovvv = np.copy(np.transpose(tmp33, (0, 1, 3, 2))) * -1 - del tmp33 - rdm2.ovvv += np.transpose(tmp34, (0, 1, 3, 2)) * -0.5 - del tmp34 - rdm2.ovvv += np.transpose(tmp35, (0, 1, 3, 2)) * -1 - del tmp35 - rdm2.ovvv += einsum(tmp30, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2.ovvv += einsum(tmp30, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1 - del tmp30 - rdm2.ovvv += tmp37 * -1 - rdm2.ovvv += np.transpose(tmp37, (0, 1, 3, 2)) - del tmp37 - rdm2.vvoo = np.copy(l2) - rdm2.vovo = einsum(l1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.vovo += np.transpose(tmp19, (2, 1, 3, 0)) * -1 - rdm2.vovo += np.transpose(tmp29, (2, 1, 3, 0)) - rdm2.vovo += einsum(delta.oo, (0, 1), tmp32, (2, 3), (2, 0, 3, 1)) * 0.5 - rdm2.voov = einsum(l1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - rdm2.voov += np.transpose(tmp19, (2, 1, 0, 3)) - rdm2.voov += np.transpose(tmp29, (2, 1, 0, 3)) * -1 - rdm2.voov += einsum(tmp31, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.ovvo = einsum(l1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2.ovvo += np.transpose(tmp19, (1, 2, 3, 0)) - rdm2.ovvo += np.transpose(tmp29, (1, 2, 3, 0)) * -1 - rdm2.ovvo += einsum(delta.oo, (0, 1), tmp32, (2, 3), (0, 2, 3, 1)) * -0.5 - del tmp32 - rdm2.ovov = einsum(l1, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.ovov += np.transpose(tmp19, (1, 2, 0, 3)) * -1 - del tmp19 - rdm2.ovov += np.transpose(tmp29, (1, 2, 0, 3)) - del tmp29 - rdm2.ovov += einsum(tmp31, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) - del tmp31 - rdm2.oovv = np.copy(t2) - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2.oovv += tmp21 - rdm2.oovv += np.transpose(tmp21, (0, 1, 3, 2)) * -1 - del tmp21 - rdm2.oovv += tmp23 * -0.5 - rdm2.oovv += np.transpose(tmp23, (0, 1, 3, 2)) * 0.5 - del tmp23 - rdm2.oovv += np.transpose(tmp24, (0, 1, 3, 2)) * 0.5 - rdm2.oovv += np.transpose(tmp24, (1, 0, 3, 2)) * -0.5 - del tmp24 - rdm2.oovv += tmp26 * -1 - rdm2.oovv += np.transpose(tmp26, (0, 1, 3, 2)) - rdm2.oovv += np.transpose(tmp26, (1, 0, 2, 3)) - rdm2.oovv += np.transpose(tmp26, (1, 0, 3, 2)) * -1 - del tmp26 - rdm2.oovv += einsum(tmp11, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -0.5 - rdm2.oovv += einsum(tmp11, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * 0.5 - rdm2.oovv += einsum(t1, (0, 1), tmp11, (2, 3), (2, 0, 1, 3)) * 0.5 - rdm2.oovv += einsum(t1, (0, 1), tmp11, (2, 3), (2, 0, 3, 1)) * -0.5 - rdm2.oovv += np.transpose(tmp27, (0, 1, 3, 2)) * -1 - rdm2.oovv += np.transpose(tmp27, (1, 0, 3, 2)) - del tmp27 - rdm2.oovv += einsum(tmp13, (0, 1, 2, 3), t2, (0, 1, 4, 5), (3, 2, 4, 5)) * 0.5 - rdm2.oovv += einsum(t1, (0, 1), tmp28, (0, 2, 3, 4), (2, 3, 1, 4)) * 0.5 - del tmp28 - rdm2.vooo = np.copy(np.transpose(tmp1, (3, 2, 1, 0))) - rdm2.vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 3, 1)) - rdm2.vooo += einsum(l1, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.ovoo = np.copy(np.transpose(tmp1, (2, 3, 1, 0))) * -1 - del tmp1 - rdm2.ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.ovoo += einsum(l1, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) - rdm2.oovo = np.copy(np.transpose(tmp5, (2, 1, 3, 0))) - rdm2.oovo += einsum(tmp16, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.oovo += einsum(delta.oo, (0, 1), tmp16, (2, 3), (0, 2, 3, 1)) - del tmp16 - rdm2.oovo += einsum(delta.oo, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2.oovo += einsum(delta.oo, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.oovo += einsum(tmp4, (0, 1), t1, (2, 3), (2, 1, 3, 0)) * -1 - rdm2.oovo += einsum(t1, (0, 1), tmp4, (2, 3), (3, 0, 1, 2)) - rdm2.oovo += np.transpose(tmp12, (1, 2, 3, 0)) - rdm2.oovo += np.transpose(tmp12, (2, 1, 3, 0)) * -1 - rdm2.oovo += einsum(tmp3, (0, 1), t1, (2, 3), (2, 1, 3, 0)) * -0.5 - rdm2.oovo += einsum(t1, (0, 1), tmp3, (2, 3), (3, 0, 1, 2)) * 0.5 - rdm2.oovo += einsum(tmp17, (0, 1, 2, 3), t1, (0, 4), (3, 2, 4, 1)) * 0.5 - del tmp17 - rdm2.ooov = np.copy(np.transpose(tmp5, (2, 1, 0, 3))) * -1 - del tmp5 - rdm2.ooov += einsum(tmp8, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.ooov += einsum(tmp8, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) - del tmp8 - rdm2.ooov += einsum(delta.oo, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.ooov += einsum(delta.oo, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - rdm2.ooov += einsum(tmp4, (0, 1), t1, (2, 3), (2, 1, 0, 3)) - rdm2.ooov += einsum(t1, (0, 1), tmp4, (2, 3), (3, 0, 2, 1)) * -1 - rdm2.ooov += einsum(delta.oo, (0, 1), tmp11, (2, 3), (2, 0, 1, 3)) * 0.5 - rdm2.ooov += einsum(delta.oo, (0, 1), tmp11, (2, 3), (0, 2, 1, 3)) * -0.5 - del tmp11 - rdm2.ooov += np.transpose(tmp12, (1, 2, 0, 3)) * -1 - rdm2.ooov += np.transpose(tmp12, (2, 1, 0, 3)) - del tmp12 - rdm2.ooov += einsum(tmp3, (0, 1), t1, (2, 3), (2, 1, 0, 3)) * 0.5 - rdm2.ooov += einsum(t1, (0, 1), tmp3, (2, 3), (3, 0, 2, 1)) * -0.5 - rdm2.ooov += einsum(tmp13, (0, 1, 2, 3), t1, (0, 4), (3, 2, 1, 4)) * -1 - del tmp13 - rdm2.oooo = np.copy(np.transpose(tmp0, (3, 2, 1, 0))) * 0.5 - del tmp0 - rdm2.oooo += np.transpose(tmp2, (2, 3, 1, 0)) * -1 - del tmp2 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp3, (2, 3), (3, 0, 2, 1)) * -0.5 - rdm2.oooo += einsum(tmp3, (0, 1), delta.oo, (2, 3), (2, 1, 0, 3)) * 0.5 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp3, (2, 3), (3, 0, 1, 2)) * 0.5 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp3, (2, 3), (0, 3, 1, 2)) * -0.5 - del tmp3 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp4, (2, 3), (3, 0, 2, 1)) * -1 - rdm2.oooo += einsum(tmp4, (0, 1), delta.oo, (2, 3), (2, 1, 0, 3)) - rdm2.oooo += einsum(tmp4, (0, 1), delta.oo, (2, 3), (1, 2, 3, 0)) - rdm2.oooo += einsum(delta.oo, (0, 1), tmp4, (2, 3), (0, 3, 1, 2)) * -1 - del tmp4, delta - rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv) - rdm2 = np.transpose(rdm2, (0, 2, 1, 3)) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:46:40.972111. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp11 : array - tmp12 : array - tmp13 : array - tmp15 : array - tmp16 : array - tmp18 : array - tmp19 : array - tmp2 : array - tmp21 : array - tmp22 : array - tmp23 : array - tmp3 : array - tmp4 : array - tmp5 : array - tmp7 : array - tmp8 : array - """ - - tmp0 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp2 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp23 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp22 = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 4, 3), (4, 2)) - tmp21 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp19 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp18 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp16 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp15 = einsum(v.ovoo, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - tmp13 = einsum(t1, (0, 1), tmp0, (0, 2), (2, 1)) - tmp12 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp11 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp8 = einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - tmp7 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - tmp5 = einsum(tmp2, (0, 1), t1, (2, 1), (2, 0)) - tmp4 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp3 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp1 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp11": tmp11, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp15": tmp15, f"tmp16": tmp16, f"tmp18": tmp18, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp3": tmp3, f"tmp4": tmp4, f"tmp5": tmp5, f"tmp7": tmp7, f"tmp8": tmp8} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:46:40.989837. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp5 = np.copy(f.oo) - tmp5 += ints.tmp0 - tmp6 = einsum(r2, (0, 1, 2), tmp5, (1, 3), (0, 3, 2)) * -1 - del tmp5 - tmp4 = einsum(ints.tmp16, (0, 1, 2, 3), r1, (1,), (0, 2, 3)) - del ints.tmp16 - tmp8 = einsum(ints.tmp4, (0, 1), r2, (2, 1, 3), (0, 2, 3)) - tmp10 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 2, 1), (4, 0, 3)) - tmp9 = einsum(ints.tmp23, (0, 1, 2, 3), r2, (4, 1, 3), (0, 4, 2)) - del ints.tmp23 - tmp3 = einsum(r2, (0, 1, 2), v.oovv, (0, 1, 3, 2), (3,)) - tmp7 = np.copy(tmp4) - del tmp4 - tmp7 += np.transpose(tmp6, (1, 0, 2)) * -1 - del tmp6 - tmp13 = np.copy(np.transpose(ints.tmp22, (1, 0))) * 0.5 - del ints.tmp22 - tmp13 += f.vv * -1 - tmp13 += einsum(t1, (0, 1), f.ov, (0, 2), (2, 1)) - tmp11 = np.copy(tmp8) * -0.5 - del tmp8 - tmp11 += tmp9 - del tmp9 - tmp11 += tmp10 - del tmp10 - tmp15 = np.copy(ints.tmp13) - del ints.tmp13 - tmp15 += ints.tmp15 * 0.5 - del ints.tmp15 - tmp15 += ints.tmp18 * 0.5 - del ints.tmp18 - tmp15 += ints.tmp7 - del ints.tmp7 - tmp15 += f.ov * -1 - tmp15 += ints.tmp11 * -1 - del ints.tmp11 - tmp15 += ints.tmp8 * -1 - del ints.tmp8 - tmp12 = np.copy(ints.tmp21) * -0.5 - del ints.tmp21 - tmp12 += v.oooo * -1 - tmp14 = np.copy(np.transpose(ints.tmp19, (2, 0, 1, 3))) * 0.5 - del ints.tmp19 - tmp14 += np.transpose(v.ovoo, (0, 2, 3, 1)) - tmp14 += ints.tmp12 * -1 - del ints.tmp12 - tmp2 = np.copy(f.oo) * 2 - tmp2 += ints.tmp0 * 2 - del ints.tmp0 - tmp2 += ints.tmp1 * 2 - del ints.tmp1 - tmp2 += np.transpose(ints.tmp4, (1, 0)) - del ints.tmp4 - tmp2 += np.transpose(ints.tmp5, (1, 0)) * 2 - del ints.tmp5 - tmp0 = np.copy(ints.tmp3) - del ints.tmp3 - tmp0 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp1 = np.copy(f.ov) - tmp1 += ints.tmp2 - del ints.tmp2 - r2new = einsum(t2, (0, 1, 2, 3), tmp3, (3,), (0, 1, 2)) * 0.5 - del tmp3 - r2new += tmp7 - r2new += np.transpose(tmp7, (1, 0, 2)) * -1 - del tmp7 - r2new += tmp11 * -1 - r2new += np.transpose(tmp11, (1, 0, 2)) - del tmp11 - r2new += einsum(r2, (0, 1, 2), tmp12, (3, 4, 1, 0), (3, 4, 2)) * 0.5 - del tmp12 - r2new += einsum(r2, (0, 1, 2), tmp13, (2, 3), (0, 1, 3)) * -1 - del tmp13 - r2new += einsum(tmp14, (0, 1, 2, 3), r1, (0,), (2, 1, 3)) - del tmp14 - r2new += einsum(tmp15, (0, 1), r1, (2,), (2, 0, 1)) * -1 - r2new += einsum(tmp15, (0, 1), r1, (2,), (0, 2, 1)) - del tmp15 - r1new = einsum(r2, (0, 1, 2), tmp0, (3, 0, 1, 2), (3,)) * 0.5 - del tmp0 - r1new += einsum(r2, (0, 1, 2), tmp1, (1, 2), (0,)) - del tmp1 - r1new += einsum(r1, (0,), tmp2, (0, 1), (1,)) * -0.5 - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:46:47.228395. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp12 : array - tmp13 : array - tmp15 : array - tmp16 : array - tmp17 : array - tmp18 : array - tmp2 : array - tmp20 : array - tmp22 : array - tmp4 : array - tmp7 : array - tmp8 : array - tmp9 : array - """ - - tmp9 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp22 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp20 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp18 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp17 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp16 = einsum(v.ovoo, (0, 1, 2, 3), t2, (2, 3, 4, 5), (0, 4, 5, 1)) - tmp15 = einsum(v.ovoo, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - tmp13 = einsum(tmp9, (0, 1), t1, (0, 2), (1, 2)) - tmp12 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp8 = einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - tmp7 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - tmp4 = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 4, 3), (4, 2)) - tmp2 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp1 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - - return {f"tmp1": tmp1, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp15": tmp15, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp18": tmp18, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp22": tmp22, f"tmp4": tmp4, f"tmp7": tmp7, f"tmp8": tmp8, f"tmp9": tmp9} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:46:47.243478. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp7 = einsum(r2, (0, 1, 2), f.ov, (3, 1), (3, 2, 0)) - tmp9 = np.copy(f.vv) * 2 - tmp9 += np.transpose(ints.tmp4, (1, 0)) * -1 - tmp5 = einsum(r2, (0, 1, 2), ints.tmp22, (3, 2, 4, 1), (3, 4, 0)) - del ints.tmp22 - tmp8 = einsum(t1, (0, 1), tmp7, (0, 2, 3), (2, 3, 1)) - del tmp7 - tmp6 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 1, 2), (0, 4, 3)) - tmp10 = einsum(tmp9, (0, 1), r2, (2, 0, 3), (3, 2, 1)) * -0.5 - del tmp9 - tmp2 = einsum(r2, (0, 1, 2), v.oovv, (3, 2, 0, 1), (3,)) - tmp0 = np.copy(f.ov) - tmp0 += ints.tmp2 - del ints.tmp2 - tmp13 = np.copy(ints.tmp16) * 0.5 - del ints.tmp16 - tmp13 += np.transpose(v.ovvv, (0, 2, 3, 1)) - tmp4 = einsum(r2, (0, 1, 2), v.oovv, (3, 4, 0, 1), (2, 3, 4)) - tmp11 = np.copy(tmp5) - del tmp5 - tmp11 += tmp6 - del tmp6 - tmp11 += tmp8 - del tmp8 - tmp11 += np.transpose(tmp10, (0, 2, 1)) * -1 - del tmp10 - tmp15 = einsum(r1, (0,), f.ov, (1, 0), (1,)) * 2 - tmp15 += tmp2 - tmp12 = einsum(r1, (0,), ints.tmp18, (1, 2, 3, 0), (1, 2, 3)) - del ints.tmp18 - tmp16 = np.copy(ints.tmp13) - del ints.tmp13 - tmp16 += ints.tmp15 * 0.5 - del ints.tmp15 - tmp16 += ints.tmp17 * 0.5 - del ints.tmp17 - tmp16 += ints.tmp7 - del ints.tmp7 - tmp16 += f.ov * -1 - tmp16 += ints.tmp12 * -1 - del ints.tmp12 - tmp16 += ints.tmp8 * -1 - del ints.tmp8 - tmp14 = np.copy(f.oo) - tmp14 += np.transpose(ints.tmp20, (1, 0)) * 0.5 - del ints.tmp20 - tmp14 += ints.tmp9 - del ints.tmp9 - tmp3 = np.copy(tmp2) * 0.5 - del tmp2 - tmp3 += einsum(tmp0, (0, 1), r1, (1,), (0,)) - tmp1 = np.copy(np.transpose(ints.tmp1, (1, 0))) - del ints.tmp1 - tmp1 += np.transpose(ints.tmp4, (1, 0)) * 0.5 - del ints.tmp4 - tmp1 += f.vv * -1 - r2new = einsum(v.vvvv, (0, 1, 2, 3), r2, (2, 3, 4), (0, 1, 4)) * 0.5 - r2new += einsum(t2, (0, 1, 2, 3), tmp4, (4, 1, 0), (2, 3, 4)) * -0.25 - del tmp4 - r2new += np.transpose(tmp11, (1, 2, 0)) * -1 - r2new += np.transpose(tmp11, (2, 1, 0)) - del tmp11 - r2new += np.transpose(tmp12, (1, 2, 0)) - r2new += np.transpose(tmp12, (2, 1, 0)) * -1 - del tmp12 - r2new += einsum(r1, (0,), tmp13, (1, 2, 3, 0), (3, 2, 1)) - del tmp13 - r2new += einsum(r2, (0, 1, 2), tmp14, (2, 3), (0, 1, 3)) * -1 - del tmp14 - r2new += einsum(tmp15, (0,), t2, (1, 0, 2, 3), (2, 3, 1)) * 0.5 - del tmp15 - r2new += einsum(tmp16, (0, 1), r1, (2,), (2, 1, 0)) * -1 - r2new += einsum(r1, (0,), tmp16, (1, 2), (2, 0, 1)) - del tmp16 - r1new = einsum(v.ovvv, (0, 1, 2, 3), r2, (2, 3, 0), (1,)) * -0.5 - r1new += einsum(r2, (0, 1, 2), tmp0, (2, 1), (0,)) - del tmp0 - r1new += einsum(r1, (0,), tmp1, (0, 1), (1,)) * -1 - del tmp1 - r1new += einsum(tmp3, (0,), t1, (0, 1), (1,)) * -1 - del tmp3 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ee_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:47:01.424327. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp10 : array - tmp12 : array - tmp17 : array - tmp18 : array - tmp2 : array - tmp22 : array - tmp23 : array - tmp26 : array - tmp30 : array - tmp31 : array - tmp33 : array - tmp36 : array - tmp37 : array - tmp39 : array - tmp4 : array - tmp44 : array - tmp46 : array - tmp5 : array - tmp6 : array - tmp7 : array - tmp9 : array - """ - - tmp0 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp6 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp46 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp44 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp39 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp37 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp36 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp33 = einsum(v.ovoo, (0, 1, 2, 3), t2, (2, 3, 4, 5), (0, 4, 5, 1)) - tmp31 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp30 = einsum(v.ovoo, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - tmp26 = einsum(t1, (0, 1), tmp0, (0, 2), (2, 1)) - tmp23 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp22 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp18 = einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - tmp17 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - tmp12 = einsum(tmp6, (0, 1), t1, (2, 1), (2, 0)) - tmp10 = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 4, 3), (4, 2)) - tmp9 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp7 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp5 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp4 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp2 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - - return {f"tmp0": tmp0, f"tmp10": tmp10, f"tmp12": tmp12, f"tmp17": tmp17, f"tmp18": tmp18, f"tmp2": tmp2, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp26": tmp26, f"tmp30": tmp30, f"tmp31": tmp31, f"tmp33": tmp33, f"tmp36": tmp36, f"tmp37": tmp37, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp44": tmp44, f"tmp46": tmp46, f"tmp5": tmp5, f"tmp6": tmp6, f"tmp7": tmp7, f"tmp9": tmp9} - -def hbar_matvec_ee(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:47:01.450592. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp5 = einsum(v.oovv, (0, 1, 2, 3), r2, (4, 1, 2, 3), (4, 0)) - tmp25 = einsum(r1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp30 = einsum(r1, (0, 1), v.ooov, (2, 0, 3, 1), (2, 3)) - tmp17 = einsum(f.ov, (0, 1), r2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp19 = einsum(r2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp26 = np.copy(np.transpose(tmp25, (1, 0))) - del tmp25 - tmp26 += tmp5 * 0.5 - tmp23 = np.copy(f.oo) - tmp23 += ints.tmp0 - tmp23 += np.transpose(ints.tmp9, (1, 0)) * 0.5 - tmp29 = einsum(v.ovvv, (0, 1, 2, 3), r1, (4, 1), (4, 0, 2, 3)) - tmp31 = einsum(t2, (0, 1, 2, 3), tmp30, (1, 4), (0, 4, 2, 3)) * -1 - del tmp30 - tmp16 = einsum(ints.tmp23, (0, 1, 2, 3), r1, (0, 4), (1, 2, 3, 4)) - del ints.tmp23 - tmp18 = einsum(t1, (0, 1), tmp17, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp17 - tmp20 = einsum(tmp19, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) * -1 - del tmp19 - tmp27 = einsum(t2, (0, 1, 2, 3), tmp26, (4, 1), (4, 0, 2, 3)) * -1 - del tmp26 - tmp24 = einsum(tmp23, (0, 1), r2, (2, 0, 3, 4), (1, 2, 3, 4)) * -1 - del tmp23 - tmp22 = einsum(ints.tmp33, (0, 1, 2, 3), r1, (4, 3), (0, 4, 1, 2)) - del ints.tmp33 - tmp37 = einsum(r2, (0, 1, 2, 3), ints.tmp10, (4, 3), (0, 1, 4, 2)) - tmp36 = einsum(ints.tmp37, (0, 1, 2, 3), r1, (2, 4), (0, 1, 3, 4)) - del ints.tmp37 - tmp14 = einsum(r2, (0, 1, 2, 3), ints.tmp46, (4, 1, 5, 3), (4, 0, 5, 2)) - del ints.tmp46 - tmp11 = einsum(ints.tmp31, (0, 1, 2, 3), r1, (1, 4), (0, 2, 3, 4)) - del ints.tmp31 - tmp13 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp12 = einsum(ints.tmp39, (0, 1, 2, 3), r1, (4, 3), (0, 4, 1, 2)) - del ints.tmp39 - tmp34 = einsum(r2, (0, 1, 2, 3), f.vv, (4, 3), (0, 1, 4, 2)) - tmp33 = einsum(r1, (0, 1), v.ooov, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp9 = einsum(v.ovvv, (0, 1, 2, 3), r1, (0, 3), (1, 2)) - tmp2 = np.copy(f.ov) - tmp2 += ints.tmp6 - del ints.tmp6 - tmp1 = np.copy(ints.tmp7) - del ints.tmp7 - tmp1 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp32 = np.copy(np.transpose(tmp29, (0, 1, 3, 2))) * -1 - del tmp29 - tmp32 += np.transpose(tmp31, (0, 1, 3, 2)) - del tmp31 - tmp8 = einsum(v.oovv, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp21 = np.copy(tmp16) - del tmp16 - tmp21 += tmp18 - del tmp18 - tmp21 += tmp20 * 0.5 - del tmp20 - tmp28 = np.copy(np.transpose(tmp22, (0, 1, 3, 2))) * -0.5 - del tmp22 - tmp28 += np.transpose(tmp24, (0, 1, 3, 2)) - del tmp24 - tmp28 += np.transpose(tmp27, (0, 1, 3, 2)) - del tmp27 - tmp38 = np.copy(tmp36) * 0.5 - del tmp36 - tmp38 += np.transpose(tmp37, (1, 0, 2, 3)) * -0.5 - del tmp37 - tmp15 = np.copy(tmp11) - del tmp11 - tmp15 += tmp12 - del tmp12 - tmp15 += tmp13 - del tmp13 - tmp15 += tmp14 * -1 - del tmp14 - tmp39 = np.copy(ints.tmp44) * -0.5 - del ints.tmp44 - tmp39 += v.oooo * -1 - tmp40 = np.copy(ints.tmp17) - del ints.tmp17 - tmp40 += ints.tmp26 - del ints.tmp26 - tmp40 += ints.tmp30 * 0.5 - del ints.tmp30 - tmp40 += ints.tmp36 * 0.5 - del ints.tmp36 - tmp40 += f.ov * -1 - tmp40 += ints.tmp18 * -1 - del ints.tmp18 - tmp40 += ints.tmp22 * -1 - del ints.tmp22 - tmp35 = np.copy(np.transpose(tmp33, (1, 0, 2, 3))) * -1 - del tmp33 - tmp35 += np.transpose(tmp34, (1, 0, 2, 3)) * -1 - del tmp34 - tmp10 = einsum(t2, (0, 1, 2, 3), tmp9, (4, 3), (0, 1, 2, 4)) * -1 - del tmp9 - tmp3 = np.copy(ints.tmp5) - del ints.tmp5 - tmp3 += np.transpose(v.ovov, (0, 2, 3, 1)) * -1 - tmp7 = np.copy(f.oo) - tmp7 += ints.tmp0 - del ints.tmp0 - tmp7 += np.transpose(ints.tmp12, (1, 0)) - del ints.tmp12 - tmp7 += ints.tmp2 - del ints.tmp2 - tmp7 += np.transpose(ints.tmp9, (1, 0)) * 0.5 - del ints.tmp9 - tmp4 = np.copy(np.transpose(ints.tmp10, (1, 0))) * 0.5 - del ints.tmp10 - tmp4 += np.transpose(ints.tmp4, (1, 0)) - del ints.tmp4 - tmp4 += f.vv * -1 - tmp0 = einsum(v.oovv, (0, 1, 2, 3), r1, (1, 3), (0, 2)) - tmp6 = np.copy(np.transpose(tmp5, (1, 0))) * 0.5 - del tmp5 - tmp6 += einsum(tmp1, (0, 1, 2, 3), r1, (1, 3), (2, 0)) - tmp6 += einsum(tmp2, (0, 1), r1, (2, 1), (0, 2)) - r2new = einsum(v.vvvv, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) * 0.5 - r2new += einsum(t2, (0, 1, 2, 3), tmp8, (4, 5, 1, 0), (5, 4, 2, 3)) * 0.25 - del tmp8 - r2new += tmp10 - r2new += np.transpose(tmp10, (0, 1, 3, 2)) * -1 - del tmp10 - r2new += tmp15 * -1 - r2new += np.transpose(tmp15, (0, 1, 3, 2)) - r2new += np.transpose(tmp15, (1, 0, 2, 3)) - r2new += np.transpose(tmp15, (1, 0, 3, 2)) * -1 - del tmp15 - r2new += tmp21 * -1 - r2new += np.transpose(tmp21, (0, 1, 3, 2)) - del tmp21 - r2new += tmp28 - r2new += np.transpose(tmp28, (1, 0, 2, 3)) * -1 - del tmp28 - r2new += tmp32 * -1 - r2new += np.transpose(tmp32, (1, 0, 2, 3)) - del tmp32 - r2new += tmp35 * -1 - r2new += np.transpose(tmp35, (0, 1, 3, 2)) - del tmp35 - r2new += np.transpose(tmp38, (1, 0, 2, 3)) * -1 - r2new += np.transpose(tmp38, (1, 0, 3, 2)) - del tmp38 - r2new += einsum(r2, (0, 1, 2, 3), tmp39, (4, 5, 0, 1), (4, 5, 2, 3)) * -0.5 - del tmp39 - r2new += einsum(tmp40, (0, 1), r1, (2, 3), (0, 2, 1, 3)) * -1 - r2new += einsum(tmp40, (0, 1), r1, (2, 3), (2, 0, 3, 1)) * -1 - r2new += einsum(r1, (0, 1), tmp40, (2, 3), (0, 2, 3, 1)) - r2new += einsum(tmp40, (0, 1), r1, (2, 3), (0, 2, 3, 1)) - del tmp40 - r1new = einsum(tmp0, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - del tmp0 - r1new += einsum(v.ovvv, (0, 1, 2, 3), r2, (4, 0, 2, 3), (4, 1)) * -0.5 - r1new += einsum(tmp1, (0, 1, 2, 3), r2, (1, 2, 4, 3), (0, 4)) * 0.5 - del tmp1 - r1new += einsum(r2, (0, 1, 2, 3), tmp2, (1, 3), (0, 2)) - del tmp2 - r1new += einsum(tmp3, (0, 1, 2, 3), r1, (1, 3), (0, 2)) - del tmp3 - r1new += einsum(r1, (0, 1), tmp4, (1, 2), (0, 2)) * -1 - del tmp4 - r1new += einsum(t1, (0, 1), tmp6, (0, 2), (2, 1)) * -1 - del tmp6 - r1new += einsum(tmp7, (0, 1), r1, (0, 2), (1, 2)) * -1 - del tmp7 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:47:09.827585. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp10 : array - tmp11 : array - tmp12 : array - tmp13 : array - tmp14 : array - tmp16 : array - tmp17 : array - tmp19 : array - tmp2 : array - tmp20 : array - tmp21 : array - tmp22 : array - tmp23 : array - tmp24 : array - tmp25 : array - tmp27 : array - tmp29 : array - tmp3 : array - tmp31 : array - tmp32 : array - tmp34 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp5 : array - tmp6 : array - tmp7 : array - tmp8 : array - tmp9 : array - """ - - tmp18 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp15 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp33 = einsum(tmp18, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp24 = einsum(tmp15, (0, 1), t1, (2, 1), (2, 0)) - tmp30 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp28 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp26 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp6 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp22 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp10 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - tmp0 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp41 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp40 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp34 = einsum(tmp33, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - del tmp33 - tmp32 = einsum(tmp24, (0, 1), t1, (1, 2), (0, 2)) - tmp31 = einsum(tmp30, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - del tmp30 - tmp29 = einsum(tmp28, (0, 1), t1, (2, 1), (2, 0)) - del tmp28 - tmp27 = einsum(tmp26, (0, 1, 2, 3), t1, (2, 4), (0, 1, 3, 4)) - del tmp26 - tmp25 = einsum(t1, (0, 1), tmp6, (0, 2), (2, 1)) - tmp23 = einsum(tmp22, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp21 = einsum(tmp10, (0, 1), t1, (1, 2), (0, 2)) - tmp20 = einsum(tmp18, (0, 1, 2, 3), t2, (4, 2, 5, 3), (0, 4, 1, 5)) * -1 - tmp19 = einsum(tmp18, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - del tmp18 - tmp17 = einsum(t2, (0, 1, 2, 3), tmp15, (4, 3), (0, 1, 4, 2)) * -1 - tmp16 = einsum(tmp15, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - del tmp15 - tmp14 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp13 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 2, 3), (4, 1)) - tmp12 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp11 = einsum(v.ovoo, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - tmp9 = einsum(v.ovov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) - tmp8 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp7 = einsum(v.oooo, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp5 = einsum(t1, (0, 1), tmp0, (0, 2), (2, 1)) - tmp4 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp3 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp2 = einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - tmp1 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp10": tmp10, f"tmp11": tmp11, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp14": tmp14, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp24": tmp24, f"tmp25": tmp25, f"tmp27": tmp27, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp31": tmp31, f"tmp32": tmp32, f"tmp34": tmp34, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp5": tmp5, f"tmp6": tmp6, f"tmp7": tmp7, f"tmp8": tmp8, f"tmp9": tmp9} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:47:09.858516. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp5 = einsum(ints.tmp41, (0, 1, 2, 3), r2, (4, 0, 2), (1, 4, 3)) - del ints.tmp41 - tmp4 = einsum(r2, (0, 1, 2), ints.tmp10, (1, 3), (3, 0, 2)) - tmp6 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 2, 1), (4, 0, 3)) - tmp8 = np.copy(f.oo) - tmp8 += np.transpose(ints.tmp0, (1, 0)) - tmp3 = einsum(r2, (0, 1, 2), t2, (0, 1, 3, 2), (3,)) - tmp7 = einsum(r1, (0,), f.ov, (1, 2), (1, 0, 2)) - tmp7 += tmp4 * -0.5 - del tmp4 - tmp7 += tmp5 - del tmp5 - tmp7 += tmp6 - del tmp6 - tmp9 = einsum(r2, (0, 1, 2), tmp8, (1, 3), (3, 0, 2)) * -1 - del tmp8 - tmp11 = np.copy(ints.tmp40) * 0.5 - del ints.tmp40 - tmp11 += f.vv * -1 - tmp11 += einsum(f.ov, (0, 1), t1, (0, 2), (2, 1)) - tmp10 = np.copy(ints.tmp22) * -0.5 - del ints.tmp22 - tmp10 += v.oooo * -1 - tmp2 = np.copy(f.oo) * 2 - tmp2 += np.transpose(ints.tmp0, (1, 0)) * 2 - del ints.tmp0 - tmp2 += ints.tmp10 - del ints.tmp10 - tmp2 += ints.tmp24 * 2 - del ints.tmp24 - tmp2 += np.transpose(ints.tmp6, (1, 0)) * 2 - del ints.tmp6 - tmp0 = np.copy(ints.tmp12) - del ints.tmp12 - tmp0 += np.transpose(ints.tmp23, (0, 2, 1, 3)) * 0.25 - del ints.tmp23 - tmp0 += np.transpose(ints.tmp34, (0, 2, 1, 3)) * 0.5 - del ints.tmp34 - tmp0 += np.transpose(ints.tmp4, (1, 0, 2, 3)) * 0.5 - del ints.tmp4 - tmp0 += np.transpose(ints.tmp7, (0, 2, 1, 3)) * 0.5 - del ints.tmp7 - tmp0 += ints.tmp9 - del ints.tmp9 - tmp0 += np.transpose(ints.tmp14, (0, 2, 1, 3)) * -0.25 - del ints.tmp14 - tmp0 += np.transpose(ints.tmp17, (0, 2, 1, 3)) * -0.5 - del ints.tmp17 - tmp0 += np.transpose(ints.tmp20, (0, 2, 1, 3)) * -1 - del ints.tmp20 - tmp0 += ints.tmp27 * -1 - del ints.tmp27 - tmp0 += np.transpose(ints.tmp31, (0, 2, 1, 3)) * -0.5 - del ints.tmp31 - tmp0 += np.transpose(v.ooov, (0, 2, 1, 3)) * -0.5 - tmp1 = np.copy(ints.tmp11) - del ints.tmp11 - tmp1 += ints.tmp13 - del ints.tmp13 - tmp1 += ints.tmp19 - del ints.tmp19 - tmp1 += ints.tmp1 * 2 - del ints.tmp1 - tmp1 += ints.tmp21 - del ints.tmp21 - tmp1 += ints.tmp25 * 2 - del ints.tmp25 - tmp1 += ints.tmp29 * 2 - del ints.tmp29 - tmp1 += ints.tmp32 * 2 - del ints.tmp32 - tmp1 += ints.tmp5 * 2 - del ints.tmp5 - tmp1 += ints.tmp8 * 2 - del ints.tmp8 - tmp1 += f.ov * -2 - tmp1 += ints.tmp16 * -2 - del ints.tmp16 - tmp1 += ints.tmp2 * -2 - del ints.tmp2 - tmp1 += ints.tmp3 * -2 - del ints.tmp3 - r2new = einsum(v.oovv, (0, 1, 2, 3), tmp3, (3,), (0, 1, 2)) * 0.5 - del tmp3 - r2new += einsum(v.ooov, (0, 1, 2, 3), r1, (2,), (0, 1, 3)) * -1 - r2new += tmp7 * -1 - r2new += np.transpose(tmp7, (1, 0, 2)) - del tmp7 - r2new += tmp9 * -1 - r2new += np.transpose(tmp9, (1, 0, 2)) - del tmp9 - r2new += einsum(r2, (0, 1, 2), tmp10, (1, 0, 3, 4), (3, 4, 2)) * 0.5 - del tmp10 - r2new += einsum(r2, (0, 1, 2), tmp11, (2, 3), (0, 1, 3)) * -1 - del tmp11 - r1new = einsum(r2, (0, 1, 2), tmp0, (0, 3, 1, 2), (3,)) - del tmp0 - r1new += einsum(r2, (0, 1, 2), tmp1, (1, 2), (0,)) * -0.5 - del tmp1 - r1new += einsum(r1, (0,), tmp2, (0, 1), (1,)) * -0.5 - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:47:18.915865. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp11 : array - tmp12 : array - tmp13 : array - tmp14 : array - tmp15 : array - tmp16 : array - tmp17 : array - tmp18 : array - tmp19 : array - tmp2 : array - tmp20 : array - tmp21 : array - tmp22 : array - tmp23 : array - tmp25 : array - tmp27 : array - tmp28 : array - tmp3 : array - tmp30 : array - tmp5 : array - tmp6 : array - tmp7 : array - tmp8 : array - """ - - tmp16 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp29 = einsum(tmp16, (0, 1), t1, (2, 1), (2, 0)) - tmp7 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp24 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp21 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp18 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp5 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp30 = einsum(t1, (0, 1), tmp29, (2, 0), (2, 1)) - del tmp29 - tmp28 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp27 = einsum(tmp7, (0, 1), t1, (2, 1), (2, 0)) - tmp25 = einsum(t1, (0, 1), tmp24, (0, 2), (2, 1)) - del tmp24 - tmp23 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp22 = einsum(t1, (0, 1), tmp21, (2, 0), (2, 1)) - tmp20 = einsum(tmp18, (0, 1, 2, 3), t2, (2, 1, 4, 5), (0, 4, 5, 3)) * -1 - tmp19 = einsum(tmp18, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp17 = einsum(tmp16, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp15 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp14 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 2, 3), (4, 1)) - tmp13 = einsum(v.ovoo, (0, 1, 2, 3), t2, (2, 3, 4, 5), (0, 4, 5, 1)) - tmp12 = einsum(v.ovoo, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - tmp11 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp10 = einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp8 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp6 = einsum(t1, (0, 1), tmp5, (0, 2), (2, 1)) - tmp3 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp2 = einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - tmp1 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp11": tmp11, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp14": tmp14, f"tmp15": tmp15, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp18": tmp18, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp25": tmp25, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp5": tmp5, f"tmp6": tmp6, f"tmp7": tmp7, f"tmp8": tmp8} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:47:18.940212. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp13 = einsum(t1, (0, 1), f.ov, (0, 2), (2, 1)) - tmp14 = np.copy(ints.tmp11) - tmp14 += f.vv * -2 - tmp14 += np.transpose(tmp13, (1, 0)) * 2 - del tmp13 - tmp11 = einsum(ints.tmp23, (0, 1, 2, 3), r2, (4, 2, 0), (1, 3, 4)) - tmp15 = einsum(tmp14, (0, 1), r2, (2, 0, 3), (3, 1, 2)) * -0.5 - del tmp14 - tmp12 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 1, 2), (0, 4, 3)) - tmp7 = einsum(r2, (0, 1, 2), t2, (3, 2, 0, 1), (3,)) - tmp1 = einsum(t1, (0, 1), r2, (2, 1, 3), (3, 0, 2)) - tmp17 = np.copy(f.oo) - tmp17 += ints.tmp21 * 0.5 - del ints.tmp21 - tmp17 += np.transpose(ints.tmp5, (1, 0)) - del ints.tmp5 - tmp16 = einsum(r1, (0,), f.ov, (1, 2), (1, 2, 0)) - tmp16 += tmp11 - del tmp11 - tmp16 += tmp12 - del tmp12 - tmp16 += tmp15 - del tmp15 - tmp10 = einsum(r2, (0, 1, 2), t2, (3, 4, 0, 1), (2, 3, 4)) - tmp5 = np.copy(ints.tmp12) * 0.5 - del ints.tmp12 - tmp5 += ints.tmp14 * 0.5 - del ints.tmp14 - tmp5 += ints.tmp19 * 0.5 - del ints.tmp19 - tmp5 += ints.tmp1 - del ints.tmp1 - tmp5 += ints.tmp22 * 0.5 - del ints.tmp22 - tmp5 += ints.tmp25 - del ints.tmp25 - tmp5 += ints.tmp27 - del ints.tmp27 - tmp5 += ints.tmp30 - del ints.tmp30 - tmp5 += ints.tmp6 - del ints.tmp6 - tmp5 += ints.tmp8 - del ints.tmp8 - tmp5 += f.ov * -1 - tmp5 += ints.tmp17 * -1 - del ints.tmp17 - tmp5 += ints.tmp2 * -1 - del ints.tmp2 - tmp5 += ints.tmp3 * -1 - del ints.tmp3 - tmp8 = einsum(r1, (0,), t1, (1, 0), (1,)) * 2 - tmp8 += tmp7 - tmp3 = einsum(tmp1, (0, 1, 2), t1, (3, 2), (0, 1, 3)) * -1 - tmp2 = np.copy(ints.tmp23) - del ints.tmp23 - tmp2 += ints.tmp28 - del ints.tmp28 - tmp2 += np.transpose(v.ovov, (0, 2, 3, 1)) * -1 - tmp9 = np.copy(f.ov) - tmp9 += ints.tmp16 - del ints.tmp16 - tmp4 = np.copy(ints.tmp18) - del ints.tmp18 - tmp4 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp0 = np.copy(ints.tmp10) * 0.5 - del ints.tmp10 - tmp0 += ints.tmp15 - del ints.tmp15 - tmp0 += ints.tmp20 * 0.25 - del ints.tmp20 - tmp0 += ints.tmp13 * -0.25 - del ints.tmp13 - tmp0 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -0.5 - tmp6 = np.copy(ints.tmp11) * 0.5 - del ints.tmp11 - tmp6 += ints.tmp7 - del ints.tmp7 - tmp6 += f.vv * -1 - r2new = einsum(v.vvvv, (0, 1, 2, 3), r2, (2, 3, 4), (0, 1, 4)) * 0.5 - r2new += einsum(v.ovvv, (0, 1, 2, 3), r1, (1,), (2, 3, 0)) * -1 - r2new += einsum(v.oovv, (0, 1, 2, 3), tmp10, (4, 1, 0), (2, 3, 4)) * -0.25 - del tmp10 - r2new += einsum(tmp7, (0,), v.oovv, (1, 0, 2, 3), (2, 3, 1)) * 0.5 - del tmp7 - r2new += np.transpose(tmp16, (1, 2, 0)) * -1 - r2new += np.transpose(tmp16, (2, 1, 0)) - del tmp16 - r2new += einsum(r2, (0, 1, 2), tmp17, (2, 3), (0, 1, 3)) * -1 - del tmp17 - r1new = einsum(r2, (0, 1, 2), tmp0, (2, 0, 1, 3), (3,)) - del tmp0 - r1new += einsum(tmp1, (0, 1, 2), tmp2, (0, 1, 2, 3), (3,)) - del tmp1, tmp2 - r1new += einsum(tmp3, (0, 1, 2), tmp4, (0, 2, 1, 3), (3,)) * -0.5 - del tmp3, tmp4 - r1new += einsum(tmp5, (0, 1), r2, (2, 1, 0), (2,)) * -1 - del tmp5 - r1new += einsum(r1, (0,), tmp6, (0, 1), (1,)) * -1 - del tmp6 - r1new += einsum(tmp9, (0, 1), tmp8, (0,), (1,)) * -0.5 - del tmp9, tmp8 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ee_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:47:34.487851. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp10 : array - tmp11 : array - tmp12 : array - tmp13 : array - tmp15 : array - tmp16 : array - tmp17 : array - tmp19 : array - tmp2 : array - tmp20 : array - tmp21 : array - tmp22 : array - tmp23 : array - tmp24 : array - tmp26 : array - tmp27 : array - tmp28 : array - tmp29 : array - tmp3 : array - tmp30 : array - tmp31 : array - tmp32 : array - tmp33 : array - tmp34 : array - tmp35 : array - tmp36 : array - tmp38 : array - tmp39 : array - tmp4 : array - tmp41 : array - tmp43 : array - tmp44 : array - tmp45 : array - tmp47 : array - tmp5 : array - tmp7 : array - tmp8 : array - tmp9 : array - """ - - tmp29 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp26 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp46 = einsum(tmp29, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp38 = einsum(tmp26, (0, 1), t1, (2, 1), (2, 0)) - tmp10 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp9 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp40 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp8 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp34 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp16 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - tmp0 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp47 = einsum(tmp46, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - del tmp46 - tmp45 = einsum(tmp38, (0, 1), t1, (1, 2), (0, 2)) - tmp44 = einsum(tmp10, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp43 = einsum(tmp9, (0, 1), t1, (2, 1), (2, 0)) - tmp41 = einsum(tmp40, (0, 1, 2, 3), t1, (2, 4), (0, 1, 3, 4)) - del tmp40 - tmp39 = einsum(t1, (0, 1), tmp8, (0, 2), (2, 1)) - tmp36 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp35 = einsum(tmp34, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp33 = einsum(t1, (0, 1), tmp16, (2, 0), (2, 1)) - tmp32 = einsum(tmp29, (0, 1, 2, 3), t2, (2, 1, 4, 5), (0, 4, 5, 3)) * -1 - tmp31 = einsum(tmp29, (0, 1, 2, 3), t2, (4, 2, 5, 3), (0, 4, 1, 5)) * -1 - tmp30 = einsum(tmp29, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp28 = einsum(t2, (0, 1, 2, 3), tmp26, (4, 3), (0, 1, 4, 2)) * -1 - tmp27 = einsum(tmp26, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp24 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp23 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp22 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 2, 3), (4, 1)) - tmp21 = einsum(v.ovoo, (0, 1, 2, 3), t2, (2, 3, 4, 5), (0, 4, 5, 1)) - tmp20 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp19 = einsum(v.ovoo, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - tmp17 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp15 = einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp13 = einsum(v.ovov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) - tmp12 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp11 = einsum(v.oooo, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp7 = einsum(t1, (0, 1), tmp0, (0, 2), (2, 1)) - tmp5 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp4 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp3 = einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - tmp2 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - - return {f"tmp0": tmp0, f"tmp10": tmp10, f"tmp11": tmp11, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp15": tmp15, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp24": tmp24, f"tmp26": tmp26, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp31": tmp31, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp34": tmp34, f"tmp35": tmp35, f"tmp36": tmp36, f"tmp38": tmp38, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp43": tmp43, f"tmp44": tmp44, f"tmp45": tmp45, f"tmp47": tmp47, f"tmp5": tmp5, f"tmp7": tmp7, f"tmp8": tmp8, f"tmp9": tmp9} - -def hbar_lmatvec_ee(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:47:34.528052. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp2 = einsum(t2, (0, 1, 2, 3), r2, (4, 1, 2, 3), (4, 0)) - tmp30 = np.copy(f.oo) - tmp30 += np.transpose(ints.tmp0, (1, 0)) - tmp30 += ints.tmp16 * 0.5 - tmp1 = einsum(r2, (0, 1, 2, 3), t2, (0, 1, 4, 3), (2, 4)) - tmp6 = einsum(r2, (0, 1, 2, 3), t1, (4, 3), (0, 1, 4, 2)) - tmp29 = einsum(tmp2, (0, 1), v.oovv, (2, 1, 3, 4), (0, 2, 3, 4)) * -1 - tmp31 = einsum(tmp30, (0, 1), r2, (2, 0, 3, 4), (1, 2, 3, 4)) * -1 - del tmp30 - tmp18 = einsum(r2, (0, 1, 2, 3), ints.tmp36, (1, 4, 3, 5), (4, 0, 5, 2)) - tmp19 = einsum(r2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp22 = einsum(tmp1, (0, 1), v.oovv, (2, 3, 4, 1), (2, 3, 0, 4)) * -1 - tmp21 = einsum(tmp6, (0, 1, 2, 3), f.ov, (2, 4), (0, 1, 4, 3)) - tmp25 = einsum(r1, (0, 1), v.ooov, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp26 = einsum(r2, (0, 1, 2, 3), f.vv, (4, 3), (0, 1, 4, 2)) - tmp0 = einsum(t1, (0, 1), r1, (2, 1), (2, 0)) - tmp32 = np.copy(np.transpose(tmp29, (0, 1, 3, 2))) * 0.5 - del tmp29 - tmp32 += np.transpose(tmp31, (0, 1, 3, 2)) - del tmp31 - tmp24 = einsum(v.ovvv, (0, 1, 2, 3), r1, (4, 1), (4, 0, 2, 3)) - tmp28 = einsum(ints.tmp17, (0, 1), r2, (2, 3, 4, 0), (2, 3, 1, 4)) - tmp20 = einsum(r1, (0, 1), f.ov, (2, 3), (2, 0, 3, 1)) - tmp20 += tmp18 - del tmp18 - tmp20 += tmp19 * -1 - del tmp19 - tmp23 = np.copy(tmp21) - del tmp21 - tmp23 += tmp22 * -0.5 - del tmp22 - tmp17 = einsum(t2, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp33 = np.copy(ints.tmp34) * -0.5 - del ints.tmp34 - tmp33 += v.oooo * -1 - tmp27 = np.copy(np.transpose(tmp25, (1, 0, 2, 3))) * -1 - del tmp25 - tmp27 += np.transpose(tmp26, (1, 0, 2, 3)) * -1 - del tmp26 - tmp3 = np.copy(ints.tmp15) * 0.5 - del ints.tmp15 - tmp3 += ints.tmp24 - del ints.tmp24 - tmp3 += ints.tmp32 * 0.25 - del ints.tmp32 - tmp3 += ints.tmp21 * -0.25 - del ints.tmp21 - tmp3 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -0.5 - tmp9 = np.copy(ints.tmp12) - del ints.tmp12 - tmp9 += ints.tmp19 * 0.5 - del ints.tmp19 - tmp9 += ints.tmp22 * 0.5 - del ints.tmp22 - tmp9 += ints.tmp2 - del ints.tmp2 - tmp9 += ints.tmp30 * 0.5 - del ints.tmp30 - tmp9 += ints.tmp33 * 0.5 - del ints.tmp33 - tmp9 += ints.tmp39 - del ints.tmp39 - tmp9 += ints.tmp43 - del ints.tmp43 - tmp9 += ints.tmp45 - del ints.tmp45 - tmp9 += ints.tmp7 - del ints.tmp7 - tmp9 += f.ov * -1 - tmp9 += ints.tmp27 * -1 - del ints.tmp27 - tmp9 += ints.tmp3 * -1 - del ints.tmp3 - tmp9 += ints.tmp4 * -1 - del ints.tmp4 - tmp11 = np.copy(ints.tmp10) - tmp11 += np.transpose(v.ovov, (0, 2, 3, 1)) * -1 - tmp12 = np.copy(tmp0) * 2 - tmp12 += tmp2 - tmp13 = np.copy(ints.tmp17) * 0.5 - del ints.tmp17 - tmp13 += ints.tmp9 - del ints.tmp9 - tmp13 += f.vv * -1 - tmp4 = np.copy(ints.tmp11) * 0.5 - del ints.tmp11 - tmp4 += np.transpose(ints.tmp13, (0, 2, 1, 3)) - del ints.tmp13 - tmp4 += np.transpose(ints.tmp20, (0, 2, 1, 3)) - del ints.tmp20 - tmp4 += ints.tmp35 * 0.25 - del ints.tmp35 - tmp4 += ints.tmp47 * 0.5 - del ints.tmp47 - tmp4 += np.transpose(ints.tmp5, (1, 2, 0, 3)) * 0.5 - del ints.tmp5 - tmp4 += ints.tmp23 * -0.25 - del ints.tmp23 - tmp4 += ints.tmp28 * -0.5 - del ints.tmp28 - tmp4 += ints.tmp31 * -1 - del ints.tmp31 - tmp4 += np.transpose(ints.tmp41, (0, 2, 1, 3)) * -1 - del ints.tmp41 - tmp4 += ints.tmp44 * -0.5 - del ints.tmp44 - tmp4 += v.ooov * -0.5 - tmp16 = np.copy(f.ov) - tmp16 += ints.tmp26 - del ints.tmp26 - tmp14 = np.copy(f.oo) - tmp14 += np.transpose(ints.tmp0, (1, 0)) - del ints.tmp0 - tmp14 += ints.tmp16 * 0.5 - del ints.tmp16 - tmp14 += ints.tmp38 - del ints.tmp38 - tmp14 += np.transpose(ints.tmp8, (1, 0)) - del ints.tmp8 - tmp5 = np.copy(ints.tmp10) - del ints.tmp10 - tmp5 += ints.tmp36 - del ints.tmp36 - tmp5 += np.transpose(v.ovov, (0, 2, 3, 1)) * -1 - tmp7 = einsum(tmp6, (0, 1, 2, 3), t1, (4, 3), (0, 1, 4, 2)) - tmp15 = np.copy(tmp0) - tmp15 += tmp2 * 0.5 - tmp10 = einsum(t2, (0, 1, 2, 3), r1, (1, 3), (0, 2)) - tmp10 += einsum(tmp6, (0, 1, 2, 3), t2, (1, 0, 4, 3), (2, 4)) * -0.5 - tmp8 = np.copy(ints.tmp29) - tmp8 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - r2new = einsum(v.vvvv, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) * 0.5 - r2new += einsum(v.oovv, (0, 1, 2, 3), tmp17, (4, 5, 1, 0), (5, 4, 2, 3)) * 0.25 - del tmp17 - r2new += tmp20 - r2new += np.transpose(tmp20, (0, 1, 3, 2)) * -1 - r2new += np.transpose(tmp20, (1, 0, 2, 3)) * -1 - r2new += np.transpose(tmp20, (1, 0, 3, 2)) - del tmp20 - r2new += tmp23 - r2new += np.transpose(tmp23, (0, 1, 3, 2)) * -1 - del tmp23 - r2new += np.transpose(tmp24, (0, 1, 3, 2)) - r2new += np.transpose(tmp24, (1, 0, 3, 2)) * -1 - del tmp24 - r2new += tmp27 * -1 - r2new += np.transpose(tmp27, (0, 1, 3, 2)) - del tmp27 - r2new += np.transpose(tmp28, (1, 0, 2, 3)) * -0.5 - r2new += np.transpose(tmp28, (1, 0, 3, 2)) * 0.5 - del tmp28 - r2new += tmp32 - r2new += np.transpose(tmp32, (1, 0, 2, 3)) * -1 - del tmp32 - r2new += einsum(r2, (0, 1, 2, 3), tmp33, (0, 1, 4, 5), (4, 5, 2, 3)) * -0.5 - del tmp33 - r1new = einsum(tmp0, (0, 1), ints.tmp29, (0, 2, 1, 3), (2, 3)) * -1 - del tmp0 - r1new += einsum(tmp1, (0, 1), v.ovvv, (2, 0, 3, 1), (2, 3)) * 0.5 - del tmp1 - r1new += einsum(tmp2, (0, 1), ints.tmp29, (0, 2, 1, 3), (2, 3)) * -0.5 - del tmp2, ints.tmp29 - r1new += einsum(tmp3, (0, 1, 2, 3), r2, (4, 0, 1, 2), (4, 3)) - del tmp3 - r1new += einsum(tmp4, (0, 1, 2, 3), r2, (0, 1, 4, 3), (2, 4)) - del tmp4 - r1new += einsum(tmp6, (0, 1, 2, 3), tmp5, (0, 2, 3, 4), (1, 4)) * -1 - del tmp6, tmp5 - r1new += einsum(tmp8, (0, 1, 2, 3), tmp7, (4, 0, 2, 1), (4, 3)) * -0.5 - del tmp8, tmp7 - r1new += einsum(r2, (0, 1, 2, 3), tmp9, (1, 3), (0, 2)) * -1 - del tmp9 - r1new += einsum(tmp10, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - del tmp10 - r1new += einsum(tmp11, (0, 1, 2, 3), r1, (0, 2), (1, 3)) - del tmp11 - r1new += einsum(v.ooov, (0, 1, 2, 3), tmp12, (2, 1), (0, 3)) * 0.5 - del tmp12 - r1new += einsum(r1, (0, 1), tmp13, (1, 2), (0, 2)) * -1 - del tmp13 - r1new += einsum(tmp14, (0, 1), r1, (0, 2), (1, 2)) * -1 - del tmp14 - r1new += einsum(tmp15, (0, 1), tmp16, (1, 2), (0, 2)) * -1 - del tmp15, tmp16 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/GCC3.py b/ebcc/codegen/GCC3.py deleted file mode 100644 index 04e37218..00000000 --- a/ebcc/codegen/GCC3.py +++ /dev/null @@ -1,434 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:15:48.888323 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:15:49.140059. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(t2) - tmp0 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - e_cc = einsum(t1, (0, 1), f.ov, (0, 1), ()) - e_cc += einsum(tmp0, (0, 1, 2, 3), v.oovv, (0, 1, 2, 3), ()) * 0.25 - del tmp0 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, t3=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:16:20.295753. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - t3 : array - T3 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - t3new : array - Updated T3 residuals. - """ - - tmp0 = einsum(t1, (0, 1), v.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp60 = einsum(t1, (0, 1), tmp0, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp12 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp61 = einsum(tmp60, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - del tmp60 - tmp66 = einsum(t2, (0, 1, 2, 3), tmp0, (4, 5, 6, 3), (4, 0, 1, 6, 5, 2)) - tmp79 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - tmp18 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp3 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp13 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp14 = einsum(v.oovv, (0, 1, 2, 3), t3, (4, 5, 1, 6, 2, 3), (4, 5, 0, 6)) - tmp62 = np.copy(np.transpose(tmp12, (2, 1, 0, 3))) * -1 - tmp62 += tmp61 - del tmp61 - tmp5 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp39 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp67 = einsum(tmp66, (0, 1, 2, 3, 4, 5), t1, (4, 6), (0, 1, 2, 3, 6, 5)) - del tmp66 - tmp54 = einsum(v.oooo, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp56 = einsum(v.vvvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp70 = einsum(t1, (0, 1), f.ov, (0, 2), (2, 1)) - tmp80 = einsum(tmp79, (0, 1, 2, 3, 4, 5), t1, (3, 6), (0, 1, 2, 4, 6, 5)) - del tmp79 - tmp27 = einsum(t1, (0, 1), tmp18, (2, 3, 4, 1), (2, 0, 3, 4)) * -1 - tmp7 = np.copy(t2) - tmp7 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - tmp37 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - tmp6 = einsum(t1, (0, 1), v.ooov, (2, 0, 3, 1), (2, 3)) - tmp46 = einsum(tmp3, (0, 1), t1, (2, 1), (2, 0)) - tmp15 = np.copy(np.transpose(tmp12, (0, 2, 1, 3))) - del tmp12 - tmp15 += np.transpose(tmp13, (2, 1, 0, 3)) * -0.5 - del tmp13 - tmp15 += np.transpose(tmp14, (2, 1, 0, 3)) * 0.5 - del tmp14 - tmp10 = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 4, 3), (4, 2)) - tmp20 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp22 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp24 = einsum(t2, (0, 1, 2, 3), tmp3, (4, 3), (0, 1, 4, 2)) * -1 - tmp29 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp31 = np.copy(t2) - tmp31 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1 - tmp59 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 6, 1), (4, 5, 0, 6, 2, 3)) - tmp63 = einsum(t2, (0, 1, 2, 3), tmp62, (4, 5, 1, 6), (4, 5, 0, 6, 2, 3)) * -1 - del tmp62 - tmp73 = np.copy(f.oo) - tmp73 += tmp5 - tmp77 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 6, 3), (4, 5, 0, 2, 6, 1)) - tmp86 = einsum(t1, (0, 1), tmp39, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - tmp75 = einsum(v.ovov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) - tmp65 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 1, 6), (0, 4, 5, 2, 3, 6)) - tmp68 = einsum(t1, (0, 1), tmp67, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 1, 6)) * -1 - del tmp67 - tmp55 = einsum(tmp54, (0, 1, 2, 3), t2, (4, 2, 5, 6), (4, 0, 1, 3, 5, 6)) * -1 - del tmp54 - tmp57 = einsum(t2, (0, 1, 2, 3), tmp56, (4, 5, 6, 3), (4, 0, 1, 2, 5, 6)) * -1 - del tmp56 - tmp84 = einsum(t2, (0, 1, 2, 3), tmp18, (4, 5, 6, 3), (4, 0, 1, 5, 2, 6)) * -1 - tmp71 = np.copy(f.vv) - tmp71 += tmp70 * -1 - del tmp70 - tmp81 = einsum(tmp80, (0, 1, 2, 3, 4, 5), t1, (2, 6), (0, 1, 3, 4, 6, 5)) * -1 - del tmp80 - tmp82 = einsum(t2, (0, 1, 2, 3), tmp27, (4, 5, 1, 6), (5, 4, 0, 2, 3, 6)) * -1 - tmp40 = einsum(tmp7, (0, 1, 2, 3), tmp39, (4, 0, 1, 5), (4, 5, 2, 3)) * 0.5 - del tmp39 - tmp34 = einsum(t2, (0, 1, 2, 3), tmp5, (1, 4), (4, 0, 2, 3)) - tmp38 = einsum(tmp37, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) - del tmp37 - tmp35 = einsum(v.ovoo, (0, 1, 2, 3), t3, (4, 2, 3, 5, 6, 1), (4, 0, 5, 6)) - tmp36 = einsum(tmp0, (0, 1, 2, 3), t3, (4, 2, 1, 5, 6, 3), (0, 4, 5, 6)) - tmp45 = einsum(tmp6, (0, 1), t2, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - tmp44 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 1), (4, 0, 2, 3)) - tmp47 = einsum(t2, (0, 1, 2, 3), tmp46, (4, 1), (4, 0, 2, 3)) * -1 - del tmp46 - tmp49 = einsum(v.ooov, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - tmp50 = einsum(t2, (0, 1, 2, 3), f.vv, (4, 3), (0, 1, 4, 2)) - tmp9 = einsum(t3, (0, 1, 2, 3, 4, 5), v.ovvv, (2, 6, 4, 5), (0, 1, 3, 6)) - tmp16 = einsum(t1, (0, 1), tmp15, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp15 - tmp11 = einsum(tmp10, (0, 1), t2, (2, 3, 4, 1), (2, 3, 4, 0)) - del tmp10 - tmp21 = einsum(t2, (0, 1, 2, 3), tmp20, (4, 3), (0, 1, 2, 4)) * -1 - del tmp20 - tmp23 = einsum(tmp22, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp22 - tmp25 = einsum(tmp24, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp24 - tmp42 = einsum(tmp0, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp30 = einsum(tmp29, (0, 1, 2, 3), t1, (1, 4), (0, 2, 4, 3)) - del tmp29 - tmp32 = einsum(tmp31, (0, 1, 2, 3), v.ovov, (4, 2, 0, 5), (1, 4, 3, 5)) - del tmp31 - tmp64 = np.copy(np.transpose(tmp59, (0, 1, 2, 3, 5, 4))) * -1 - del tmp59 - tmp64 += np.transpose(tmp63, (0, 1, 2, 3, 5, 4)) * -1 - del tmp63 - tmp74 = einsum(tmp73, (0, 1), t3, (2, 3, 0, 4, 5, 6), (1, 2, 3, 4, 5, 6)) - del tmp73 - tmp78 = einsum(t1, (0, 1), tmp77, (2, 3, 0, 4, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp77 - tmp87 = einsum(tmp86, (0, 1, 2, 3), t2, (4, 1, 5, 6), (0, 4, 2, 3, 5, 6)) * -1 - del tmp86 - tmp76 = einsum(tmp75, (0, 1, 2, 3), t2, (4, 1, 5, 6), (0, 4, 2, 5, 6, 3)) - del tmp75 - tmp69 = np.copy(np.transpose(tmp65, (0, 2, 1, 4, 3, 5))) - del tmp65 - tmp69 += np.transpose(tmp68, (0, 2, 1, 4, 3, 5)) - del tmp68 - tmp58 = np.copy(np.transpose(tmp55, (0, 2, 1, 3, 5, 4))) - del tmp55 - tmp58 += np.transpose(tmp57, (0, 2, 1, 3, 5, 4)) - del tmp57 - tmp85 = einsum(tmp84, (0, 1, 2, 3, 4, 5), t1, (3, 6), (0, 1, 2, 6, 4, 5)) - del tmp84 - tmp72 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp71, (5, 6), (0, 1, 2, 6, 3, 4)) - del tmp71 - tmp83 = np.copy(np.transpose(tmp81, (0, 1, 2, 4, 3, 5))) * -1 - del tmp81 - tmp83 += np.transpose(tmp82, (0, 1, 2, 4, 3, 5)) * -1 - del tmp82 - tmp41 = np.copy(np.transpose(tmp34, (0, 1, 3, 2))) - del tmp34 - tmp41 += np.transpose(tmp35, (0, 1, 3, 2)) * -0.5 - del tmp35 - tmp41 += np.transpose(tmp36, (0, 1, 3, 2)) * 0.5 - del tmp36 - tmp41 += np.transpose(tmp38, (0, 1, 3, 2)) * -0.5 - del tmp38 - tmp41 += np.transpose(tmp40, (0, 1, 3, 2)) * -1 - del tmp40 - tmp48 = np.copy(np.transpose(tmp44, (0, 1, 3, 2))) * -1 - del tmp44 - tmp48 += np.transpose(tmp45, (0, 1, 3, 2)) - del tmp45 - tmp48 += np.transpose(tmp47, (0, 1, 3, 2)) * -1 - del tmp47 - tmp51 = np.copy(np.transpose(tmp49, (1, 0, 2, 3))) * -1 - del tmp49 - tmp51 += np.transpose(tmp50, (1, 0, 2, 3)) * -1 - del tmp50 - tmp19 = einsum(t2, (0, 1, 2, 3), tmp18, (4, 1, 5, 3), (4, 0, 2, 5)) * -1 - del tmp18 - tmp17 = np.copy(tmp9) * 0.5 - del tmp9 - tmp17 += tmp11 * 0.5 - del tmp11 - tmp17 += np.transpose(tmp16, (1, 0, 3, 2)) * -1 - del tmp16 - tmp26 = np.copy(tmp21) - del tmp21 - tmp26 += tmp23 - del tmp23 - tmp26 += tmp25 * -1 - del tmp25 - tmp2 = np.copy(t2) * 0.5 - tmp2 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp43 = einsum(t1, (0, 1), tmp42, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp42 - tmp53 = np.copy(v.oooo) - tmp53 += einsum(tmp7, (0, 1, 2, 3), v.oovv, (4, 5, 2, 3), (4, 5, 1, 0)) * -0.5 - tmp33 = np.copy(tmp30) - del tmp30 - tmp33 += tmp32 * -1 - del tmp32 - tmp28 = einsum(tmp27, (0, 1, 2, 3), t1, (2, 4), (1, 0, 4, 3)) * -1 - del tmp27 - tmp52 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - tmp4 = np.copy(f.ov) - tmp4 += tmp3 - del tmp3 - tmp1 = np.copy(np.transpose(v.ovoo, (0, 2, 3, 1))) * -1 - tmp1 += np.transpose(tmp0, (0, 2, 1, 3)) * -1 - del tmp0 - tmp8 = np.copy(f.oo) - tmp8 += tmp5 - del tmp5 - tmp8 += tmp6 - del tmp6 - tmp8 += einsum(v.oovv, (0, 1, 2, 3), tmp7, (1, 4, 2, 3), (0, 4)) * -0.5 - t3new = np.copy(tmp58) * -1 - t3new += np.transpose(tmp58, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp58, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp58, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp58, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp58, (2, 0, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp58, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp58, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp58, (2, 1, 0, 4, 5, 3)) - del tmp58 - t3new += tmp64 * -1 - t3new += np.transpose(tmp64, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp64, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp64, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp64, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp64, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp64, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp64, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp64, (2, 1, 0, 4, 5, 3)) - del tmp64 - t3new += tmp69 * -1 - t3new += np.transpose(tmp69, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp69, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp69, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp69, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp69, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp69, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp69, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp69, (2, 1, 0, 5, 3, 4)) - del tmp69 - t3new += np.transpose(tmp72, (1, 2, 0, 3, 4, 5)) - t3new += np.transpose(tmp72, (1, 2, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp72, (1, 2, 0, 4, 5, 3)) - del tmp72 - t3new += tmp74 * -1 - t3new += np.transpose(tmp74, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp74, (2, 1, 0, 3, 4, 5)) - del tmp74 - t3new += np.transpose(tmp76, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp76, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp76, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp76, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp76, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp76, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp76, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp76, (1, 0, 2, 4, 5, 3)) - t3new += np.transpose(tmp76, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp76, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp76, (2, 0, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp76, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp76, (1, 2, 0, 4, 3, 5)) - t3new += np.transpose(tmp76, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp76, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp76, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp76, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp76, (2, 1, 0, 5, 4, 3)) * -1 - del tmp76 - t3new += tmp78 * -1 - t3new += np.transpose(tmp78, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp78, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp78, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp78, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp78, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp78, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp78, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp78, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp78, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp78, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp78, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp78, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp78, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp78, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp78, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp78, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp78, (2, 1, 0, 5, 4, 3)) * -1 - del tmp78 - t3new += tmp83 * -1 - t3new += np.transpose(tmp83, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp83, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp83, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp83, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp83, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp83, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp83, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp83, (2, 1, 0, 5, 3, 4)) - del tmp83 - t3new += np.transpose(tmp85, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp85, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp85, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp85, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp85, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp85, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp85, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp85, (1, 0, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp85, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp85, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp85, (1, 0, 2, 4, 5, 3)) - t3new += np.transpose(tmp85, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp85, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp85, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp85, (1, 2, 0, 4, 3, 5)) - t3new += np.transpose(tmp85, (1, 2, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp85, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp85, (1, 2, 0, 5, 4, 3)) - del tmp85 - t3new += np.transpose(tmp87, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp87, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp87, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp87, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp87, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp87, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp87, (1, 0, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp87, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp87, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp87, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp87, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp87, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp87, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp87, (1, 2, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp87, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp87, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp87, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp87, (2, 1, 0, 5, 4, 3)) * -1 - del tmp87 - t2new = np.copy(v.oovv) - t2new += tmp17 * -1 - t2new += np.transpose(tmp17, (0, 1, 3, 2)) - del tmp17 - t2new += tmp19 - t2new += np.transpose(tmp19, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp19, (1, 0, 2, 3)) * -1 - t2new += np.transpose(tmp19, (1, 0, 3, 2)) - del tmp19 - t2new += tmp26 - t2new += np.transpose(tmp26, (0, 1, 3, 2)) * -1 - del tmp26 - t2new += tmp28 * -1 - t2new += np.transpose(tmp28, (0, 1, 3, 2)) - del tmp28 - t2new += tmp33 - t2new += np.transpose(tmp33, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp33, (1, 0, 2, 3)) * -1 - t2new += np.transpose(tmp33, (1, 0, 3, 2)) - del tmp33 - t2new += tmp41 * -1 - t2new += np.transpose(tmp41, (1, 0, 2, 3)) - del tmp41 - t2new += tmp43 * -1 - t2new += np.transpose(tmp43, (0, 1, 3, 2)) - t2new += np.transpose(tmp43, (1, 0, 2, 3)) - t2new += np.transpose(tmp43, (1, 0, 3, 2)) * -1 - del tmp43 - t2new += tmp48 * -1 - t2new += np.transpose(tmp48, (1, 0, 2, 3)) - del tmp48 - t2new += tmp51 * -1 - t2new += np.transpose(tmp51, (0, 1, 3, 2)) - del tmp51 - t2new += np.transpose(tmp52, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp52, (1, 0, 3, 2)) - del tmp52 - t2new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp4, (2, 5), (0, 1, 3, 4)) - t2new += einsum(tmp53, (0, 1, 2, 3), tmp7, (0, 1, 4, 5), (2, 3, 5, 4)) * -0.5 - del tmp7, tmp53 - t2new += einsum(tmp2, (0, 1, 2, 3), v.vvvv, (4, 5, 2, 3), (1, 0, 4, 5)) * -1 - t1new = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) * -1 - t1new += f.ov - t1new += einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - t1new += einsum(v.oovv, (0, 1, 2, 3), t3, (4, 0, 1, 5, 2, 3), (4, 5)) * 0.25 - t1new += einsum(tmp1, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) * 0.5 - del tmp1 - t1new += einsum(v.ovvv, (0, 1, 2, 3), tmp2, (0, 4, 2, 3), (4, 1)) - del tmp2 - t1new += einsum(tmp4, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - del tmp4 - t1new += einsum(t1, (0, 1), tmp8, (0, 2), (2, 1)) * -1 - del tmp8 - - return {f"t1new": t1new, f"t2new": t2new, f"t3new": t3new} - diff --git a/ebcc/codegen/GCCD.py b/ebcc/codegen/GCCD.py deleted file mode 100644 index cb3bf784..00000000 --- a/ebcc/codegen/GCCD.py +++ /dev/null @@ -1,1153 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:23:06.843112 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:06.910278. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - e_cc = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 2, 3), ()) * 0.25 - - return e_cc - -def update_amps(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:08.134197. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t2new : array - Updated T2 residuals. - """ - - tmp3 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp1 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp5 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp4 = einsum(t2, (0, 1, 2, 3), tmp3, (4, 3), (0, 1, 2, 4)) - del tmp3 - tmp8 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp2 = einsum(tmp1, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp1 - tmp6 = einsum(tmp5, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) - del tmp5 - tmp0 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - tmp9 = np.copy(v.oooo) - tmp9 += einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (0, 1, 4, 5)) * 0.5 - tmp7 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - t2new = einsum(t2, (0, 1, 2, 3), v.vvvv, (4, 5, 2, 3), (0, 1, 4, 5)) * 0.5 - t2new += v.oovv - t2new += np.transpose(tmp0, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp0, (1, 0, 3, 2)) - del tmp0 - t2new += tmp2 - t2new += np.transpose(tmp2, (0, 1, 3, 2)) * -1 - del tmp2 - t2new += tmp4 * -0.5 - t2new += np.transpose(tmp4, (0, 1, 3, 2)) * 0.5 - del tmp4 - t2new += np.transpose(tmp6, (0, 1, 3, 2)) * 0.5 - t2new += np.transpose(tmp6, (1, 0, 3, 2)) * -0.5 - del tmp6 - t2new += np.transpose(tmp7, (1, 0, 2, 3)) - t2new += np.transpose(tmp7, (1, 0, 3, 2)) * -1 - del tmp7 - t2new += tmp8 * -1 - t2new += np.transpose(tmp8, (0, 1, 3, 2)) - t2new += np.transpose(tmp8, (1, 0, 2, 3)) - t2new += np.transpose(tmp8, (1, 0, 3, 2)) * -1 - del tmp8 - t2new += einsum(t2, (0, 1, 2, 3), tmp9, (0, 1, 4, 5), (4, 5, 2, 3)) * 0.5 - del tmp9 - - return {f"t2new": t2new} - -def update_lams(f=None, l2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:09.828872. - - Parameters - ---------- - f : array - Fock matrix. - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - l2new : array - Updated L2 residuals. - """ - - tmp12 = einsum(l2, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - tmp10 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp2 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp5 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp7 = einsum(t2, (0, 1, 2, 3), l2, (2, 3, 4, 1), (4, 0)) - tmp13 = einsum(v.oovv, (0, 1, 2, 3), tmp12, (4, 3), (0, 1, 4, 2)) * -1 - del tmp12 - tmp11 = einsum(tmp10, (0, 1), l2, (2, 0, 3, 4), (3, 4, 2, 1)) - del tmp10 - tmp3 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp3 += tmp2 - del tmp2 - tmp6 = einsum(l2, (0, 1, 2, 3), tmp5, (3, 4), (2, 4, 0, 1)) - del tmp5 - tmp8 = einsum(tmp7, (0, 1), v.oovv, (2, 1, 3, 4), (0, 2, 3, 4)) * -1 - del tmp7 - tmp14 = np.copy(tmp11) * 0.5 - del tmp11 - tmp14 += tmp13 * 0.5 - del tmp13 - tmp4 = einsum(l2, (0, 1, 2, 3), tmp3, (3, 4, 1, 5), (2, 4, 0, 5)) - del tmp3 - tmp1 = einsum(l2, (0, 1, 2, 3), f.oo, (4, 3), (4, 2, 0, 1)) - tmp15 = einsum(l2, (0, 1, 2, 3), f.vv, (4, 1), (2, 3, 4, 0)) - tmp16 = np.copy(v.oooo) * 2 - tmp16 += einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp0 = einsum(t2, (0, 1, 2, 3), l2, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp9 = np.copy(np.transpose(tmp6, (0, 1, 3, 2))) * -0.5 - del tmp6 - tmp9 += np.transpose(tmp8, (0, 1, 3, 2)) * -0.5 - del tmp8 - l2new = einsum(v.vvvv, (0, 1, 2, 3), l2, (2, 3, 4, 5), (0, 1, 4, 5)) * 0.5 - l2new += np.transpose(v.oovv, (2, 3, 0, 1)) - l2new += einsum(v.oovv, (0, 1, 2, 3), tmp0, (4, 5, 1, 0), (2, 3, 4, 5)) * -0.25 - del tmp0 - l2new += np.transpose(tmp1, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp1, (3, 2, 1, 0)) - del tmp1 - l2new += np.transpose(tmp4, (2, 3, 0, 1)) - l2new += np.transpose(tmp4, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp4, (2, 3, 1, 0)) * -1 - l2new += np.transpose(tmp4, (3, 2, 1, 0)) - del tmp4 - l2new += np.transpose(tmp9, (3, 2, 0, 1)) - l2new += np.transpose(tmp9, (3, 2, 1, 0)) * -1 - del tmp9 - l2new += np.transpose(tmp14, (2, 3, 1, 0)) - l2new += np.transpose(tmp14, (3, 2, 1, 0)) * -1 - del tmp14 - l2new += np.transpose(tmp15, (2, 3, 1, 0)) - l2new += np.transpose(tmp15, (3, 2, 1, 0)) * -1 - del tmp15 - l2new += einsum(tmp16, (0, 1, 2, 3), l2, (4, 5, 0, 1), (4, 5, 2, 3)) * 0.25 - del tmp16 - - return {f"l2new": l2new} - -def make_rdm1_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:09.980310. - - Parameters - ---------- - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm1 : array - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - rdm1.vv = einsum(l2, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) * 0.5 - rdm1.oo = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 0, 1), (4, 2)) * -0.5 - rdm1.oo += delta.oo - del delta - rdm1.ov = np.zeros((t2.shape[0], t2.shape[-1])) - rdm1.vo = np.zeros((t2.shape[-1], t2.shape[0])) - rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]]) - - return rdm1 - -def make_rdm2_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:11.493025. - - Parameters - ---------- - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm2 : array - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp2 = einsum(t2, (0, 1, 2, 3), l2, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp4 = einsum(l2, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - tmp1 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 0, 1), (2, 4)) - tmp3 = einsum(t2, (0, 1, 2, 3), tmp2, (1, 4, 3, 5), (0, 4, 2, 5)) - tmp5 = einsum(tmp4, (0, 1), t2, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp6 = einsum(tmp1, (0, 1), t2, (2, 0, 3, 4), (2, 1, 3, 4)) - tmp0 = einsum(t2, (0, 1, 2, 3), l2, (2, 3, 4, 5), (4, 5, 0, 1)) - rdm2.vvvv = einsum(t2, (0, 1, 2, 3), l2, (4, 5, 0, 1), (4, 5, 2, 3)) * 0.5 - rdm2.vvoo = np.copy(l2) - rdm2.vovo = einsum(tmp4, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 0.5 - rdm2.vovo += np.transpose(tmp2, (2, 1, 3, 0)) * -1 - rdm2.voov = einsum(tmp4, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -0.5 - rdm2.voov += np.transpose(tmp2, (2, 1, 0, 3)) - rdm2.ovvo = einsum(tmp4, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -0.5 - rdm2.ovvo += np.transpose(tmp2, (1, 2, 3, 0)) - rdm2.ovov = einsum(tmp4, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * 0.5 - del tmp4 - rdm2.ovov += np.transpose(tmp2, (1, 2, 0, 3)) * -1 - del tmp2 - rdm2.oovv = einsum(tmp0, (0, 1, 2, 3), t2, (1, 0, 4, 5), (3, 2, 4, 5)) * 0.25 - rdm2.oovv += t2 - rdm2.oovv += tmp3 - rdm2.oovv += np.transpose(tmp3, (0, 1, 3, 2)) * -1 - del tmp3 - rdm2.oovv += tmp5 * -0.5 - rdm2.oovv += np.transpose(tmp5, (0, 1, 3, 2)) * 0.5 - del tmp5 - rdm2.oovv += np.transpose(tmp6, (0, 1, 3, 2)) * 0.5 - rdm2.oovv += np.transpose(tmp6, (1, 0, 3, 2)) * -0.5 - del tmp6 - rdm2.oooo = np.copy(np.transpose(tmp0, (3, 2, 1, 0))) * 0.5 - del tmp0 - rdm2.oooo += einsum(tmp1, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * -0.5 - rdm2.oooo += einsum(tmp1, (0, 1), delta.oo, (2, 3), (2, 1, 0, 3)) * 0.5 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp1, (2, 3), (3, 0, 1, 2)) * 0.5 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp1, (2, 3), (0, 3, 1, 2)) * -0.5 - del tmp1 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -1 - del delta - rdm2.ooov = np.zeros((t2.shape[0], t2.shape[0], t2.shape[0], t2.shape[-1])) - rdm2.oovo = np.zeros((t2.shape[0], t2.shape[0], t2.shape[-1], t2.shape[0])) - rdm2.ovoo = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[0], t2.shape[0])) - rdm2.vooo = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[0], t2.shape[0])) - rdm2.ovvv = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[-1], t2.shape[-1])) - rdm2.vovv = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[-1], t2.shape[-1])) - rdm2.vvov = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[0], t2.shape[-1])) - rdm2.vvvo = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[-1], t2.shape[0])) - rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv) - rdm2 = np.transpose(rdm2, (0, 2, 1, 3)) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:15.330483. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp11 : array - tmp12 : array - tmp13 : array - tmp2 : array - tmp3 : array - tmp5 : array - tmp6 : array - tmp8 : array - tmp9 : array - """ - - tmp13 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp12 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp11 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp9 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp8 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp6 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp5 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp3 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp2 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp0 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - - return {f"tmp0": tmp0, f"tmp11": tmp11, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp2": tmp2, f"tmp3": tmp3, f"tmp5": tmp5, f"tmp6": tmp6, f"tmp8": tmp8, f"tmp9": tmp9} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:15.342329. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp3 = einsum(r1, (0,), ints.tmp6, (1, 0, 2, 3), (1, 2, 3)) - del ints.tmp6 - tmp2 = einsum(f.oo, (0, 1), r2, (2, 1, 3), (0, 2, 3)) - tmp6 = einsum(ints.tmp13, (0, 1, 2, 3), r2, (4, 1, 3), (0, 4, 2)) - del ints.tmp13 - tmp7 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 2, 1), (4, 0, 3)) - tmp5 = einsum(ints.tmp0, (0, 1), r2, (2, 1, 3), (0, 2, 3)) - tmp1 = einsum(r2, (0, 1, 2), v.oovv, (0, 1, 3, 2), (3,)) - tmp4 = np.copy(tmp2) - del tmp2 - tmp4 += tmp3 - del tmp3 - tmp12 = np.copy(f.ov) - tmp12 += ints.tmp2 - del ints.tmp2 - tmp12 += ints.tmp5 * -0.5 - del ints.tmp5 - tmp12 += ints.tmp8 * -0.5 - del ints.tmp8 - tmp8 = np.copy(tmp5) * -0.5 - del tmp5 - tmp8 += tmp6 - del tmp6 - tmp8 += tmp7 - del tmp7 - tmp10 = np.copy(f.vv) - tmp10 += np.transpose(ints.tmp12, (1, 0)) * -0.5 - del ints.tmp12 - tmp11 = np.copy(np.transpose(ints.tmp9, (2, 0, 1, 3))) * 0.5 - del ints.tmp9 - tmp11 += np.transpose(v.ovoo, (0, 2, 3, 1)) - tmp11 += ints.tmp3 * -1 - del ints.tmp3 - tmp9 = np.copy(ints.tmp11) * 0.5 - del ints.tmp11 - tmp9 += v.oooo - tmp0 = np.copy(f.oo) * 2 - tmp0 += np.transpose(ints.tmp0, (1, 0)) - del ints.tmp0 - r2new = einsum(tmp1, (0,), t2, (1, 2, 3, 0), (1, 2, 3)) * 0.5 - del tmp1 - r2new += tmp4 - r2new += np.transpose(tmp4, (1, 0, 2)) * -1 - del tmp4 - r2new += tmp8 * -1 - r2new += np.transpose(tmp8, (1, 0, 2)) - del tmp8 - r2new += einsum(tmp9, (0, 1, 2, 3), r2, (2, 3, 4), (0, 1, 4)) * 0.5 - del tmp9 - r2new += einsum(r2, (0, 1, 2), tmp10, (2, 3), (0, 1, 3)) - del tmp10 - r2new += einsum(r1, (0,), tmp11, (0, 1, 2, 3), (2, 1, 3)) - del tmp11 - r2new += einsum(tmp12, (0, 1), r1, (2,), (2, 0, 1)) - r2new += einsum(r1, (0,), tmp12, (1, 2), (1, 0, 2)) * -1 - del tmp12 - r1new = einsum(r2, (0, 1, 2), v.ovoo, (3, 2, 0, 1), (3,)) * -0.5 - r1new += einsum(r2, (0, 1, 2), f.ov, (1, 2), (0,)) - r1new += einsum(tmp0, (0, 1), r1, (0,), (1,)) * -0.5 - del tmp0 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:19.283901. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp10 : array - tmp12 : array - tmp2 : array - tmp5 : array - tmp6 : array - tmp7 : array - tmp8 : array - """ - - tmp12 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp10 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp8 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp7 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp6 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 5, 0, 1), (4, 2, 3, 5)) - tmp5 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp2 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp0 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - - return {f"tmp0": tmp0, f"tmp10": tmp10, f"tmp12": tmp12, f"tmp2": tmp2, f"tmp5": tmp5, f"tmp6": tmp6, f"tmp7": tmp7, f"tmp8": tmp8} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:19.294679. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp5 = np.copy(f.vv) * 2 - tmp5 += np.transpose(ints.tmp0, (1, 0)) * -1 - tmp6 = einsum(tmp5, (0, 1), r2, (2, 0, 3), (3, 2, 1)) * -0.5 - del tmp5 - tmp4 = einsum(r2, (0, 1, 2), v.ovov, (3, 1, 2, 4), (3, 0, 4)) - tmp3 = einsum(ints.tmp12, (0, 1, 2, 3), r2, (4, 3, 1), (0, 2, 4)) - del ints.tmp12 - tmp1 = einsum(v.oovv, (0, 1, 2, 3), r2, (2, 3, 4), (4, 0, 1)) - tmp10 = np.copy(f.oo) - tmp10 += np.transpose(ints.tmp10, (1, 0)) * 0.5 - del ints.tmp10 - tmp2 = einsum(r1, (0,), ints.tmp8, (1, 2, 3, 0), (1, 2, 3)) - del ints.tmp8 - tmp11 = np.copy(f.ov) - tmp11 += ints.tmp2 - del ints.tmp2 - tmp11 += ints.tmp5 * -0.5 - del ints.tmp5 - tmp11 += ints.tmp7 * -0.5 - del ints.tmp7 - tmp9 = einsum(r1, (0,), f.ov, (1, 0), (1,)) - tmp9 += einsum(v.oovv, (0, 1, 2, 3), r2, (2, 3, 1), (0,)) * 0.5 - tmp8 = np.copy(ints.tmp6) * 0.5 - del ints.tmp6 - tmp8 += np.transpose(v.ovvv, (0, 2, 3, 1)) - tmp7 = np.copy(tmp3) - del tmp3 - tmp7 += tmp4 - del tmp4 - tmp7 += np.transpose(tmp6, (0, 2, 1)) * -1 - del tmp6 - tmp0 = np.copy(f.vv) - tmp0 += np.transpose(ints.tmp0, (1, 0)) * -0.5 - del ints.tmp0 - r2new = einsum(tmp1, (0, 1, 2), t2, (2, 1, 3, 4), (3, 4, 0)) * -0.25 - del tmp1 - r2new += einsum(r2, (0, 1, 2), v.vvvv, (3, 4, 0, 1), (3, 4, 2)) * 0.5 - r2new += np.transpose(tmp2, (1, 2, 0)) - r2new += np.transpose(tmp2, (2, 1, 0)) * -1 - del tmp2 - r2new += np.transpose(tmp7, (1, 2, 0)) * -1 - r2new += np.transpose(tmp7, (2, 1, 0)) - del tmp7 - r2new += einsum(r1, (0,), tmp8, (1, 2, 3, 0), (3, 2, 1)) - del tmp8 - r2new += einsum(tmp9, (0,), t2, (1, 0, 2, 3), (2, 3, 1)) - del tmp9 - r2new += einsum(tmp10, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp10 - r2new += einsum(tmp11, (0, 1), r1, (2,), (2, 1, 0)) - r2new += einsum(tmp11, (0, 1), r1, (2,), (1, 2, 0)) * -1 - del tmp11 - r1new = einsum(v.ovvv, (0, 1, 2, 3), r2, (2, 3, 0), (1,)) * -0.5 - r1new += einsum(f.ov, (0, 1), r2, (2, 1, 0), (2,)) - r1new += einsum(tmp0, (0, 1), r1, (0,), (1,)) - del tmp0 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ee_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:29.230560. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp13 : array - tmp14 : array - tmp16 : array - tmp20 : array - tmp21 : array - tmp23 : array - tmp28 : array - tmp30 : array - tmp5 : array - tmp6 : array - """ - - tmp30 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp28 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp23 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp21 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp20 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp16 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 5, 0, 1), (4, 2, 3, 5)) - tmp14 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp13 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp6 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp5 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp1 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp0 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp13": tmp13, f"tmp14": tmp14, f"tmp16": tmp16, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp23": tmp23, f"tmp28": tmp28, f"tmp30": tmp30, f"tmp5": tmp5, f"tmp6": tmp6} - -def hbar_matvec_ee(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:29.249522. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp19 = einsum(r1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp20 = einsum(v.oovv, (0, 1, 2, 3), r2, (4, 1, 2, 3), (4, 0)) - tmp10 = einsum(r2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp17 = np.copy(f.oo) * 2 - tmp17 += np.transpose(ints.tmp0, (1, 0)) - tmp21 = np.copy(np.transpose(tmp19, (1, 0))) - del tmp19 - tmp21 += tmp20 * 0.5 - del tmp20 - tmp30 = einsum(v.ooov, (0, 1, 2, 3), r1, (1, 3), (0, 2)) - tmp11 = einsum(tmp10, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) * -1 - del tmp10 - tmp9 = einsum(r1, (0, 1), ints.tmp6, (0, 2, 3, 4), (2, 3, 4, 1)) - del ints.tmp6 - tmp6 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp4 = einsum(r1, (0, 1), ints.tmp14, (2, 0, 3, 4), (2, 3, 4, 1)) - del ints.tmp14 - tmp7 = einsum(r2, (0, 1, 2, 3), ints.tmp30, (4, 1, 5, 3), (4, 0, 5, 2)) - del ints.tmp30 - tmp5 = einsum(ints.tmp23, (0, 1, 2, 3), r1, (4, 3), (0, 4, 1, 2)) - del ints.tmp23 - tmp14 = einsum(f.vv, (0, 1), r2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp13 = einsum(v.ooov, (0, 1, 2, 3), r1, (2, 4), (0, 1, 4, 3)) - tmp16 = einsum(ints.tmp16, (0, 1, 2, 3), r1, (4, 3), (0, 4, 1, 2)) - del ints.tmp16 - tmp18 = einsum(tmp17, (0, 1), r2, (2, 0, 3, 4), (2, 1, 3, 4)) * -0.5 - del tmp17 - tmp22 = einsum(tmp21, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) * -1 - del tmp21 - tmp27 = einsum(v.ovvv, (0, 1, 2, 3), r1, (0, 3), (1, 2)) - tmp29 = einsum(v.ovvv, (0, 1, 2, 3), r1, (4, 1), (4, 0, 2, 3)) - tmp31 = einsum(tmp30, (0, 1), t2, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - del tmp30 - tmp24 = einsum(r1, (0, 1), ints.tmp21, (2, 3, 0, 4), (2, 3, 4, 1)) - del ints.tmp21 - tmp25 = einsum(r2, (0, 1, 2, 3), ints.tmp1, (4, 3), (0, 1, 4, 2)) - tmp12 = np.copy(tmp9) - del tmp9 - tmp12 += tmp11 * 0.5 - del tmp11 - tmp3 = einsum(v.oovv, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp8 = np.copy(tmp4) - del tmp4 - tmp8 += tmp5 - del tmp5 - tmp8 += tmp6 - del tmp6 - tmp8 += tmp7 * -1 - del tmp7 - tmp15 = np.copy(np.transpose(tmp13, (1, 0, 2, 3))) * -1 - del tmp13 - tmp15 += np.transpose(tmp14, (1, 0, 2, 3)) * -1 - del tmp14 - tmp23 = np.copy(np.transpose(tmp16, (0, 1, 3, 2))) * -0.5 - del tmp16 - tmp23 += np.transpose(tmp18, (1, 0, 3, 2)) - del tmp18 - tmp23 += np.transpose(tmp22, (1, 0, 3, 2)) - del tmp22 - tmp34 = np.copy(f.ov) - tmp34 += ints.tmp5 - tmp34 += ints.tmp13 * -0.5 - tmp34 += ints.tmp20 * -0.5 - tmp28 = einsum(t2, (0, 1, 2, 3), tmp27, (4, 3), (0, 1, 2, 4)) * -1 - del tmp27 - tmp33 = np.copy(ints.tmp28) - del ints.tmp28 - tmp33 += v.oooo * 2 - tmp32 = np.copy(np.transpose(tmp29, (0, 1, 3, 2))) * -1 - del tmp29 - tmp32 += np.transpose(tmp31, (0, 1, 3, 2)) - del tmp31 - tmp35 = np.copy(f.ov) * 2 - tmp35 += ints.tmp5 * 2 - del ints.tmp5 - tmp35 += ints.tmp13 * -1 - del ints.tmp13 - tmp35 += ints.tmp20 * -1 - del ints.tmp20 - tmp26 = np.copy(tmp24) * 0.5 - del tmp24 - tmp26 += np.transpose(tmp25, (1, 0, 2, 3)) * -0.5 - del tmp25 - tmp1 = np.copy(f.vv) - tmp1 += np.transpose(ints.tmp1, (1, 0)) * -0.5 - del ints.tmp1 - tmp2 = np.copy(f.oo) - tmp2 += np.transpose(ints.tmp0, (1, 0)) * 0.5 - del ints.tmp0 - tmp0 = einsum(v.oovv, (0, 1, 2, 3), r1, (1, 3), (0, 2)) - r2new = einsum(v.vvvv, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) * 0.5 - r2new += einsum(tmp3, (0, 1, 2, 3), t2, (3, 2, 4, 5), (1, 0, 4, 5)) * 0.25 - del tmp3 - r2new += tmp8 * -1 - r2new += np.transpose(tmp8, (0, 1, 3, 2)) - r2new += np.transpose(tmp8, (1, 0, 2, 3)) - r2new += np.transpose(tmp8, (1, 0, 3, 2)) * -1 - del tmp8 - r2new += tmp12 * -1 - r2new += np.transpose(tmp12, (0, 1, 3, 2)) - del tmp12 - r2new += tmp15 * -1 - r2new += np.transpose(tmp15, (0, 1, 3, 2)) - del tmp15 - r2new += tmp23 - r2new += np.transpose(tmp23, (1, 0, 2, 3)) * -1 - del tmp23 - r2new += np.transpose(tmp26, (1, 0, 2, 3)) * -1 - r2new += np.transpose(tmp26, (1, 0, 3, 2)) - del tmp26 - r2new += tmp28 - r2new += np.transpose(tmp28, (0, 1, 3, 2)) * -1 - del tmp28 - r2new += tmp32 * -1 - r2new += np.transpose(tmp32, (1, 0, 2, 3)) - del tmp32 - r2new += einsum(r2, (0, 1, 2, 3), tmp33, (4, 5, 0, 1), (4, 5, 2, 3)) * 0.25 - del tmp33 - r2new += einsum(tmp34, (0, 1), r1, (2, 3), (0, 2, 1, 3)) - r2new += einsum(r1, (0, 1), tmp34, (2, 3), (0, 2, 1, 3)) - r2new += einsum(r1, (0, 1), tmp35, (2, 3), (0, 2, 3, 1)) * -0.5 - del tmp35 - r2new += einsum(tmp34, (0, 1), r1, (2, 3), (0, 2, 3, 1)) * -1 - del tmp34 - r1new = einsum(v.ovvv, (0, 1, 2, 3), r2, (4, 0, 2, 3), (4, 1)) * -0.5 - r1new += einsum(t2, (0, 1, 2, 3), tmp0, (1, 3), (0, 2)) - del tmp0 - r1new += einsum(r2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) * -0.5 - r1new += einsum(r2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - r1new += einsum(v.ovov, (0, 1, 2, 3), r1, (2, 1), (0, 3)) * -1 - r1new += einsum(r1, (0, 1), tmp1, (1, 2), (0, 2)) - del tmp1 - r1new += einsum(tmp2, (0, 1), r1, (0, 2), (1, 2)) * -1 - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:32.772040. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp10 : array - tmp11 : array - tmp12 : array - tmp2 : array - tmp3 : array - tmp4 : array - tmp5 : array - tmp6 : array - """ - - tmp12 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp11 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp10 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp6 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp5 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp4 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp3 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp2 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp1 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp0 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp10": tmp10, f"tmp11": tmp11, f"tmp12": tmp12, f"tmp2": tmp2, f"tmp3": tmp3, f"tmp4": tmp4, f"tmp5": tmp5, f"tmp6": tmp6} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:32.783748. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp4 = einsum(ints.tmp2, (0, 1), r2, (2, 0, 3), (1, 2, 3)) - tmp5 = einsum(ints.tmp12, (0, 1, 2, 3), r2, (4, 0, 2), (1, 4, 3)) - del ints.tmp12 - tmp6 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 2, 1), (4, 0, 3)) - tmp3 = einsum(r2, (0, 1, 2), t2, (0, 1, 3, 2), (3,)) - tmp8 = einsum(f.oo, (0, 1), r2, (2, 1, 3), (0, 2, 3)) - tmp10 = np.copy(f.vv) - tmp10 += ints.tmp11 * -0.5 - del ints.tmp11 - tmp9 = np.copy(ints.tmp10) * 0.5 - del ints.tmp10 - tmp9 += v.oooo - tmp7 = einsum(r1, (0,), f.ov, (1, 2), (1, 0, 2)) - tmp7 += tmp4 * -0.5 - del tmp4 - tmp7 += tmp5 - del tmp5 - tmp7 += tmp6 - del tmp6 - tmp1 = np.copy(f.ov) - tmp1 += ints.tmp0 - del ints.tmp0 - tmp1 += ints.tmp3 * -0.5 - del ints.tmp3 - tmp1 += ints.tmp5 * -0.5 - del ints.tmp5 - tmp2 = np.copy(f.oo) * 2 - tmp2 += ints.tmp2 - del ints.tmp2 - tmp0 = np.copy(ints.tmp1) * 0.5 - del ints.tmp1 - tmp0 += np.transpose(ints.tmp4, (1, 0, 2, 3)) - del ints.tmp4 - tmp0 += np.transpose(ints.tmp6, (2, 0, 1, 3)) * -0.25 - del ints.tmp6 - tmp0 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -0.5 - r2new = einsum(v.oovv, (0, 1, 2, 3), tmp3, (3,), (0, 1, 2)) * 0.5 - del tmp3 - r2new += einsum(r1, (0,), v.ooov, (1, 2, 0, 3), (1, 2, 3)) * -1 - r2new += tmp7 * -1 - r2new += np.transpose(tmp7, (1, 0, 2)) - del tmp7 - r2new += tmp8 - r2new += np.transpose(tmp8, (1, 0, 2)) * -1 - del tmp8 - r2new += einsum(tmp9, (0, 1, 2, 3), r2, (0, 1, 4), (2, 3, 4)) * 0.5 - del tmp9 - r2new += einsum(r2, (0, 1, 2), tmp10, (2, 3), (0, 1, 3)) - del tmp10 - r1new = einsum(tmp0, (0, 1, 2, 3), r2, (2, 1, 3), (0,)) * -1 - del tmp0 - r1new += einsum(r2, (0, 1, 2), tmp1, (1, 2), (0,)) - del tmp1 - r1new += einsum(r1, (0,), tmp2, (0, 1), (1,)) * -0.5 - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:36.434478. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp11 : array - tmp2 : array - tmp3 : array - tmp4 : array - tmp5 : array - tmp6 : array - tmp9 : array - """ - - tmp11 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp9 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp6 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp5 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp4 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 5, 0, 1), (4, 2, 3, 5)) - tmp3 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp2 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp0 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - - return {f"tmp0": tmp0, f"tmp11": tmp11, f"tmp2": tmp2, f"tmp3": tmp3, f"tmp4": tmp4, f"tmp5": tmp5, f"tmp6": tmp6, f"tmp9": tmp9} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:36.445025. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp7 = np.copy(f.vv) * 2 - tmp7 += ints.tmp2 * -1 - tmp8 = einsum(r2, (0, 1, 2), tmp7, (1, 3), (2, 0, 3)) * -0.5 - del tmp7 - tmp5 = einsum(r2, (0, 1, 2), ints.tmp11, (2, 3, 1, 4), (3, 4, 0)) - del ints.tmp11 - tmp6 = einsum(r2, (0, 1, 2), v.ovov, (3, 1, 2, 4), (3, 0, 4)) - tmp4 = einsum(r2, (0, 1, 2), t2, (3, 4, 0, 1), (2, 3, 4)) - tmp10 = np.copy(f.oo) - tmp10 += ints.tmp9 * 0.5 - del ints.tmp9 - tmp0 = einsum(r2, (0, 1, 2), t2, (3, 2, 0, 1), (3,)) - tmp9 = einsum(r1, (0,), f.ov, (1, 2), (1, 2, 0)) - tmp9 += tmp5 - del tmp5 - tmp9 += tmp6 - del tmp6 - tmp9 += np.transpose(tmp8, (0, 2, 1)) * -1 - del tmp8 - tmp1 = np.copy(ints.tmp6) - del ints.tmp6 - tmp1 += ints.tmp4 * -0.25 - del ints.tmp4 - tmp1 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -0.5 - tmp3 = np.copy(f.vv) - tmp3 += ints.tmp2 * -0.5 - del ints.tmp2 - tmp2 = np.copy(f.ov) - tmp2 += ints.tmp0 - del ints.tmp0 - tmp2 += ints.tmp3 * -0.5 - del ints.tmp3 - tmp2 += ints.tmp5 * -0.5 - del ints.tmp5 - r2new = einsum(v.oovv, (0, 1, 2, 3), tmp4, (4, 1, 0), (2, 3, 4)) * -0.25 - del tmp4 - r2new += einsum(v.oovv, (0, 1, 2, 3), tmp0, (1,), (2, 3, 0)) * 0.5 - r2new += einsum(r2, (0, 1, 2), v.vvvv, (3, 4, 0, 1), (3, 4, 2)) * 0.5 - r2new += einsum(r1, (0,), v.ovvv, (1, 0, 2, 3), (2, 3, 1)) * -1 - r2new += np.transpose(tmp9, (1, 2, 0)) * -1 - r2new += np.transpose(tmp9, (2, 1, 0)) - del tmp9 - r2new += einsum(tmp10, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp10 - r1new = einsum(tmp0, (0,), f.ov, (0, 1), (1,)) * -0.5 - del tmp0 - r1new += einsum(tmp1, (0, 1, 2, 3), r2, (2, 1, 0), (3,)) * -1 - del tmp1 - r1new += einsum(tmp2, (0, 1), r2, (2, 1, 0), (2,)) - del tmp2 - r1new += einsum(r1, (0,), tmp3, (0, 1), (1,)) - del tmp3 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ee_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:43.616564. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp10 : array - tmp11 : array - tmp19 : array - tmp21 : array - tmp3 : array - tmp4 : array - tmp6 : array - tmp7 : array - tmp8 : array - tmp9 : array - """ - - tmp21 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp19 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp11 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp10 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp9 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp8 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 5, 0, 1), (4, 2, 3, 5)) - tmp7 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp6 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp4 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp3 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp1 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp0 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp10": tmp10, f"tmp11": tmp11, f"tmp19": tmp19, f"tmp21": tmp21, f"tmp3": tmp3, f"tmp4": tmp4, f"tmp6": tmp6, f"tmp7": tmp7, f"tmp8": tmp8, f"tmp9": tmp9} - -def hbar_lmatvec_ee(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:43.634093. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp7 = np.copy(f.oo) * 2 - tmp7 += ints.tmp3 - del ints.tmp3 - tmp1 = einsum(t2, (0, 1, 2, 3), r2, (4, 1, 2, 3), (4, 0)) - tmp13 = einsum(f.vv, (0, 1), r2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp12 = einsum(v.ooov, (0, 1, 2, 3), r1, (2, 4), (0, 1, 4, 3)) - tmp10 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp9 = einsum(ints.tmp21, (0, 1, 2, 3), r2, (4, 0, 5, 2), (1, 4, 3, 5)) - del ints.tmp21 - tmp16 = einsum(tmp7, (0, 1), r2, (2, 0, 3, 4), (2, 1, 3, 4)) * -0.5 - tmp15 = einsum(v.oovv, (0, 1, 2, 3), tmp1, (4, 1), (4, 0, 2, 3)) * -1 - tmp2 = einsum(t2, (0, 1, 2, 3), r2, (0, 1, 4, 3), (4, 2)) - tmp14 = np.copy(np.transpose(tmp12, (1, 0, 2, 3))) * -1 - del tmp12 - tmp14 += np.transpose(tmp13, (1, 0, 2, 3)) * -1 - del tmp13 - tmp19 = einsum(v.ovvv, (0, 1, 2, 3), r1, (4, 1), (4, 0, 2, 3)) - tmp8 = einsum(t2, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp21 = np.copy(ints.tmp19) - del ints.tmp19 - tmp21 += v.oooo * 2 - tmp11 = einsum(r1, (0, 1), f.ov, (2, 3), (2, 0, 3, 1)) - tmp11 += tmp9 - del tmp9 - tmp11 += tmp10 * -1 - del tmp10 - tmp20 = einsum(ints.tmp4, (0, 1), r2, (2, 3, 4, 0), (2, 3, 1, 4)) - tmp17 = np.copy(np.transpose(tmp15, (0, 1, 3, 2))) * 0.5 - del tmp15 - tmp17 += np.transpose(tmp16, (1, 0, 3, 2)) - del tmp16 - tmp18 = einsum(v.oovv, (0, 1, 2, 3), tmp2, (4, 3), (0, 1, 4, 2)) * -1 - tmp4 = np.copy(np.transpose(ints.tmp1, (1, 2, 0, 3))) - del ints.tmp1 - tmp4 += np.transpose(ints.tmp7, (0, 2, 1, 3)) * 2 - del ints.tmp7 - tmp4 += ints.tmp10 * -0.5 - del ints.tmp10 - tmp4 += v.ooov * -1 - tmp3 = np.copy(ints.tmp8) * 0.25 - del ints.tmp8 - tmp3 += np.transpose(v.ovvv, (0, 2, 3, 1)) * 0.5 - tmp3 += ints.tmp11 * -1 - del ints.tmp11 - tmp5 = np.copy(f.ov) - tmp5 += ints.tmp0 - del ints.tmp0 - tmp5 += ints.tmp6 * -0.5 - del ints.tmp6 - tmp5 += ints.tmp9 * -0.5 - del ints.tmp9 - tmp6 = np.copy(f.vv) - tmp6 += ints.tmp4 * -0.5 - del ints.tmp4 - tmp0 = einsum(t2, (0, 1, 2, 3), r1, (1, 3), (0, 2)) - r2new = einsum(v.vvvv, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) * 0.5 - r2new += einsum(v.oovv, (0, 1, 2, 3), tmp8, (4, 5, 1, 0), (5, 4, 2, 3)) * 0.25 - del tmp8 - r2new += tmp11 - r2new += np.transpose(tmp11, (0, 1, 3, 2)) * -1 - r2new += np.transpose(tmp11, (1, 0, 2, 3)) * -1 - r2new += np.transpose(tmp11, (1, 0, 3, 2)) - del tmp11 - r2new += tmp14 * -1 - r2new += np.transpose(tmp14, (0, 1, 3, 2)) - del tmp14 - r2new += tmp17 - r2new += np.transpose(tmp17, (1, 0, 2, 3)) * -1 - del tmp17 - r2new += tmp18 * -0.5 - r2new += np.transpose(tmp18, (0, 1, 3, 2)) * 0.5 - del tmp18 - r2new += np.transpose(tmp19, (0, 1, 3, 2)) - r2new += np.transpose(tmp19, (1, 0, 3, 2)) * -1 - del tmp19 - r2new += np.transpose(tmp20, (1, 0, 2, 3)) * -0.5 - r2new += np.transpose(tmp20, (1, 0, 3, 2)) * 0.5 - del tmp20 - r2new += einsum(r2, (0, 1, 2, 3), tmp21, (0, 1, 4, 5), (4, 5, 2, 3)) * 0.25 - del tmp21 - r1new = einsum(v.oovv, (0, 1, 2, 3), tmp0, (1, 3), (0, 2)) - del tmp0 - r1new += einsum(f.ov, (0, 1), tmp1, (2, 0), (2, 1)) * -0.5 - r1new += einsum(v.ovvv, (0, 1, 2, 3), tmp2, (1, 3), (0, 2)) * 0.5 - del tmp2 - r1new += einsum(v.ooov, (0, 1, 2, 3), tmp1, (2, 1), (0, 3)) * 0.5 - del tmp1 - r1new += einsum(v.ovov, (0, 1, 2, 3), r1, (2, 1), (0, 3)) * -1 - r1new += einsum(r2, (0, 1, 2, 3), tmp3, (1, 2, 3, 4), (0, 4)) * -1 - del tmp3 - r1new += einsum(tmp4, (0, 1, 2, 3), r2, (1, 0, 4, 3), (2, 4)) * -0.5 - del tmp4 - r1new += einsum(r2, (0, 1, 2, 3), tmp5, (1, 3), (0, 2)) - del tmp5 - r1new += einsum(r1, (0, 1), tmp6, (1, 2), (0, 2)) - del tmp6 - r1new += einsum(tmp7, (0, 1), r1, (0, 2), (1, 2)) * -0.5 - del tmp7 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/GCCSD.py b/ebcc/codegen/GCCSD.py deleted file mode 100644 index 85472ba1..00000000 --- a/ebcc/codegen/GCCSD.py +++ /dev/null @@ -1,2289 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:55:52.557299 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:55:52.812141. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(t2) - tmp0 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - e_cc = einsum(f.ov, (0, 1), t1, (0, 1), ()) - e_cc += einsum(tmp0, (0, 1, 2, 3), v.oovv, (0, 1, 2, 3), ()) * 0.25 - del tmp0 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:56:00.614240. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - """ - - tmp3 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp20 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp21 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp34 = einsum(tmp3, (0, 1), t1, (2, 1), (2, 0)) - tmp6 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp40 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp7 = np.copy(t2) - tmp7 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - tmp5 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp38 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - tmp0 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp29 = np.copy(t2) - tmp29 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1 - tmp27 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp11 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp13 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp15 = einsum(tmp3, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) * -1 - tmp22 = np.copy(np.transpose(tmp20, (0, 2, 1, 3))) * -1 - del tmp20 - tmp22 += np.transpose(tmp21, (2, 1, 0, 3)) * 0.5 - del tmp21 - tmp18 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp9 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp35 = einsum(t2, (0, 1, 2, 3), tmp34, (4, 1), (4, 0, 2, 3)) * -1 - del tmp34 - tmp33 = einsum(tmp6, (0, 1), t2, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - tmp32 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 1), (4, 0, 2, 3)) - tmp41 = einsum(tmp7, (0, 1, 2, 3), tmp40, (4, 0, 1, 5), (4, 5, 2, 3)) * 0.5 - del tmp40 - tmp37 = einsum(t2, (0, 1, 2, 3), tmp5, (1, 4), (4, 0, 2, 3)) - tmp39 = einsum(t2, (0, 1, 2, 3), tmp38, (4, 1), (0, 4, 2, 3)) - del tmp38 - tmp47 = einsum(t2, (0, 1, 2, 3), tmp0, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp30 = einsum(tmp29, (0, 1, 2, 3), v.ovov, (4, 2, 0, 5), (1, 4, 3, 5)) - del tmp29 - tmp28 = einsum(tmp27, (0, 1, 2, 3), t1, (1, 4), (0, 2, 4, 3)) - del tmp27 - tmp12 = einsum(tmp11, (0, 1), t2, (2, 3, 4, 1), (2, 3, 4, 0)) * -1 - del tmp11 - tmp14 = einsum(tmp13, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp13 - tmp16 = einsum(tmp15, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp15 - tmp23 = einsum(tmp22, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp22 - tmp19 = einsum(tmp18, (0, 1), t2, (2, 3, 4, 1), (2, 3, 4, 0)) - del tmp18 - tmp25 = einsum(tmp9, (0, 1, 2, 3), t1, (4, 3), (0, 4, 1, 2)) * -1 - tmp44 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp43 = einsum(v.ooov, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - tmp36 = np.copy(np.transpose(tmp32, (0, 1, 3, 2))) * -1 - del tmp32 - tmp36 += np.transpose(tmp33, (0, 1, 3, 2)) - del tmp33 - tmp36 += np.transpose(tmp35, (0, 1, 3, 2)) * -1 - del tmp35 - tmp42 = np.copy(np.transpose(tmp37, (0, 1, 3, 2))) - del tmp37 - tmp42 += np.transpose(tmp39, (0, 1, 3, 2)) * -0.5 - del tmp39 - tmp42 += np.transpose(tmp41, (0, 1, 3, 2)) * -1 - del tmp41 - tmp48 = einsum(tmp47, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp47 - tmp10 = einsum(t2, (0, 1, 2, 3), tmp9, (4, 1, 5, 3), (4, 0, 2, 5)) * -1 - del tmp9 - tmp31 = np.copy(tmp28) - del tmp28 - tmp31 += tmp30 * -1 - del tmp30 - tmp17 = np.copy(tmp12) - del tmp12 - tmp17 += tmp14 - del tmp14 - tmp17 += tmp16 * -1 - del tmp16 - tmp24 = np.copy(tmp19) * 0.5 - del tmp19 - tmp24 += np.transpose(tmp23, (1, 0, 3, 2)) - del tmp23 - tmp46 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - tmp26 = einsum(tmp25, (0, 1, 2, 3), t1, (2, 4), (1, 0, 4, 3)) * -1 - del tmp25 - tmp45 = np.copy(np.transpose(tmp43, (1, 0, 2, 3))) * -1 - del tmp43 - tmp45 += np.transpose(tmp44, (1, 0, 2, 3)) * -1 - del tmp44 - tmp2 = np.copy(t2) * 0.5 - tmp2 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp49 = np.copy(v.oooo) - tmp49 += einsum(tmp7, (0, 1, 2, 3), v.oovv, (4, 5, 2, 3), (4, 5, 1, 0)) * -0.5 - tmp8 = np.copy(f.oo) - tmp8 += tmp5 - del tmp5 - tmp8 += tmp6 - del tmp6 - tmp8 += einsum(tmp7, (0, 1, 2, 3), v.oovv, (4, 0, 2, 3), (4, 1)) * -0.5 - tmp1 = np.copy(np.transpose(v.ovoo, (0, 2, 3, 1))) * -1 - tmp1 += np.transpose(tmp0, (0, 2, 1, 3)) * -1 - del tmp0 - tmp4 = np.copy(f.ov) - tmp4 += tmp3 - del tmp3 - t2new = np.copy(v.oovv) - t2new += tmp10 - t2new += np.transpose(tmp10, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp10, (1, 0, 2, 3)) * -1 - t2new += np.transpose(tmp10, (1, 0, 3, 2)) - del tmp10 - t2new += tmp17 - t2new += np.transpose(tmp17, (0, 1, 3, 2)) * -1 - del tmp17 - t2new += tmp24 * -1 - t2new += np.transpose(tmp24, (0, 1, 3, 2)) - del tmp24 - t2new += tmp26 * -1 - t2new += np.transpose(tmp26, (0, 1, 3, 2)) - del tmp26 - t2new += tmp31 - t2new += np.transpose(tmp31, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp31, (1, 0, 2, 3)) * -1 - t2new += np.transpose(tmp31, (1, 0, 3, 2)) - del tmp31 - t2new += tmp36 * -1 - t2new += np.transpose(tmp36, (1, 0, 2, 3)) - del tmp36 - t2new += tmp42 * -1 - t2new += np.transpose(tmp42, (1, 0, 2, 3)) - del tmp42 - t2new += tmp45 * -1 - t2new += np.transpose(tmp45, (0, 1, 3, 2)) - del tmp45 - t2new += np.transpose(tmp46, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp46, (1, 0, 3, 2)) - del tmp46 - t2new += tmp48 * -1 - t2new += np.transpose(tmp48, (0, 1, 3, 2)) - t2new += np.transpose(tmp48, (1, 0, 2, 3)) - t2new += np.transpose(tmp48, (1, 0, 3, 2)) * -1 - del tmp48 - t2new += einsum(tmp7, (0, 1, 2, 3), tmp49, (0, 1, 4, 5), (4, 5, 3, 2)) * -0.5 - del tmp7, tmp49 - t2new += einsum(tmp2, (0, 1, 2, 3), v.vvvv, (4, 5, 2, 3), (1, 0, 4, 5)) * -1 - t1new = np.copy(f.ov) - t1new += einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - t1new += einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) * -1 - t1new += einsum(tmp1, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) * 0.5 - del tmp1 - t1new += einsum(tmp2, (0, 1, 2, 3), v.ovvv, (0, 4, 2, 3), (1, 4)) - del tmp2 - t1new += einsum(t2, (0, 1, 2, 3), tmp4, (1, 3), (0, 2)) - del tmp4 - t1new += einsum(tmp8, (0, 1), t1, (0, 2), (1, 2)) * -1 - del tmp8 - - return {f"t1new": t1new, f"t2new": t2new} - -def update_lams(f=None, l1=None, l2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:56:11.541705. - - Parameters - ---------- - f : array - Fock matrix. - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - l1new : array - Updated L1 residuals. - l2new : array - Updated L2 residuals. - """ - - tmp5 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp36 = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 4, 3), (4, 2)) - tmp25 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp4 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp28 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp27 = einsum(t1, (0, 1), v.ooov, (2, 0, 3, 1), (2, 3)) - tmp20 = einsum(t1, (0, 1), l1, (1, 2), (2, 0)) - tmp21 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 0, 1), (2, 4)) - tmp1 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - tmp11 = np.copy(v.ooov) - tmp11 += np.transpose(tmp5, (2, 1, 0, 3)) * 0.5 - tmp7 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp18 = einsum(t2, (0, 1, 2, 3), l2, (4, 3, 0, 1), (4, 2)) - tmp37 = np.copy(tmp25) - tmp37 += tmp36 * 0.5 - del tmp36 - tmp6 = np.copy(np.transpose(v.ovoo, (0, 2, 3, 1))) * -1 - tmp6 += np.transpose(tmp5, (0, 2, 1, 3)) * -1 - tmp31 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp31 += tmp4 - tmp41 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp44 = np.copy(tmp27) * 2 - tmp44 += np.transpose(tmp28, (1, 0)) - tmp24 = np.copy(tmp20) - tmp24 += tmp21 * 0.5 - tmp50 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp0 = einsum(l2, (0, 1, 2, 3), t2, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp2 = einsum(t1, (0, 1), tmp1, (2, 3, 4, 1), (3, 2, 4, 0)) - tmp12 = einsum(t1, (0, 1), tmp11, (2, 3, 4, 1), (2, 3, 4, 0)) - del tmp11 - tmp10 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp56 = einsum(f.vv, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp57 = einsum(tmp7, (0, 1), tmp1, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp35 = einsum(v.oovv, (0, 1, 2, 3), tmp18, (4, 3), (0, 1, 4, 2)) * -1 - tmp38 = einsum(tmp37, (0, 1), l2, (2, 0, 3, 4), (3, 4, 1, 2)) * -1 - del tmp37 - tmp34 = einsum(tmp1, (0, 1, 2, 3), f.ov, (2, 4), (0, 1, 4, 3)) - tmp39 = einsum(l1, (0, 1), tmp6, (1, 2, 3, 4), (2, 3, 4, 0)) - tmp32 = einsum(l2, (0, 1, 2, 3), tmp31, (3, 4, 1, 5), (4, 2, 5, 0)) - del tmp31 - tmp30 = einsum(tmp1, (0, 1, 2, 3), v.ooov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp42 = einsum(l2, (0, 1, 2, 3), tmp41, (4, 3), (4, 2, 0, 1)) - del tmp41 - tmp45 = einsum(l2, (0, 1, 2, 3), tmp44, (4, 3), (4, 2, 0, 1)) * -0.5 - del tmp44 - tmp43 = einsum(v.oovv, (0, 1, 2, 3), tmp24, (4, 1), (4, 0, 2, 3)) * -1 - tmp52 = einsum(tmp5, (0, 1, 2, 3), tmp1, (0, 4, 2, 5), (4, 1, 5, 3)) * -1 - del tmp5 - tmp51 = einsum(l2, (0, 1, 2, 3), tmp50, (3, 4, 1, 5), (2, 4, 0, 5)) - del tmp50 - tmp54 = einsum(tmp7, (0, 1), t1, (2, 1), (2, 0)) - tmp48 = einsum(l1, (0, 1), v.ovvv, (2, 0, 3, 4), (1, 2, 3, 4)) - tmp47 = einsum(l2, (0, 1, 2, 3), f.oo, (4, 3), (4, 2, 0, 1)) - tmp8 = np.copy(f.ov) - tmp8 += tmp7 - tmp16 = np.copy(np.transpose(tmp0, (1, 0, 3, 2))) * -0.5 - tmp16 += np.transpose(tmp2, (0, 1, 3, 2)) - tmp9 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) - tmp9 += np.transpose(tmp4, (0, 1, 3, 2)) * -0.5 - tmp13 = np.copy(v.oooo) * -0.5 - tmp13 += np.transpose(tmp10, (3, 2, 1, 0)) * -0.25 - tmp13 += np.transpose(tmp12, (1, 0, 3, 2)) * -1 - tmp22 = np.copy(tmp20) * 2 - del tmp20 - tmp22 += tmp21 - del tmp21 - tmp58 = np.copy(np.transpose(tmp56, (1, 0, 2, 3))) * -1 - del tmp56 - tmp58 += tmp57 - del tmp57 - tmp40 = np.copy(tmp34) * -1 - del tmp34 - tmp40 += tmp35 * 0.5 - del tmp35 - tmp40 += np.transpose(tmp38, (1, 0, 3, 2)) - del tmp38 - tmp40 += np.transpose(tmp39, (1, 0, 3, 2)) - del tmp39 - tmp59 = np.copy(v.oooo) * 0.5 - tmp59 += np.transpose(tmp10, (1, 0, 3, 2)) * 0.25 - del tmp10 - tmp59 += np.transpose(tmp12, (2, 3, 1, 0)) * -1 - del tmp12 - tmp33 = einsum(tmp7, (0, 1), l1, (2, 3), (3, 0, 2, 1)) - del tmp7 - tmp33 += tmp30 - del tmp30 - tmp33 += np.transpose(tmp32, (1, 0, 3, 2)) - del tmp32 - tmp46 = np.copy(np.transpose(tmp42, (0, 1, 3, 2))) - del tmp42 - tmp46 += np.transpose(tmp43, (0, 1, 3, 2)) * -1 - del tmp43 - tmp46 += np.transpose(tmp45, (1, 0, 3, 2)) - del tmp45 - tmp60 = np.copy(np.transpose(tmp0, (1, 0, 3, 2))) * -1 - tmp60 += np.transpose(tmp2, (0, 1, 3, 2)) * 2 - tmp53 = np.copy(tmp51) - del tmp51 - tmp53 += tmp52 * -1 - del tmp52 - tmp55 = einsum(tmp54, (0, 1), l2, (2, 3, 4, 0), (4, 1, 2, 3)) - del tmp54 - tmp49 = np.copy(np.transpose(tmp47, (0, 1, 3, 2))) * -1 - del tmp47 - tmp49 += np.transpose(tmp48, (0, 1, 3, 2)) - del tmp48 - tmp29 = np.copy(f.oo) - tmp29 += np.transpose(tmp27, (1, 0)) - del tmp27 - tmp29 += tmp28 * 0.5 - del tmp28 - tmp29 += einsum(tmp8, (0, 1), t1, (2, 1), (2, 0)) - tmp17 = einsum(t2, (0, 1, 2, 3), l1, (3, 4), (4, 0, 1, 2)) * 0.5 - tmp17 += einsum(tmp1, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - tmp17 += einsum(t1, (0, 1), tmp16, (0, 2, 3, 4), (2, 4, 3, 1)) * -0.5 - del tmp16 - tmp3 = einsum(t2, (0, 1, 2, 3), l2, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp14 = np.copy(np.transpose(v.ovoo, (0, 2, 3, 1))) * -0.5 - tmp14 += einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (0, 4, 5, 1)) * -0.25 - tmp14 += einsum(t2, (0, 1, 2, 3), tmp6, (4, 1, 5, 3), (5, 0, 4, 2)) - del tmp6 - tmp14 += einsum(tmp8, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) * 0.5 - tmp14 += einsum(tmp9, (0, 1, 2, 3), t1, (4, 2), (1, 0, 4, 3)) * -1 - del tmp9 - tmp14 += einsum(t1, (0, 1), tmp13, (0, 2, 3, 4), (2, 4, 3, 1)) * -1 - del tmp13 - tmp15 = np.copy(v.ovvv) - tmp15 += einsum(v.vvvv, (0, 1, 2, 3), t1, (4, 1), (4, 0, 2, 3)) * -1 - tmp26 = np.copy(f.vv) - tmp26 += tmp25 * -1 - del tmp25 - tmp23 = np.copy(t1) * -1 - tmp23 += einsum(l1, (0, 1), t2, (2, 1, 3, 0), (2, 3)) * -1 - tmp23 += einsum(t2, (0, 1, 2, 3), tmp1, (1, 0, 4, 3), (4, 2)) * 0.5 - tmp23 += einsum(tmp22, (0, 1), t1, (0, 2), (1, 2)) * 0.5 - del tmp22 - tmp19 = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) * 2 - tmp19 += tmp18 - del tmp18 - l2new = einsum(v.ovvv, (0, 1, 2, 3), tmp1, (4, 5, 0, 1), (2, 3, 4, 5)) - l2new += np.transpose(v.oovv, (2, 3, 0, 1)) - l2new += einsum(l2, (0, 1, 2, 3), v.vvvv, (4, 5, 0, 1), (4, 5, 2, 3)) * 0.5 - l2new += np.transpose(tmp33, (2, 3, 0, 1)) - l2new += np.transpose(tmp33, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp33, (2, 3, 1, 0)) * -1 - l2new += np.transpose(tmp33, (3, 2, 1, 0)) - del tmp33 - l2new += np.transpose(tmp40, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp40, (3, 2, 0, 1)) - del tmp40 - l2new += np.transpose(tmp46, (3, 2, 0, 1)) - l2new += np.transpose(tmp46, (3, 2, 1, 0)) * -1 - del tmp46 - l2new += np.transpose(tmp49, (2, 3, 0, 1)) - l2new += np.transpose(tmp49, (2, 3, 1, 0)) * -1 - del tmp49 - l2new += einsum(l1, (0, 1), f.ov, (2, 3), (3, 0, 2, 1)) - l2new += einsum(f.ov, (0, 1), l1, (2, 3), (2, 1, 0, 3)) * -1 - l2new += einsum(f.ov, (0, 1), l1, (2, 3), (1, 2, 3, 0)) * -1 - l2new += einsum(f.ov, (0, 1), l1, (2, 3), (2, 1, 3, 0)) - l2new += np.transpose(tmp53, (2, 3, 0, 1)) - l2new += np.transpose(tmp53, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp53, (2, 3, 1, 0)) * -1 - l2new += np.transpose(tmp53, (3, 2, 1, 0)) - del tmp53 - l2new += np.transpose(tmp55, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp55, (2, 3, 1, 0)) - del tmp55 - l2new += np.transpose(tmp58, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp58, (3, 2, 0, 1)) - del tmp58 - l2new += einsum(tmp59, (0, 1, 2, 3), l2, (4, 5, 0, 1), (4, 5, 2, 3)) - del tmp59 - l2new += einsum(tmp60, (0, 1, 2, 3), v.oovv, (2, 3, 4, 5), (4, 5, 1, 0)) * 0.25 - del tmp60 - l1new = np.copy(np.transpose(f.ov, (1, 0))) - l1new += einsum(l1, (0, 1), v.ovov, (2, 0, 1, 3), (3, 2)) * -1 - l1new += einsum(v.ovoo, (0, 1, 2, 3), tmp0, (4, 0, 3, 2), (1, 4)) * 0.25 - del tmp0 - l1new += einsum(v.ooov, (0, 1, 2, 3), tmp2, (4, 2, 0, 1), (3, 4)) * -0.5 - del tmp2 - l1new += einsum(tmp1, (0, 1, 2, 3), v.ovov, (2, 3, 1, 4), (4, 0)) * -1 - l1new += einsum(v.ovvv, (0, 1, 2, 3), tmp3, (4, 0, 1, 3), (2, 4)) * -1 - del tmp3 - l1new += einsum(tmp1, (0, 1, 2, 3), tmp4, (1, 2, 3, 4), (4, 0)) - del tmp4, tmp1 - l1new += einsum(tmp14, (0, 1, 2, 3), l2, (4, 3, 1, 2), (4, 0)) - del tmp14 - l1new += einsum(l2, (0, 1, 2, 3), tmp15, (3, 4, 0, 1), (4, 2)) * -0.5 - del tmp15 - l1new += einsum(tmp17, (0, 1, 2, 3), v.oovv, (1, 2, 4, 3), (4, 0)) - del tmp17 - l1new += einsum(tmp19, (0, 1), v.ovvv, (2, 0, 3, 1), (3, 2)) * 0.5 - del tmp19 - l1new += einsum(v.oovv, (0, 1, 2, 3), tmp23, (1, 3), (2, 0)) * -1 - del tmp23 - l1new += einsum(tmp24, (0, 1), v.ooov, (2, 1, 0, 3), (3, 2)) - l1new += einsum(l1, (0, 1), tmp26, (0, 2), (2, 1)) - del tmp26 - l1new += einsum(tmp29, (0, 1), l1, (2, 0), (2, 1)) * -1 - del tmp29 - l1new += einsum(tmp8, (0, 1), tmp24, (2, 0), (1, 2)) * -1 - del tmp24, tmp8 - - return {f"l1new": l1new, f"l2new": l2new} - -def make_rdm1_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:56:12.323425. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm1 : array - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp1 = einsum(t1, (0, 1), l1, (1, 2), (2, 0)) - tmp0 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 0, 1), (2, 4)) - tmp3 = np.copy(tmp1) * 2 - tmp3 += tmp0 - tmp2 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - rdm1.vv = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) - rdm1.vv += einsum(t2, (0, 1, 2, 3), l2, (4, 3, 0, 1), (4, 2)) * 0.5 - rdm1.vo = np.copy(l1) - rdm1.ov = einsum(l1, (0, 1), t2, (2, 1, 3, 0), (2, 3)) - rdm1.ov += t1 - rdm1.ov += einsum(tmp2, (0, 1, 2, 3), t2, (1, 0, 4, 3), (2, 4)) * -0.5 - del tmp2 - rdm1.ov += einsum(tmp3, (0, 1), t1, (0, 2), (1, 2)) * -0.5 - del tmp3 - rdm1.oo = np.copy(np.transpose(tmp0, (1, 0))) * -0.5 - del tmp0 - rdm1.oo += delta.oo - del delta - rdm1.oo += np.transpose(tmp1, (1, 0)) * -1 - del tmp1 - rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]]) - - return rdm1 - -def make_rdm2_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:56:23.297584. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm2 : array - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp3 = einsum(t1, (0, 1), l1, (1, 2), (2, 0)) - tmp1 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - tmp4 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 0, 1), (2, 4)) - tmp21 = einsum(t2, (0, 1, 2, 3), l2, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp10 = einsum(l1, (0, 1), t2, (2, 1, 3, 0), (2, 3)) - tmp11 = einsum(tmp3, (0, 1), t1, (0, 2), (1, 2)) - tmp6 = einsum(t2, (0, 1, 2, 3), tmp1, (4, 1, 5, 3), (4, 5, 0, 2)) * -1 - tmp0 = einsum(l2, (0, 1, 2, 3), t2, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp2 = einsum(t1, (0, 1), tmp1, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp5 = einsum(t2, (0, 1, 2, 3), l1, (3, 4), (4, 0, 1, 2)) - tmp14 = np.copy(tmp3) * 2 - tmp14 += tmp4 - tmp30 = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) - tmp25 = einsum(t2, (0, 1, 2, 3), l2, (4, 3, 0, 1), (4, 2)) - tmp29 = einsum(tmp1, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - tmp36 = einsum(tmp21, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - tmp12 = np.copy(tmp10) - tmp12 += tmp11 * -1 - del tmp11 - tmp18 = einsum(tmp6, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - tmp7 = einsum(tmp1, (0, 1, 2, 3), t2, (1, 0, 4, 3), (2, 4)) - tmp8 = einsum(t1, (0, 1), tmp4, (0, 2), (2, 1)) - tmp13 = np.copy(np.transpose(tmp0, (1, 0, 3, 2))) * -0.5 - tmp13 += np.transpose(tmp2, (0, 1, 3, 2)) - tmp22 = einsum(t2, (0, 1, 2, 3), tmp21, (1, 4, 3, 5), (0, 4, 2, 5)) - tmp20 = einsum(tmp5, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - tmp15 = einsum(tmp14, (0, 1), t1, (0, 2), (1, 2)) * 0.5 - del tmp14 - tmp38 = einsum(l2, (0, 1, 2, 3), t1, (3, 4), (2, 0, 1, 4)) - tmp31 = np.copy(tmp30) - tmp31 += tmp25 * 0.5 - tmp33 = einsum(t2, (0, 1, 2, 3), tmp1, (1, 0, 4, 5), (4, 5, 2, 3)) * -1 - tmp35 = einsum(l1, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) - tmp34 = einsum(tmp29, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) * -1 - tmp37 = np.copy(tmp36) - tmp37 += einsum(tmp25, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -0.5 - tmp32 = np.copy(tmp30) * 2 - tmp32 += tmp25 - tmp19 = np.copy(tmp18) - del tmp18 - tmp19 += einsum(tmp12, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -1 - tmp9 = np.copy(tmp7) - tmp9 += tmp8 - del tmp8 - tmp28 = einsum(t1, (0, 1), tmp13, (0, 2, 3, 4), (2, 4, 3, 1)) * -2 - tmp27 = einsum(t2, (0, 1, 2, 3), tmp4, (1, 4), (0, 4, 2, 3)) - tmp24 = einsum(t2, (0, 1, 2, 3), tmp3, (1, 4), (4, 0, 2, 3)) - tmp26 = einsum(tmp25, (0, 1), t2, (2, 3, 4, 0), (2, 3, 4, 1)) - del tmp25 - tmp23 = np.copy(tmp20) - del tmp20 - tmp23 += tmp22 - del tmp22 - tmp17 = np.copy(np.transpose(tmp0, (1, 0, 3, 2))) * -1 - tmp17 += np.transpose(tmp2, (0, 1, 3, 2)) * 2 - tmp16 = np.copy(tmp10) * -1 - del tmp10 - tmp16 += tmp7 * 0.5 - del tmp7 - tmp16 += tmp15 - del tmp15 - rdm2.vvvv = einsum(t2, (0, 1, 2, 3), l2, (4, 5, 0, 1), (4, 5, 2, 3)) * 0.5 - rdm2.vvvv += einsum(tmp38, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - rdm2.vvvo = np.copy(np.transpose(tmp38, (2, 1, 3, 0))) - rdm2.vvov = np.copy(np.transpose(tmp38, (2, 1, 0, 3))) * -1 - del tmp38 - rdm2.vovv = np.copy(np.transpose(tmp33, (1, 0, 3, 2))) * 0.5 - rdm2.vovv += np.transpose(tmp34, (1, 0, 3, 2)) - rdm2.vovv += np.transpose(tmp35, (1, 0, 3, 2)) - rdm2.vovv += np.transpose(tmp36, (1, 0, 2, 3)) - rdm2.vovv += np.transpose(tmp36, (1, 0, 3, 2)) * -1 - del tmp36 - rdm2.vovv += einsum(tmp31, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.vovv += einsum(tmp31, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - rdm2.ovvv = np.copy(np.transpose(tmp33, (0, 1, 3, 2))) * -0.5 - del tmp33 - rdm2.ovvv += np.transpose(tmp34, (0, 1, 3, 2)) * -1 - del tmp34 - rdm2.ovvv += np.transpose(tmp35, (0, 1, 3, 2)) * -1 - del tmp35 - rdm2.ovvv += tmp37 * -1 - rdm2.ovvv += np.transpose(tmp37, (0, 1, 3, 2)) - del tmp37 - rdm2.ovvv += einsum(tmp30, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2.ovvv += einsum(tmp30, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1 - del tmp30 - rdm2.vvoo = np.copy(l2) - rdm2.vovo = np.copy(np.transpose(tmp21, (2, 1, 3, 0))) * -1 - rdm2.vovo += np.transpose(tmp29, (2, 1, 3, 0)) - rdm2.vovo += einsum(l1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.vovo += einsum(delta.oo, (0, 1), tmp32, (2, 3), (2, 0, 3, 1)) * 0.5 - rdm2.voov = np.copy(np.transpose(tmp21, (2, 1, 0, 3))) - rdm2.voov += np.transpose(tmp29, (2, 1, 0, 3)) * -1 - rdm2.voov += einsum(l1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - rdm2.voov += einsum(tmp31, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.ovvo = np.copy(np.transpose(tmp21, (1, 2, 3, 0))) - rdm2.ovvo += np.transpose(tmp29, (1, 2, 3, 0)) * -1 - rdm2.ovvo += einsum(l1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2.ovvo += einsum(delta.oo, (0, 1), tmp32, (2, 3), (0, 2, 3, 1)) * -0.5 - del tmp32 - rdm2.ovov = np.copy(np.transpose(tmp21, (1, 2, 0, 3))) * -1 - del tmp21 - rdm2.ovov += np.transpose(tmp29, (1, 2, 0, 3)) - del tmp29 - rdm2.ovov += einsum(l1, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.ovov += einsum(tmp31, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) - del tmp31 - rdm2.oovv = np.copy(t2) - rdm2.oovv += tmp19 * -1 - rdm2.oovv += np.transpose(tmp19, (0, 1, 3, 2)) - rdm2.oovv += np.transpose(tmp19, (1, 0, 2, 3)) - rdm2.oovv += np.transpose(tmp19, (1, 0, 3, 2)) * -1 - del tmp19 - rdm2.oovv += tmp23 - rdm2.oovv += np.transpose(tmp23, (0, 1, 3, 2)) * -1 - del tmp23 - rdm2.oovv += np.transpose(tmp24, (0, 1, 3, 2)) * -1 - rdm2.oovv += np.transpose(tmp24, (1, 0, 3, 2)) - del tmp24 - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2.oovv += tmp26 * -0.5 - rdm2.oovv += np.transpose(tmp26, (0, 1, 3, 2)) * 0.5 - del tmp26 - rdm2.oovv += np.transpose(tmp27, (0, 1, 3, 2)) * 0.5 - rdm2.oovv += np.transpose(tmp27, (1, 0, 3, 2)) * -0.5 - del tmp27 - rdm2.oovv += einsum(tmp9, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -0.5 - rdm2.oovv += einsum(t1, (0, 1), tmp9, (2, 3), (0, 2, 3, 1)) * 0.5 - rdm2.oovv += einsum(tmp9, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * 0.5 - rdm2.oovv += einsum(tmp9, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * -0.5 - rdm2.oovv += einsum(t2, (0, 1, 2, 3), tmp13, (0, 1, 4, 5), (5, 4, 2, 3)) * 0.5 - rdm2.oovv += einsum(tmp28, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) * 0.5 - del tmp28 - rdm2.vooo = np.copy(np.transpose(tmp1, (3, 2, 1, 0))) - rdm2.vooo += einsum(l1, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) - rdm2.vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.ovoo = np.copy(np.transpose(tmp1, (2, 3, 1, 0))) * -1 - del tmp1 - rdm2.ovoo += einsum(l1, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 1, 3)) - rdm2.oovo = np.copy(np.transpose(tmp5, (2, 1, 3, 0))) - rdm2.oovo += np.transpose(tmp6, (1, 2, 3, 0)) - rdm2.oovo += np.transpose(tmp6, (2, 1, 3, 0)) * -1 - rdm2.oovo += einsum(tmp4, (0, 1), t1, (2, 3), (2, 1, 3, 0)) * -0.5 - rdm2.oovo += einsum(tmp4, (0, 1), t1, (2, 3), (1, 2, 3, 0)) * 0.5 - rdm2.oovo += einsum(delta.oo, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2.oovo += einsum(t1, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.oovo += einsum(tmp16, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.oovo += einsum(delta.oo, (0, 1), tmp16, (2, 3), (0, 2, 3, 1)) - del tmp16 - rdm2.oovo += einsum(tmp3, (0, 1), t1, (2, 3), (2, 1, 3, 0)) * -1 - rdm2.oovo += einsum(tmp3, (0, 1), t1, (2, 3), (1, 2, 3, 0)) - rdm2.oovo += einsum(t1, (0, 1), tmp17, (0, 2, 3, 4), (4, 3, 1, 2)) * 0.5 - del tmp17 - rdm2.ooov = np.copy(np.transpose(tmp5, (2, 1, 0, 3))) * -1 - del tmp5 - rdm2.ooov += np.transpose(tmp6, (1, 2, 0, 3)) * -1 - rdm2.ooov += np.transpose(tmp6, (2, 1, 0, 3)) - del tmp6 - rdm2.ooov += einsum(tmp4, (0, 1), t1, (2, 3), (2, 1, 0, 3)) * 0.5 - rdm2.ooov += einsum(tmp4, (0, 1), t1, (2, 3), (1, 2, 0, 3)) * -0.5 - rdm2.ooov += einsum(delta.oo, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.ooov += einsum(t1, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) - rdm2.ooov += einsum(tmp9, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * 0.5 - rdm2.ooov += einsum(delta.oo, (0, 1), tmp9, (2, 3), (0, 2, 1, 3)) * -0.5 - del tmp9 - rdm2.ooov += einsum(tmp3, (0, 1), t1, (2, 3), (2, 1, 0, 3)) - rdm2.ooov += einsum(tmp3, (0, 1), t1, (2, 3), (1, 2, 0, 3)) * -1 - rdm2.ooov += einsum(tmp12, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.ooov += einsum(delta.oo, (0, 1), tmp12, (2, 3), (0, 2, 1, 3)) - del tmp12 - rdm2.ooov += einsum(t1, (0, 1), tmp13, (0, 2, 3, 4), (4, 3, 2, 1)) * -1 - del tmp13 - rdm2.oooo = np.copy(np.transpose(tmp0, (3, 2, 1, 0))) * 0.5 - del tmp0 - rdm2.oooo += np.transpose(tmp2, (2, 3, 1, 0)) * -1 - del tmp2 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.oooo += einsum(tmp3, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * -1 - rdm2.oooo += einsum(tmp3, (0, 1), delta.oo, (2, 3), (2, 1, 0, 3)) - rdm2.oooo += einsum(tmp3, (0, 1), delta.oo, (2, 3), (1, 2, 3, 0)) - rdm2.oooo += einsum(tmp3, (0, 1), delta.oo, (2, 3), (2, 1, 3, 0)) * -1 - del tmp3 - rdm2.oooo += einsum(tmp4, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * -0.5 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp4, (2, 3), (0, 3, 2, 1)) * 0.5 - rdm2.oooo += einsum(tmp4, (0, 1), delta.oo, (2, 3), (1, 2, 3, 0)) * 0.5 - rdm2.oooo += einsum(tmp4, (0, 1), delta.oo, (2, 3), (2, 1, 3, 0)) * -0.5 - del tmp4, delta - rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv) - rdm2 = np.transpose(rdm2, (0, 2, 1, 3)) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:56:37.272966. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp11 : array - tmp12 : array - tmp13 : array - tmp15 : array - tmp16 : array - tmp17 : array - tmp2 : array - tmp20 : array - tmp24 : array - tmp25 : array - tmp27 : array - tmp28 : array - tmp3 : array - tmp30 : array - tmp31 : array - tmp33 : array - tmp34 : array - tmp35 : array - tmp38 : array - tmp39 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp43 : array - tmp44 : array - tmp45 : array - tmp46 : array - tmp48 : array - tmp49 : array - tmp5 : array - tmp52 : array - tmp55 : array - tmp56 : array - tmp7 : array - tmp8 : array - """ - - tmp3 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp2 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp52 = einsum(tmp3, (0, 1, 2, 3), t1, (4, 3), (0, 4, 2, 1)) - tmp5 = einsum(tmp2, (0, 1), t1, (2, 1), (2, 0)) - tmp25 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp24 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp20 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp1 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp33 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp4 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - tmp0 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp56 = einsum(t1, (0, 1), tmp52, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp55 = einsum(t1, (0, 1), tmp5, (2, 0), (2, 1)) - tmp49 = einsum(tmp25, (0, 1, 2, 3), t1, (4, 3), (0, 4, 1, 2)) * -1 - tmp48 = einsum(tmp24, (0, 1), t1, (2, 1), (2, 0)) - tmp46 = einsum(t1, (0, 1), tmp20, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - tmp45 = einsum(tmp1, (0, 1), t1, (0, 2), (1, 2)) - tmp44 = einsum(t1, (0, 1), tmp33, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - tmp43 = einsum(tmp4, (0, 1), t1, (1, 2), (0, 2)) - tmp41 = einsum(tmp3, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp40 = einsum(t2, (0, 1, 2, 3), tmp3, (4, 1, 0, 3), (4, 2)) - tmp39 = einsum(tmp2, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) * -1 - tmp38 = einsum(tmp2, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp35 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp34 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp31 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp30 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp28 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp27 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp17 = einsum(v.ovov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) - tmp16 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp15 = einsum(t1, (0, 1), v.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp13 = einsum(tmp0, (0, 1), t1, (0, 2), (1, 2)) - tmp12 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp11 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp8 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp7 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp11": tmp11, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp15": tmp15, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp24": tmp24, f"tmp25": tmp25, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp31": tmp31, f"tmp33": tmp33, f"tmp34": tmp34, f"tmp35": tmp35, f"tmp38": tmp38, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp43": tmp43, f"tmp44": tmp44, f"tmp45": tmp45, f"tmp46": tmp46, f"tmp48": tmp48, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp52": tmp52, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp7": tmp7, f"tmp8": tmp8} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:56:37.305240. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp9 = einsum(ints.tmp3, (0, 1, 2, 3), r2, (4, 1, 3), (0, 2, 4)) - tmp10 = einsum(r2, (0, 1, 2), v.ooov, (3, 1, 4, 2), (0, 3, 4)) - tmp18 = np.copy(ints.tmp17) - tmp18 += ints.tmp28 - tmp16 = np.copy(f.oo) - tmp16 += ints.tmp0 - tmp16 += ints.tmp1 - tmp16 += np.transpose(ints.tmp5, (1, 0)) - tmp11 = np.copy(tmp9) - del tmp9 - tmp11 += tmp10 * -1 - del tmp10 - tmp13 = np.copy(ints.tmp41) - tmp13 += np.transpose(ints.tmp46, (0, 2, 1, 3)) - tmp7 = np.copy(ints.tmp25) - tmp7 += ints.tmp35 - tmp19 = einsum(r1, (0,), tmp18, (1, 0, 2, 3), (1, 2, 3)) - del tmp18 - tmp17 = einsum(r2, (0, 1, 2), tmp16, (1, 3), (3, 0, 2)) * -1 - del tmp16 - tmp12 = einsum(tmp11, (0, 1, 2), t1, (1, 3), (0, 2, 3)) - del tmp11 - tmp14 = einsum(tmp13, (0, 1, 2, 3), r1, (2,), (0, 1, 3)) - del tmp13 - tmp5 = einsum(ints.tmp20, (0, 1, 2, 3), r2, (2, 1, 4), (0, 3, 4)) * -1 - tmp8 = einsum(tmp7, (0, 1, 2, 3), r2, (4, 1, 3), (0, 4, 2)) * -1 - del tmp7 - tmp6 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 2, 1), (4, 0, 3)) - tmp4 = einsum(ints.tmp4, (0, 1), r2, (2, 1, 3), (0, 2, 3)) - tmp22 = np.copy(f.ov) - tmp22 += ints.tmp2 - tmp20 = np.copy(tmp17) * -1 - del tmp17 - tmp20 += tmp19 - del tmp19 - tmp15 = np.copy(tmp4) * -0.5 - del tmp4 - tmp15 += tmp5 * 0.5 - del tmp5 - tmp15 += tmp6 - del tmp6 - tmp15 += tmp8 * -1 - del tmp8 - tmp15 += tmp12 * -1 - del tmp12 - tmp15 += tmp14 - del tmp14 - tmp3 = einsum(r2, (0, 1, 2), v.oovv, (0, 1, 3, 2), (3,)) - tmp25 = np.copy(ints.tmp13) - tmp25 += ints.tmp16 - tmp25 += ints.tmp27 * 0.5 - tmp25 += ints.tmp30 * 0.5 - tmp25 += ints.tmp40 * 0.5 - tmp25 += ints.tmp43 * 0.5 - tmp25 += ints.tmp45 - tmp25 += ints.tmp48 - tmp25 += ints.tmp55 - tmp25 += ints.tmp7 - tmp25 += f.ov * -1 - tmp25 += ints.tmp11 * -1 - tmp25 += ints.tmp38 * -1 - tmp25 += ints.tmp8 * -1 - tmp24 = np.copy(ints.tmp12) - tmp24 += np.transpose(ints.tmp15, (2, 0, 1, 3)) - tmp24 += np.transpose(ints.tmp44, (2, 0, 1, 3)) * 0.5 - tmp24 += np.transpose(ints.tmp49, (2, 1, 0, 3)) - tmp24 += np.transpose(ints.tmp31, (2, 0, 1, 3)) * -0.5 - tmp24 += np.transpose(ints.tmp39, (2, 0, 1, 3)) * -1 - tmp24 += np.transpose(ints.tmp56, (2, 1, 0, 3)) * -1 - tmp24 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp21 = np.copy(ints.tmp33) * 0.5 - tmp21 += ints.tmp52 - tmp21 += v.oooo - tmp23 = np.copy(np.transpose(ints.tmp24, (1, 0))) - tmp23 += np.transpose(ints.tmp34, (1, 0)) * 0.5 - tmp23 += f.vv * -1 - tmp23 += einsum(tmp22, (0, 1), t1, (0, 2), (1, 2)) - del tmp22 - tmp1 = np.copy(f.ov) - tmp1 += ints.tmp2 - tmp0 = np.copy(ints.tmp3) - tmp0 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp2 = np.copy(f.oo) * 2 - tmp2 += ints.tmp0 * 2 - tmp2 += ints.tmp1 * 2 - tmp2 += np.transpose(ints.tmp4, (1, 0)) - tmp2 += np.transpose(ints.tmp5, (1, 0)) * 2 - r2new = einsum(tmp3, (0,), t2, (1, 2, 3, 0), (1, 2, 3)) * 0.5 - del tmp3 - r2new += tmp15 * -1 - r2new += np.transpose(tmp15, (1, 0, 2)) - del tmp15 - r2new += tmp20 - r2new += np.transpose(tmp20, (1, 0, 2)) * -1 - del tmp20 - r2new += einsum(tmp21, (0, 1, 2, 3), r2, (2, 3, 4), (0, 1, 4)) * 0.5 - del tmp21 - r2new += einsum(r2, (0, 1, 2), tmp23, (2, 3), (0, 1, 3)) * -1 - del tmp23 - r2new += einsum(tmp24, (0, 1, 2, 3), r1, (0,), (2, 1, 3)) * -1 - del tmp24 - r2new += einsum(tmp25, (0, 1), r1, (2,), (2, 0, 1)) * -1 - r2new += einsum(tmp25, (0, 1), r1, (2,), (0, 2, 1)) - del tmp25 - r1new = einsum(r2, (0, 1, 2), tmp0, (3, 0, 1, 2), (3,)) * 0.5 - del tmp0 - r1new += einsum(r2, (0, 1, 2), tmp1, (1, 2), (0,)) - del tmp1 - r1new += einsum(tmp2, (0, 1), r1, (0,), (1,)) * -0.5 - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:56:52.751918. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp12 : array - tmp13 : array - tmp15 : array - tmp18 : array - tmp19 : array - tmp2 : array - tmp23 : array - tmp27 : array - tmp28 : array - tmp29 : array - tmp30 : array - tmp32 : array - tmp34 : array - tmp37 : array - tmp38 : array - tmp39 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp44 : array - tmp47 : array - tmp50 : array - tmp56 : array - tmp7 : array - tmp8 : array - tmp9 : array - """ - - tmp2 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp50 = einsum(tmp2, (0, 1), t1, (2, 1), (2, 0)) - tmp1 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp19 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp32 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - tmp38 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp9 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp56 = einsum(tmp50, (0, 1), t1, (1, 2), (0, 2)) - tmp47 = einsum(tmp1, (0, 1), t1, (2, 1), (2, 0)) - tmp44 = einsum(tmp19, (0, 1), t1, (0, 2), (1, 2)) - tmp41 = einsum(t1, (0, 1), tmp32, (2, 0), (2, 1)) - tmp40 = einsum(t2, (0, 1, 2, 3), tmp38, (4, 1, 0, 5), (4, 2, 3, 5)) * -1 - tmp39 = einsum(tmp38, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp37 = einsum(tmp2, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp34 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp30 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp29 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp28 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 5, 0, 1), (4, 2, 3, 5)) - tmp27 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp23 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp18 = einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp15 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp13 = einsum(t1, (0, 1), tmp9, (0, 2), (2, 1)) - tmp12 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp8 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp7 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - tmp4 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - - return {f"tmp1": tmp1, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp15": tmp15, f"tmp18": tmp18, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp23": tmp23, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp29": tmp29, f"tmp30": tmp30, f"tmp32": tmp32, f"tmp34": tmp34, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp44": tmp44, f"tmp47": tmp47, f"tmp50": tmp50, f"tmp56": tmp56, f"tmp7": tmp7, f"tmp8": tmp8, f"tmp9": tmp9} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:56:52.777476. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp13 = np.copy(ints.tmp38) - tmp13 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp0 = np.copy(f.ov) - tmp0 += ints.tmp2 - tmp14 = einsum(r2, (0, 1, 2), tmp13, (3, 2, 4, 1), (3, 4, 0)) * -1 - tmp15 = einsum(r2, (0, 1, 2), tmp0, (3, 1), (2, 3, 0)) * -1 - tmp5 = einsum(r2, (0, 1, 2), v.oovv, (3, 4, 0, 1), (2, 3, 4)) - tmp11 = np.copy(f.vv) * 2 - tmp11 += np.transpose(ints.tmp4, (1, 0)) * -1 - tmp9 = np.copy(ints.tmp23) - tmp9 += ints.tmp34 - tmp8 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp8 += einsum(r1, (0,), t1, (1, 2), (1, 0, 2)) - tmp16 = np.copy(np.transpose(tmp14, (1, 0, 2))) * -1 - del tmp14 - tmp16 += np.transpose(tmp15, (1, 0, 2)) * -1 - del tmp15 - tmp6 = einsum(v.ovvv, (0, 1, 2, 3), r2, (2, 3, 4), (4, 0, 1)) - tmp20 = einsum(ints.tmp1, (0, 1), r2, (2, 1, 3), (3, 0, 2)) - tmp21 = einsum(r1, (0,), ints.tmp30, (1, 2, 3, 0), (1, 2, 3)) - tmp25 = np.copy(np.transpose(tmp5, (0, 2, 1))) * -0.5 - tmp25 += einsum(tmp13, (0, 1, 2, 3), r1, (3,), (0, 1, 2)) - del tmp13 - tmp3 = einsum(r1, (0,), tmp0, (1, 0), (1,)) - tmp2 = einsum(r2, (0, 1, 2), v.oovv, (3, 2, 0, 1), (3,)) - tmp12 = einsum(tmp11, (0, 1), r2, (2, 0, 3), (3, 1, 2)) * -0.5 - del tmp11 - tmp10 = einsum(tmp8, (0, 1, 2), tmp9, (3, 0, 4, 1), (3, 4, 2)) - del tmp9 - tmp18 = einsum(tmp8, (0, 1, 2), v.ovov, (3, 1, 0, 4), (3, 4, 2)) - del tmp8 - tmp17 = einsum(tmp16, (0, 1, 2), t1, (0, 3), (1, 2, 3)) - del tmp16 - tmp7 = einsum(tmp6, (0, 1, 2), t1, (1, 3), (0, 3, 2)) - del tmp6 - tmp22 = np.copy(tmp20) - del tmp20 - tmp22 += tmp21 - del tmp21 - tmp27 = np.copy(ints.tmp13) - tmp27 += ints.tmp15 - tmp27 += ints.tmp27 * 0.5 - tmp27 += ints.tmp29 * 0.5 - tmp27 += ints.tmp39 * 0.5 - tmp27 += ints.tmp41 * 0.5 - tmp27 += ints.tmp44 - tmp27 += ints.tmp47 - tmp27 += ints.tmp56 - tmp27 += ints.tmp7 - tmp27 += f.ov * -1 - tmp27 += ints.tmp12 * -1 - tmp27 += ints.tmp37 * -1 - tmp27 += ints.tmp8 * -1 - tmp24 = np.copy(f.oo) - tmp24 += ints.tmp19 - tmp24 += np.transpose(ints.tmp32, (1, 0)) * 0.5 - tmp24 += np.transpose(ints.tmp50, (1, 0)) - tmp24 += ints.tmp9 - tmp26 = einsum(tmp25, (0, 1, 2), t1, (1, 3), (0, 2, 3)) * 2 - del tmp25 - tmp23 = np.copy(ints.tmp18) - tmp23 += ints.tmp40 * 0.5 - tmp23 += ints.tmp28 * -0.5 - tmp23 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -1 - tmp4 = np.copy(tmp2) * 0.5 - del tmp2 - tmp4 += tmp3 - del tmp3 - tmp19 = np.copy(tmp7) * 0.5 - del tmp7 - tmp19 += tmp10 * -1 - del tmp10 - tmp19 += tmp12 * -1 - del tmp12 - tmp19 += tmp17 - del tmp17 - tmp19 += np.transpose(tmp18, (0, 2, 1)) * -1 - del tmp18 - tmp1 = np.copy(np.transpose(ints.tmp1, (1, 0))) - tmp1 += np.transpose(ints.tmp4, (1, 0)) * 0.5 - tmp1 += f.vv * -1 - r2new = einsum(tmp5, (0, 1, 2), t2, (2, 1, 3, 4), (3, 4, 0)) * -0.25 - del tmp5 - r2new += einsum(r2, (0, 1, 2), v.vvvv, (3, 4, 0, 1), (3, 4, 2)) * 0.5 - r2new += np.transpose(tmp19, (1, 2, 0)) * -1 - r2new += np.transpose(tmp19, (2, 1, 0)) - del tmp19 - r2new += np.transpose(tmp22, (1, 2, 0)) - r2new += np.transpose(tmp22, (2, 1, 0)) * -1 - del tmp22 - r2new += einsum(r1, (0,), tmp23, (1, 2, 3, 0), (3, 2, 1)) * -1 - del tmp23 - r2new += einsum(tmp24, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp24 - r2new += einsum(tmp4, (0,), t2, (1, 0, 2, 3), (2, 3, 1)) - r2new += einsum(t1, (0, 1), tmp26, (2, 0, 3), (1, 3, 2)) * -0.5 - del tmp26 - r2new += einsum(r1, (0,), tmp27, (1, 2), (0, 2, 1)) * -1 - r2new += einsum(tmp27, (0, 1), r1, (2,), (1, 2, 0)) - del tmp27 - r1new = einsum(v.ovvv, (0, 1, 2, 3), r2, (2, 3, 0), (1,)) * -0.5 - r1new += einsum(r2, (0, 1, 2), tmp0, (2, 1), (0,)) - del tmp0 - r1new += einsum(tmp1, (0, 1), r1, (0,), (1,)) * -1 - del tmp1 - r1new += einsum(tmp4, (0,), t1, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ee_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:57:28.419927. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp10 : array - tmp101 : array - tmp105 : array - tmp106 : array - tmp12 : array - tmp17 : array - tmp18 : array - tmp2 : array - tmp22 : array - tmp23 : array - tmp26 : array - tmp30 : array - tmp32 : array - tmp33 : array - tmp37 : array - tmp4 : array - tmp40 : array - tmp48 : array - tmp49 : array - tmp5 : array - tmp51 : array - tmp54 : array - tmp55 : array - tmp57 : array - tmp6 : array - tmp62 : array - tmp64 : array - tmp7 : array - tmp70 : array - tmp71 : array - tmp74 : array - tmp75 : array - tmp77 : array - tmp80 : array - tmp81 : array - tmp87 : array - tmp88 : array - tmp9 : array - tmp93 : array - tmp94 : array - """ - - tmp7 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp6 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp101 = einsum(tmp7, (0, 1, 2, 3), t1, (4, 3), (0, 4, 2, 1)) - tmp12 = einsum(tmp6, (0, 1), t1, (2, 1), (2, 0)) - tmp5 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp4 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp40 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp2 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp62 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp9 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - tmp0 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp106 = einsum(t1, (0, 1), tmp101, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - tmp105 = einsum(tmp12, (0, 1), t1, (1, 2), (0, 2)) - tmp94 = einsum(tmp5, (0, 1, 2, 3), t1, (4, 3), (0, 4, 1, 2)) * -1 - tmp93 = einsum(tmp4, (0, 1), t1, (2, 1), (2, 0)) - tmp88 = einsum(t1, (0, 1), tmp40, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp87 = einsum(tmp2, (0, 1), t1, (0, 2), (1, 2)) - tmp81 = einsum(t1, (0, 1), tmp62, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp80 = einsum(tmp9, (0, 1), t1, (1, 2), (0, 2)) - tmp77 = einsum(t2, (0, 1, 2, 3), tmp7, (4, 1, 0, 5), (4, 2, 3, 5)) * -1 - tmp75 = einsum(tmp7, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp74 = einsum(t2, (0, 1, 2, 3), tmp7, (4, 1, 0, 3), (4, 2)) - tmp71 = einsum(t2, (0, 1, 2, 3), tmp6, (4, 3), (0, 1, 4, 2)) * -1 - tmp70 = einsum(tmp6, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp64 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp57 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp55 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp54 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) - tmp51 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 5, 0, 1), (4, 2, 3, 5)) - tmp49 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp48 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp37 = einsum(v.vvvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp33 = einsum(v.ovov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) - tmp32 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp30 = einsum(t1, (0, 1), v.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp26 = einsum(tmp0, (0, 1), t1, (0, 2), (1, 2)) - tmp23 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp22 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp18 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp17 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - tmp10 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - - return {f"tmp0": tmp0, f"tmp10": tmp10, f"tmp101": tmp101, f"tmp105": tmp105, f"tmp106": tmp106, f"tmp12": tmp12, f"tmp17": tmp17, f"tmp18": tmp18, f"tmp2": tmp2, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp26": tmp26, f"tmp30": tmp30, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp37": tmp37, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp48": tmp48, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp51": tmp51, f"tmp54": tmp54, f"tmp55": tmp55, f"tmp57": tmp57, f"tmp6": tmp6, f"tmp62": tmp62, f"tmp64": tmp64, f"tmp7": tmp7, f"tmp70": tmp70, f"tmp71": tmp71, f"tmp74": tmp74, f"tmp75": tmp75, f"tmp77": tmp77, f"tmp80": tmp80, f"tmp81": tmp81, f"tmp87": tmp87, f"tmp88": tmp88, f"tmp9": tmp9, f"tmp93": tmp93, f"tmp94": tmp94} - -def hbar_matvec_ee(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:57:28.463427. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp0 = einsum(r1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp2 = np.copy(f.ov) - tmp2 += ints.tmp6 - tmp40 = np.copy(ints.tmp5) - tmp40 += ints.tmp64 - tmp20 = einsum(tmp0, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) * -1 - tmp19 = einsum(v.ovvv, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp26 = einsum(r1, (0, 1), v.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp7 = einsum(tmp2, (0, 1), r1, (2, 1), (0, 2)) - tmp32 = einsum(r1, (0, 1), ints.tmp7, (2, 0, 3, 1), (2, 3)) - tmp6 = einsum(r2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - tmp42 = einsum(v.ooov, (0, 1, 2, 3), r2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp44 = einsum(tmp40, (0, 1, 2, 3), r1, (4, 3), (0, 1, 4, 2)) - tmp43 = einsum(ints.tmp7, (0, 1, 2, 3), r2, (4, 1, 5, 3), (0, 2, 4, 5)) - tmp10 = einsum(v.ovvv, (0, 1, 2, 3), r1, (0, 3), (1, 2)) - tmp50 = einsum(r1, (0, 1), ints.tmp7, (2, 3, 4, 1), (2, 3, 4, 0)) - tmp17 = einsum(tmp2, (0, 1), r2, (2, 3, 4, 1), (0, 2, 3, 4)) * -1 - tmp13 = einsum(v.oovv, (0, 1, 2, 3), r2, (0, 1, 4, 3), (4, 2)) - tmp15 = np.copy(ints.tmp106) - tmp15 += np.transpose(ints.tmp23, (1, 2, 0, 3)) - tmp21 = np.copy(np.transpose(tmp19, (1, 0, 2, 3))) - del tmp19 - tmp21 += tmp20 * -2 - del tmp20 - tmp27 = einsum(t1, (0, 1), tmp26, (2, 3, 0, 4), (2, 3, 4, 1)) - del tmp26 - tmp5 = np.copy(f.oo) - tmp5 += ints.tmp0 - tmp5 += np.transpose(ints.tmp12, (1, 0)) - tmp5 += ints.tmp2 - tmp5 += np.transpose(ints.tmp9, (1, 0)) * 0.5 - tmp29 = np.copy(ints.tmp51) - tmp29 += ints.tmp77 * -1 - tmp24 = einsum(v.ooov, (0, 1, 2, 3), r1, (1, 3), (0, 2)) - tmp33 = np.copy(tmp32) - del tmp32 - tmp33 += tmp6 * 0.5 - tmp33 += np.transpose(tmp7, (1, 0)) - tmp55 = np.copy(ints.tmp55) - tmp55 += ints.tmp71 * 2 - tmp55 += ints.tmp81 * -1 - tmp53 = np.copy(ints.tmp10) * 0.5 - tmp53 += ints.tmp4 - tmp38 = einsum(r1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp47 = np.copy(ints.tmp33) - tmp47 += ints.tmp49 - tmp45 = np.copy(tmp42) - del tmp42 - tmp45 += tmp43 * -1 - del tmp43 - tmp45 += tmp44 - del tmp44 - tmp9 = einsum(r1, (0, 1), ints.tmp94, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp11 = einsum(tmp10, (0, 1), t2, (2, 3, 4, 1), (2, 3, 4, 0)) * -1 - del tmp10 - tmp64 = einsum(r1, (0, 1), ints.tmp37, (2, 3, 4, 1), (2, 0, 3, 4)) - tmp65 = einsum(r1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp58 = np.copy(ints.tmp75) - tmp58 += np.transpose(ints.tmp88, (0, 2, 1, 3)) - tmp51 = einsum(t1, (0, 1), tmp50, (2, 3, 0, 4), (2, 3, 4, 1)) - del tmp50 - tmp18 = einsum(tmp17, (0, 1, 2, 3), t1, (0, 4), (2, 1, 4, 3)) - del tmp17 - tmp14 = einsum(tmp13, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) * -1 - del tmp13 - tmp16 = einsum(r1, (0, 1), tmp15, (2, 3, 0, 4), (2, 3, 4, 1)) - del tmp15 - tmp22 = einsum(tmp21, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) * 0.5 - del tmp21 - tmp28 = einsum(t1, (0, 1), tmp27, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - del tmp27 - tmp31 = einsum(r2, (0, 1, 2, 3), tmp5, (1, 4), (4, 0, 2, 3)) * -1 - tmp30 = einsum(r1, (0, 1), tmp29, (2, 3, 4, 1), (2, 0, 3, 4)) * 0.5 - del tmp29 - tmp25 = einsum(tmp24, (0, 1), t2, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - del tmp24 - tmp34 = einsum(t2, (0, 1, 2, 3), tmp33, (4, 1), (0, 4, 2, 3)) * -1 - del tmp33 - tmp62 = einsum(f.vv, (0, 1), r2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp60 = einsum(ints.tmp30, (0, 1, 2, 3), r1, (2, 4), (0, 1, 3, 4)) - tmp61 = einsum(v.ooov, (0, 1, 2, 3), r1, (2, 4), (0, 1, 4, 3)) - tmp56 = einsum(tmp55, (0, 1, 2, 3), r1, (2, 4), (0, 1, 3, 4)) * 0.5 - del tmp55 - tmp54 = einsum(tmp53, (0, 1), r2, (2, 3, 4, 1), (2, 3, 0, 4)) * -1 - del tmp53 - tmp36 = einsum(r1, (0, 1), ints.tmp57, (2, 3, 4, 1), (2, 0, 3, 4)) - tmp39 = einsum(tmp38, (0, 1, 2, 3), t1, (1, 4), (0, 2, 4, 3)) - del tmp38 - tmp48 = einsum(tmp47, (0, 1, 2, 3), r1, (1, 4), (0, 2, 3, 4)) - del tmp47 - tmp41 = einsum(r2, (0, 1, 2, 3), tmp40, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp40 - tmp37 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp46 = einsum(t1, (0, 1), tmp45, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp45 - tmp1 = np.copy(ints.tmp7) - tmp1 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp12 = np.copy(tmp9) - del tmp9 - tmp12 += tmp11 - del tmp11 - tmp70 = np.copy(ints.tmp105) - tmp70 += ints.tmp17 - tmp70 += ints.tmp26 - tmp70 += ints.tmp32 - tmp70 += ints.tmp48 * 0.5 - tmp70 += ints.tmp54 * 0.5 - tmp70 += ints.tmp74 * 0.5 - tmp70 += ints.tmp80 * 0.5 - tmp70 += ints.tmp87 - tmp70 += ints.tmp93 - tmp70 += f.ov * -1 - tmp70 += ints.tmp18 * -1 - tmp70 += ints.tmp22 * -1 - tmp70 += ints.tmp70 * -1 - tmp69 = np.copy(t2) - tmp69 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - tmp67 = np.copy(ints.tmp101) - tmp67 += ints.tmp62 * 0.5 - tmp67 += v.oooo - tmp67 += np.transpose(ints.tmp40, (0, 3, 1, 2)) * -1 - tmp67 += np.transpose(ints.tmp40, (3, 0, 1, 2)) - tmp66 = np.copy(tmp64) - del tmp64 - tmp66 += np.transpose(tmp65, (0, 1, 3, 2)) * -1 - del tmp65 - tmp59 = einsum(tmp58, (0, 1, 2, 3), r1, (2, 4), (0, 1, 3, 4)) - del tmp58 - tmp71 = np.copy(ints.tmp105) * 2 - tmp71 += ints.tmp17 * 2 - tmp71 += ints.tmp26 * 2 - tmp71 += ints.tmp32 * 2 - tmp71 += ints.tmp48 - tmp71 += ints.tmp54 - tmp71 += ints.tmp74 - tmp71 += ints.tmp80 - tmp71 += ints.tmp87 * 2 - tmp71 += ints.tmp93 * 2 - tmp71 += f.ov * -2 - tmp71 += ints.tmp18 * -2 - tmp71 += ints.tmp22 * -2 - tmp71 += ints.tmp70 * -2 - tmp52 = einsum(tmp51, (0, 1, 2, 3), t1, (1, 4), (0, 2, 4, 3)) - del tmp51 - tmp23 = np.copy(tmp14) * 0.5 - del tmp14 - tmp23 += tmp16 - del tmp16 - tmp23 += np.transpose(tmp18, (1, 0, 3, 2)) * -1 - del tmp18 - tmp23 += np.transpose(tmp22, (1, 0, 2, 3)) - del tmp22 - tmp35 = np.copy(np.transpose(tmp25, (0, 1, 3, 2))) * -1 - del tmp25 - tmp35 += np.transpose(tmp28, (0, 1, 3, 2)) - del tmp28 - tmp35 += np.transpose(tmp30, (0, 1, 3, 2)) * -1 - del tmp30 - tmp35 += np.transpose(tmp31, (0, 1, 3, 2)) - del tmp31 - tmp35 += np.transpose(tmp34, (1, 0, 3, 2)) - del tmp34 - tmp68 = einsum(v.oovv, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp63 = np.copy(tmp60) * -1 - del tmp60 - tmp63 += np.transpose(tmp61, (1, 0, 2, 3)) - del tmp61 - tmp63 += np.transpose(tmp62, (1, 0, 2, 3)) - del tmp62 - tmp57 = np.copy(np.transpose(tmp54, (1, 0, 2, 3))) * -1 - del tmp54 - tmp57 += tmp56 * -1 - del tmp56 - tmp49 = np.copy(tmp36) - del tmp36 - tmp49 += tmp37 - del tmp37 - tmp49 += tmp39 * -1 - del tmp39 - tmp49 += tmp41 * -1 - del tmp41 - tmp49 += np.transpose(tmp46, (0, 1, 3, 2)) - del tmp46 - tmp49 += tmp48 - del tmp48 - tmp3 = np.copy(ints.tmp5) - tmp3 += np.transpose(v.ovov, (0, 2, 3, 1)) * -1 - tmp8 = np.copy(np.transpose(tmp6, (1, 0))) * 0.5 - del tmp6 - tmp8 += einsum(tmp1, (0, 1, 2, 3), r1, (1, 3), (2, 0)) - tmp8 += tmp7 - del tmp7 - tmp4 = np.copy(np.transpose(ints.tmp10, (1, 0))) * 0.5 - tmp4 += np.transpose(ints.tmp4, (1, 0)) - tmp4 += f.vv * -1 - r2new = einsum(v.vvvv, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) * 0.5 - r2new += tmp12 - r2new += np.transpose(tmp12, (0, 1, 3, 2)) * -1 - del tmp12 - r2new += tmp23 * -1 - r2new += np.transpose(tmp23, (0, 1, 3, 2)) - del tmp23 - r2new += tmp35 - r2new += np.transpose(tmp35, (1, 0, 2, 3)) * -1 - del tmp35 - r2new += tmp49 * -1 - r2new += np.transpose(tmp49, (0, 1, 3, 2)) - r2new += np.transpose(tmp49, (1, 0, 2, 3)) - r2new += np.transpose(tmp49, (1, 0, 3, 2)) * -1 - del tmp49 - r2new += tmp52 * -1 - r2new += np.transpose(tmp52, (1, 0, 2, 3)) - del tmp52 - r2new += np.transpose(tmp57, (1, 0, 2, 3)) - r2new += np.transpose(tmp57, (1, 0, 3, 2)) * -1 - del tmp57 - r2new += tmp59 - r2new += np.transpose(tmp59, (0, 1, 3, 2)) * -1 - r2new += np.transpose(tmp59, (1, 0, 2, 3)) * -1 - r2new += np.transpose(tmp59, (1, 0, 3, 2)) - del tmp59 - r2new += np.transpose(tmp63, (1, 0, 2, 3)) * -1 - r2new += np.transpose(tmp63, (1, 0, 3, 2)) - del tmp63 - r2new += np.transpose(tmp66, (0, 1, 3, 2)) - r2new += np.transpose(tmp66, (1, 0, 3, 2)) * -1 - del tmp66 - r2new += einsum(r2, (0, 1, 2, 3), tmp67, (4, 5, 0, 1), (4, 5, 2, 3)) * 0.5 - del tmp67 - r2new += einsum(tmp69, (0, 1, 2, 3), tmp68, (4, 5, 0, 1), (5, 4, 3, 2)) * 0.25 - del tmp69, tmp68 - r2new += einsum(r1, (0, 1), tmp70, (2, 3), (2, 0, 3, 1)) * -1 - r2new += einsum(r1, (0, 1), tmp70, (2, 3), (0, 2, 1, 3)) * -1 - r2new += einsum(r1, (0, 1), tmp71, (2, 3), (0, 2, 3, 1)) * 0.5 - del tmp71 - r2new += einsum(tmp70, (0, 1), r1, (2, 3), (0, 2, 3, 1)) - del tmp70 - r1new = einsum(v.ovvv, (0, 1, 2, 3), r2, (4, 0, 2, 3), (4, 1)) * -0.5 - r1new += einsum(tmp0, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - del tmp0 - r1new += einsum(tmp1, (0, 1, 2, 3), r2, (1, 2, 4, 3), (0, 4)) * 0.5 - del tmp1 - r1new += einsum(tmp2, (0, 1), r2, (2, 0, 3, 1), (2, 3)) - del tmp2 - r1new += einsum(r1, (0, 1), tmp3, (2, 0, 3, 1), (2, 3)) - del tmp3 - r1new += einsum(tmp4, (0, 1), r1, (2, 0), (2, 1)) * -1 - del tmp4 - r1new += einsum(r1, (0, 1), tmp5, (0, 2), (2, 1)) * -1 - del tmp5 - r1new += einsum(tmp8, (0, 1), t1, (0, 2), (1, 2)) * -1 - del tmp8 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:57:39.456121. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp10 : array - tmp11 : array - tmp12 : array - tmp13 : array - tmp14 : array - tmp15 : array - tmp16 : array - tmp17 : array - tmp18 : array - tmp19 : array - tmp2 : array - tmp20 : array - tmp21 : array - tmp22 : array - tmp23 : array - tmp24 : array - tmp25 : array - tmp26 : array - tmp27 : array - tmp28 : array - tmp29 : array - tmp3 : array - tmp30 : array - tmp31 : array - tmp32 : array - tmp33 : array - tmp34 : array - tmp4 : array - tmp43 : array - tmp44 : array - tmp5 : array - tmp6 : array - tmp7 : array - tmp8 : array - tmp9 : array - """ - - tmp18 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp15 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp33 = einsum(tmp18, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp24 = einsum(tmp15, (0, 1), t1, (2, 1), (2, 0)) - tmp30 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp28 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp26 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp6 = einsum(t1, (0, 1), v.ooov, (2, 0, 3, 1), (2, 3)) - tmp22 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp10 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp0 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp44 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp43 = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 4, 3), (4, 2)) - tmp34 = einsum(t1, (0, 1), tmp33, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp32 = einsum(tmp24, (0, 1), t1, (1, 2), (0, 2)) - tmp31 = einsum(tmp30, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp29 = einsum(tmp28, (0, 1), t1, (2, 1), (2, 0)) - tmp27 = einsum(t1, (0, 1), tmp26, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp25 = einsum(tmp6, (0, 1), t1, (0, 2), (1, 2)) - tmp23 = einsum(t1, (0, 1), tmp22, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp21 = einsum(t1, (0, 1), tmp10, (2, 0), (2, 1)) - tmp20 = einsum(tmp18, (0, 1, 2, 3), t2, (4, 2, 5, 3), (0, 4, 1, 5)) * -1 - tmp19 = einsum(t2, (0, 1, 2, 3), tmp18, (4, 1, 0, 3), (4, 2)) - tmp17 = einsum(tmp15, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) * -1 - tmp16 = einsum(tmp15, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp14 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp13 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 2, 3), (4, 1)) - tmp12 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp11 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp9 = einsum(v.ovov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) - tmp8 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp7 = einsum(t1, (0, 1), v.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp5 = einsum(tmp0, (0, 1), t1, (0, 2), (1, 2)) - tmp4 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp3 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp2 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp1 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp10": tmp10, f"tmp11": tmp11, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp14": tmp14, f"tmp15": tmp15, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp18": tmp18, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp24": tmp24, f"tmp25": tmp25, f"tmp26": tmp26, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp31": tmp31, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp34": tmp34, f"tmp4": tmp4, f"tmp43": tmp43, f"tmp44": tmp44, f"tmp5": tmp5, f"tmp6": tmp6, f"tmp7": tmp7, f"tmp8": tmp8, f"tmp9": tmp9} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:57:39.487597. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp9 = np.copy(ints.tmp30) - tmp9 += ints.tmp44 - tmp6 = einsum(r2, (0, 1, 2), t1, (3, 2), (0, 1, 3)) - tmp10 = einsum(tmp9, (0, 1, 2, 3), r2, (4, 0, 2), (1, 4, 3)) * -1 - del tmp9 - tmp5 = einsum(v.ovov, (0, 1, 2, 3), r2, (4, 2, 1), (4, 0, 3)) - tmp8 = einsum(tmp6, (0, 1, 2), v.ooov, (3, 2, 1, 4), (0, 3, 4)) - tmp7 = einsum(ints.tmp18, (0, 1, 2, 3), tmp6, (4, 0, 2), (1, 4, 3)) - del tmp6 - tmp4 = einsum(r2, (0, 1, 2), ints.tmp10, (1, 3), (3, 0, 2)) - tmp11 = np.copy(f.ov) - tmp11 += ints.tmp15 - tmp13 = np.copy(f.oo) - tmp13 += np.transpose(ints.tmp0, (1, 0)) - tmp13 += ints.tmp24 - tmp13 += np.transpose(ints.tmp6, (1, 0)) - tmp12 = np.copy(tmp4) * -0.5 - del tmp4 - tmp12 += tmp5 - del tmp5 - tmp12 += tmp7 * -1 - del tmp7 - tmp12 += tmp8 * -1 - del tmp8 - tmp12 += tmp10 * -1 - del tmp10 - tmp12 += einsum(tmp11, (0, 1), r1, (2,), (0, 2, 1)) - tmp14 = einsum(r2, (0, 1, 2), tmp13, (1, 3), (3, 0, 2)) * -1 - del tmp13 - tmp17 = np.copy(ints.tmp18) - tmp17 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp15 = np.copy(ints.tmp22) - tmp15 += ints.tmp33 * 2 - tmp15 += v.oooo * 2 - tmp15 += np.transpose(ints.tmp26, (0, 3, 1, 2)) * -4 - tmp3 = einsum(r2, (0, 1, 2), t2, (0, 1, 3, 2), (3,)) - tmp16 = np.copy(ints.tmp28) - tmp16 += ints.tmp43 * 0.5 - tmp16 += f.vv * -1 - tmp16 += einsum(tmp11, (0, 1), t1, (0, 2), (2, 1)) - del tmp11 - tmp1 = np.copy(ints.tmp11) - tmp1 += ints.tmp13 - tmp1 += ints.tmp19 - tmp1 += ints.tmp1 * 2 - tmp1 += ints.tmp21 - tmp1 += ints.tmp25 * 2 - tmp1 += ints.tmp29 * 2 - tmp1 += ints.tmp32 * 2 - tmp1 += ints.tmp5 * 2 - tmp1 += ints.tmp8 * 2 - tmp1 += f.ov * -2 - tmp1 += ints.tmp16 * -2 - tmp1 += ints.tmp2 * -2 - tmp1 += ints.tmp3 * -2 - tmp0 = np.copy(ints.tmp12) - tmp0 += np.transpose(ints.tmp23, (0, 2, 1, 3)) * 0.25 - tmp0 += np.transpose(ints.tmp34, (0, 2, 1, 3)) * 0.5 - tmp0 += np.transpose(ints.tmp4, (1, 0, 2, 3)) * 0.5 - tmp0 += np.transpose(ints.tmp7, (0, 2, 1, 3)) * 0.5 - tmp0 += ints.tmp9 - tmp0 += np.transpose(ints.tmp14, (0, 2, 1, 3)) * -0.25 - tmp0 += np.transpose(ints.tmp17, (0, 2, 1, 3)) * -0.5 - tmp0 += np.transpose(ints.tmp20, (0, 2, 1, 3)) * -1 - tmp0 += ints.tmp27 * -1 - tmp0 += np.transpose(ints.tmp31, (0, 2, 1, 3)) * -0.5 - tmp0 += np.transpose(v.ooov, (0, 2, 1, 3)) * -0.5 - tmp2 = np.copy(f.oo) * 2 - tmp2 += np.transpose(ints.tmp0, (1, 0)) * 2 - tmp2 += ints.tmp10 - tmp2 += ints.tmp24 * 2 - tmp2 += np.transpose(ints.tmp6, (1, 0)) * 2 - r2new = einsum(tmp3, (0,), v.oovv, (1, 2, 3, 0), (1, 2, 3)) * 0.5 - del tmp3 - r2new += tmp12 * -1 - r2new += np.transpose(tmp12, (1, 0, 2)) - del tmp12 - r2new += tmp14 * -1 - r2new += np.transpose(tmp14, (1, 0, 2)) - del tmp14 - r2new += einsum(tmp15, (0, 1, 2, 3), r2, (0, 1, 4), (2, 3, 4)) * 0.25 - del tmp15 - r2new += einsum(r2, (0, 1, 2), tmp16, (2, 3), (0, 1, 3)) * -1 - del tmp16 - r2new += einsum(r1, (0,), tmp17, (0, 1, 2, 3), (2, 1, 3)) * -1 - del tmp17 - r1new = einsum(r2, (0, 1, 2), tmp0, (0, 3, 1, 2), (3,)) - del tmp0 - r1new += einsum(r2, (0, 1, 2), tmp1, (1, 2), (0,)) * -0.5 - del tmp1 - r1new += einsum(tmp2, (0, 1), r1, (0,), (1,)) * -0.5 - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:57:51.571408. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp11 : array - tmp12 : array - tmp13 : array - tmp14 : array - tmp15 : array - tmp16 : array - tmp17 : array - tmp18 : array - tmp19 : array - tmp2 : array - tmp20 : array - tmp21 : array - tmp22 : array - tmp23 : array - tmp24 : array - tmp25 : array - tmp27 : array - tmp28 : array - tmp29 : array - tmp3 : array - tmp30 : array - tmp5 : array - tmp6 : array - tmp7 : array - tmp8 : array - """ - - tmp16 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp29 = einsum(tmp16, (0, 1), t1, (2, 1), (2, 0)) - tmp7 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp24 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp21 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp18 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp5 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp30 = einsum(t1, (0, 1), tmp29, (2, 0), (2, 1)) - tmp28 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp27 = einsum(tmp7, (0, 1), t1, (2, 1), (2, 0)) - tmp25 = einsum(tmp24, (0, 1), t1, (0, 2), (1, 2)) - tmp23 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp22 = einsum(tmp21, (0, 1), t1, (1, 2), (0, 2)) - tmp20 = einsum(t2, (0, 1, 2, 3), tmp18, (4, 1, 0, 5), (4, 2, 3, 5)) * -1 - tmp19 = einsum(t2, (0, 1, 2, 3), tmp18, (4, 1, 0, 3), (4, 2)) - tmp17 = einsum(tmp16, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp15 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp14 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 2, 3), (4, 1)) - tmp13 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 5, 0, 1), (4, 2, 3, 5)) - tmp12 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp11 = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 4, 3), (4, 2)) - tmp10 = einsum(v.vvvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp8 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp6 = einsum(t1, (0, 1), tmp5, (0, 2), (2, 1)) - tmp3 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp2 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp1 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp11": tmp11, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp14": tmp14, f"tmp15": tmp15, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp18": tmp18, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp24": tmp24, f"tmp25": tmp25, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp5": tmp5, f"tmp6": tmp6, f"tmp7": tmp7, f"tmp8": tmp8} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:57:51.596781. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp10 = np.copy(f.ov) - tmp10 += ints.tmp16 - tmp17 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 4), (0, 2, 4, 3)) - tmp14 = einsum(tmp10, (0, 1), t1, (0, 2), (1, 2)) * 2 - tmp11 = einsum(ints.tmp18, (0, 1, 2, 3), t1, (2, 4), (0, 1, 3, 4)) - tmp18 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) - tmp18 += np.transpose(tmp17, (1, 0, 3, 2)) * -1 - del tmp17 - tmp15 = np.copy(ints.tmp11) - tmp15 += f.vv * -2 - tmp15 += np.transpose(tmp14, (1, 0)) - del tmp14 - tmp12 = np.copy(ints.tmp23) - tmp12 += ints.tmp28 - tmp12 += np.transpose(tmp11, (0, 1, 3, 2)) * -1 - del tmp11 - tmp7 = einsum(r1, (0,), t1, (1, 0), (1,)) - tmp8 = einsum(t2, (0, 1, 2, 3), r2, (2, 3, 1), (0,)) - tmp19 = einsum(r2, (0, 1, 2), tmp18, (2, 3, 4, 1), (3, 4, 0)) * -1 - del tmp18 - tmp16 = einsum(tmp15, (0, 1), r2, (2, 0, 3), (3, 1, 2)) * -0.5 - del tmp15 - tmp13 = einsum(r2, (0, 1, 2), tmp12, (2, 3, 1, 4), (3, 4, 0)) * -1 - del tmp12 - tmp22 = np.copy(t2) - tmp22 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - tmp1 = einsum(t1, (0, 1), r2, (2, 1, 3), (3, 0, 2)) - tmp9 = np.copy(tmp7) - del tmp7 - tmp9 += tmp8 * 0.5 - del tmp8 - tmp20 = np.copy(tmp13) * -1 - del tmp13 - tmp20 += tmp16 - del tmp16 - tmp20 += np.transpose(tmp19, (0, 2, 1)) * -1 - del tmp19 - tmp20 += einsum(tmp10, (0, 1), r1, (2,), (0, 1, 2)) - tmp24 = np.copy(f.oo) - tmp24 += ints.tmp21 * 0.5 - tmp24 += np.transpose(ints.tmp24, (1, 0)) - tmp24 += ints.tmp29 - tmp24 += np.transpose(ints.tmp5, (1, 0)) - tmp21 = einsum(ints.tmp7, (0, 1), r2, (2, 0, 3), (3, 1, 2)) - tmp23 = einsum(tmp22, (0, 1, 2, 3), r2, (2, 3, 4), (4, 1, 0)) * -1 - del tmp22 - tmp5 = np.copy(ints.tmp12) * 0.5 - tmp5 += ints.tmp14 * 0.5 - tmp5 += ints.tmp19 * 0.5 - tmp5 += ints.tmp1 - tmp5 += ints.tmp22 * 0.5 - tmp5 += ints.tmp25 - tmp5 += ints.tmp27 - tmp5 += ints.tmp30 - tmp5 += ints.tmp6 - tmp5 += ints.tmp8 - tmp5 += f.ov * -1 - tmp5 += ints.tmp17 * -1 - tmp5 += ints.tmp2 * -1 - tmp5 += ints.tmp3 * -1 - tmp3 = einsum(t1, (0, 1), tmp1, (2, 3, 1), (2, 3, 0)) * -1 - tmp6 = np.copy(ints.tmp11) * 0.5 - tmp6 += ints.tmp7 - tmp6 += f.vv * -1 - tmp4 = np.copy(ints.tmp18) - tmp4 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp0 = np.copy(ints.tmp10) * 0.5 - tmp0 += ints.tmp15 - tmp0 += ints.tmp20 * 0.25 - tmp0 += ints.tmp13 * -0.25 - tmp0 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -0.5 - tmp2 = np.copy(ints.tmp23) - tmp2 += ints.tmp28 - tmp2 += np.transpose(v.ovov, (0, 2, 3, 1)) * -1 - r2new = einsum(v.ovvv, (0, 1, 2, 3), tmp1, (4, 0, 1), (2, 3, 4)) - r2new += einsum(r2, (0, 1, 2), v.vvvv, (3, 4, 0, 1), (3, 4, 2)) * 0.5 - r2new += einsum(r1, (0,), v.ovvv, (1, 0, 2, 3), (2, 3, 1)) * -1 - r2new += np.transpose(tmp20, (1, 2, 0)) * -1 - r2new += np.transpose(tmp20, (2, 1, 0)) - del tmp20 - r2new += np.transpose(tmp21, (1, 2, 0)) - r2new += np.transpose(tmp21, (2, 1, 0)) * -1 - del tmp21 - r2new += einsum(v.oovv, (0, 1, 2, 3), tmp23, (4, 0, 1), (2, 3, 4)) * 0.25 - del tmp23 - r2new += einsum(tmp24, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp24 - r2new += einsum(v.oovv, (0, 1, 2, 3), tmp9, (1,), (2, 3, 0)) - r1new = einsum(tmp0, (0, 1, 2, 3), r2, (1, 2, 0), (3,)) - del tmp0 - r1new += einsum(tmp1, (0, 1, 2), tmp2, (0, 1, 2, 3), (3,)) - del tmp1, tmp2 - r1new += einsum(tmp3, (0, 1, 2), tmp4, (0, 2, 1, 3), (3,)) * -0.5 - del tmp3, tmp4 - r1new += einsum(r2, (0, 1, 2), tmp5, (2, 1), (0,)) * -1 - del tmp5 - r1new += einsum(tmp6, (0, 1), r1, (0,), (1,)) * -1 - del tmp6 - r1new += einsum(tmp9, (0,), tmp10, (0, 1), (1,)) * -1 - del tmp10, tmp9 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ee_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:58:11.847808. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp10 : array - tmp11 : array - tmp12 : array - tmp13 : array - tmp15 : array - tmp16 : array - tmp17 : array - tmp19 : array - tmp2 : array - tmp20 : array - tmp21 : array - tmp22 : array - tmp23 : array - tmp24 : array - tmp26 : array - tmp27 : array - tmp28 : array - tmp29 : array - tmp3 : array - tmp30 : array - tmp31 : array - tmp32 : array - tmp33 : array - tmp34 : array - tmp35 : array - tmp36 : array - tmp38 : array - tmp39 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp43 : array - tmp44 : array - tmp45 : array - tmp46 : array - tmp47 : array - tmp5 : array - tmp7 : array - tmp8 : array - tmp9 : array - """ - - tmp29 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp26 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp46 = einsum(tmp29, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp38 = einsum(tmp26, (0, 1), t1, (2, 1), (2, 0)) - tmp10 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp9 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp40 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp8 = einsum(t1, (0, 1), v.ooov, (2, 0, 3, 1), (2, 3)) - tmp34 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp16 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 2, 3), (4, 0)) - tmp0 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp47 = einsum(t1, (0, 1), tmp46, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp45 = einsum(tmp38, (0, 1), t1, (1, 2), (0, 2)) - tmp44 = einsum(tmp10, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp43 = einsum(tmp9, (0, 1), t1, (2, 1), (2, 0)) - tmp41 = einsum(t1, (0, 1), tmp40, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp39 = einsum(tmp8, (0, 1), t1, (0, 2), (1, 2)) - tmp36 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp35 = einsum(t1, (0, 1), tmp34, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp33 = einsum(t1, (0, 1), tmp16, (2, 0), (2, 1)) - tmp32 = einsum(tmp29, (0, 1, 2, 3), t2, (2, 1, 4, 5), (0, 4, 5, 3)) * -1 - tmp31 = einsum(t2, (0, 1, 2, 3), tmp29, (4, 5, 1, 3), (4, 0, 5, 2)) * -1 - tmp30 = einsum(tmp29, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp28 = einsum(tmp26, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) * -1 - tmp27 = einsum(tmp26, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp24 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp23 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp22 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 2, 3), (4, 1)) - tmp21 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 5, 0, 1), (4, 2, 3, 5)) - tmp20 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp19 = einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) - tmp17 = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 4, 3), (4, 2)) - tmp15 = einsum(v.vvvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp13 = einsum(v.ovov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) - tmp12 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp11 = einsum(t1, (0, 1), v.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp7 = einsum(tmp0, (0, 1), t1, (0, 2), (1, 2)) - tmp5 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp4 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp3 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp2 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - - return {f"tmp0": tmp0, f"tmp10": tmp10, f"tmp11": tmp11, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp15": tmp15, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp24": tmp24, f"tmp26": tmp26, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp31": tmp31, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp34": tmp34, f"tmp35": tmp35, f"tmp36": tmp36, f"tmp38": tmp38, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp43": tmp43, f"tmp44": tmp44, f"tmp45": tmp45, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp5": tmp5, f"tmp7": tmp7, f"tmp8": tmp8, f"tmp9": tmp9} - -def hbar_lmatvec_ee(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:58:11.888475. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp1 = einsum(r1, (0, 1), t1, (2, 1), (0, 2)) - tmp0 = einsum(t2, (0, 1, 2, 3), r2, (4, 1, 2, 3), (4, 0)) - tmp6 = einsum(t1, (0, 1), r2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp12 = np.copy(tmp1) * 2 - tmp12 += tmp0 - tmp14 = np.copy(f.oo) - tmp14 += np.transpose(ints.tmp0, (1, 0)) - tmp14 += ints.tmp16 * 0.5 - tmp14 += ints.tmp38 - tmp14 += np.transpose(ints.tmp8, (1, 0)) - tmp15 = np.copy(f.ov) - tmp15 += ints.tmp26 - tmp2 = einsum(r2, (0, 1, 2, 3), t2, (0, 1, 4, 3), (2, 4)) - tmp19 = np.copy(ints.tmp10) - tmp19 += ints.tmp36 - tmp7 = einsum(tmp6, (0, 1, 2, 3), t1, (4, 3), (0, 1, 4, 2)) - tmp30 = einsum(f.vv, (0, 1), r2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp29 = einsum(v.ooov, (0, 1, 2, 3), r1, (2, 4), (0, 1, 4, 3)) - tmp28 = einsum(ints.tmp29, (0, 1, 2, 3), r1, (0, 4), (1, 2, 3, 4)) - tmp26 = einsum(v.oovv, (0, 1, 2, 3), tmp12, (4, 1), (4, 0, 2, 3)) * -0.5 - tmp25 = einsum(tmp14, (0, 1), r2, (2, 0, 3, 4), (1, 2, 3, 4)) * -1 - tmp23 = einsum(tmp6, (0, 1, 2, 3), tmp15, (2, 4), (0, 1, 4, 3)) - tmp22 = einsum(v.oovv, (0, 1, 2, 3), tmp2, (4, 3), (0, 1, 4, 2)) * -1 - tmp20 = einsum(r2, (0, 1, 2, 3), tmp19, (1, 4, 3, 5), (4, 0, 5, 2)) - del tmp19 - tmp18 = einsum(ints.tmp29, (0, 1, 2, 3), tmp6, (4, 0, 2, 5), (1, 4, 3, 5)) - tmp17 = einsum(tmp6, (0, 1, 2, 3), v.ooov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp16 = einsum(r2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp33 = np.copy(ints.tmp17) * 0.5 - tmp33 += ints.tmp9 - tmp36 = einsum(t2, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) * -0.5 - tmp36 += np.transpose(tmp7, (0, 1, 3, 2)) - tmp31 = np.copy(tmp28) * -1 - del tmp28 - tmp31 += np.transpose(tmp29, (1, 0, 2, 3)) - del tmp29 - tmp31 += np.transpose(tmp30, (1, 0, 2, 3)) - del tmp30 - tmp27 = np.copy(np.transpose(tmp25, (0, 1, 3, 2))) - del tmp25 - tmp27 += np.transpose(tmp26, (0, 1, 3, 2)) - del tmp26 - tmp24 = np.copy(tmp22) * -0.5 - del tmp22 - tmp24 += np.transpose(tmp23, (1, 0, 2, 3)) * -1 - del tmp23 - tmp21 = np.copy(tmp16) * -1 - del tmp16 - tmp21 += tmp17 - del tmp17 - tmp21 += tmp18 * -1 - del tmp18 - tmp21 += tmp20 - del tmp20 - tmp21 += einsum(tmp15, (0, 1), r1, (2, 3), (0, 2, 1, 3)) - tmp35 = np.copy(ints.tmp34) * 0.25 - tmp35 += ints.tmp46 * 0.5 - tmp35 += v.oooo * 0.5 - tmp35 += np.transpose(ints.tmp40, (0, 3, 1, 2)) * -1 - tmp34 = einsum(tmp33, (0, 1), r2, (2, 3, 4, 0), (2, 3, 1, 4)) * -1 - del tmp33 - tmp32 = einsum(r1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp3 = np.copy(ints.tmp15) * 0.5 - tmp3 += ints.tmp24 - tmp3 += ints.tmp32 * 0.25 - tmp3 += ints.tmp21 * -0.25 - tmp3 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -0.5 - tmp13 = np.copy(ints.tmp17) * 0.5 - tmp13 += ints.tmp9 - tmp13 += f.vv * -1 - tmp10 = einsum(r1, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp10 += einsum(t2, (0, 1, 2, 3), tmp6, (1, 0, 4, 3), (4, 2)) * -0.5 - tmp5 = np.copy(ints.tmp10) - tmp5 += ints.tmp36 - tmp5 += np.transpose(v.ovov, (0, 2, 3, 1)) * -1 - tmp9 = np.copy(ints.tmp12) - tmp9 += ints.tmp19 * 0.5 - tmp9 += ints.tmp22 * 0.5 - tmp9 += ints.tmp2 - tmp9 += ints.tmp30 * 0.5 - tmp9 += ints.tmp33 * 0.5 - tmp9 += ints.tmp39 - tmp9 += ints.tmp43 - tmp9 += ints.tmp45 - tmp9 += ints.tmp7 - tmp9 += f.ov * -1 - tmp9 += ints.tmp27 * -1 - tmp9 += ints.tmp3 * -1 - tmp9 += ints.tmp4 * -1 - tmp8 = np.copy(ints.tmp29) - tmp8 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp4 = np.copy(ints.tmp11) * 0.5 - tmp4 += np.transpose(ints.tmp13, (0, 2, 1, 3)) - tmp4 += np.transpose(ints.tmp20, (0, 2, 1, 3)) - tmp4 += ints.tmp35 * 0.25 - tmp4 += ints.tmp47 * 0.5 - tmp4 += np.transpose(ints.tmp5, (1, 2, 0, 3)) * 0.5 - tmp4 += ints.tmp23 * -0.25 - tmp4 += ints.tmp28 * -0.5 - tmp4 += ints.tmp31 * -1 - tmp4 += np.transpose(ints.tmp41, (0, 2, 1, 3)) * -1 - tmp4 += ints.tmp44 * -0.5 - tmp4 += v.ooov * -0.5 - tmp11 = np.copy(ints.tmp10) - tmp11 += np.transpose(v.ovov, (0, 2, 3, 1)) * -1 - r2new = einsum(v.ovvv, (0, 1, 2, 3), tmp6, (4, 5, 0, 1), (5, 4, 2, 3)) * -1 - r2new += einsum(v.vvvv, (0, 1, 2, 3), r2, (4, 5, 2, 3), (4, 5, 0, 1)) * 0.5 - r2new += tmp21 - r2new += np.transpose(tmp21, (0, 1, 3, 2)) * -1 - r2new += np.transpose(tmp21, (1, 0, 2, 3)) * -1 - r2new += np.transpose(tmp21, (1, 0, 3, 2)) - del tmp21 - r2new += tmp24 - r2new += np.transpose(tmp24, (0, 1, 3, 2)) * -1 - del tmp24 - r2new += tmp27 - r2new += np.transpose(tmp27, (1, 0, 2, 3)) * -1 - del tmp27 - r2new += np.transpose(tmp31, (1, 0, 2, 3)) * -1 - r2new += np.transpose(tmp31, (1, 0, 3, 2)) - del tmp31 - r2new += np.transpose(tmp32, (0, 1, 3, 2)) - r2new += np.transpose(tmp32, (1, 0, 3, 2)) * -1 - del tmp32 - r2new += np.transpose(tmp34, (1, 0, 2, 3)) - r2new += np.transpose(tmp34, (1, 0, 3, 2)) * -1 - del tmp34 - r2new += einsum(tmp35, (0, 1, 2, 3), r2, (0, 1, 4, 5), (2, 3, 4, 5)) - del tmp35 - r2new += einsum(v.oovv, (0, 1, 2, 3), tmp36, (4, 5, 0, 1), (5, 4, 2, 3)) * 0.5 - del tmp36 - r1new = einsum(ints.tmp29, (0, 1, 2, 3), tmp0, (0, 2), (1, 3)) * -0.5 - del tmp0 - r1new += einsum(tmp1, (0, 1), ints.tmp29, (0, 2, 1, 3), (2, 3)) * -1 - del tmp1 - r1new += einsum(v.ovvv, (0, 1, 2, 3), tmp2, (1, 3), (0, 2)) * 0.5 - del tmp2 - r1new += einsum(r2, (0, 1, 2, 3), tmp3, (1, 2, 3, 4), (0, 4)) - del tmp3 - r1new += einsum(tmp4, (0, 1, 2, 3), r2, (0, 1, 4, 3), (2, 4)) - del tmp4 - r1new += einsum(tmp5, (0, 1, 2, 3), tmp6, (0, 4, 1, 2), (4, 3)) * -1 - del tmp6, tmp5 - r1new += einsum(tmp7, (0, 1, 2, 3), tmp8, (1, 3, 2, 4), (0, 4)) * -0.5 - del tmp7, tmp8 - r1new += einsum(r2, (0, 1, 2, 3), tmp9, (1, 3), (0, 2)) * -1 - del tmp9 - r1new += einsum(tmp10, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - del tmp10 - r1new += einsum(tmp11, (0, 1, 2, 3), r1, (0, 2), (1, 3)) - del tmp11 - r1new += einsum(tmp12, (0, 1), v.ooov, (2, 1, 0, 3), (2, 3)) * 0.5 - r1new += einsum(r1, (0, 1), tmp13, (1, 2), (0, 2)) * -1 - del tmp13 - r1new += einsum(tmp14, (0, 1), r1, (0, 2), (1, 2)) * -1 - del tmp14 - r1new += einsum(tmp15, (0, 1), tmp12, (2, 0), (2, 1)) * -0.5 - del tmp12, tmp15 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/GCCSDT.py b/ebcc/codegen/GCCSDT.py deleted file mode 100644 index c0bf1564..00000000 --- a/ebcc/codegen/GCCSDT.py +++ /dev/null @@ -1,1692 +0,0 @@ -# Code generated for ebcc. - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, Namespace -from ebcc.precision import types - -def energy(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, **kwargs): - # energy - e_cc = 0 - e_cc += einsum(f.ov, (0, 1), t1, (0, 1), ()) - x0 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x0 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x0 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 2.0 - e_cc += einsum(v.oovv, (0, 1, 2, 3), x0, (0, 1, 2, 3), ()) * 0.25 - del x0 - - return e_cc - -def update_amps(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, **kwargs): - # T amplitudes - t1new = np.zeros((nocc, nvir), dtype=types[float]) - t1new += einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - t1new += einsum(v.oovv, (0, 1, 2, 3), t3, (4, 0, 1, 5, 2, 3), (4, 5)) * 0.25 - t1new += einsum(f.ov, (0, 1), (0, 1)) - t1new += einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) * -1.0 - t2new = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - t2new += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x0 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x0 += einsum(t1, (0, 1), v.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - x1 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x1 += einsum(v.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x1 += einsum(x0, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - t1new += einsum(t2, (0, 1, 2, 3), x1, (4, 1, 0, 3), (4, 2)) * -0.5 - del x1 - x2 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x2 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x2 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 2.0 - t1new += einsum(v.ovvv, (0, 1, 2, 3), x2, (0, 4, 2, 3), (4, 1)) * 0.5 - x3 = np.zeros((nocc, nvir), dtype=types[float]) - x3 += einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - x4 = np.zeros((nocc, nvir), dtype=types[float]) - x4 += einsum(f.ov, (0, 1), (0, 1)) - x4 += einsum(x3, (0, 1), (0, 1)) - del x3 - t1new += einsum(x4, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - t2new += einsum(x4, (0, 1), t3, (2, 3, 0, 4, 5, 1), (2, 3, 4, 5)) - x5 = np.zeros((nocc, nocc), dtype=types[float]) - x5 += einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - x6 = np.zeros((nocc, nocc), dtype=types[float]) - x6 += einsum(t1, (0, 1), v.ooov, (2, 0, 3, 1), (2, 3)) - x7 = np.zeros((nocc, nocc), dtype=types[float]) - x7 += einsum(v.oovv, (0, 1, 2, 3), x2, (1, 4, 2, 3), (4, 0)) * -1.0 - x8 = np.zeros((nocc, nocc), dtype=types[float]) - x8 += einsum(f.oo, (0, 1), (0, 1)) * 2.0 - x8 += einsum(x5, (0, 1), (0, 1)) * 2.0 - x8 += einsum(x6, (0, 1), (0, 1)) * 2.0 - x8 += einsum(x7, (0, 1), (1, 0)) - t1new += einsum(t1, (0, 1), x8, (0, 2), (2, 1)) * -0.5 - del x8 - x9 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x9 += einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - x10 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x10 += einsum(v.ooov, (0, 1, 2, 3), t3, (4, 0, 1, 5, 6, 3), (4, 2, 5, 6)) - x11 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x11 += einsum(x0, (0, 1, 2, 3), t3, (4, 2, 1, 5, 6, 3), (0, 4, 5, 6)) - x12 = np.zeros((nocc, nocc), dtype=types[float]) - x12 += einsum(t1, (0, 1), x4, (2, 1), (2, 0)) - x13 = np.zeros((nocc, nocc), dtype=types[float]) - x13 += einsum(f.oo, (0, 1), (0, 1)) - x13 += einsum(x12, (0, 1), (1, 0)) - del x12 - x14 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x14 += einsum(x13, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) * -1.0 - del x13 - x15 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x15 += einsum(t1, (0, 1), v.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - x16 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x16 += einsum(x15, (0, 1, 2, 3), x2, (1, 2, 4, 5), (0, 3, 4, 5)) * 0.5 - x17 = np.zeros((nocc, nocc), dtype=types[float]) - x17 += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - x18 = np.zeros((nocc, nocc), dtype=types[float]) - x18 += einsum(x6, (0, 1), (0, 1)) - x18 += einsum(x17, (0, 1), (1, 0)) * 0.5 - del x17 - x19 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x19 += einsum(x18, (0, 1), t2, (2, 0, 3, 4), (2, 1, 3, 4)) * -1.0 - del x18 - x20 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x20 += einsum(x9, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x9 - x20 += einsum(x10, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.5 - del x10 - x20 += einsum(x11, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.5 - del x11 - x20 += einsum(x14, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x14 - x20 += einsum(x16, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x16 - x20 += einsum(x19, (0, 1, 2, 3), (0, 1, 3, 2)) - del x19 - t2new += einsum(x20, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - t2new += einsum(x20, (0, 1, 2, 3), (1, 0, 2, 3)) - del x20 - x21 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x21 += einsum(t1, (0, 1), v.ooov, (2, 3, 0, 4), (2, 3, 1, 4)) - x22 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x22 += einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - x23 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x23 += einsum(x21, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x21 - x23 += einsum(x22, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x22 - t2new += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - t2new += einsum(x23, (0, 1, 2, 3), (0, 1, 3, 2)) - del x23 - x24 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x24 += einsum(v.ovvv, (0, 1, 2, 3), t3, (4, 5, 0, 6, 2, 3), (4, 5, 6, 1)) - x25 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x25 += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - x26 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x26 += einsum(t2, (0, 1, 2, 3), x25, (4, 1, 5, 3), (0, 4, 2, 5)) - x27 = np.zeros((nvir, nvir), dtype=types[float]) - x27 += einsum(t1, (0, 1), v.ovvv, (0, 2, 3, 1), (2, 3)) - x28 = np.zeros((nvir, nvir), dtype=types[float]) - x28 += einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - x29 = np.zeros((nvir, nvir), dtype=types[float]) - x29 += einsum(x27, (0, 1), (0, 1)) - x29 += einsum(x28, (0, 1), (0, 1)) * 0.5 - del x28 - x30 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x30 += einsum(x29, (0, 1), t2, (2, 3, 4, 1), (2, 3, 4, 0)) * -1.0 - del x29 - x31 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x31 += einsum(v.oovv, (0, 1, 2, 3), t3, (4, 5, 1, 6, 2, 3), (4, 5, 0, 6)) - x32 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x32 += einsum(v.ovvv, (0, 1, 2, 3), x2, (4, 5, 2, 3), (0, 4, 5, 1)) * 0.5 - x33 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x33 += einsum(x4, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) * -1.0 - x34 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x34 += einsum(x31, (0, 1, 2, 3), (2, 1, 0, 3)) * -0.5 - x34 += einsum(x32, (0, 1, 2, 3), (0, 2, 1, 3)) - del x32 - x34 += einsum(x33, (0, 1, 2, 3), (2, 1, 0, 3)) - del x33 - x35 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x35 += einsum(t1, (0, 1), x34, (0, 2, 3, 4), (2, 3, 4, 1)) - del x34 - x36 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x36 += einsum(x24, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x24 - x36 += einsum(x26, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x26 - x36 += einsum(x30, (0, 1, 2, 3), (1, 0, 2, 3)) - del x30 - x36 += einsum(x35, (0, 1, 2, 3), (1, 0, 3, 2)) - del x35 - t2new += einsum(x36, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - t2new += einsum(x36, (0, 1, 2, 3), (0, 1, 3, 2)) - del x36 - x37 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x37 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - x38 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x38 += einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x39 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x39 += einsum(t2, (0, 1, 2, 3), x38, (4, 1, 5, 3), (4, 0, 2, 5)) * -1.0 - x40 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x40 += einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - x41 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x41 += einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - x42 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x42 += einsum(t2, (0, 1, 2, 3), x0, (4, 1, 5, 3), (4, 0, 5, 2)) - x43 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x43 += einsum(x40, (0, 1, 2, 3), (0, 1, 2, 3)) - x43 += einsum(x41, (0, 1, 2, 3), (0, 1, 2, 3)) - x43 += einsum(x42, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x44 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x44 += einsum(t1, (0, 1), x43, (2, 0, 3, 4), (2, 3, 4, 1)) - del x43 - x45 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x45 += einsum(x37, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x37 - x45 += einsum(x39, (0, 1, 2, 3), (0, 1, 2, 3)) - del x39 - x45 += einsum(x44, (0, 1, 2, 3), (0, 1, 3, 2)) - del x44 - t2new += einsum(x45, (0, 1, 2, 3), (0, 1, 2, 3)) - t2new += einsum(x45, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - t2new += einsum(x45, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - t2new += einsum(x45, (0, 1, 2, 3), (1, 0, 3, 2)) - del x45 - x46 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x46 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x46 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - t2new += einsum(v.vvvv, (0, 1, 2, 3), x46, (4, 5, 2, 3), (5, 4, 0, 1)) * -1.0 - del x46 - x47 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x47 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x47 += einsum(v.oovv, (0, 1, 2, 3), x2, (4, 5, 2, 3), (0, 1, 5, 4)) * -1.0 - t2new += einsum(x2, (0, 1, 2, 3), x47, (0, 1, 4, 5), (4, 5, 3, 2)) * -0.25 - del x47 - x48 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x48 += einsum(x15, (0, 1, 2, 3), t3, (4, 1, 2, 5, 6, 7), (0, 4, 3, 5, 6, 7)) - t3new = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - t3new += einsum(x48, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * 0.5 - t3new += einsum(x48, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -0.5 - t3new += einsum(x48, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) * -0.5 - t3new += einsum(x48, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * 0.5 - t3new += einsum(x48, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 5, 3)) * 0.5 - t3new += einsum(x48, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -0.5 - del x48 - x49 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x49 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 5, 2, 6, 7, 1), (4, 5, 0, 6, 7, 3)) - x50 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x50 += einsum(v.ooov, (0, 1, 2, 3), x2, (0, 1, 4, 5), (2, 3, 4, 5)) - x51 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x51 += einsum(t2, (0, 1, 2, 3), x50, (4, 3, 5, 6), (0, 1, 4, 2, 6, 5)) * 0.5 - del x50 - x52 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x52 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * 2.0 - x52 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x53 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x53 += einsum(v.ovvv, (0, 1, 2, 3), x52, (4, 5, 2, 3), (0, 4, 5, 1)) - x54 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x54 += einsum(t2, (0, 1, 2, 3), x53, (1, 4, 5, 6), (0, 5, 4, 2, 3, 6)) * 0.5 - del x53 - x55 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x55 += einsum(x49, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x49 - x55 += einsum(x51, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -1.0 - del x51 - x55 += einsum(x54, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) - del x54 - t3new += einsum(x55, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new += einsum(x55, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new += einsum(x55, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new += einsum(x55, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - t3new += einsum(x55, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - t3new += einsum(x55, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - t3new += einsum(x55, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new += einsum(x55, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new += einsum(x55, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - del x55 - x56 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x56 += einsum(v.oovv, (0, 1, 2, 3), t3, (4, 0, 1, 5, 6, 3), (4, 5, 6, 2)) - x57 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x57 += einsum(x4, (0, 1), t2, (2, 0, 3, 4), (2, 3, 4, 1)) * -1.0 - del x4 - x58 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x58 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) - x58 += einsum(x56, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.5 - del x56 - x58 += einsum(x57, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x57 - x59 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x59 += einsum(t2, (0, 1, 2, 3), x58, (4, 5, 6, 3), (0, 1, 4, 2, 5, 6)) * -1.0 - del x58 - x60 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x60 += einsum(v.ooov, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (4, 5, 0, 2, 6, 7)) - x61 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x61 += einsum(v.oovv, (0, 1, 2, 3), x52, (4, 5, 2, 3), (0, 1, 4, 5)) - del x52 - x62 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x62 += einsum(t2, (0, 1, 2, 3), x61, (4, 1, 5, 6), (0, 6, 5, 4, 2, 3)) * -0.5 - x63 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x63 += einsum(x60, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - del x60 - x63 += einsum(x62, (0, 1, 2, 3, 4, 5), (2, 1, 3, 0, 5, 4)) * -1.0 - del x62 - x64 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x64 += einsum(t1, (0, 1), x63, (2, 3, 0, 4, 5, 6), (2, 3, 4, 5, 6, 1)) - del x63 - x65 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x65 += einsum(x59, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) * -1.0 - del x59 - x65 += einsum(x64, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -1.0 - del x64 - t3new += einsum(x65, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new += einsum(x65, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - t3new += einsum(x65, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - t3new += einsum(x65, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - t3new += einsum(x65, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * -1.0 - t3new += einsum(x65, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - t3new += einsum(x65, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new += einsum(x65, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) * -1.0 - t3new += einsum(x65, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) - del x65 - x66 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x66 += einsum(x6, (0, 1), t3, (2, 3, 0, 4, 5, 6), (2, 3, 1, 4, 5, 6)) * -1.0 - del x6 - x67 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x67 += einsum(x61, (0, 1, 2, 3), t3, (4, 1, 0, 5, 6, 7), (4, 3, 2, 5, 6, 7)) * -0.25 - del x61 - x68 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x68 += einsum(x66, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - del x66 - x68 += einsum(x67, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - del x67 - t3new += einsum(x68, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - t3new += einsum(x68, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -1.0 - t3new += einsum(x68, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) * -1.0 - del x68 - x69 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x69 += einsum(t2, (0, 1, 2, 3), x41, (4, 1, 5, 6), (0, 4, 5, 2, 3, 6)) - del x41 - x70 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x70 += einsum(x40, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x40 - x70 += einsum(x42, (0, 1, 2, 3), (0, 1, 2, 3)) - del x42 - x71 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x71 += einsum(t2, (0, 1, 2, 3), x70, (4, 5, 1, 6), (0, 4, 5, 2, 3, 6)) * -1.0 - del x70 - x72 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x72 += einsum(x69, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x69 - x72 += einsum(x71, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - del x71 - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -1.0 - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -1.0 - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) * -1.0 - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) * -1.0 - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 3, 4)) - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) - t3new += einsum(x72, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) * -1.0 - del x72 - x73 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x73 += einsum(t1, (0, 1), x15, (2, 0, 3, 4), (2, 3, 4, 1)) * -1.0 - del x15 - x74 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x74 += einsum(t2, (0, 1, 2, 3), x73, (4, 1, 5, 6), (4, 0, 5, 6, 2, 3)) * -1.0 - del x73 - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) * -1.0 - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) * -1.0 - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -1.0 - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * -1.0 - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 4, 3)) - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 3, 4)) * -1.0 - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 4, 3)) - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - t3new += einsum(x74, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) * -1.0 - del x74 - x75 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x75 += einsum(v.ovvv, (0, 1, 2, 3), t3, (4, 5, 6, 7, 2, 3), (4, 5, 6, 0, 7, 1)) - x76 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x76 += einsum(t1, (0, 1), x75, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x75 - t3new += einsum(x76, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.5 - t3new += einsum(x76, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -0.5 - t3new += einsum(x76, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -0.5 - t3new += einsum(x76, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * 0.5 - t3new += einsum(x76, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * 0.5 - t3new += einsum(x76, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -0.5 - del x76 - x77 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x77 += einsum(x38, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (0, 4, 5, 6, 7, 2)) * -1.0 - x78 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x78 += einsum(x0, (0, 1, 2, 3), x2, (1, 2, 4, 5), (0, 3, 4, 5)) - del x0 - x79 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x79 += einsum(t2, (0, 1, 2, 3), x78, (4, 3, 5, 6), (0, 1, 4, 2, 6, 5)) * 0.5 - del x78 - x80 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x80 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x80 += einsum(x31, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x31 - x81 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x81 += einsum(t2, (0, 1, 2, 3), x80, (4, 5, 1, 6), (0, 4, 5, 2, 3, 6)) * -1.0 - del x80 - x82 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x82 += einsum(x77, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - del x77 - x82 += einsum(x79, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) - del x79 - x82 += einsum(x81, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x81 - t3new += einsum(x82, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new += einsum(x82, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new += einsum(x82, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new += einsum(x82, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x82, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) - t3new += einsum(x82, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * -1.0 - t3new += einsum(x82, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new += einsum(x82, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new += einsum(x82, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - del x82 - x83 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x83 += einsum(x27, (0, 1), t3, (2, 3, 4, 5, 6, 1), (2, 3, 4, 5, 6, 0)) * -1.0 - del x27 - x84 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x84 += einsum(v.oovv, (0, 1, 2, 3), t3, (4, 5, 6, 7, 2, 3), (4, 5, 6, 0, 1, 7)) - x85 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x85 += einsum(x2, (0, 1, 2, 3), x84, (4, 5, 6, 0, 1, 7), (4, 5, 6, 2, 3, 7)) * 0.25 - del x84 - x86 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x86 += einsum(x83, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x83 - x86 += einsum(x85, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x85 - t3new += einsum(x86, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new += einsum(x86, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - t3new += einsum(x86, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - del x86 - x87 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x87 += einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - x88 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x88 += einsum(t2, (0, 1, 2, 3), x87, (4, 5, 6, 3), (0, 1, 4, 2, 5, 6)) - del x87 - x89 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x89 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x89 += einsum(x25, (0, 1, 2, 3), (0, 1, 2, 3)) - del x25 - x90 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x90 += einsum(t2, (0, 1, 2, 3), x89, (4, 5, 6, 3), (0, 1, 4, 5, 2, 6)) * -1.0 - del x89 - x91 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x91 += einsum(t1, (0, 1), x90, (2, 3, 4, 0, 5, 6), (3, 2, 4, 5, 6, 1)) * -1.0 - del x90 - x92 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x92 += einsum(x88, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x88 - x92 += einsum(x91, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - del x91 - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -1.0 - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -1.0 - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) * -1.0 - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - t3new += einsum(x92, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) - del x92 - x93 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x93 += einsum(t2, (0, 1, 2, 3), x38, (4, 5, 6, 3), (4, 0, 1, 5, 2, 6)) * -1.0 - del x38 - x94 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x94 += einsum(t1, (0, 1), x93, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x93 - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * -1.0 - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) * -1.0 - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) * -1.0 - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -1.0 - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) * -1.0 - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 3, 5)) - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 3, 4)) * -1.0 - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 5, 3)) * -1.0 - t3new += einsum(x94, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 4, 3)) - del x94 - x95 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x95 += einsum(v.vvvv, (0, 1, 2, 3), t3, (4, 5, 6, 7, 2, 3), (4, 5, 6, 7, 0, 1)) - x96 = np.zeros((nvir, nvir), dtype=types[float]) - x96 += einsum(f.ov, (0, 1), t1, (0, 2), (1, 2)) - x97 = np.zeros((nvir, nvir), dtype=types[float]) - x97 += einsum(v.oovv, (0, 1, 2, 3), x2, (0, 1, 3, 4), (4, 2)) * -1.0 - del x2 - x98 = np.zeros((nvir, nvir), dtype=types[float]) - x98 += einsum(f.vv, (0, 1), (0, 1)) * -2.0 - x98 += einsum(x96, (0, 1), (0, 1)) * 2.0 - del x96 - x98 += einsum(x97, (0, 1), (1, 0)) - del x97 - x99 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x99 += einsum(x98, (0, 1), t3, (2, 3, 4, 5, 6, 0), (2, 3, 4, 5, 6, 1)) * 0.5 - del x98 - x100 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x100 += einsum(x95, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -0.5 - del x95 - x100 += einsum(x99, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 3, 4)) * -1.0 - del x99 - t3new += einsum(x100, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new += einsum(x100, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - t3new += einsum(x100, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - del x100 - x101 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x101 += einsum(t1, (0, 1), v.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - x102 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x102 += einsum(t2, (0, 1, 2, 3), x101, (4, 5, 1, 6), (0, 4, 5, 6, 2, 3)) * -1.0 - del x101 - x103 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x103 += einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x104 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x104 += einsum(t2, (0, 1, 2, 3), x103, (4, 5, 6, 3), (4, 0, 1, 2, 5, 6)) * -1.0 - del x103 - x105 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x105 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x105 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -0.99999999999999 - x106 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x106 += einsum(v.oovv, (0, 1, 2, 3), x105, (1, 4, 3, 5), (0, 4, 2, 5)) - del x105 - x107 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x107 += einsum(x106, (0, 1, 2, 3), t3, (4, 5, 0, 6, 7, 2), (4, 5, 1, 6, 7, 3)) * 1.00000000000001 - del x106 - x108 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x108 += einsum(x102, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - del x102 - x108 += einsum(x104, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - del x104 - x108 += einsum(x107, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * -1.0 - del x107 - t3new += einsum(x108, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new += einsum(x108, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - t3new += einsum(x108, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - t3new += einsum(x108, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x108, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) - t3new += einsum(x108, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * -1.0 - t3new += einsum(x108, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new += einsum(x108, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) * -1.0 - t3new += einsum(x108, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) - del x108 - x109 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x109 += einsum(v.oooo, (0, 1, 2, 3), t3, (4, 2, 3, 5, 6, 7), (4, 0, 1, 5, 6, 7)) - x110 = np.zeros((nocc, nocc), dtype=types[float]) - x110 += einsum(f.oo, (0, 1), (0, 1)) * 2.0 - x110 += einsum(x5, (0, 1), (0, 1)) * 2.0 - del x5 - x110 += einsum(x7, (0, 1), (1, 0)) - del x7 - x111 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x111 += einsum(x110, (0, 1), t3, (2, 3, 0, 4, 5, 6), (2, 3, 1, 4, 5, 6)) * 0.5 - del x110 - x112 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x112 += einsum(x109, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -0.5 - del x109 - x112 += einsum(x111, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * -1.0 - del x111 - t3new += einsum(x112, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - t3new += einsum(x112, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) - t3new += einsum(x112, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) * -1.0 - del x112 - - return {"t1new": t1new, "t2new": t2new, "t3new": t3new} - -def update_lams(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, l1=None, l2=None, l3=None, **kwargs): - # L amplitudes - l1new = np.zeros((nvir, nocc), dtype=types[float]) - l1new += einsum(l2, (0, 1, 2, 3), v.ovvv, (3, 4, 0, 1), (4, 2)) * -0.5 - l1new += einsum(f.ov, (0, 1), (1, 0)) - l1new += einsum(l1, (0, 1), v.ovov, (2, 0, 1, 3), (3, 2)) * -1.0 - l2new = np.zeros((nvir, nvir, nocc, nocc), dtype=types[float]) - l2new += einsum(v.oovv, (0, 1, 2, 3), (2, 3, 0, 1)) - l2new += einsum(l2, (0, 1, 2, 3), v.vvvv, (4, 5, 0, 1), (4, 5, 2, 3)) * 0.5 - x0 = np.zeros((nocc, nocc), dtype=types[float]) - x0 += einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - x1 = np.zeros((nocc, nvir), dtype=types[float]) - x1 += einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - l1new += einsum(x0, (0, 1), x1, (1, 2), (2, 0)) * -1.0 - l3new = np.zeros((nvir, nvir, nvir, nocc, nocc, nocc), dtype=types[float]) - l3new += einsum(x1, (0, 1), l2, (2, 3, 4, 5), (2, 3, 1, 4, 5, 0)) - l3new += einsum(x1, (0, 1), l2, (2, 3, 4, 5), (2, 1, 3, 4, 5, 0)) * -1.0 - l3new += einsum(x1, (0, 1), l2, (2, 3, 4, 5), (1, 2, 3, 4, 5, 0)) - l3new += einsum(x1, (0, 1), l2, (2, 3, 4, 5), (2, 3, 1, 4, 0, 5)) * -1.0 - l3new += einsum(x1, (0, 1), l2, (2, 3, 4, 5), (2, 1, 3, 4, 0, 5)) - l3new += einsum(x1, (0, 1), l2, (2, 3, 4, 5), (1, 2, 3, 4, 0, 5)) * -1.0 - l3new += einsum(x1, (0, 1), l2, (2, 3, 4, 5), (2, 3, 1, 0, 4, 5)) - l3new += einsum(x1, (0, 1), l2, (2, 3, 4, 5), (2, 1, 3, 0, 4, 5)) * -1.0 - l3new += einsum(x1, (0, 1), l2, (2, 3, 4, 5), (1, 2, 3, 0, 4, 5)) - x2 = np.zeros((nvir, nvir), dtype=types[float]) - x2 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 4, 5, 6, 1, 2), (0, 6)) - l1new += einsum(x2, (0, 1), v.ovvv, (2, 0, 3, 1), (3, 2)) * 0.08333333333333 - x3 = np.zeros((nocc, nocc), dtype=types[float]) - x3 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 4, 5, 0, 1, 2), (3, 6)) - l1new += einsum(x3, (0, 1), v.ooov, (2, 1, 0, 3), (3, 2)) * 0.08333333333333 - x4 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x4 += einsum(t1, (0, 1), v.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - x5 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x5 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x5 += einsum(x4, (0, 1, 2, 3), (2, 1, 0, 3)) - x6 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x6 += einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x7 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x7 += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - x8 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x8 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x8 += einsum(x6, (0, 1, 2, 3), (0, 1, 2, 3)) - x8 += einsum(x7, (0, 1, 2, 3), (0, 1, 2, 3)) - x9 = np.zeros((nocc, nvir), dtype=types[float]) - x9 += einsum(f.ov, (0, 1), (0, 1)) - x9 += einsum(x1, (0, 1), (0, 1)) - x10 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x10 += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 5, 2, 3), (0, 1, 4, 5)) - x11 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x11 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x11 += einsum(x4, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.5 - x12 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x12 += einsum(t1, (0, 1), x11, (2, 3, 4, 1), (0, 2, 3, 4)) * 4.0 - del x11 - x13 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x13 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x13 += einsum(x10, (0, 1, 2, 3), (3, 2, 1, 0)) - x13 += einsum(x12, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x14 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x14 += einsum(v.oovv, (0, 1, 2, 3), t3, (4, 5, 6, 7, 2, 3), (4, 5, 6, 0, 1, 7)) - l2new += einsum(l3, (0, 1, 2, 3, 4, 5), x14, (3, 4, 5, 6, 7, 2), (0, 1, 6, 7)) * 0.08333333333333 - x15 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x15 += einsum(v.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x15 += einsum(x4, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x16 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x16 += einsum(x14, (0, 1, 2, 3, 4, 5), (0, 1, 4, 3, 2, 5)) * 0.16666666666666 - del x14 - x16 += einsum(t2, (0, 1, 2, 3), x15, (4, 5, 6, 3), (0, 1, 6, 5, 4, 2)) - x17 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x17 += einsum(v.ovvv, (0, 1, 2, 3), t3, (4, 5, 6, 7, 2, 3), (0, 4, 5, 6, 7, 1)) * 0.66666666666664 - x17 += einsum(x5, (0, 1, 2, 3), t3, (4, 5, 0, 6, 7, 3), (1, 4, 2, 5, 6, 7)) * -2.0 - x17 += einsum(t2, (0, 1, 2, 3), x8, (4, 5, 6, 3), (5, 0, 4, 1, 2, 6)) * -4.0 - del x8 - x17 += einsum(x9, (0, 1), t3, (2, 3, 4, 5, 6, 1), (0, 2, 3, 4, 5, 6)) * -0.66666666666664 - x17 += einsum(t2, (0, 1, 2, 3), x13, (1, 4, 5, 6), (4, 0, 6, 5, 2, 3)) * -1.0 - x17 += einsum(t1, (0, 1), x16, (2, 3, 4, 0, 5, 6), (4, 3, 5, 2, 6, 1)) * 4.0 - del x16 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x17, (6, 3, 4, 5, 2, 1), (0, 6)) * -0.125 - del x17 - x18 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x18 += einsum(t2, (0, 1, 2, 3), l3, (4, 5, 3, 6, 0, 1), (6, 4, 5, 2)) - l2new += einsum(x18, (0, 1, 2, 3), x5, (4, 5, 0, 3), (1, 2, 5, 4)) * -0.5 - x19 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x19 += einsum(t1, (0, 1), l2, (2, 3, 4, 0), (4, 2, 3, 1)) * 2.0 - x19 += einsum(x18, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - l1new += einsum(v.vvvv, (0, 1, 2, 3), x19, (4, 3, 2, 1), (0, 4)) * -0.25 - del x19 - x20 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x20 += einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 5, 2, 3), (0, 1, 4, 5)) - x21 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x21 += einsum(v.oovv, (0, 1, 2, 3), t3, (4, 5, 1, 6, 2, 3), (4, 5, 0, 6)) - x22 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x22 += einsum(t2, (0, 1, 2, 3), x15, (4, 1, 5, 3), (0, 4, 5, 2)) * 2.0 - x23 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x23 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x23 += einsum(x6, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.5 - x24 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x24 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x24 += einsum(x10, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - x24 += einsum(x12, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - x25 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x25 += einsum(v.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x25 += einsum(x20, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.5 - x25 += einsum(x21, (0, 1, 2, 3), (2, 1, 0, 3)) * -0.5 - x25 += einsum(x22, (0, 1, 2, 3), (2, 0, 1, 3)) - x25 += einsum(x9, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - x25 += einsum(t1, (0, 1), x23, (2, 3, 1, 4), (3, 2, 0, 4)) * -2.0 - del x23 - x25 += einsum(t1, (0, 1), x24, (0, 2, 3, 4), (2, 4, 3, 1)) * -0.5 - del x24 - l1new += einsum(l2, (0, 1, 2, 3), x25, (4, 2, 3, 1), (0, 4)) * 0.5 - del x25 - x26 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x26 += einsum(t1, (0, 1), l3, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - x27 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x27 += einsum(t1, (0, 1), x26, (2, 3, 4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - x28 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x28 += einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - x29 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x29 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) - x30 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x30 += einsum(x28, (0, 1, 2, 3), (1, 0, 2, 3)) - x30 += einsum(x29, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - l2new += einsum(v.ovvv, (0, 1, 2, 3), x30, (4, 5, 0, 1), (2, 3, 4, 5)) * -1.0 - x31 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x31 += einsum(l2, (0, 1, 2, 3), t2, (4, 5, 0, 1), (2, 3, 4, 5)) - x32 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x32 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 7, 5, 0, 1, 2), (3, 4, 6, 7)) - x33 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x33 += einsum(x28, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x33 += einsum(x29, (0, 1, 2, 3), (0, 1, 2, 3)) - x34 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x34 += einsum(x31, (0, 1, 2, 3), (1, 0, 3, 2)) * -3.00000000000012 - x34 += einsum(x32, (0, 1, 2, 3), (0, 1, 3, 2)) - x34 += einsum(t1, (0, 1), x33, (2, 3, 4, 1), (2, 3, 0, 4)) * -6.00000000000024 - x35 = np.zeros((nocc, nocc), dtype=types[float]) - x35 += einsum(l2, (0, 1, 2, 3), t2, (4, 3, 0, 1), (2, 4)) - x36 = np.zeros((nocc, nocc), dtype=types[float]) - x36 += einsum(x35, (0, 1), (0, 1)) - x36 += einsum(x3, (0, 1), (0, 1)) * 0.16666666666666 - x37 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x37 += einsum(l1, (0, 1), t2, (2, 3, 4, 0), (1, 2, 3, 4)) - x37 += einsum(l2, (0, 1, 2, 3), t3, (4, 5, 3, 6, 0, 1), (2, 4, 5, 6)) * 0.5 - x37 += einsum(t3, (0, 1, 2, 3, 4, 5), x26, (6, 1, 2, 7, 5, 4), (6, 0, 7, 3)) * -0.5 - x37 += einsum(t2, (0, 1, 2, 3), x18, (4, 3, 2, 5), (4, 0, 1, 5)) * -0.25 - x37 += einsum(t2, (0, 1, 2, 3), x27, (4, 0, 1, 5, 6, 3), (4, 6, 5, 2)) * -0.5 - x37 += einsum(t2, (0, 1, 2, 3), x30, (4, 1, 5, 3), (4, 0, 5, 2)) * 2.0 - x37 += einsum(t1, (0, 1), x34, (0, 2, 3, 4), (2, 4, 3, 1)) * -0.16666666666666 - del x34 - x37 += einsum(t1, (0, 1), x36, (2, 3), (2, 0, 3, 1)) - del x36 - l1new += einsum(v.oovv, (0, 1, 2, 3), x37, (4, 0, 1, 3), (2, 4)) * 0.5 - del x37 - x38 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x38 += einsum(t2, (0, 1, 2, 3), x26, (4, 0, 1, 5, 3, 6), (4, 5, 6, 2)) - x39 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x39 += einsum(x28, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x39 += einsum(x29, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - l1new += einsum(v.ovov, (0, 1, 2, 3), x39, (0, 4, 2, 3), (1, 4)) - x40 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x40 += einsum(x38, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x40 += einsum(t1, (0, 1), x39, (0, 2, 3, 4), (2, 3, 4, 1)) * -1.0 - l1new += einsum(v.ovvv, (0, 1, 2, 3), x40, (4, 0, 1, 3), (2, 4)) - del x40 - x41 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x41 += einsum(l2, (0, 1, 2, 3), t2, (4, 3, 5, 1), (2, 4, 0, 5)) - x42 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x42 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 4, 5, 7, 1, 2), (3, 6, 0, 7)) - x43 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x43 += einsum(x41, (0, 1, 2, 3), (0, 1, 2, 3)) - x43 += einsum(x42, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - l1new += einsum(v.ovvv, (0, 1, 2, 3), x43, (4, 0, 1, 3), (2, 4)) * -1.0 - del x43 - x44 = np.zeros((nocc, nocc), dtype=types[float]) - x44 += einsum(x0, (0, 1), (0, 1)) * 12.00000000000048 - x44 += einsum(x35, (0, 1), (0, 1)) * 6.00000000000024 - x44 += einsum(x3, (0, 1), (0, 1)) - x45 = np.zeros((nocc, nvir), dtype=types[float]) - x45 += einsum(t1, (0, 1), (0, 1)) * -1.0 - x45 += einsum(l1, (0, 1), t2, (2, 1, 3, 0), (2, 3)) * -1.0 - x45 += einsum(l2, (0, 1, 2, 3), t3, (4, 2, 3, 5, 0, 1), (4, 5)) * -0.25 - x45 += einsum(t3, (0, 1, 2, 3, 4, 5), x26, (2, 0, 1, 6, 5, 4), (6, 3)) * -0.08333333333333 - x45 += einsum(t2, (0, 1, 2, 3), x39, (0, 1, 4, 3), (4, 2)) * -0.5 - x45 += einsum(t1, (0, 1), x44, (0, 2), (2, 1)) * 0.08333333333333 - l1new += einsum(x45, (0, 1), v.oovv, (2, 0, 3, 1), (3, 2)) * -1.0 - del x45 - x46 = np.zeros((nvir, nvir), dtype=types[float]) - x46 += einsum(l2, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - x47 = np.zeros((nvir, nvir), dtype=types[float]) - x47 += einsum(l1, (0, 1), t1, (1, 2), (0, 2)) - x47 += einsum(x46, (0, 1), (0, 1)) * 0.5 - l1new += einsum(x47, (0, 1), v.ovvv, (2, 0, 3, 1), (3, 2)) - del x47 - x48 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x48 += einsum(x31, (0, 1, 2, 3), (1, 0, 3, 2)) * 3.00000000000012 - x48 += einsum(x32, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - l1new += einsum(v.ooov, (0, 1, 2, 3), x48, (2, 4, 0, 1), (3, 4)) * 0.08333333333333 - del x48 - x49 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x49 += einsum(t1, (0, 1), x33, (2, 3, 4, 1), (3, 2, 4, 0)) - l1new += einsum(v.ooov, (0, 1, 2, 3), x49, (4, 2, 0, 1), (3, 4)) * -0.5 - del x49 - x50 = np.zeros((nocc, nocc), dtype=types[float]) - x50 += einsum(x0, (0, 1), (0, 1)) * 2.0 - x50 += einsum(x35, (0, 1), (0, 1)) - l1new += einsum(x50, (0, 1), v.ooov, (2, 1, 0, 3), (3, 2)) * 0.5 - del x50 - x51 = np.zeros((nvir, nvir), dtype=types[float]) - x51 += einsum(t1, (0, 1), v.ovvv, (0, 2, 3, 1), (2, 3)) - x52 = np.zeros((nvir, nvir), dtype=types[float]) - x52 += einsum(f.vv, (0, 1), (0, 1)) - x52 += einsum(x51, (0, 1), (0, 1)) * -1.0 - l1new += einsum(l1, (0, 1), x52, (0, 2), (2, 1)) - del x52 - x53 = np.zeros((nocc, nocc), dtype=types[float]) - x53 += einsum(t1, (0, 1), v.ooov, (2, 0, 3, 1), (2, 3)) - x54 = np.zeros((nocc, nocc), dtype=types[float]) - x54 += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - x55 = np.zeros((nocc, nocc), dtype=types[float]) - x55 += einsum(f.oo, (0, 1), (0, 1)) * 2.0 - x55 += einsum(x53, (0, 1), (1, 0)) * 2.0 - x55 += einsum(x54, (0, 1), (0, 1)) - x55 += einsum(t1, (0, 1), x9, (2, 1), (0, 2)) * 2.0 - del x9 - l1new += einsum(l1, (0, 1), x55, (1, 2), (0, 2)) * -0.5 - del x55 - x56 = np.zeros((nocc, nocc), dtype=types[float]) - x56 += einsum(x0, (0, 1), (0, 1)) * 2.0 - del x0 - x56 += einsum(x35, (0, 1), (0, 1)) - del x35 - x56 += einsum(x3, (0, 1), (0, 1)) * 0.16666666666666 - del x3 - l1new += einsum(f.ov, (0, 1), x56, (2, 0), (1, 2)) * -0.5 - del x56 - x57 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x57 += einsum(f.vv, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - x58 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x58 += einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x59 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x59 += einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - x60 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x60 += einsum(v.oovv, (0, 1, 2, 3), t3, (4, 0, 1, 5, 6, 3), (4, 5, 6, 2)) - x61 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x61 += einsum(t2, (0, 1, 2, 3), x5, (0, 1, 4, 5), (4, 2, 3, 5)) * 0.5 - del x5 - x62 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x62 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x62 += einsum(x58, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x58 - x62 += einsum(x59, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x59 - x62 += einsum(x60, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.49999999999998 - del x60 - x62 += einsum(x61, (0, 1, 2, 3), (0, 2, 1, 3)) - del x61 - x63 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x63 += einsum(x62, (0, 1, 2, 3), l3, (4, 1, 2, 5, 6, 0), (5, 6, 4, 3)) * -0.5 - del x62 - x64 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x64 += einsum(t1, (0, 1), v.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - x65 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x65 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x65 += einsum(x64, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - del x64 - x65 += einsum(x7, (0, 1, 2, 3), (0, 1, 2, 3)) - x66 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x66 += einsum(x65, (0, 1, 2, 3), x26, (4, 5, 0, 1, 2, 6), (4, 5, 6, 3)) - del x65 - x67 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x67 += einsum(t1, (0, 1), x4, (2, 3, 0, 4), (2, 3, 1, 4)) - x68 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x68 += einsum(x6, (0, 1, 2, 3), (0, 1, 2, 3)) - x68 += einsum(x67, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x67 - x69 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x69 += einsum(x68, (0, 1, 2, 3), x26, (4, 5, 0, 1, 2, 6), (4, 5, 6, 3)) - del x68 - x70 = np.zeros((nvir, nvir), dtype=types[float]) - x70 += einsum(x46, (0, 1), (0, 1)) - del x46 - x70 += einsum(x2, (0, 1), (0, 1)) * 0.16666666666666 - del x2 - x71 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x71 += einsum(x70, (0, 1), v.oovv, (2, 3, 4, 1), (2, 3, 0, 4)) * -0.5 - del x70 - x72 = np.zeros((nvir, nvir), dtype=types[float]) - x72 += einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - x73 = np.zeros((nvir, nvir), dtype=types[float]) - x73 += einsum(x51, (0, 1), (0, 1)) - del x51 - x73 += einsum(x72, (0, 1), (0, 1)) * 0.5 - del x72 - x74 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x74 += einsum(x73, (0, 1), l2, (2, 0, 3, 4), (3, 4, 2, 1)) * -1.0 - x75 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x75 += einsum(l1, (0, 1), x15, (1, 2, 3, 4), (2, 3, 0, 4)) - del x15 - x76 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x76 += einsum(f.ov, (0, 1), x39, (2, 3, 0, 4), (2, 3, 4, 1)) - x77 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x77 += einsum(x1, (0, 1), x39, (2, 3, 0, 4), (2, 3, 4, 1)) - del x39 - x78 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x78 += einsum(x57, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x57 - x78 += einsum(x63, (0, 1, 2, 3), (0, 1, 2, 3)) - del x63 - x78 += einsum(x66, (0, 1, 2, 3), (0, 1, 2, 3)) - del x66 - x78 += einsum(x69, (0, 1, 2, 3), (0, 1, 2, 3)) - del x69 - x78 += einsum(x71, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x71 - x78 += einsum(x74, (0, 1, 2, 3), (1, 0, 2, 3)) - del x74 - x78 += einsum(x75, (0, 1, 2, 3), (1, 0, 2, 3)) - del x75 - x78 += einsum(x76, (0, 1, 2, 3), (1, 0, 3, 2)) - del x76 - x78 += einsum(x77, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x77 - l2new += einsum(x78, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - l2new += einsum(x78, (0, 1, 2, 3), (3, 2, 0, 1)) - del x78 - x79 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x79 += einsum(x28, (0, 1, 2, 3), x4, (0, 4, 2, 5), (1, 4, 3, 5)) * -1.0 - x80 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x80 += einsum(v.ovvv, (0, 1, 2, 3), x18, (4, 5, 1, 3), (4, 0, 5, 2)) - x81 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x81 += einsum(t1, (0, 1), x29, (0, 2, 3, 4), (2, 3, 4, 1)) * -1.0 - x82 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x82 += einsum(x41, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - del x41 - x82 += einsum(x42, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.49999999999998 - del x42 - x82 += einsum(x38, (0, 1, 2, 3), (0, 1, 2, 3)) - del x38 - x82 += einsum(x81, (0, 1, 2, 3), (0, 1, 2, 3)) - del x81 - x83 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x83 += einsum(v.oovv, (0, 1, 2, 3), x82, (4, 1, 5, 3), (4, 0, 5, 2)) * 0.5 - del x82 - x84 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x84 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x84 += einsum(x6, (0, 1, 2, 3), (0, 1, 2, 3)) - x85 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x85 += einsum(l2, (0, 1, 2, 3), x84, (3, 4, 1, 5), (2, 4, 0, 5)) - del x84 - x86 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x86 += einsum(v.ooov, (0, 1, 2, 3), x30, (4, 2, 1, 5), (0, 4, 3, 5)) * -1.0 - del x30 - x87 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x87 += einsum(f.ov, (0, 1), l1, (2, 3), (0, 3, 1, 2)) - x87 += einsum(l1, (0, 1), x1, (2, 3), (1, 2, 0, 3)) - x87 += einsum(x79, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x79 - x87 += einsum(x80, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x80 - x87 += einsum(x83, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x83 - x87 += einsum(x85, (0, 1, 2, 3), (0, 1, 2, 3)) - del x85 - x87 += einsum(x86, (0, 1, 2, 3), (1, 0, 3, 2)) - del x86 - l2new += einsum(x87, (0, 1, 2, 3), (2, 3, 0, 1)) - l2new += einsum(x87, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - l2new += einsum(x87, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - l2new += einsum(x87, (0, 1, 2, 3), (3, 2, 1, 0)) - del x87 - x88 = np.zeros((nocc, nocc), dtype=types[float]) - x88 += einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - x89 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x89 += einsum(x88, (0, 1), l2, (2, 3, 4, 1), (0, 4, 2, 3)) - x90 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x90 += einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - x91 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x91 += einsum(x90, (0, 1, 2, 3), l3, (4, 5, 3, 6, 2, 1), (0, 6, 4, 5)) - del x90 - x92 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x92 += einsum(x1, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) * -1.0 - x93 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x93 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x93 += einsum(x6, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.5 - x94 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x94 += einsum(t1, (0, 1), x93, (2, 3, 4, 1), (0, 2, 3, 4)) * 2.0 - del x93 - x95 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x95 += einsum(t1, (0, 1), x13, (0, 2, 3, 4), (2, 3, 4, 1)) * 0.5 - del x13 - x96 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x96 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x96 += einsum(x20, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - del x20 - x96 += einsum(x21, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.49999999999998 - del x21 - x96 += einsum(x92, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x92 - x96 += einsum(x22, (0, 1, 2, 3), (0, 1, 2, 3)) - del x22 - x96 += einsum(x94, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - del x94 - x96 += einsum(x95, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x95 - x97 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x97 += einsum(x96, (0, 1, 2, 3), l3, (4, 5, 3, 6, 0, 1), (6, 2, 4, 5)) * -0.5 - del x96 - x98 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x98 += einsum(x44, (0, 1), v.oovv, (2, 1, 3, 4), (0, 2, 3, 4)) * -0.08333333333333 - del x44 - x99 = np.zeros((nocc, nocc), dtype=types[float]) - x99 += einsum(t1, (0, 1), x1, (2, 1), (0, 2)) - x100 = np.zeros((nocc, nocc), dtype=types[float]) - x100 += einsum(x53, (0, 1), (0, 1)) - del x53 - x100 += einsum(x54, (0, 1), (1, 0)) * 0.5 - del x54 - x100 += einsum(x99, (0, 1), (1, 0)) - del x99 - x101 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x101 += einsum(x100, (0, 1), l2, (2, 3, 4, 1), (4, 0, 2, 3)) * -1.0 - x102 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x102 += einsum(x89, (0, 1, 2, 3), (0, 1, 3, 2)) - del x89 - x102 += einsum(x91, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.5 - del x91 - x102 += einsum(x97, (0, 1, 2, 3), (0, 1, 2, 3)) - del x97 - x102 += einsum(x98, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x98 - x102 += einsum(x101, (0, 1, 2, 3), (0, 1, 3, 2)) - del x101 - l2new += einsum(x102, (0, 1, 2, 3), (3, 2, 0, 1)) - l2new += einsum(x102, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - del x102 - x103 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x103 += einsum(f.oo, (0, 1), l2, (2, 3, 4, 1), (0, 4, 2, 3)) - x104 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x104 += einsum(l1, (0, 1), v.ovvv, (2, 0, 3, 4), (1, 2, 3, 4)) - x105 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x105 += einsum(x103, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x103 - x105 += einsum(x104, (0, 1, 2, 3), (0, 1, 3, 2)) - del x104 - l2new += einsum(x105, (0, 1, 2, 3), (2, 3, 0, 1)) - l2new += einsum(x105, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - del x105 - x106 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x106 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x106 += einsum(x10, (0, 1, 2, 3), (1, 0, 3, 2)) - del x10 - x106 += einsum(x12, (0, 1, 2, 3), (3, 0, 2, 1)) * -1.0 - del x12 - l2new += einsum(l2, (0, 1, 2, 3), x106, (2, 3, 4, 5), (0, 1, 4, 5)) * 0.25 - x107 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x107 += einsum(x31, (0, 1, 2, 3), (1, 0, 3, 2)) - del x31 - x107 += einsum(x32, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.33333333333332 - del x32 - x107 += einsum(t1, (0, 1), x33, (2, 3, 4, 1), (3, 2, 4, 0)) * 2.0 - del x33 - l2new += einsum(v.oovv, (0, 1, 2, 3), x107, (4, 5, 0, 1), (2, 3, 5, 4)) * -0.25 - del x107 - x108 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x108 += einsum(x106, (0, 1, 2, 3), l3, (4, 5, 6, 7, 0, 1), (7, 2, 3, 4, 5, 6)) * -0.25 - del x106 - x109 = np.zeros((nocc, nocc), dtype=types[float]) - x109 += einsum(f.oo, (0, 1), (0, 1)) - x109 += einsum(x88, (0, 1), (1, 0)) - del x88 - x110 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x110 += einsum(x109, (0, 1), l3, (2, 3, 4, 5, 6, 0), (5, 6, 1, 2, 3, 4)) - del x109 - x111 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x111 += einsum(x108, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - del x108 - x111 += einsum(x110, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) - del x110 - l3new += einsum(x111, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) * -1.0 - l3new += einsum(x111, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) - l3new += einsum(x111, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -1.0 - del x111 - x112 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x112 += einsum(x100, (0, 1), l3, (2, 3, 4, 5, 6, 1), (5, 6, 0, 2, 3, 4)) - del x100 - l3new += einsum(x112, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - l3new += einsum(x112, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - l3new += einsum(x112, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) - del x112 - x113 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x113 += einsum(v.ooov, (0, 1, 2, 3), x26, (4, 2, 5, 1, 6, 7), (4, 5, 0, 6, 7, 3)) * -1.0 - x114 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x114 += einsum(x4, (0, 1, 2, 3), x26, (0, 4, 5, 2, 6, 7), (5, 4, 1, 6, 7, 3)) * -1.0 - x115 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x115 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x115 += einsum(x6, (0, 1, 2, 3), (0, 1, 2, 3)) - del x6 - x115 += einsum(x7, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.00000000000001 - del x7 - x116 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x116 += einsum(x115, (0, 1, 2, 3), l3, (4, 5, 2, 6, 7, 0), (6, 7, 1, 4, 5, 3)) - del x115 - x117 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x117 += einsum(x113, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x113 - x117 += einsum(x114, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x114 - x117 += einsum(x116, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x116 - l3new += einsum(x117, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) - l3new += einsum(x117, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * -1.0 - l3new += einsum(x117, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * -1.0 - l3new += einsum(x117, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) * -1.0 - l3new += einsum(x117, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) - l3new += einsum(x117, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) - l3new += einsum(x117, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 1, 0)) - l3new += einsum(x117, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) * -1.0 - l3new += einsum(x117, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) * -1.0 - del x117 - x118 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x118 += einsum(f.vv, (0, 1), l3, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - x119 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x119 += einsum(f.ov, (0, 1), x26, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - x120 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x120 += einsum(v.vvvv, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 7), (5, 6, 7, 4, 0, 1)) - x121 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x121 += einsum(v.ovvv, (0, 1, 2, 3), x26, (4, 5, 6, 0, 7, 1), (4, 5, 6, 7, 2, 3)) * -1.0 - x122 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x122 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 7), (5, 6, 7, 0, 1, 4)) - x123 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x123 += einsum(x122, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x122 - x123 += einsum(x27, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -2.0 - del x27 - x124 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x124 += einsum(v.oovv, (0, 1, 2, 3), x123, (4, 5, 6, 0, 1, 7), (4, 5, 6, 7, 2, 3)) * 0.25 - del x123 - x125 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x125 += einsum(x118, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - del x118 - x125 += einsum(x119, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - del x119 - x125 += einsum(x120, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -0.5 - del x120 - x125 += einsum(x121, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - del x121 - x125 += einsum(x124, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - del x124 - l3new += einsum(x125, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) - l3new += einsum(x125, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) - l3new += einsum(x125, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * -1.0 - del x125 - x126 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x126 += einsum(x1, (0, 1), x26, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 6, 1)) - del x1, x26 - x127 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x127 += einsum(x73, (0, 1), l3, (2, 3, 0, 4, 5, 6), (4, 5, 6, 2, 3, 1)) - del x73 - x128 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x128 += einsum(x126, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x126 - x128 += einsum(x127, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) - del x127 - l3new += einsum(x128, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) - l3new += einsum(x128, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -1.0 - l3new += einsum(x128, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - del x128 - x129 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x129 += einsum(l2, (0, 1, 2, 3), v.ovvv, (4, 1, 5, 6), (2, 3, 4, 0, 5, 6)) - x130 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x130 += einsum(v.oovv, (0, 1, 2, 3), x29, (4, 5, 1, 6), (5, 4, 0, 6, 2, 3)) - del x29 - x131 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x131 += einsum(x129, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - del x129 - x131 += einsum(x130, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -0.5 - del x130 - l3new += einsum(x131, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) - l3new += einsum(x131, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - l3new += einsum(x131, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 0, 2)) * -1.0 - l3new += einsum(x131, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) * -1.0 - l3new += einsum(x131, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - l3new += einsum(x131, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) - l3new += einsum(x131, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) - l3new += einsum(x131, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) - l3new += einsum(x131, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 1, 0)) * -1.0 - del x131 - x132 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x132 += einsum(l2, (0, 1, 2, 3), v.ooov, (4, 5, 3, 6), (2, 4, 5, 0, 1, 6)) - x133 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x133 += einsum(v.oovv, (0, 1, 2, 3), x18, (4, 5, 6, 3), (4, 0, 1, 6, 5, 2)) - del x18 - x134 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x134 += einsum(x132, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - del x132 - x134 += einsum(x133, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * 0.5 - del x133 - l3new += einsum(x134, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 1, 2)) - l3new += einsum(x134, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) * -1.0 - l3new += einsum(x134, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 1, 2)) * -1.0 - l3new += einsum(x134, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) * -1.0 - l3new += einsum(x134, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) - l3new += einsum(x134, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - l3new += einsum(x134, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) - l3new += einsum(x134, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -1.0 - l3new += einsum(x134, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - del x134 - x135 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x135 += einsum(f.ov, (0, 1), l2, (2, 3, 4, 5), (0, 4, 5, 1, 2, 3)) - x135 += einsum(l1, (0, 1), v.oovv, (2, 3, 4, 5), (1, 2, 3, 0, 4, 5)) - l3new += einsum(x135, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 1, 2)) - l3new += einsum(x135, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 1, 2)) * -1.0 - l3new += einsum(x135, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) - l3new += einsum(x135, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) * -1.0 - l3new += einsum(x135, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) - l3new += einsum(x135, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * -1.0 - l3new += einsum(x135, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) - l3new += einsum(x135, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) * -1.0 - l3new += einsum(x135, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) - del x135 - x136 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x136 += einsum(l2, (0, 1, 2, 3), x4, (3, 4, 5, 6), (2, 5, 4, 0, 1, 6)) * -1.0 - del x4 - l3new += einsum(x136, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * -1.0 - l3new += einsum(x136, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * -1.0 - l3new += einsum(x136, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) - l3new += einsum(x136, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 0, 1)) - l3new += einsum(x136, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 0, 1)) - l3new += einsum(x136, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 0, 1)) * -1.0 - l3new += einsum(x136, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) * -1.0 - l3new += einsum(x136, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) * -1.0 - l3new += einsum(x136, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 1, 0)) - del x136 - x137 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x137 += einsum(v.oovv, (0, 1, 2, 3), x28, (4, 5, 1, 6), (4, 5, 0, 6, 2, 3)) - del x28 - l3new += einsum(x137, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 0, 2)) - l3new += einsum(x137, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * -1.0 - l3new += einsum(x137, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * -1.0 - l3new += einsum(x137, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 2, 0)) * -1.0 - l3new += einsum(x137, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) - l3new += einsum(x137, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) - l3new += einsum(x137, (0, 1, 2, 3, 4, 5), (3, 5, 4, 2, 1, 0)) - l3new += einsum(x137, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) * -1.0 - l3new += einsum(x137, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) * -1.0 - del x137 - - return {"l1new": l1new, "l2new": l2new, "l3new": l3new} - -def make_rdm1_f(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, l1=None, l2=None, l3=None, **kwargs): - delta = Namespace(oo=np.eye(nocc), vv=np.eye(nvir)) - - # RDM1 - rdm1_f_oo = np.zeros((nocc, nocc), dtype=types[float]) - rdm1_f_oo += einsum(delta.oo, (0, 1), (0, 1)) - rdm1_f_ov = np.zeros((nocc, nvir), dtype=types[float]) - rdm1_f_ov += einsum(t1, (0, 1), (0, 1)) - rdm1_f_ov += einsum(l2, (0, 1, 2, 3), t3, (4, 2, 3, 5, 0, 1), (4, 5)) * 0.25 - rdm1_f_ov += einsum(l1, (0, 1), t2, (2, 1, 3, 0), (2, 3)) - rdm1_f_vo = np.zeros((nvir, nocc), dtype=types[float]) - rdm1_f_vo += einsum(l1, (0, 1), (0, 1)) - rdm1_f_vv = np.zeros((nvir, nvir), dtype=types[float]) - rdm1_f_vv += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 4, 5, 6, 1, 2), (0, 6)) * 0.08333333333333 - rdm1_f_vv += einsum(l2, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) * 0.5 - rdm1_f_vv += einsum(l1, (0, 1), t1, (1, 2), (0, 2)) - x0 = np.zeros((nocc, nocc), dtype=types[float]) - x0 += einsum(l2, (0, 1, 2, 3), t2, (4, 3, 0, 1), (2, 4)) - rdm1_f_oo += einsum(x0, (0, 1), (1, 0)) * -0.5 - x1 = np.zeros((nocc, nocc), dtype=types[float]) - x1 += einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - rdm1_f_oo += einsum(x1, (0, 1), (1, 0)) * -1.0 - x2 = np.zeros((nocc, nocc), dtype=types[float]) - x2 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 4, 5, 0, 1, 2), (3, 6)) - rdm1_f_oo += einsum(x2, (0, 1), (1, 0)) * -0.08333333333333 - x3 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x3 += einsum(t1, (0, 1), l3, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - rdm1_f_ov += einsum(t3, (0, 1, 2, 3, 4, 5), x3, (0, 1, 2, 6, 5, 4), (6, 3)) * 0.08333333333333 - del x3 - x4 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x4 += einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - x4 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) * 0.5 - rdm1_f_ov += einsum(t2, (0, 1, 2, 3), x4, (0, 1, 4, 3), (4, 2)) * 0.5 - del x4 - x5 = np.zeros((nocc, nocc), dtype=types[float]) - x5 += einsum(x1, (0, 1), (0, 1)) - del x1 - x5 += einsum(x0, (0, 1), (0, 1)) * 0.5 - del x0 - x5 += einsum(x2, (0, 1), (0, 1)) * 0.08333333333333 - del x2 - rdm1_f_ov += einsum(t1, (0, 1), x5, (0, 2), (2, 1)) * -1.0 - del x5 - - rdm1_f = np.block([[rdm1_f_oo, rdm1_f_ov], [rdm1_f_vo, rdm1_f_vv]]) - - return rdm1_f - -def make_rdm2_f(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, l1=None, l2=None, l3=None, **kwargs): - delta = Namespace(oo=np.eye(nocc), vv=np.eye(nvir)) - - # RDM2 - rdm2_f_oooo = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - rdm2_f_oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_ovoo = np.zeros((nocc, nvir, nocc, nocc), dtype=types[float]) - rdm2_f_ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 1, 3)) - rdm2_f_ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_vooo = np.zeros((nvir, nocc, nocc, nocc), dtype=types[float]) - rdm2_f_vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 3, 1)) - rdm2_f_oovv = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - rdm2_f_oovv += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(l1, (0, 1), t3, (2, 3, 1, 4, 5, 0), (2, 3, 4, 5)) - rdm2_f_oovv += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_oovv += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - rdm2_f_ovov = np.zeros((nocc, nvir, nocc, nvir), dtype=types[float]) - rdm2_f_ovov += einsum(l1, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_ovvo = np.zeros((nocc, nvir, nvir, nocc), dtype=types[float]) - rdm2_f_ovvo += einsum(l1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2_f_voov = np.zeros((nvir, nocc, nocc, nvir), dtype=types[float]) - rdm2_f_voov += einsum(l1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - rdm2_f_vovo = np.zeros((nvir, nocc, nvir, nocc), dtype=types[float]) - rdm2_f_vovo += einsum(l1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_vvoo = np.zeros((nvir, nvir, nocc, nocc), dtype=types[float]) - rdm2_f_vvoo += einsum(l2, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_vvvv = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - rdm2_f_vvvv += einsum(l2, (0, 1, 2, 3), t2, (2, 3, 4, 5), (0, 1, 4, 5)) * 0.5 - rdm2_f_vvvv += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 4, 5, 6, 7, 2), (0, 1, 6, 7)) * 0.16666666666667 - x0 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x0 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 7, 5, 0, 1, 2), (3, 4, 6, 7)) - rdm2_f_oooo += einsum(x0, (0, 1, 2, 3), (2, 3, 1, 0)) * -0.16666666666667 - x1 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x1 += einsum(l2, (0, 1, 2, 3), t2, (4, 5, 0, 1), (2, 3, 4, 5)) - rdm2_f_oooo += einsum(x1, (0, 1, 2, 3), (3, 2, 1, 0)) * 0.5 - x2 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x2 += einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - rdm2_f_ovoo += einsum(x2, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - rdm2_f_vooo += einsum(x2, (0, 1, 2, 3), (3, 2, 1, 0)) - x3 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x3 += einsum(t1, (0, 1), x2, (2, 3, 4, 1), (2, 3, 0, 4)) - rdm2_f_oooo += einsum(x3, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - x4 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x4 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) - rdm2_f_ovoo += einsum(x4, (0, 1, 2, 3), (2, 3, 1, 0)) * -0.5 - rdm2_f_vooo += einsum(x4, (0, 1, 2, 3), (3, 2, 1, 0)) * 0.5 - x5 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x5 += einsum(t1, (0, 1), x4, (2, 3, 4, 1), (2, 3, 0, 4)) - rdm2_f_oooo += einsum(x5, (0, 1, 2, 3), (2, 3, 1, 0)) * -0.5 - rdm2_f_oooo += einsum(x5, (0, 1, 2, 3), (3, 2, 1, 0)) * 0.5 - x6 = np.zeros((nocc, nocc), dtype=types[float]) - x6 += einsum(l2, (0, 1, 2, 3), t2, (4, 3, 0, 1), (2, 4)) - x7 = np.zeros((nocc, nocc), dtype=types[float]) - x7 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 4, 5, 0, 1, 2), (3, 6)) - x8 = np.zeros((nocc, nocc), dtype=types[float]) - x8 += einsum(x6, (0, 1), (0, 1)) - x8 += einsum(x7, (0, 1), (0, 1)) * 0.16666666666666 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x8, (2, 3), (0, 3, 1, 2)) * -0.5 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x8, (2, 3), (0, 3, 2, 1)) * 0.5 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x8, (2, 3), (3, 0, 1, 2)) * 0.5 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x8, (2, 3), (3, 0, 2, 1)) * -0.5 - del x8 - x9 = np.zeros((nocc, nocc), dtype=types[float]) - x9 += einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), x9, (2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x9, (2, 3), (3, 0, 1, 2)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), x9, (2, 3), (0, 3, 2, 1)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), x9, (2, 3), (3, 0, 2, 1)) * -1.0 - x10 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x10 += einsum(l1, (0, 1), t2, (2, 3, 4, 0), (1, 2, 3, 4)) - rdm2_f_ooov = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - rdm2_f_ooov += einsum(x10, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_oovo = np.zeros((nocc, nocc, nvir, nocc), dtype=types[float]) - rdm2_f_oovo += einsum(x10, (0, 1, 2, 3), (2, 1, 3, 0)) - x11 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x11 += einsum(l2, (0, 1, 2, 3), t3, (4, 5, 3, 6, 0, 1), (2, 4, 5, 6)) - rdm2_f_ooov += einsum(x11, (0, 1, 2, 3), (1, 2, 0, 3)) * 0.5 - rdm2_f_oovo += einsum(x11, (0, 1, 2, 3), (1, 2, 3, 0)) * -0.5 - x12 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x12 += einsum(t2, (0, 1, 2, 3), l3, (4, 5, 3, 6, 0, 1), (6, 4, 5, 2)) - rdm2_f_vvov = np.zeros((nvir, nvir, nocc, nvir), dtype=types[float]) - rdm2_f_vvov += einsum(x12, (0, 1, 2, 3), (1, 2, 0, 3)) * 0.5 - rdm2_f_vvvo = np.zeros((nvir, nvir, nvir, nocc), dtype=types[float]) - rdm2_f_vvvo += einsum(x12, (0, 1, 2, 3), (1, 2, 3, 0)) * -0.5 - x13 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x13 += einsum(t2, (0, 1, 2, 3), x12, (4, 3, 2, 5), (4, 0, 1, 5)) * -1.0 - rdm2_f_ooov += einsum(x13, (0, 1, 2, 3), (1, 2, 0, 3)) * 0.25 - rdm2_f_oovo += einsum(x13, (0, 1, 2, 3), (1, 2, 3, 0)) * -0.25 - x14 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x14 += einsum(t1, (0, 1), l3, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - x15 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x15 += einsum(t1, (0, 1), x14, (2, 3, 4, 5, 1, 6), (2, 3, 4, 5, 0, 6)) - x16 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x16 += einsum(t2, (0, 1, 2, 3), x15, (4, 1, 0, 5, 6, 3), (4, 6, 5, 2)) - rdm2_f_ooov += einsum(x16, (0, 1, 2, 3), (1, 2, 0, 3)) * 0.5 - rdm2_f_oovo += einsum(x16, (0, 1, 2, 3), (1, 2, 3, 0)) * -0.5 - x17 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x17 += einsum(t3, (0, 1, 2, 3, 4, 5), x14, (6, 1, 2, 7, 4, 5), (6, 7, 0, 3)) - x18 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x18 += einsum(t1, (0, 1), x5, (0, 2, 3, 4), (2, 3, 4, 1)) * -1.0 - x19 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x19 += einsum(x2, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x19 += einsum(x4, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x20 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x20 += einsum(t2, (0, 1, 2, 3), x19, (1, 4, 5, 3), (4, 5, 0, 2)) - x21 = np.zeros((nocc, nocc), dtype=types[float]) - x21 += einsum(x9, (0, 1), (0, 1)) * 12.00000000000048 - x21 += einsum(x6, (0, 1), (0, 1)) * 6.00000000000024 - x21 += einsum(x7, (0, 1), (0, 1)) - x22 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x22 += einsum(delta.oo, (0, 1), t1, (2, 3), (0, 1, 2, 3)) - x22 += einsum(x17, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.25 - x22 += einsum(x18, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - del x18 - x22 += einsum(x20, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x20 - x22 += einsum(t1, (0, 1), x21, (2, 3), (0, 2, 3, 1)) * 0.08333333333333 - rdm2_f_ooov += einsum(x22, (0, 1, 2, 3), (0, 2, 1, 3)) - rdm2_f_ooov += einsum(x22, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_oovo += einsum(x22, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_oovo += einsum(x22, (0, 1, 2, 3), (2, 0, 3, 1)) - del x22 - x23 = np.zeros((nocc, nvir), dtype=types[float]) - x23 += einsum(l1, (0, 1), t2, (2, 1, 3, 0), (2, 3)) - x24 = np.zeros((nocc, nvir), dtype=types[float]) - x24 += einsum(l2, (0, 1, 2, 3), t3, (4, 2, 3, 5, 0, 1), (4, 5)) - x25 = np.zeros((nocc, nvir), dtype=types[float]) - x25 += einsum(t3, (0, 1, 2, 3, 4, 5), x14, (0, 1, 2, 6, 4, 5), (6, 3)) - x26 = np.zeros((nocc, nvir), dtype=types[float]) - x26 += einsum(t2, (0, 1, 2, 3), x19, (0, 1, 4, 3), (4, 2)) * -0.5 - x27 = np.zeros((nocc, nvir), dtype=types[float]) - x27 += einsum(t1, (0, 1), x21, (0, 2), (2, 1)) * 0.08333333333333 - del x21 - x28 = np.zeros((nocc, nvir), dtype=types[float]) - x28 += einsum(x23, (0, 1), (0, 1)) * -1.0 - del x23 - x28 += einsum(x24, (0, 1), (0, 1)) * -0.25 - del x24 - x28 += einsum(x25, (0, 1), (0, 1)) * 0.08333333333333 - del x25 - x28 += einsum(x26, (0, 1), (0, 1)) - del x26 - x28 += einsum(x27, (0, 1), (0, 1)) - del x27 - rdm2_f_ooov += einsum(delta.oo, (0, 1), x28, (2, 3), (0, 2, 1, 3)) * -1.0 - rdm2_f_ooov += einsum(delta.oo, (0, 1), x28, (2, 3), (2, 0, 1, 3)) - rdm2_f_oovo += einsum(delta.oo, (0, 1), x28, (2, 3), (0, 2, 3, 1)) - rdm2_f_oovo += einsum(delta.oo, (0, 1), x28, (2, 3), (2, 0, 3, 1)) * -1.0 - x29 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x29 += einsum(x1, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - x29 += einsum(x3, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - x29 += einsum(x0, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.33333333333334 - x30 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x30 += einsum(t1, (0, 1), x29, (0, 2, 3, 4), (2, 3, 4, 1)) * 0.5 - del x29 - rdm2_f_ooov += einsum(x30, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_oovo += einsum(x30, (0, 1, 2, 3), (2, 1, 3, 0)) - del x30 - x31 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x31 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 4, 5, 7, 1, 2), (3, 6, 0, 7)) - rdm2_f_ovov += einsum(x31, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.25 - rdm2_f_ovvo += einsum(x31, (0, 1, 2, 3), (1, 2, 3, 0)) * 0.25 - rdm2_f_voov += einsum(x31, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.25 - rdm2_f_vovo += einsum(x31, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.25 - x32 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x32 += einsum(t2, (0, 1, 2, 3), x31, (1, 4, 3, 5), (0, 4, 2, 5)) - x33 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x33 += einsum(t2, (0, 1, 2, 3), x14, (4, 1, 0, 5, 6, 3), (4, 5, 6, 2)) - rdm2_f_ovov += einsum(x33, (0, 1, 2, 3), (1, 2, 0, 3)) * 0.5 - rdm2_f_ovvo += einsum(x33, (0, 1, 2, 3), (1, 2, 3, 0)) * -0.5 - rdm2_f_voov += einsum(x33, (0, 1, 2, 3), (2, 1, 0, 3)) * -0.5 - rdm2_f_vovo += einsum(x33, (0, 1, 2, 3), (2, 1, 3, 0)) * 0.5 - x34 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x34 += einsum(t1, (0, 1), x4, (0, 2, 3, 4), (2, 3, 4, 1)) * -1.0 - x35 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x35 += einsum(x33, (0, 1, 2, 3), (0, 1, 2, 3)) - x35 += einsum(x34, (0, 1, 2, 3), (0, 1, 2, 3)) - del x34 - x36 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x36 += einsum(t2, (0, 1, 2, 3), x35, (1, 4, 3, 5), (4, 0, 5, 2)) * 0.5 - del x35 - x37 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x37 += einsum(t2, (0, 1, 2, 3), x2, (4, 1, 5, 3), (4, 5, 0, 2)) * -1.0 - x38 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x38 += einsum(x37, (0, 1, 2, 3), (0, 1, 2, 3)) - del x37 - x38 += einsum(x17, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - del x17 - x39 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x39 += einsum(t1, (0, 1), x38, (0, 2, 3, 4), (2, 3, 1, 4)) - del x38 - x40 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x40 += einsum(x32, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.25 - del x32 - x40 += einsum(x36, (0, 1, 2, 3), (0, 1, 2, 3)) - del x36 - x40 += einsum(x39, (0, 1, 2, 3), (0, 1, 2, 3)) - del x39 - x40 += einsum(t1, (0, 1), x28, (2, 3), (0, 2, 1, 3)) - del x28 - rdm2_f_oovv += einsum(x40, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x40, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_oovv += einsum(x40, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_oovv += einsum(x40, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x40 - x41 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x41 += einsum(x7, (0, 1), t2, (2, 0, 3, 4), (2, 1, 3, 4)) - del x7 - x42 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x42 += einsum(x4, (0, 1, 2, 3), t3, (4, 0, 1, 5, 6, 3), (2, 4, 5, 6)) - x43 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x43 += einsum(x41, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.08333333333333 - del x41 - x43 += einsum(x42, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - del x42 - rdm2_f_oovv += einsum(x43, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x43, (0, 1, 2, 3), (1, 0, 2, 3)) - del x43 - x44 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x44 += einsum(l2, (0, 1, 2, 3), t2, (4, 3, 5, 1), (2, 4, 0, 5)) - rdm2_f_ovov += einsum(x44, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_ovvo += einsum(x44, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_voov += einsum(x44, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_vovo += einsum(x44, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x45 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x45 += einsum(t2, (0, 1, 2, 3), x44, (1, 4, 3, 5), (4, 0, 5, 2)) - x46 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x46 += einsum(x12, (0, 1, 2, 3), t3, (4, 5, 0, 6, 1, 2), (4, 5, 3, 6)) - x47 = np.zeros((nvir, nvir), dtype=types[float]) - x47 += einsum(l2, (0, 1, 2, 3), t2, (2, 3, 4, 1), (0, 4)) - x48 = np.zeros((nvir, nvir), dtype=types[float]) - x48 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 4, 5, 6, 1, 2), (0, 6)) - x49 = np.zeros((nvir, nvir), dtype=types[float]) - x49 += einsum(x47, (0, 1), (0, 1)) - x49 += einsum(x48, (0, 1), (0, 1)) * 0.16666666666666 - x50 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x50 += einsum(x49, (0, 1), t2, (2, 3, 4, 0), (2, 3, 1, 4)) * -0.5 - del x49 - x51 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x51 += einsum(x10, (0, 1, 2, 3), (0, 2, 1, 3)) - del x10 - x51 += einsum(x11, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.5 - del x11 - x51 += einsum(x13, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.25 - del x13 - x51 += einsum(x16, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.5 - del x16 - x52 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x52 += einsum(t1, (0, 1), x51, (0, 2, 3, 4), (2, 3, 1, 4)) - del x51 - x53 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x53 += einsum(x45, (0, 1, 2, 3), (0, 1, 2, 3)) - del x45 - x53 += einsum(x46, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.25 - del x46 - x53 += einsum(x50, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x50 - x53 += einsum(x52, (0, 1, 2, 3), (1, 0, 2, 3)) - del x52 - rdm2_f_oovv += einsum(x53, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x53, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x53 - x54 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x54 += einsum(x9, (0, 1), t2, (2, 0, 3, 4), (1, 2, 3, 4)) - del x9 - x55 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x55 += einsum(x2, (0, 1, 2, 3), t3, (4, 1, 0, 5, 6, 3), (2, 4, 5, 6)) - x56 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x56 += einsum(x6, (0, 1), t2, (2, 0, 3, 4), (2, 1, 3, 4)) - del x6 - x57 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x57 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * 2.0 - x57 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x58 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x58 += einsum(x5, (0, 1, 2, 3), x57, (0, 1, 4, 5), (2, 3, 4, 5)) * 0.25 - del x5, x57 - x59 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x59 += einsum(x54, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x54 - x59 += einsum(x55, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.5 - del x55 - x59 += einsum(x56, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.5 - del x56 - x59 += einsum(x58, (0, 1, 2, 3), (0, 1, 3, 2)) - del x58 - rdm2_f_oovv += einsum(x59, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x59, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x59 - x60 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x60 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 7), (5, 6, 7, 0, 1, 4)) - x60 += einsum(x15, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -2.00000000000012 - del x15 - rdm2_f_oovv += einsum(t3, (0, 1, 2, 3, 4, 5), x60, (0, 1, 2, 6, 7, 5), (6, 7, 3, 4)) * 0.08333333333333 - del x60 - x61 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x61 += einsum(x1, (0, 1, 2, 3), (1, 0, 3, 2)) * -3.00000000000012 - x61 += einsum(x3, (0, 1, 2, 3), (0, 1, 3, 2)) * 6.00000000000024 - x61 += einsum(x0, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_oovv += einsum(t2, (0, 1, 2, 3), x61, (0, 1, 4, 5), (5, 4, 2, 3)) * 0.08333333333333 - del x61 - x62 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x62 += einsum(x1, (0, 1, 2, 3), (1, 0, 3, 2)) * -2.99999999999994 - del x1 - x62 += einsum(x3, (0, 1, 2, 3), (0, 1, 3, 2)) * 5.99999999999988 - del x3 - x62 += einsum(x0, (0, 1, 2, 3), (0, 1, 3, 2)) - del x0 - x63 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x63 += einsum(t1, (0, 1), x62, (0, 2, 3, 4), (2, 4, 3, 1)) * -0.16666666666667 - del x62 - rdm2_f_oovv += einsum(t1, (0, 1), x63, (0, 2, 3, 4), (2, 3, 4, 1)) * -1.0 - del x63 - x64 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x64 += einsum(x2, (0, 1, 2, 3), (1, 0, 2, 3)) * -2.0 - del x2 - x64 += einsum(x4, (0, 1, 2, 3), (0, 1, 2, 3)) - del x4 - x65 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x65 += einsum(t1, (0, 1), x64, (0, 2, 3, 4), (2, 3, 1, 4)) * 0.5 - del x64 - rdm2_f_ovov += einsum(x65, (0, 1, 2, 3), (1, 3, 0, 2)) * -1.0 - rdm2_f_ovvo += einsum(x65, (0, 1, 2, 3), (1, 3, 2, 0)) - rdm2_f_voov += einsum(x65, (0, 1, 2, 3), (3, 1, 0, 2)) - rdm2_f_vovo += einsum(x65, (0, 1, 2, 3), (3, 1, 2, 0)) * -1.0 - del x65 - x66 = np.zeros((nvir, nvir), dtype=types[float]) - x66 += einsum(l1, (0, 1), t1, (1, 2), (0, 2)) - x67 = np.zeros((nvir, nvir), dtype=types[float]) - x67 += einsum(x66, (0, 1), (0, 1)) * 12.00000000000048 - x67 += einsum(x47, (0, 1), (0, 1)) * 6.00000000000024 - x67 += einsum(x48, (0, 1), (0, 1)) - rdm2_f_ovov += einsum(delta.oo, (0, 1), x67, (2, 3), (0, 2, 1, 3)) * 0.08333333333333 - rdm2_f_voov += einsum(delta.oo, (0, 1), x67, (2, 3), (2, 0, 1, 3)) * -0.08333333333333 - del x67 - x68 = np.zeros((nvir, nvir), dtype=types[float]) - x68 += einsum(x66, (0, 1), (0, 1)) * 2.0 - x68 += einsum(x47, (0, 1), (0, 1)) - x68 += einsum(x48, (0, 1), (0, 1)) * 0.16666666666666 - rdm2_f_ovvo += einsum(delta.oo, (0, 1), x68, (2, 3), (0, 2, 3, 1)) * -0.5 - rdm2_f_vovo += einsum(delta.oo, (0, 1), x68, (2, 3), (2, 0, 3, 1)) * 0.5 - del x68 - x69 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x69 += einsum(l2, (0, 1, 2, 3), t3, (4, 2, 3, 5, 6, 1), (4, 0, 5, 6)) - rdm2_f_ovvv = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - rdm2_f_ovvv += einsum(x69, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.5 - rdm2_f_vovv = np.zeros((nvir, nocc, nvir, nvir), dtype=types[float]) - rdm2_f_vovv += einsum(x69, (0, 1, 2, 3), (1, 0, 3, 2)) * 0.5 - del x69 - x70 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x70 += einsum(t3, (0, 1, 2, 3, 4, 5), x14, (0, 1, 2, 6, 7, 5), (6, 7, 3, 4)) * -1.0 - del x14 - rdm2_f_ovvv += einsum(x70, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.16666666666667 - rdm2_f_vovv += einsum(x70, (0, 1, 2, 3), (1, 0, 3, 2)) * 0.16666666666667 - del x70 - x71 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x71 += einsum(l1, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) - rdm2_f_ovvv += einsum(x71, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_vovv += einsum(x71, (0, 1, 2, 3), (1, 0, 3, 2)) - del x71 - x72 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x72 += einsum(t2, (0, 1, 2, 3), x12, (1, 4, 3, 5), (0, 4, 5, 2)) * -1.0 - x73 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x73 += einsum(x44, (0, 1, 2, 3), (0, 1, 2, 3)) - del x44 - x73 += einsum(x31, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - del x31 - x73 += einsum(x33, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x33 - x74 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x74 += einsum(t1, (0, 1), x73, (0, 2, 3, 4), (2, 1, 3, 4)) - del x73 - x75 = np.zeros((nvir, nvir), dtype=types[float]) - x75 += einsum(x66, (0, 1), (0, 1)) - del x66 - x75 += einsum(x47, (0, 1), (0, 1)) * 0.5 - del x47 - x75 += einsum(x48, (0, 1), (0, 1)) * 0.08333333333333 - del x48 - x76 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x76 += einsum(x72, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x72 - x76 += einsum(x74, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x74 - x76 += einsum(t1, (0, 1), x75, (2, 3), (0, 2, 1, 3)) - del x75 - rdm2_f_ovvv += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_ovvv += einsum(x76, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_vovv += einsum(x76, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_vovv += einsum(x76, (0, 1, 2, 3), (1, 0, 3, 2)) - del x76 - x77 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x77 += einsum(t2, (0, 1, 2, 3), x19, (0, 1, 4, 5), (4, 5, 2, 3)) * 0.5 - rdm2_f_ovvv += einsum(x77, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_vovv += einsum(x77, (0, 1, 2, 3), (1, 0, 3, 2)) - del x77 - x78 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x78 += einsum(t1, (0, 1), x19, (0, 2, 3, 4), (2, 3, 4, 1)) * -1.0 - rdm2_f_ovvv += einsum(t1, (0, 1), x78, (0, 2, 3, 4), (2, 3, 1, 4)) - del x78 - x79 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x79 += einsum(t1, (0, 1), x19, (0, 2, 3, 4), (2, 3, 4, 1)) * -2.0 - del x19 - rdm2_f_vovv += einsum(t1, (0, 1), x79, (0, 2, 3, 4), (3, 2, 4, 1)) * 0.5 - del x79 - x80 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x80 += einsum(t1, (0, 1), l2, (2, 3, 4, 0), (4, 2, 3, 1)) - rdm2_f_vvov += einsum(x80, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_vvvo += einsum(x80, (0, 1, 2, 3), (2, 1, 3, 0)) - rdm2_f_vvvv += einsum(t1, (0, 1), x80, (0, 2, 3, 4), (2, 3, 1, 4)) - del x80 - x81 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x81 += einsum(t1, (0, 1), x12, (0, 2, 3, 4), (3, 2, 1, 4)) * -1.0 - del x12 - rdm2_f_vvvv += einsum(x81, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - rdm2_f_vvvv += einsum(x81, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.5 - del x81 - - rdm2_f = pack_2e(rdm2_f_oooo, rdm2_f_ooov, rdm2_f_oovo, rdm2_f_ovoo, rdm2_f_vooo, rdm2_f_oovv, rdm2_f_ovov, rdm2_f_ovvo, rdm2_f_voov, rdm2_f_vovo, rdm2_f_vvoo, rdm2_f_ovvv, rdm2_f_vovv, rdm2_f_vvov, rdm2_f_vvvo, rdm2_f_vvvv) - - rdm2_f = np.transpose(rdm2_f, (0, 2, 1, 3)) - - return rdm2_f - diff --git a/ebcc/codegen/GCCSDwtwp.py b/ebcc/codegen/GCCSDwtwp.py deleted file mode 100644 index 8e0ef679..00000000 --- a/ebcc/codegen/GCCSDwtwp.py +++ /dev/null @@ -1,890 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:18:28.820515 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace -from ebcc.backend import _inflate - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:18:29.071491. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(t2) - tmp0 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - e_cc = einsum(f.ov, (0, 1), t1, (0, 1), ()) - e_cc += einsum(tmp0, (0, 1, 2, 3), v.oovv, (0, 1, 2, 3), ()) * 0.25 - del tmp0 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, t3=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:19:16.670741. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - t3 : array - T3 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - t3new : array - Updated T3 residuals. - """ - - space = kwargs["space"] - t1new = Namespace() - t2new = Namespace() - t3new = Namespace() - so = np.ones((t1.shape[0],), dtype=bool) - sv = np.ones((t1.shape[1],), dtype=bool) - sO = space.active[space.correlated][space.occupied[space.correlated]] - sV = space.active[space.correlated][space.virtual[space.correlated]] - t2_OOvv = np.copy(t2[np.ix_(sO, sO, sv, sv)]) - t2_OoVv = np.copy(t2[np.ix_(sO, so, sV, sv)]) - t1_ov = np.copy(t1[np.ix_(so, sv)]) - t1_Ov = np.copy(t1[np.ix_(sO, sv)]) - t2_oovv = np.copy(t2[np.ix_(so, so, sv, sv)]) - t2_OoVV = np.copy(t2[np.ix_(sO, so, sV, sV)]) - t2_ooVv = np.copy(t2[np.ix_(so, so, sV, sv)]) - t2_Oovv = np.copy(t2[np.ix_(sO, so, sv, sv)]) - t1_oV = np.copy(t1[np.ix_(so, sV)]) - t2_OOVv = np.copy(t2[np.ix_(sO, sO, sV, sv)]) - t2_ooVV = np.copy(t2[np.ix_(so, so, sV, sV)]) - - tmp110 = einsum(t1_Ov, (0, 1), v.oovv, (2, 3, 4, 1), (2, 3, 4, 0)) - tmp140 = einsum(v.OoVv, (0, 1, 2, 3), t1_Ov, (4, 3), (1, 4, 0, 2)) - tmp115 = einsum(t1_oV, (0, 1), v.oovv, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp137 = einsum(t1_Ov, (0, 1), v.OOvv, (2, 3, 4, 1), (4, 0, 2, 3)) - tmp123 = einsum(t1_oV, (0, 1), v.Ovoo, (2, 3, 4, 0), (4, 3, 2, 1)) * -1 - tmp126 = einsum(v.Vovv, (0, 1, 2, 3), t1_Ov, (4, 3), (1, 2, 4, 0)) * -1 - tmp146 = einsum(t1_Ov, (0, 1), tmp110, (2, 3, 1, 4), (3, 2, 4, 0)) - tmp1 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp143 = einsum(v.VVoo, (0, 1, 2, 3), t1_oV, (3, 4), (2, 4, 0, 1)) - tmp120 = einsum(v.Ovoo, (0, 1, 2, 3), t1_Ov, (4, 1), (2, 3, 4, 0)) * -1 - tmp131 = einsum(v.Oovv, (0, 1, 2, 3), t1, (1, 3), (2, 0)) * -1 - tmp149 = einsum(t1_oV, (0, 1), tmp110, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp134 = einsum(t1, (0, 1), v.Vvoo, (2, 1, 3, 0), (3, 2)) * -1 - tmp2 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp18 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp23 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp104 = einsum(v.Vovv, (0, 1, 2, 3), t2_OOvv, (4, 5, 2, 3), (1, 4, 5, 0)) * -1 - tmp87 = einsum(v.Oovv, (0, 1, 2, 3), t2_Oovv, (4, 1, 2, 3), (4, 0)) - tmp100 = einsum(t2_OoVv, (0, 1, 2, 3), v.Ovoo, (4, 3, 5, 1), (5, 0, 4, 2)) * -1 - tmp106 = einsum(v.Vovv, (0, 1, 2, 3), t2_OoVv, (4, 1, 5, 3), (2, 4, 5, 0)) * -1 - tmp141 = einsum(tmp140, (0, 1, 2, 3), t1_oV, (0, 4), (1, 2, 4, 3)) - del tmp140 - tmp118 = einsum(tmp115, (0, 1, 2, 3), t2_OoVv, (4, 0, 5, 1), (2, 4, 3, 5)) - tmp138 = einsum(t1_Ov, (0, 1), tmp137, (1, 2, 3, 4), (2, 0, 4, 3)) - del tmp137 - tmp102 = einsum(t2_ooVV, (0, 1, 2, 3), v.Ovoo, (4, 5, 0, 1), (5, 4, 2, 3)) * -1 - tmp56 = einsum(f.Ov, (0, 1), t1_Ov, (2, 1), (0, 2)) - tmp97 = einsum(t2_ooVV, (0, 1, 2, 3), v.VVoo, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp124 = einsum(tmp123, (0, 1, 2, 3), t1_oV, (0, 4), (1, 2, 3, 4)) * -1 - del tmp123 - tmp129 = einsum(tmp126, (0, 1, 2, 3), t1_oV, (0, 4), (1, 2, 4, 3)) - tmp147 = einsum(t1_oV, (0, 1), tmp146, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - del tmp146 - tmp108 = einsum(t2_OOVv, (0, 1, 2, 3), tmp1, (4, 3), (4, 0, 1, 2)) - tmp116 = einsum(tmp115, (0, 1, 2, 3), t2_OOvv, (4, 5, 2, 1), (0, 4, 5, 3)) * -1 - del tmp115 - tmp85 = einsum(v.VoVV, (0, 1, 2, 3), t1_oV, (1, 4), (4, 0, 2, 3)) * -1 - tmp111 = einsum(t2_OoVv, (0, 1, 2, 3), tmp110, (1, 4, 3, 5), (4, 5, 0, 2)) - tmp91 = einsum(t2_ooVv, (0, 1, 2, 3), v.Vvoo, (4, 3, 0, 1), (2, 4)) - tmp144 = einsum(t1_oV, (0, 1), tmp143, (0, 2, 3, 4), (2, 1, 4, 3)) - del tmp143 - tmp113 = einsum(t2_ooVV, (0, 1, 2, 3), tmp110, (1, 0, 4, 5), (4, 5, 2, 3)) * -1 - del tmp110 - tmp93 = einsum(v.OoVv, (0, 1, 2, 3), t2_OoVv, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp121 = einsum(t1_oV, (0, 1), tmp120, (2, 0, 3, 4), (2, 3, 4, 1)) - del tmp120 - tmp69 = einsum(v.OvVo, (0, 1, 2, 3), t1_Ov, (4, 1), (3, 4, 0, 2)) - tmp132 = einsum(tmp131, (0, 1), t1_Ov, (2, 0), (2, 1)) * -1 - del tmp131 - tmp150 = einsum(tmp149, (0, 1, 2, 3), t1_oV, (0, 4), (1, 2, 3, 4)) * -1 - del tmp149 - tmp71 = einsum(v.OvVo, (0, 1, 2, 3), t1_oV, (3, 4), (1, 0, 4, 2)) - tmp127 = einsum(t1_Ov, (0, 1), tmp126, (2, 1, 3, 4), (2, 3, 0, 4)) * -1 - del tmp126 - tmp75 = einsum(v.OoOv, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp60 = einsum(f.ov, (0, 1), t2_OOVv, (2, 3, 4, 1), (0, 2, 3, 4)) * -1 - tmp30 = einsum(t3, (0, 1, 2, 3, 4, 5), v.OoVV, (2, 6, 4, 5), (6, 0, 1, 3)) * -1 - tmp79 = einsum(v.OoOV, (0, 1, 2, 3), t1_oV, (1, 4), (0, 2, 4, 3)) * -1 - tmp73 = einsum(v.VVvv, (0, 1, 2, 3), t1_Ov, (4, 3), (2, 4, 0, 1)) - tmp77 = einsum(v.OvOO, (0, 1, 2, 3), t1_Ov, (4, 1), (4, 0, 2, 3)) * -1 - tmp81 = einsum(v.VoVv, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp89 = einsum(v.OOvv, (0, 1, 2, 3), t2_OOvv, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp83 = einsum(v.OVVv, (0, 1, 2, 3), t1_Ov, (4, 3), (4, 0, 2, 1)) * -1 - tmp67 = einsum(t1_oV, (0, 1), v.OOoo, (2, 3, 4, 0), (4, 2, 3, 1)) - tmp95 = einsum(t2_OOVv, (0, 1, 2, 3), v.OOVv, (4, 5, 6, 3), (0, 1, 4, 5, 2, 6)) - tmp58 = einsum(t1_oV, (0, 1), f.Vo, (2, 0), (2, 1)) - tmp135 = einsum(tmp134, (0, 1), t1_oV, (0, 2), (2, 1)) * -1 - del tmp134 - tmp28 = einsum(v.OOVv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) * -1 - tmp43 = einsum(t2, (0, 1, 2, 3), tmp1, (4, 3), (0, 1, 4, 2)) * -1 - tmp0 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp4 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp37 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 5, 2, 3), (0, 1, 4, 5)) - tmp3 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - tmp40 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp46 = einsum(tmp2, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp20 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp25 = einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 5, 2, 3), (0, 1, 4, 5)) - tmp33 = einsum(v.ovov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) - tmp5 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp10 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp6 = einsum(tmp1, (0, 1), t1, (2, 1), (2, 0)) - tmp45 = einsum(tmp2, (0, 1, 2, 3), t1, (4, 3), (0, 4, 2, 1)) - tmp49 = einsum(tmp18, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) * -1 - tmp51 = einsum(t1, (0, 1), tmp23, (2, 3, 4, 1), (2, 0, 3, 4)) * -1 - tmp38 = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 4, 3), (2, 4)) - tmp105 = einsum(t2_OoVV, (0, 1, 2, 3), tmp104, (1, 4, 5, 6), (4, 5, 0, 2, 3, 6)) * -1 - del tmp104 - tmp88 = einsum(tmp87, (0, 1), t3, (2, 3, 1, 4, 5, 6), (0, 2, 3, 4, 5, 6)) - del tmp87 - tmp101 = einsum(tmp100, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (4, 1, 2, 5, 6, 3)) * -1 - del tmp100 - tmp107 = einsum(t2_OOVv, (0, 1, 2, 3), tmp106, (3, 4, 5, 6), (0, 1, 4, 2, 5, 6)) * -1 - del tmp106 - tmp142 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp141, (6, 2, 7, 5), (6, 0, 1, 7, 3, 4)) - del tmp141 - tmp119 = einsum(t2_OOVv, (0, 1, 2, 3), tmp118, (3, 4, 5, 6), (0, 1, 4, 5, 2, 6)) * -1 - del tmp118 - tmp139 = einsum(tmp138, (0, 1, 2, 3), t3, (4, 2, 3, 5, 6, 7), (1, 0, 4, 5, 6, 7)) * -1 - del tmp138 - tmp103 = einsum(tmp102, (0, 1, 2, 3), t2_OOVv, (4, 5, 6, 0), (4, 5, 1, 2, 3, 6)) * -1 - del tmp102 - tmp57 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp56, (2, 6), (6, 0, 1, 3, 4, 5)) - del tmp56 - tmp98 = einsum(tmp97, (0, 1, 2, 3), t3, (4, 5, 6, 7, 3, 2), (4, 5, 6, 1, 0, 7)) - del tmp97 - tmp125 = einsum(tmp124, (0, 1, 2, 3), t2_OOVv, (4, 5, 6, 0), (4, 5, 1, 2, 3, 6)) * -1 - del tmp124 - tmp130 = einsum(t2_OOVv, (0, 1, 2, 3), tmp129, (3, 4, 5, 6), (4, 0, 1, 5, 2, 6)) - del tmp129 - tmp148 = einsum(t2_OoVV, (0, 1, 2, 3), tmp147, (1, 4, 5, 6), (5, 4, 0, 6, 2, 3)) * -1 - del tmp147 - tmp109 = einsum(t2_OoVV, (0, 1, 2, 3), tmp108, (1, 4, 5, 6), (4, 5, 0, 6, 2, 3)) - del tmp108 - tmp66 = einsum(v.VVVV, (0, 1, 2, 3), t3, (4, 5, 6, 7, 2, 3), (4, 5, 6, 7, 0, 1)) - tmp55 = einsum(f.VV, (0, 1), t3, (2, 3, 4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - tmp117 = einsum(t2_OoVV, (0, 1, 2, 3), tmp116, (1, 4, 5, 6), (4, 5, 0, 6, 2, 3)) - del tmp116 - tmp54 = einsum(f.OO, (0, 1), t3, (2, 3, 1, 4, 5, 6), (0, 2, 3, 4, 5, 6)) - tmp86 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp85, (6, 7, 5, 4), (0, 1, 2, 6, 3, 7)) * -1 - del tmp85 - tmp65 = einsum(v.OVOV, (0, 1, 2, 3), t3, (4, 5, 2, 6, 7, 1), (4, 5, 0, 6, 7, 3)) - tmp112 = einsum(tmp111, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (1, 4, 2, 5, 6, 3)) * -1 - del tmp111 - tmp92 = einsum(tmp91, (0, 1), t3, (2, 3, 4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - del tmp91 - tmp145 = einsum(tmp144, (0, 1, 2, 3), t3, (4, 5, 6, 7, 2, 3), (4, 5, 6, 0, 1, 7)) - del tmp144 - tmp114 = einsum(t2_OOVv, (0, 1, 2, 3), tmp113, (3, 4, 5, 6), (4, 0, 1, 5, 6, 2)) - del tmp113 - tmp94 = einsum(tmp93, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (0, 4, 5, 2, 6, 7)) - del tmp93 - tmp122 = einsum(tmp121, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (1, 4, 2, 3, 5, 6)) - del tmp121 - tmp70 = einsum(tmp69, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (1, 4, 2, 5, 6, 3)) * -1 - del tmp69 - tmp133 = einsum(tmp132, (0, 1), t3, (2, 3, 1, 4, 5, 6), (0, 2, 3, 4, 5, 6)) - del tmp132 - tmp151 = einsum(tmp150, (0, 1, 2, 3), t2_OOVv, (4, 5, 6, 0), (1, 4, 5, 2, 3, 6)) - del tmp150 - tmp63 = einsum(t2_OOVv, (0, 1, 2, 3), v.OvVV, (4, 3, 5, 6), (0, 1, 4, 2, 5, 6)) - tmp72 = einsum(t2_OOVv, (0, 1, 2, 3), tmp71, (3, 4, 5, 6), (0, 1, 4, 5, 2, 6)) * -1 - del tmp71 - tmp128 = einsum(t2_OoVV, (0, 1, 2, 3), tmp127, (1, 4, 5, 6), (4, 5, 0, 2, 3, 6)) * -1 - del tmp127 - tmp76 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp75, (2, 6), (0, 1, 6, 3, 4, 5)) - del tmp75 - tmp61 = einsum(tmp60, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (1, 2, 4, 3, 5, 6)) * -1 - del tmp60 - tmp64 = einsum(t3, (0, 1, 2, 3, 4, 5), v.OOOO, (6, 7, 1, 2), (0, 6, 7, 3, 4, 5)) - tmp99 = einsum(tmp30, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (4, 2, 1, 5, 6, 3)) - tmp80 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp79, (2, 6, 7, 5), (0, 1, 6, 7, 3, 4)) - del tmp79 - tmp74 = einsum(t2_OOVv, (0, 1, 2, 3), tmp73, (3, 4, 5, 6), (4, 0, 1, 2, 5, 6)) - del tmp73 - tmp78 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp77, (6, 7, 2, 1), (6, 0, 7, 3, 4, 5)) * -1 - del tmp77 - tmp62 = einsum(v.OOVo, (0, 1, 2, 3), t2_OoVV, (4, 3, 5, 6), (4, 0, 1, 5, 6, 2)) - tmp82 = einsum(tmp81, (0, 1), t3, (2, 3, 4, 5, 6, 1), (2, 3, 4, 5, 6, 0)) - del tmp81 - tmp90 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp89, (6, 7, 2, 1), (7, 6, 0, 3, 4, 5)) - del tmp89 - tmp84 = einsum(tmp83, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 2), (0, 4, 5, 6, 7, 3)) - del tmp83 - tmp68 = einsum(tmp67, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (4, 1, 2, 3, 5, 6)) - del tmp67 - tmp96 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp95, (6, 7, 1, 2, 8, 5), (6, 7, 0, 8, 3, 4)) - del tmp95 - tmp59 = einsum(tmp58, (0, 1), t3, (2, 3, 4, 5, 6, 0), (2, 3, 4, 1, 5, 6)) - del tmp58 - tmp136 = einsum(tmp135, (0, 1), t3, (2, 3, 4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - del tmp135 - tmp16 = einsum(t3, (0, 1, 2, 3, 4, 5), v.OvVV, (2, 6, 4, 5), (6, 0, 1, 3)) * -1 - tmp31 = einsum(tmp30, (0, 1, 2, 3), t1, (0, 4), (4, 1, 2, 3)) - del tmp30 - tmp29 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp28, (6, 2, 1, 5), (6, 0, 3, 4)) * -1 - del tmp28 - tmp15 = einsum(v.OOVo, (0, 1, 2, 3), t3, (4, 0, 1, 5, 6, 2), (3, 4, 5, 6)) * -1 - tmp27 = einsum(v.OoVv, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp44 = einsum(tmp43, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp43 - tmp9 = einsum(tmp0, (0, 1), t2, (2, 0, 3, 4), (1, 2, 3, 4)) - tmp8 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp14 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp17 = einsum(t2, (0, 1, 2, 3), tmp4, (1, 4), (0, 4, 2, 3)) * -1 - tmp48 = einsum(tmp37, (0, 1, 2, 3), t1, (2, 4), (0, 1, 3, 4)) * -1 - tmp36 = einsum(tmp3, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) - tmp12 = einsum(v.ooov, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - tmp41 = einsum(tmp40, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp40 - tmp47 = einsum(tmp46, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp46 - tmp21 = einsum(t1, (0, 1), tmp20, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp20 - tmp26 = einsum(tmp25, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp25 - tmp19 = einsum(tmp18, (0, 1, 2, 3), t2, (2, 1, 4, 5), (0, 3, 4, 5)) * -1 - del tmp18 - tmp34 = einsum(t1, (0, 1), tmp33, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp33 - tmp22 = einsum(tmp5, (0, 1), t2, (2, 3, 4, 1), (2, 3, 4, 0)) * -1 - tmp24 = einsum(t2, (0, 1, 2, 3), tmp23, (4, 1, 5, 3), (4, 0, 2, 5)) * -1 - del tmp23 - tmp11 = einsum(tmp10, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - del tmp10 - tmp7 = einsum(f.oo, (0, 1), t2, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp13 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 1), (4, 0, 2, 3)) - tmp42 = einsum(tmp6, (0, 1), t2, (2, 1, 3, 4), (0, 2, 3, 4)) * -1 - tmp53 = einsum(tmp45, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp50 = einsum(t1, (0, 1), tmp49, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - del tmp49 - tmp35 = einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp52 = einsum(t1, (0, 1), tmp51, (2, 3, 0, 4), (3, 2, 1, 4)) * -1 - del tmp51 - tmp32 = einsum(v.oooo, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp39 = einsum(tmp38, (0, 1), t2, (2, 3, 4, 1), (2, 3, 4, 0)) - del tmp38 - t3new = np.copy(np.transpose(tmp54, (1, 2, 0, 4, 5, 3))) * -1 - t3new += np.transpose(tmp54, (1, 0, 2, 4, 5, 3)) - t3new += np.transpose(tmp54, (0, 2, 1, 4, 5, 3)) - del tmp54 - t3new += np.transpose(tmp55, (0, 1, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp55, (0, 1, 2, 5, 3, 4)) - t3new += np.transpose(tmp55, (0, 1, 2, 5, 4, 3)) * -1 - del tmp55 - t3new += np.transpose(tmp57, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp57, (1, 0, 2, 4, 5, 3)) - t3new += np.transpose(tmp57, (0, 2, 1, 4, 5, 3)) - del tmp57 - t3new += np.transpose(tmp59, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp59, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp59, (0, 1, 2, 5, 4, 3)) - del tmp59 - t3new += np.transpose(tmp61, (2, 1, 0, 3, 5, 4)) - t3new += np.transpose(tmp61, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp61, (2, 1, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp61, (0, 2, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp61, (0, 1, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp61, (0, 1, 2, 5, 3, 4)) - t3new += np.transpose(tmp61, (2, 1, 0, 5, 4, 3)) - t3new += np.transpose(tmp61, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp61, (0, 1, 2, 5, 4, 3)) * -1 - del tmp61 - t3new += np.transpose(tmp62, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp62, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp62, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp62, (1, 0, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp62, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp62, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp62, (0, 2, 1, 4, 3, 5)) - t3new += np.transpose(tmp62, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp62, (1, 2, 0, 4, 3, 5)) * -1 - del tmp62 - t3new += np.transpose(tmp63, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp63, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp63, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp63, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp63, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp63, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp63, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp63, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp63, (2, 1, 0, 3, 5, 4)) * -1 - del tmp63 - t3new += np.transpose(tmp64, (0, 2, 1, 4, 5, 3)) * -0.5 - t3new += np.transpose(tmp64, (1, 0, 2, 4, 5, 3)) * -0.5 - t3new += np.transpose(tmp64, (1, 2, 0, 4, 5, 3)) * 0.5 - del tmp64 - t3new += np.transpose(tmp65, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp65, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp65, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp65, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp65, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp65, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp65, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp65, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp65, (2, 1, 0, 4, 3, 5)) * -1 - del tmp65 - t3new += np.transpose(tmp66, (0, 1, 2, 5, 4, 3)) * -0.5 - t3new += np.transpose(tmp66, (0, 1, 2, 5, 3, 4)) * 0.5 - t3new += np.transpose(tmp66, (0, 1, 2, 3, 5, 4)) * -0.5 - del tmp66 - t3new += np.transpose(tmp68, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp68, (1, 0, 2, 3, 5, 4)) - t3new += np.transpose(tmp68, (0, 2, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp68, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp68, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp68, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp68, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp68, (1, 2, 0, 5, 3, 4)) - t3new += np.transpose(tmp68, (1, 2, 0, 5, 4, 3)) * -1 - del tmp68 - t3new += np.transpose(tmp70, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp70, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp70, (1, 0, 2, 4, 5, 3)) - t3new += np.transpose(tmp70, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp72, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp72, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp72, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp72, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp70, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp70, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp70, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp70, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp70, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp70, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp70, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp70, (2, 0, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp72, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp72, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp72, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp72, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp72, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp72, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp72, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp72, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp70, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp70, (0, 1, 2, 4, 3, 5)) - t3new += tmp72 * -1 - t3new += np.transpose(tmp72, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp72, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp72, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp70, (1, 2, 0, 4, 3, 5)) - t3new += np.transpose(tmp70, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp70, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp70, (2, 0, 1, 4, 3, 5)) - del tmp70 - t3new += np.transpose(tmp72, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp72, (2, 1, 0, 4, 3, 5)) * -1 - del tmp72 - t3new += np.transpose(tmp74, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp74, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp74, (1, 2, 0, 5, 3, 4)) - t3new += np.transpose(tmp74, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp74, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp74, (0, 2, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp74, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp74, (1, 0, 2, 3, 5, 4)) - t3new += np.transpose(tmp74, (0, 2, 1, 3, 5, 4)) - del tmp74 - t3new += np.transpose(tmp76, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp76, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp78, (1, 0, 2, 4, 5, 3)) * 0.5 - t3new += np.transpose(tmp78, (0, 1, 2, 4, 5, 3)) * -0.5 - t3new += np.transpose(tmp80, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp80, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp80, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp80, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp80, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp80, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp78, (1, 2, 0, 4, 5, 3)) * -0.5 - t3new += np.transpose(tmp78, (0, 2, 1, 4, 5, 3)) * 0.5 - t3new += np.transpose(tmp76, (2, 1, 0, 4, 5, 3)) - del tmp76 - t3new += np.transpose(tmp78, (2, 1, 0, 4, 5, 3)) * 0.5 - t3new += np.transpose(tmp78, (2, 0, 1, 4, 5, 3)) * -0.5 - del tmp78 - t3new += np.transpose(tmp80, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp80, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp80, (2, 1, 0, 5, 4, 3)) * -1 - del tmp80 - t3new += np.transpose(tmp82, (0, 1, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp82, (0, 1, 2, 4, 5, 3)) - t3new += np.transpose(tmp84, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp84, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp84, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp84, (1, 0, 2, 4, 5, 3)) - t3new += np.transpose(tmp84, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp84, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp86, (0, 1, 2, 5, 3, 4)) * 0.5 - t3new += np.transpose(tmp86, (0, 1, 2, 5, 4, 3)) * -0.5 - t3new += np.transpose(tmp86, (0, 1, 2, 3, 5, 4)) * -0.5 - t3new += np.transpose(tmp86, (0, 1, 2, 4, 5, 3)) * 0.5 - t3new += np.transpose(tmp82, (0, 1, 2, 4, 3, 5)) * -1 - del tmp82 - t3new += np.transpose(tmp84, (1, 2, 0, 4, 3, 5)) - t3new += np.transpose(tmp84, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp84, (0, 2, 1, 4, 3, 5)) * -1 - del tmp84 - t3new += tmp86 * 0.5 - t3new += np.transpose(tmp86, (0, 1, 2, 4, 3, 5)) * -0.5 - del tmp86 - t3new += np.transpose(tmp88, (1, 2, 0, 3, 5, 4)) * 0.5 - t3new += np.transpose(tmp88, (2, 0, 1, 3, 5, 4)) * 0.5 - t3new += np.transpose(tmp88, (0, 2, 1, 3, 5, 4)) * -0.5 - del tmp88 - t3new += np.transpose(tmp90, (2, 1, 0, 3, 4, 5)) * -0.25 - t3new += np.transpose(tmp90, (1, 2, 0, 3, 4, 5)) * 0.25 - t3new += tmp90 * 0.25 - del tmp90 - t3new += np.transpose(tmp92, (2, 1, 0, 3, 4, 5)) * 0.5 - t3new += np.transpose(tmp92, (2, 1, 0, 4, 3, 5)) * -0.5 - t3new += np.transpose(tmp94, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp94, (2, 0, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp94, (1, 2, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp94, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp94, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp94, (0, 2, 1, 4, 3, 5)) - t3new += np.transpose(tmp96, (2, 1, 0, 3, 5, 4)) * -0.5 - t3new += np.transpose(tmp96, (1, 2, 0, 3, 5, 4)) * 0.5 - t3new += np.transpose(tmp96, (2, 1, 0, 5, 3, 4)) * 0.5 - t3new += np.transpose(tmp96, (1, 2, 0, 5, 3, 4)) * -0.5 - t3new += np.transpose(tmp96, (0, 1, 2, 3, 5, 4)) * 0.5 - t3new += np.transpose(tmp96, (0, 1, 2, 5, 3, 4)) * -0.5 - t3new += np.transpose(tmp92, (2, 1, 0, 4, 5, 3)) * 0.5 - del tmp92 - t3new += np.transpose(tmp94, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp94, (2, 0, 1, 4, 5, 3)) - t3new += np.transpose(tmp94, (0, 2, 1, 4, 5, 3)) * -1 - del tmp94 - t3new += np.transpose(tmp96, (2, 1, 0, 5, 4, 3)) * -0.5 - t3new += np.transpose(tmp96, (1, 2, 0, 5, 4, 3)) * 0.5 - t3new += np.transpose(tmp96, (0, 1, 2, 5, 4, 3)) * 0.5 - del tmp96 - t3new += np.transpose(tmp98, (2, 1, 0, 3, 4, 5)) * -0.25 - t3new += np.transpose(tmp98, (2, 1, 0, 3, 5, 4)) * 0.25 - t3new += np.transpose(tmp99, (1, 2, 0, 4, 3, 5)) * 0.5 - t3new += np.transpose(tmp99, (2, 0, 1, 4, 3, 5)) * 0.5 - t3new += np.transpose(tmp99, (1, 2, 0, 4, 5, 3)) * -0.5 - t3new += np.transpose(tmp99, (2, 0, 1, 4, 5, 3)) * -0.5 - t3new += np.transpose(tmp99, (0, 2, 1, 4, 3, 5)) * -0.5 - t3new += np.transpose(tmp99, (0, 2, 1, 4, 5, 3)) * 0.5 - t3new += np.transpose(tmp98, (2, 1, 0, 5, 4, 3)) * 0.25 - del tmp98 - t3new += np.transpose(tmp99, (1, 2, 0, 5, 4, 3)) * 0.5 - t3new += np.transpose(tmp99, (2, 0, 1, 5, 4, 3)) * 0.5 - t3new += np.transpose(tmp99, (0, 2, 1, 5, 4, 3)) * -0.5 - del tmp99 - t3new += np.transpose(tmp101, (0, 1, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp101, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp101, (0, 1, 2, 4, 5, 3)) - t3new += np.transpose(tmp101, (1, 0, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp103, (0, 1, 2, 5, 4, 3)) * 0.5 - t3new += np.transpose(tmp103, (0, 2, 1, 5, 4, 3)) * -0.5 - t3new += np.transpose(tmp103, (0, 1, 2, 4, 5, 3)) * -0.5 - t3new += np.transpose(tmp103, (0, 2, 1, 4, 5, 3)) * 0.5 - t3new += np.transpose(tmp101, (0, 1, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp101, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp103, (0, 1, 2, 4, 3, 5)) * 0.5 - t3new += np.transpose(tmp103, (0, 2, 1, 4, 3, 5)) * -0.5 - t3new += np.transpose(tmp101, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp101, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp101, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp101, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp101, (0, 2, 1, 4, 3, 5)) - t3new += np.transpose(tmp101, (1, 2, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp101, (2, 0, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp101, (2, 1, 0, 5, 4, 3)) - t3new += np.transpose(tmp101, (2, 0, 1, 4, 5, 3)) - t3new += np.transpose(tmp101, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp103, (2, 1, 0, 5, 4, 3)) * -0.5 - t3new += np.transpose(tmp103, (2, 1, 0, 4, 5, 3)) * 0.5 - t3new += np.transpose(tmp101, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp101, (2, 1, 0, 4, 3, 5)) - del tmp101 - t3new += np.transpose(tmp103, (2, 1, 0, 4, 3, 5)) * -0.5 - del tmp103 - t3new += np.transpose(tmp105, (2, 1, 0, 5, 4, 3)) * 0.5 - t3new += np.transpose(tmp105, (0, 2, 1, 5, 4, 3)) * 0.5 - t3new += np.transpose(tmp105, (2, 1, 0, 4, 5, 3)) * -0.5 - t3new += np.transpose(tmp105, (0, 2, 1, 4, 5, 3)) * -0.5 - t3new += np.transpose(tmp105, (0, 1, 2, 5, 4, 3)) * -0.5 - t3new += np.transpose(tmp105, (0, 1, 2, 4, 5, 3)) * 0.5 - t3new += np.transpose(tmp107, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp107, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp107, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp107, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp107, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp107, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp107, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp107, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp107, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp107, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp107, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp107, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp105, (2, 1, 0, 4, 3, 5)) * 0.5 - t3new += np.transpose(tmp105, (0, 2, 1, 4, 3, 5)) * 0.5 - t3new += np.transpose(tmp105, (0, 1, 2, 4, 3, 5)) * -0.5 - del tmp105 - t3new += np.transpose(tmp107, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp107, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp107, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp107, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp107, (0, 2, 1, 3, 4, 5)) - t3new += tmp107 * -1 - del tmp107 - t3new += np.transpose(tmp109, (2, 1, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp109, (1, 2, 0, 3, 4, 5)) - t3new += np.transpose(tmp109, (2, 1, 0, 4, 3, 5)) - t3new += np.transpose(tmp109, (1, 2, 0, 4, 3, 5)) * -1 - t3new += tmp109 - t3new += np.transpose(tmp109, (0, 1, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp109, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp109, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp109, (0, 1, 2, 4, 5, 3)) - del tmp109 - t3new += np.transpose(tmp112, (1, 2, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp112, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp112, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp112, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp114, (1, 2, 0, 5, 3, 4)) * 0.5 - t3new += np.transpose(tmp114, (2, 0, 1, 5, 3, 4)) * 0.5 - t3new += np.transpose(tmp114, (1, 2, 0, 3, 5, 4)) * -0.5 - t3new += np.transpose(tmp114, (2, 0, 1, 3, 5, 4)) * -0.5 - t3new += np.transpose(tmp112, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp112, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp114, (1, 2, 0, 3, 4, 5)) * 0.5 - t3new += np.transpose(tmp114, (2, 0, 1, 3, 4, 5)) * 0.5 - t3new += np.transpose(tmp112, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp112, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp112, (1, 0, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp112, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp112, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp112, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp112, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp112, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp112, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp112, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp114, (0, 2, 1, 5, 3, 4)) * -0.5 - t3new += np.transpose(tmp114, (0, 2, 1, 3, 5, 4)) * 0.5 - t3new += tmp112 * -1 - t3new += np.transpose(tmp112, (0, 2, 1, 3, 4, 5)) - del tmp112 - t3new += np.transpose(tmp114, (0, 2, 1, 3, 4, 5)) * -0.5 - del tmp114 - t3new += np.transpose(tmp117, (2, 1, 0, 3, 4, 5)) * -0.5 - t3new += np.transpose(tmp117, (1, 2, 0, 3, 4, 5)) * 0.5 - t3new += np.transpose(tmp117, (2, 1, 0, 4, 3, 5)) * 0.5 - t3new += np.transpose(tmp117, (1, 2, 0, 4, 3, 5)) * -0.5 - t3new += tmp117 * 0.5 - t3new += np.transpose(tmp117, (0, 1, 2, 4, 3, 5)) * -0.5 - t3new += np.transpose(tmp119, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp119, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp119, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp119, (1, 2, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp119, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp119, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp119, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp119, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp119, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp119, (1, 2, 0, 4, 3, 5)) - t3new += tmp119 * -1 - t3new += np.transpose(tmp119, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp117, (2, 1, 0, 4, 5, 3)) * -0.5 - t3new += np.transpose(tmp117, (1, 2, 0, 4, 5, 3)) * 0.5 - t3new += np.transpose(tmp117, (0, 1, 2, 4, 5, 3)) * 0.5 - del tmp117 - t3new += np.transpose(tmp119, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp119, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp119, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp119, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp119, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp119, (0, 1, 2, 4, 5, 3)) * -1 - del tmp119 - t3new += np.transpose(tmp122, (1, 0, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp122, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp122, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp122, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp122, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp122, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp125, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp125, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp125, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp125, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp125, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp125, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp122, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp122, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp122, (1, 2, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp122, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp122, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp122, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp122, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp122, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp122, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp122, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp122, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp122, (2, 0, 1, 5, 4, 3)) - del tmp122 - t3new += np.transpose(tmp125, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp125, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp125, (2, 1, 0, 5, 4, 3)) * -1 - del tmp125 - t3new += np.transpose(tmp128, (2, 1, 0, 5, 4, 3)) - t3new += np.transpose(tmp128, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp128, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp128, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp130, (1, 2, 0, 5, 3, 4)) - t3new += np.transpose(tmp130, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp130, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp130, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp128, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp128, (1, 0, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp130, (0, 2, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp130, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp130, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp130, (1, 0, 2, 3, 5, 4)) - t3new += np.transpose(tmp130, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp130, (1, 0, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp130, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp130, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp128, (2, 1, 0, 4, 3, 5)) - t3new += np.transpose(tmp128, (1, 2, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp130, (1, 2, 0, 3, 4, 5)) - t3new += np.transpose(tmp130, (1, 0, 2, 3, 4, 5)) * -1 - t3new += np.transpose(tmp130, (1, 2, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp130, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp128, (1, 0, 2, 4, 3, 5)) - del tmp128 - t3new += np.transpose(tmp130, (0, 2, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp130, (0, 2, 1, 4, 3, 5)) - del tmp130 - t3new += np.transpose(tmp133, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp133, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp133, (0, 2, 1, 3, 5, 4)) * -1 - del tmp133 - t3new += np.transpose(tmp136, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp136, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp136, (2, 1, 0, 4, 5, 3)) - del tmp136 - t3new += np.transpose(tmp139, (2, 0, 1, 3, 4, 5)) * 0.5 - t3new += np.transpose(tmp139, (0, 2, 1, 3, 4, 5)) * -0.5 - t3new += np.transpose(tmp142, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp142, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp142, (1, 2, 0, 4, 3, 5)) - t3new += np.transpose(tmp142, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp142, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp142, (2, 0, 1, 4, 5, 3)) * -1 - t3new += tmp139 * 0.5 - del tmp139 - t3new += np.transpose(tmp142, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp142, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp142, (0, 2, 1, 4, 5, 3)) - del tmp142 - t3new += np.transpose(tmp145, (2, 1, 0, 3, 4, 5)) * -0.5 - t3new += np.transpose(tmp145, (2, 1, 0, 3, 5, 4)) * 0.5 - t3new += np.transpose(tmp145, (2, 1, 0, 5, 3, 4)) * -0.5 - del tmp145 - t3new += np.transpose(tmp148, (2, 0, 1, 3, 4, 5)) - t3new += np.transpose(tmp148, (0, 2, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp148, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp148, (0, 2, 1, 4, 3, 5)) - t3new += np.transpose(tmp148, (2, 0, 1, 4, 5, 3)) - t3new += np.transpose(tmp148, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp151, (1, 2, 0, 3, 4, 5)) - t3new += np.transpose(tmp151, (2, 0, 1, 3, 4, 5)) - t3new += np.transpose(tmp151, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp151, (2, 0, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp151, (1, 2, 0, 5, 3, 4)) - t3new += np.transpose(tmp151, (2, 0, 1, 5, 3, 4)) - t3new += tmp148 - t3new += np.transpose(tmp148, (0, 1, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp148, (0, 1, 2, 4, 5, 3)) - del tmp148 - t3new += np.transpose(tmp151, (0, 2, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp151, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp151, (0, 2, 1, 5, 3, 4)) * -1 - del tmp151 - t2new_OOVv = np.copy(np.transpose(tmp16, (1, 2, 3, 0))) * 0.5 - t2new_OOVv += np.transpose(tmp31, (1, 2, 3, 0)) * -0.5 - t2new_OOvV = np.copy(np.transpose(tmp16, (1, 2, 0, 3))) * -0.5 - del tmp16 - t2new_OOvV += np.transpose(tmp31, (1, 2, 0, 3)) * 0.5 - del tmp31 - t2new_oOVV = np.copy(np.transpose(tmp15, (0, 1, 3, 2))) * -0.5 - t2new_oOVV += np.transpose(tmp29, (0, 1, 3, 2)) * -0.5 - t2new_OoVV = np.copy(np.transpose(tmp15, (1, 0, 3, 2))) * 0.5 - del tmp15 - t2new_OoVV += np.transpose(tmp29, (1, 0, 3, 2)) * 0.5 - del tmp29 - t2new_OOVV = einsum(f.OV, (0, 1), t3, (2, 3, 0, 4, 5, 1), (2, 3, 4, 5)) - t2new_OOVV += einsum(t3, (0, 1, 2, 3, 4, 5), tmp27, (2, 5), (0, 1, 3, 4)) - del tmp27 - t2new = np.copy(np.transpose(tmp7, (1, 0, 3, 2))) - t2new += np.transpose(tmp7, (0, 1, 3, 2)) * -1 - del tmp7 - t2new += np.transpose(tmp8, (1, 0, 2, 3)) - t2new += np.transpose(tmp8, (1, 0, 3, 2)) * -1 - del tmp8 - t2new += np.transpose(tmp9, (1, 0, 3, 2)) - t2new += np.transpose(tmp9, (0, 1, 3, 2)) * -1 - del tmp9 - t2new += tmp11 - t2new += np.transpose(tmp11, (0, 1, 3, 2)) * -1 - del tmp11 - t2new += v.oovv - t2new += np.transpose(tmp12, (1, 0, 3, 2)) * -1 - t2new += np.transpose(tmp12, (1, 0, 2, 3)) - del tmp12 - t2new += np.transpose(tmp13, (0, 1, 3, 2)) - t2new += np.transpose(tmp13, (1, 0, 3, 2)) * -1 - del tmp13 - t2new += einsum(v.oooo, (0, 1, 2, 3), t2, (2, 3, 4, 5), (0, 1, 4, 5)) * 0.5 - t2new += np.transpose(tmp14, (0, 1, 3, 2)) - t2new += np.transpose(tmp14, (1, 0, 3, 2)) * -1 - t2new += tmp14 * -1 - t2new += np.transpose(tmp14, (1, 0, 2, 3)) - del tmp14 - t2new += einsum(v.vvvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) * 0.5 - t2new += np.transpose(tmp17, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp17, (1, 0, 3, 2)) - del tmp17 - t2new += np.transpose(tmp19, (0, 1, 3, 2)) * 0.5 - t2new += np.transpose(tmp19, (1, 0, 3, 2)) * -0.5 - del tmp19 - t2new += tmp21 - t2new += np.transpose(tmp21, (1, 0, 2, 3)) * -1 - t2new += np.transpose(tmp21, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp21, (1, 0, 3, 2)) - del tmp21 - t2new += np.transpose(tmp22, (0, 1, 3, 2)) * -1 - t2new += tmp22 - del tmp22 - t2new += np.transpose(tmp24, (1, 0, 3, 2)) - t2new += np.transpose(tmp24, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp24, (1, 0, 2, 3)) * -1 - t2new += tmp24 - del tmp24 - t2new += np.transpose(tmp26, (0, 1, 3, 2)) * 0.5 - t2new += tmp26 * -0.5 - del tmp26 - t2new += einsum(tmp32, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp32 - t2new += np.transpose(tmp34, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp34, (1, 0, 3, 2)) - t2new += tmp34 - t2new += np.transpose(tmp34, (1, 0, 2, 3)) * -1 - del tmp34 - t2new += einsum(tmp35, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) * -1 - del tmp35 - t2new += np.transpose(tmp36, (0, 1, 3, 2)) * 0.5 - t2new += np.transpose(tmp36, (1, 0, 3, 2)) * -0.5 - del tmp36 - t2new += einsum(tmp37, (0, 1, 2, 3), t2, (3, 2, 4, 5), (1, 0, 4, 5)) * 0.25 - del tmp37 - t2new += np.transpose(tmp39, (0, 1, 3, 2)) * 0.5 - t2new += np.transpose(tmp41, (0, 1, 3, 2)) * -1 - t2new += tmp41 - del tmp41 - t2new += tmp39 * -0.5 - del tmp39 - t2new += np.transpose(tmp42, (1, 0, 3, 2)) * -1 - t2new += np.transpose(tmp42, (0, 1, 3, 2)) - del tmp42 - t2new += tmp44 * -1 - t2new += np.transpose(tmp44, (0, 1, 3, 2)) - del tmp44 - t2new += einsum(tmp45, (0, 1, 2, 3), t2, (2, 3, 4, 5), (1, 0, 4, 5)) * -0.5 - del tmp45 - t2new += np.transpose(tmp47, (1, 0, 2, 3)) - t2new += tmp47 * -1 - t2new += np.transpose(tmp47, (1, 0, 3, 2)) * -1 - t2new += np.transpose(tmp47, (0, 1, 3, 2)) - del tmp47 - t2new += einsum(tmp48, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) * 0.5 - del tmp48 - t2new += np.transpose(tmp50, (0, 1, 3, 2)) - t2new += np.transpose(tmp50, (1, 0, 3, 2)) * -1 - del tmp50 - t2new += np.transpose(tmp52, (0, 1, 3, 2)) - t2new += tmp52 * -1 - del tmp52 - t2new += einsum(tmp53, (0, 1, 2, 3), t1, (2, 4), (1, 0, 4, 3)) * -1 - del tmp53 - t1new_OV = einsum(t3, (0, 1, 2, 3, 4, 5), v.OOVV, (1, 2, 4, 5), (0, 3)) * 0.25 - t1new = np.copy(f.ov) - t1new += einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) * -1 - t1new += einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - t1new += einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - t1new += einsum(tmp0, (0, 1), t1, (0, 2), (1, 2)) * -1 - del tmp0 - t1new += einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) * -1 - t1new += einsum(t2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) * -0.5 - t1new += einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 2, 3), (4, 1)) * -0.5 - t1new += einsum(tmp1, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - del tmp1 - t1new += einsum(t2, (0, 1, 2, 3), tmp2, (4, 1, 0, 3), (4, 2)) * -0.5 - del tmp2 - t1new += einsum(tmp3, (0, 1), t1, (1, 2), (0, 2)) * -0.5 - del tmp3 - t1new += einsum(t1, (0, 1), tmp4, (0, 2), (2, 1)) * -1 - del tmp4 - t1new += einsum(tmp5, (0, 1), t1, (2, 1), (2, 0)) * -1 - del tmp5 - t1new += einsum(tmp6, (0, 1), t1, (1, 2), (0, 2)) * -1 - del tmp6 - - t2new += _inflate(t2new.shape, np.ix_(sO, sO, sV, sV), t2new_OOVV) - t2new += _inflate(t2new.shape, np.ix_(sO, sO, sv, sV), t2new_OOvV) - t2new += _inflate(t2new.shape, np.ix_(sO, so, sV, sV), t2new_OoVV) - t2new += _inflate(t2new.shape, np.ix_(so, sO, sV, sV), t2new_oOVV) - t1new += _inflate(t1new.shape, np.ix_(sO, sV), t1new_OV) - t2new += _inflate(t2new.shape, np.ix_(sO, sO, sV, sv), t2new_OOVv) - - return {f"t1new": t1new, f"t2new": t2new, f"t3new": t3new} - diff --git a/ebcc/codegen/GMP2.py b/ebcc/codegen/GMP2.py deleted file mode 100644 index ecf09448..00000000 --- a/ebcc/codegen/GMP2.py +++ /dev/null @@ -1,323 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:16:53.582731 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:53.643143. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_mp : array - """ - - e_mp = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 2, 3), ()) * 0.25 - - return e_mp - -def make_rdm1_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:53.769567. - - Parameters - ---------- - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm1 : array - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - rdm1.vv = einsum(t2, (0, 1, 2, 3), l2, (4, 3, 0, 1), (4, 2)) * 0.5 - rdm1.oo = einsum(t2, (0, 1, 2, 3), l2, (2, 3, 4, 1), (0, 4)) * -0.5 - rdm1.oo += delta.oo - del delta - rdm1.ov = np.zeros((t2.shape[0], t2.shape[-1])) - rdm1.vo = np.zeros((t2.shape[-1], t2.shape[0])) - rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]]) - - return rdm1 - -def make_rdm2_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:53.793472. - - Parameters - ---------- - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm2 : array - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - rdm2.vvoo = np.copy(l2) - rdm2.oovv = np.copy(t2) - rdm2.oooo = np.zeros((t2.shape[0], t2.shape[0], t2.shape[0], t2.shape[0])) - rdm2.ooov = np.zeros((t2.shape[0], t2.shape[0], t2.shape[0], t2.shape[-1])) - rdm2.oovo = np.zeros((t2.shape[0], t2.shape[0], t2.shape[-1], t2.shape[0])) - rdm2.ovoo = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[0], t2.shape[0])) - rdm2.vooo = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[0], t2.shape[0])) - rdm2.ovov = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[0], t2.shape[-1])) - rdm2.ovvo = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[-1], t2.shape[0])) - rdm2.voov = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[0], t2.shape[-1])) - rdm2.vovo = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[-1], t2.shape[0])) - rdm2.ovvv = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[-1], t2.shape[-1])) - rdm2.vovv = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[-1], t2.shape[-1])) - rdm2.vvov = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[0], t2.shape[-1])) - rdm2.vvvo = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[-1], t2.shape[0])) - rdm2.vvvv = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[-1], t2.shape[-1])) - rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv) - rdm2 = np.transpose(rdm2, (0, 2, 1, 3)) - rdm1 = make_rdm1_f(t2=t2, l2=l2) - delta = np.diag(np.concatenate([np.ones(t2.shape[0]), np.zeros(t2.shape[-1])])) - rdm1 -= delta - rdm2 += einsum(delta, (0, 1), rdm1, (3, 2), (0, 1, 2, 3)) - rdm2 += einsum(rdm1, (1, 0), delta, (2, 3), (0, 1, 2, 3)) - rdm2 -= einsum(delta, (0, 3), rdm1, (2, 1), (0, 1, 2, 3)) - rdm2 -= einsum(rdm1, (0, 3), delta, (1, 2), (0, 1, 2, 3)) - rdm2 += einsum(delta, (0, 1), delta, (2, 3), (0, 1, 2, 3)) - rdm2 -= einsum(delta, (0, 3), delta, (1, 2), (0, 1, 2, 3)) - - return rdm2 - -def hbar_matvec_ip_intermediates(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:54.732360. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - """ - - tmp0 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - - return {f"tmp0": tmp0} - -def hbar_matvec_ip(f=None, r1=None, r2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:54.734725. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp1 = einsum(f.oo, (0, 1), r2, (2, 1, 3), (0, 2, 3)) - tmp0 = np.copy(f.oo) * 4 - tmp0 += ints.tmp0 - tmp0 += np.transpose(ints.tmp0, (1, 0)) - del ints.tmp0 - r2new = einsum(r2, (0, 1, 2), f.vv, (3, 2), (0, 1, 3)) - r2new += einsum(v.ooov, (0, 1, 2, 3), r1, (2,), (0, 1, 3)) * -1 - r2new += tmp1 - r2new += np.transpose(tmp1, (1, 0, 2)) * -1 - del tmp1 - r1new = einsum(v.ovoo, (0, 1, 2, 3), r2, (2, 3, 1), (0,)) * -0.5 - r1new += einsum(tmp0, (0, 1), r1, (0,), (1,)) * -0.25 - del tmp0 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:55.609531. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - """ - - tmp0 = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 4, 3), (4, 2)) - - return {f"tmp0": tmp0} - -def hbar_matvec_ea(f=None, r1=None, r2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:55.611954. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp1 = einsum(r2, (0, 1, 2), f.vv, (3, 1), (2, 3, 0)) - tmp0 = np.copy(f.vv) * -1 - tmp0 += ints.tmp0 * 0.25 - tmp0 += np.transpose(ints.tmp0, (1, 0)) * 0.25 - del ints.tmp0 - r2new = einsum(r1, (0,), v.ovvv, (1, 0, 2, 3), (2, 3, 1)) * -1 - r2new += einsum(r2, (0, 1, 2), f.oo, (3, 2), (0, 1, 3)) * -1 - r2new += np.transpose(tmp1, (1, 2, 0)) * -1 - r2new += np.transpose(tmp1, (2, 1, 0)) - del tmp1 - r1new = einsum(r2, (0, 1, 2), v.ovvv, (2, 3, 0, 1), (3,)) * -0.5 - r1new += einsum(tmp0, (0, 1), r1, (0,), (1,)) * -1 - del tmp0 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ee_intermediates(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:57.449062. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - """ - - tmp1 = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 4, 3), (4, 2)) - tmp0 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - - return {f"tmp0": tmp0, f"tmp1": tmp1} - -def hbar_matvec_ee(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:57.453715. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp6 = einsum(f.oo, (0, 1), r2, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp7 = einsum(r1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp4 = einsum(f.vv, (0, 1), r2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp3 = einsum(r1, (0, 1), v.ooov, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp8 = np.copy(np.transpose(tmp6, (0, 1, 3, 2))) * -1 - del tmp6 - tmp8 += np.transpose(tmp7, (0, 1, 3, 2)) - del tmp7 - tmp5 = np.copy(np.transpose(tmp3, (1, 0, 2, 3))) * -1 - del tmp3 - tmp5 += np.transpose(tmp4, (1, 0, 2, 3)) * -1 - del tmp4 - tmp2 = np.copy(f.oo) - tmp2 += np.transpose(ints.tmp0, (1, 0)) * 0.5 - del ints.tmp0 - tmp1 = np.copy(f.vv) - tmp1 += np.transpose(ints.tmp1, (1, 0)) * -0.5 - del ints.tmp1 - tmp0 = einsum(v.oovv, (0, 1, 2, 3), r1, (1, 3), (0, 2)) - r2new = np.copy(tmp5) * -1 - r2new += np.transpose(tmp5, (0, 1, 3, 2)) - del tmp5 - r2new += tmp8 - r2new += np.transpose(tmp8, (1, 0, 2, 3)) * -1 - del tmp8 - r1new = einsum(r2, (0, 1, 2, 3), v.ovvv, (1, 4, 2, 3), (0, 4)) * -0.5 - r1new += einsum(r2, (0, 1, 2, 3), v.ovoo, (4, 3, 0, 1), (4, 2)) * -0.5 - r1new += einsum(tmp0, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - del tmp0 - r1new += einsum(v.ovov, (0, 1, 2, 3), r1, (2, 1), (0, 3)) * -1 - r1new += einsum(r1, (0, 1), tmp1, (1, 2), (0, 2)) - del tmp1 - r1new += einsum(r1, (0, 1), tmp2, (0, 2), (2, 1)) * -1 - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/GMP3.py b/ebcc/codegen/GMP3.py deleted file mode 100644 index e1e9f447..00000000 --- a/ebcc/codegen/GMP3.py +++ /dev/null @@ -1,45 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:17:12.347606 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:17:12.782214. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_mp : array - """ - - tmp0 = einsum(t2, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 0, 1, 5)) - tmp1 = np.copy(v.oovv) * 2 - tmp1 += einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 1), (0, 4, 3, 5)) * -8 - tmp1 += einsum(t2, (0, 1, 2, 3), v.vvvv, (4, 5, 2, 3), (0, 1, 4, 5)) - e_mp = einsum(v.oooo, (0, 1, 2, 3), tmp0, (3, 0, 1, 2), ()) * -0.125 - del tmp0 - e_mp += einsum(tmp1, (0, 1, 2, 3), t2, (0, 1, 2, 3), ()) * 0.125 - del tmp1 - - return e_mp - diff --git a/ebcc/codegen/GQCISD.py b/ebcc/codegen/GQCISD.py deleted file mode 100644 index fc901e87..00000000 --- a/ebcc/codegen/GQCISD.py +++ /dev/null @@ -1,127 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T16:30:02.028619 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:30:02.094697. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - e_cc = einsum(t2, (0, 1, 2, 3), v.oovv, (0, 1, 2, 3), ()) * 0.25 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:30:04.131102. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - """ - - tmp7 = einsum(v.oovv, (0, 1, 2, 3), t2, (0, 1, 4, 3), (4, 2)) - tmp2 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 2, 3), (0, 4)) - tmp11 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp10 = einsum(v.ooov, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - tmp5 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp14 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 1), (4, 0, 2, 3)) - tmp8 = einsum(tmp7, (0, 1), t2, (2, 3, 4, 1), (2, 3, 4, 0)) - del tmp7 - tmp4 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp13 = einsum(f.oo, (0, 1), t2, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp9 = einsum(tmp2, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) - tmp15 = np.copy(v.oooo) - tmp15 += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 5, 2, 3), (4, 5, 0, 1)) * 0.5 - tmp12 = np.copy(np.transpose(tmp10, (1, 0, 2, 3))) * -1 - del tmp10 - tmp12 += np.transpose(tmp11, (1, 0, 2, 3)) * -1 - del tmp11 - tmp6 = einsum(tmp5, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp5 - tmp3 = np.copy(f.oo) * 2 - tmp3 += np.transpose(tmp2, (1, 0)) - del tmp2 - tmp0 = np.copy(np.transpose(v.ovoo, (0, 2, 3, 1))) * -1 - tmp0 += einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp1 = np.copy(f.ov) - tmp1 += einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - t2new = einsum(v.vvvv, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) * 0.5 - t2new += v.oovv - t2new += tmp4 * -1 - t2new += np.transpose(tmp4, (0, 1, 3, 2)) - t2new += np.transpose(tmp4, (1, 0, 2, 3)) - t2new += np.transpose(tmp4, (1, 0, 3, 2)) * -1 - del tmp4 - t2new += tmp6 - t2new += np.transpose(tmp6, (0, 1, 3, 2)) * -1 - del tmp6 - t2new += tmp8 * -0.5 - t2new += np.transpose(tmp8, (0, 1, 3, 2)) * 0.5 - del tmp8 - t2new += np.transpose(tmp9, (0, 1, 3, 2)) * 0.5 - t2new += np.transpose(tmp9, (1, 0, 3, 2)) * -0.5 - del tmp9 - t2new += tmp12 * -1 - t2new += np.transpose(tmp12, (0, 1, 3, 2)) - del tmp12 - t2new += np.transpose(tmp13, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp13, (1, 0, 3, 2)) - del tmp13 - t2new += np.transpose(tmp14, (0, 1, 3, 2)) - t2new += np.transpose(tmp14, (1, 0, 3, 2)) * -1 - del tmp14 - t2new += einsum(t2, (0, 1, 2, 3), tmp15, (0, 1, 4, 5), (4, 5, 2, 3)) * 0.5 - del tmp15 - t1new = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) * -1 - t1new += einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - t1new += einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 2, 3), (4, 1)) * -0.5 - t1new += einsum(tmp0, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) * 0.5 - del tmp0 - t1new += einsum(t2, (0, 1, 2, 3), tmp1, (1, 3), (0, 2)) - del tmp1 - t1new += einsum(tmp3, (0, 1), t1, (0, 2), (1, 2)) * -0.5 - del tmp3 - - return {f"t1new": t1new, f"t2new": t2new} - diff --git a/ebcc/codegen/RCC2.py b/ebcc/codegen/RCC2.py deleted file mode 100644 index d03ae058..00000000 --- a/ebcc/codegen/RCC2.py +++ /dev/null @@ -1,2201 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T16:30:45.916354 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:30:46.628800. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp0 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp1 = np.copy(f.ov) - tmp1 += einsum(tmp0, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - del tmp0 - e_cc = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 1, 3), ()) * 2 - e_cc += einsum(t2, (0, 1, 2, 3), v.ovov, (0, 3, 1, 2), ()) * -1 - e_cc += einsum(tmp1, (0, 1), t1, (0, 1), ()) * 2 - del tmp1 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:30:52.503298. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - """ - - tmp17 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp26 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp27 = einsum(t1, (0, 1), v.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp18 = einsum(tmp17, (0, 1, 2, 3), t1, (3, 4), (0, 2, 1, 4)) - del tmp17 - tmp16 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp28 = np.copy(tmp26) - del tmp26 - tmp28 += np.transpose(tmp27, (2, 0, 1, 3)) - del tmp27 - tmp24 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp1 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp11 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp11 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp15 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp19 = einsum(tmp18, (0, 1, 2, 3), t1, (1, 4), (0, 2, 4, 3)) - del tmp18 - tmp21 = einsum(t1, (0, 1), tmp16, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp29 = einsum(tmp28, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp28 - tmp25 = einsum(t2, (0, 1, 2, 3), tmp24, (1, 4), (4, 0, 2, 3)) - del tmp24 - tmp32 = np.copy(v.oooo) - tmp32 += einsum(tmp1, (0, 1, 2, 3), t1, (4, 3), (1, 4, 2, 0)) - tmp3 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * 2 - tmp3 += np.transpose(v.ovov, (0, 2, 1, 3)) * -1 - tmp7 = np.copy(v.ovvv) - tmp7 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -0.5 - tmp9 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp9 += np.transpose(v.ovov, (0, 2, 1, 3)) * 2 - tmp10 = np.copy(v.ooov) * -0.5 - tmp10 += np.transpose(v.ovoo, (0, 2, 3, 1)) - tmp12 = np.copy(f.ov) * 0.5 - tmp12 += einsum(tmp11, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - del tmp11 - tmp20 = np.copy(tmp15) - del tmp15 - tmp20 += tmp16 - del tmp16 - tmp20 += tmp19 - del tmp19 - tmp22 = einsum(tmp21, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp21 - tmp14 = einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp23 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - tmp30 = np.copy(tmp25) - del tmp25 - tmp30 += np.transpose(tmp29, (0, 1, 3, 2)) - del tmp29 - tmp31 = einsum(tmp1, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - tmp33 = np.copy(v.ooov) * -1 - tmp33 += einsum(tmp32, (0, 1, 2, 3), t1, (0, 4), (2, 3, 1, 4)) - del tmp32 - tmp4 = np.copy(f.ov) - tmp4 += einsum(t1, (0, 1), tmp3, (0, 2, 3, 1), (2, 3)) - del tmp3 - tmp8 = np.copy(f.vv) * 0.5 - tmp8 += einsum(t1, (0, 1), tmp7, (0, 1, 2, 3), (3, 2)) - del tmp7 - tmp6 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp6 += v.oovv * -1 - tmp5 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp5 += t2 * -1 - tmp13 = np.copy(f.oo) - tmp13 += einsum(tmp9, (0, 1, 2, 3), t2, (4, 0, 3, 2), (1, 4)) - del tmp9 - tmp13 += einsum(tmp10, (0, 1, 2, 3), t1, (0, 3), (2, 1)) * 2 - del tmp10 - tmp13 += einsum(t1, (0, 1), tmp12, (2, 1), (2, 0)) * 2 - del tmp12 - tmp2 = np.copy(v.ooov) - tmp2 += np.transpose(v.ooov, (0, 2, 1, 3)) * -0.5 - tmp2 += tmp1 * -0.5 - tmp2 += np.transpose(tmp1, (0, 2, 1, 3)) - del tmp1 - tmp0 = np.copy(v.ovvv) * -0.5 - tmp0 += np.transpose(v.ovvv, (0, 2, 1, 3)) - t2new = einsum(tmp14, (0, 1, 2, 3), t1, (4, 2), (4, 0, 1, 3)) - del tmp14 - t2new += np.transpose(v.ovov, (0, 2, 1, 3)) - t2new += einsum(v.ooov, (0, 1, 2, 3), t1, (1, 4), (0, 2, 4, 3)) * -1 - t2new += np.transpose(tmp20, (0, 1, 3, 2)) - t2new += np.transpose(tmp20, (1, 0, 2, 3)) - del tmp20 - t2new += tmp22 * -1 - t2new += np.transpose(tmp22, (1, 0, 3, 2)) * -1 - del tmp22 - t2new += np.transpose(tmp23, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp23, (1, 0, 2, 3)) * -1 - del tmp23 - t2new += np.transpose(tmp30, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp30, (1, 0, 2, 3)) * -1 - del tmp30 - t2new += tmp31 * -1 - t2new += np.transpose(tmp31, (1, 0, 3, 2)) * -1 - del tmp31 - t2new += einsum(tmp33, (0, 1, 2, 3), t1, (0, 4), (2, 1, 3, 4)) - del tmp33 - t1new = np.copy(f.ov) - t1new += einsum(t2, (0, 1, 2, 3), tmp0, (1, 2, 3, 4), (0, 4)) * 2 - del tmp0 - t1new += einsum(t2, (0, 1, 2, 3), tmp2, (4, 0, 1, 3), (4, 2)) * -2 - del tmp2 - t1new += einsum(tmp4, (0, 1), tmp5, (0, 2, 3, 1), (2, 3)) - del tmp4, tmp5 - t1new += einsum(tmp6, (0, 1, 2, 3), t1, (0, 2), (1, 3)) - del tmp6 - t1new += einsum(t1, (0, 1), tmp8, (1, 2), (0, 2)) * 2 - del tmp8 - t1new += einsum(tmp13, (0, 1), t1, (0, 2), (1, 2)) * -1 - del tmp13 - - return {f"t1new": t1new, f"t2new": t2new} - -def update_lams(f=None, l1=None, l2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:31:44.304343. - - Parameters - ---------- - f : array - Fock matrix. - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - l1new : array - Updated L1 residuals. - l2new : array - Updated L2 residuals. - """ - - tmp50 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * 2 - tmp50 += np.transpose(v.ovov, (0, 2, 1, 3)) * -1 - tmp86 = einsum(tmp50, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp8 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp17 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - tmp25 = einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp78 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp85 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp87 = einsum(tmp86, (0, 1), t1, (2, 1), (2, 0)) - tmp2 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp5 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp5 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp27 = einsum(tmp8, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp34 = einsum(l2, (0, 1, 2, 3), t2, (4, 5, 1, 0), (3, 2, 4, 5)) - tmp35 = einsum(tmp17, (0, 1, 2, 3), t1, (4, 3), (1, 0, 2, 4)) - tmp47 = einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - tmp12 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp69 = np.copy(v.oovv) - tmp69 += np.transpose(tmp25, (0, 1, 3, 2)) - tmp63 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp79 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp79 += tmp78 - del tmp78 - tmp77 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp77 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp73 = einsum(t1, (0, 1), v.ovvv, (0, 1, 2, 3), (2, 3)) - tmp83 = np.copy(tmp8) * -1 - tmp83 += np.transpose(tmp8, (0, 2, 1, 3)) * 2 - tmp42 = np.copy(tmp17) * -1 - tmp42 += np.transpose(tmp17, (1, 0, 2, 3)) * 2 - tmp88 = np.copy(tmp85) - del tmp85 - tmp88 += tmp87 * -1 - del tmp87 - tmp93 = einsum(v.ooov, (0, 1, 2, 3), t1, (2, 3), (0, 1)) - tmp3 = einsum(tmp2, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - del tmp2 - tmp1 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp6 = einsum(t1, (0, 1), tmp5, (0, 2, 3, 1), (2, 3)) * 2 - tmp28 = einsum(tmp27, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp26 = einsum(tmp25, (0, 1, 2, 3), t1, (4, 3), (0, 4, 1, 2)) - del tmp25 - tmp16 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp16 += t2 - tmp36 = np.copy(np.transpose(tmp34, (1, 0, 3, 2))) - tmp36 += tmp35 - tmp98 = einsum(l2, (0, 1, 2, 3), f.oo, (4, 3), (4, 2, 0, 1)) - tmp100 = einsum(tmp47, (0, 1), v.ovov, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp99 = einsum(tmp8, (0, 1, 2, 3), l1, (4, 0), (1, 2, 4, 3)) - tmp66 = einsum(tmp12, (0, 1, 2, 3), l2, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp70 = einsum(l2, (0, 1, 2, 3), tmp69, (2, 4, 1, 5), (3, 4, 0, 5)) - tmp61 = einsum(l2, (0, 1, 2, 3), f.vv, (4, 1), (2, 3, 4, 0)) - tmp65 = einsum(tmp17, (0, 1, 2, 3), f.ov, (2, 4), (0, 1, 4, 3)) - tmp64 = einsum(tmp63, (0, 1), l2, (2, 3, 4, 1), (0, 4, 2, 3)) - del tmp63 - tmp67 = einsum(v.ooov, (0, 1, 2, 3), tmp17, (1, 4, 2, 5), (4, 0, 5, 3)) - tmp68 = einsum(tmp8, (0, 1, 2, 3), tmp17, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp62 = einsum(v.ovvv, (0, 1, 2, 3), l1, (3, 4), (4, 0, 1, 2)) - tmp72 = einsum(tmp17, (0, 1, 2, 3), v.ooov, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp76 = einsum(tmp8, (0, 1, 2, 3), tmp17, (0, 4, 2, 5), (4, 1, 5, 3)) - tmp80 = einsum(tmp79, (0, 1, 2, 3), tmp77, (0, 4, 3, 5), (4, 1, 5, 2)) - del tmp79, tmp77 - tmp74 = einsum(l2, (0, 1, 2, 3), tmp73, (4, 1), (2, 3, 0, 4)) - del tmp73 - tmp84 = einsum(tmp83, (0, 1, 2, 3), tmp17, (4, 0, 1, 5), (4, 2, 5, 3)) - del tmp83 - tmp75 = einsum(v.ovvv, (0, 1, 2, 3), tmp17, (4, 5, 0, 3), (5, 4, 1, 2)) - tmp81 = einsum(tmp69, (0, 1, 2, 3), l2, (4, 2, 5, 0), (5, 1, 4, 3)) - del tmp69 - tmp82 = einsum(v.ovoo, (0, 1, 2, 3), tmp42, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp90 = einsum(tmp86, (0, 1), tmp17, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp89 = einsum(l2, (0, 1, 2, 3), tmp88, (2, 4), (3, 4, 0, 1)) - del tmp88 - tmp96 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp94 = einsum(tmp93, (0, 1), l2, (2, 3, 4, 1), (4, 0, 2, 3)) - del tmp93 - tmp92 = einsum(v.ooov, (0, 1, 2, 3), l1, (4, 1), (0, 2, 4, 3)) - tmp4 = np.copy(tmp1) - del tmp1 - tmp4 += tmp3 * -1 - del tmp3 - tmp9 = np.copy(v.ooov) * 2 - tmp9 += np.transpose(v.ooov, (0, 2, 1, 3)) * -1 - tmp9 += tmp8 * -1 - tmp9 += np.transpose(tmp8, (0, 2, 1, 3)) * 2 - tmp11 = np.copy(v.oovv) * 2 - tmp11 += np.transpose(v.ovov, (0, 2, 1, 3)) * -1 - tmp10 = np.copy(v.ooov) * -0.5 - tmp10 += np.transpose(v.ooov, (0, 2, 1, 3)) - tmp10 += tmp8 - tmp10 += np.transpose(tmp8, (0, 2, 1, 3)) * -0.5 - del tmp8 - tmp7 = einsum(tmp6, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) * 2 - tmp13 = np.copy(np.transpose(v.oooo, (0, 2, 1, 3))) * 2 - tmp13 += v.oooo * -1 - tmp13 += np.transpose(tmp12, (2, 1, 0, 3)) * -1 - tmp13 += np.transpose(tmp12, (3, 2, 0, 1)) * 2 - tmp0 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp55 = np.copy(v.ovvv) - tmp55 += np.transpose(v.ovvv, (0, 2, 1, 3)) * -0.5 - tmp15 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp15 += t2 * -1 - tmp18 = np.copy(tmp17) - tmp18 += np.transpose(tmp17, (1, 0, 2, 3)) * -0.5 - tmp30 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp30 += v.oovv * -1 - tmp31 = np.copy(np.transpose(tmp12, (0, 2, 1, 3))) * 2 - tmp31 += np.transpose(tmp12, (0, 3, 2, 1)) * -1 - del tmp12 - tmp29 = np.copy(tmp26) * 2 - del tmp26 - tmp29 += tmp28 * -2 - del tmp28 - tmp48 = np.copy(tmp47) * 0.5 - tmp48 += einsum(l2, (0, 1, 2, 3), tmp16, (2, 4, 0, 1), (3, 4)) - tmp22 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp22 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp23 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp23 += t2 * 2 - tmp58 = np.copy(v.ooov) * -0.5 - tmp58 += np.transpose(v.ovoo, (0, 2, 3, 1)) - tmp59 = np.copy(f.ov) - tmp59 += tmp6 - del tmp6 - tmp51 = einsum(l2, (0, 1, 2, 3), tmp16, (2, 4, 0, 1), (3, 4)) * 2 - tmp38 = np.copy(tmp17) * -1 - tmp38 += np.transpose(tmp17, (1, 0, 2, 3)) * 2 - tmp37 = einsum(tmp36, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp36 - tmp40 = einsum(l1, (0, 1), t2, (2, 3, 4, 0), (1, 2, 3, 4)) - tmp102 = np.copy(v.oooo) - tmp102 += np.transpose(tmp27, (0, 2, 3, 1)) - del tmp27 - tmp101 = np.copy(tmp98) - del tmp98 - tmp101 += tmp99 - del tmp99 - tmp101 += tmp100 - del tmp100 - tmp71 = np.copy(tmp61) - del tmp61 - tmp71 += tmp62 - del tmp62 - tmp71 += tmp64 * -1 - del tmp64 - tmp71 += tmp65 * -1 - del tmp65 - tmp71 += tmp66 - del tmp66 - tmp71 += tmp67 - del tmp67 - tmp71 += tmp68 - del tmp68 - tmp71 += tmp70 * -1 - del tmp70 - tmp91 = einsum(l1, (0, 1), f.ov, (2, 3), (2, 1, 3, 0)) - tmp91 += tmp72 - del tmp72 - tmp91 += tmp74 * 2 - del tmp74 - tmp91 += tmp75 * -1 - del tmp75 - tmp91 += tmp76 - del tmp76 - tmp91 += tmp80 - del tmp80 - tmp91 += tmp81 * -1 - del tmp81 - tmp91 += np.transpose(tmp82, (1, 0, 3, 2)) * -1 - del tmp82 - tmp91 += tmp84 * -1 - del tmp84 - tmp91 += np.transpose(tmp89, (0, 1, 3, 2)) - del tmp89 - tmp91 += tmp90 * -1 - del tmp90 - tmp91 += einsum(l1, (0, 1), tmp86, (2, 3), (1, 2, 0, 3)) - del tmp86 - tmp97 = einsum(l2, (0, 1, 2, 3), tmp96, (4, 1), (2, 3, 0, 4)) - del tmp96 - tmp95 = np.copy(tmp92) - del tmp92 - tmp95 += tmp94 * 2 - del tmp94 - tmp14 = np.copy(np.transpose(v.ooov, (0, 2, 1, 3))) - tmp14 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -2 - tmp14 += np.transpose(tmp0, (1, 2, 0, 3)) * -2 - tmp14 += np.transpose(tmp0, (2, 1, 0, 3)) - del tmp0 - tmp14 += tmp4 - tmp14 += np.transpose(tmp4, (1, 0, 2, 3)) * -2 - del tmp4 - tmp14 += np.transpose(tmp7, (1, 0, 2, 3)) * -1 - tmp14 += tmp7 * 0.5 - del tmp7 - tmp14 += einsum(t2, (0, 1, 2, 3), tmp9, (4, 5, 1, 3), (4, 0, 5, 2)) - del tmp9 - tmp14 += einsum(t2, (0, 1, 2, 3), tmp10, (4, 5, 1, 2), (4, 0, 5, 3)) * 2 - tmp14 += einsum(t1, (0, 1), tmp11, (2, 3, 1, 4), (0, 3, 2, 4)) * -1 - del tmp11 - tmp14 += einsum(tmp13, (0, 1, 2, 3), t1, (0, 4), (2, 1, 3, 4)) - del tmp13 - tmp57 = np.copy(f.ov) * 0.5 - tmp57 += einsum(t1, (0, 1), tmp5, (0, 2, 3, 1), (2, 3)) - del tmp5 - tmp44 = np.copy(np.transpose(tmp34, (1, 0, 2, 3))) * -1 - tmp44 += np.transpose(tmp34, (1, 0, 3, 2)) * 2 - del tmp34 - tmp56 = np.copy(f.vv) - tmp56 += einsum(t1, (0, 1), tmp55, (0, 1, 2, 3), (3, 2)) * 2 - del tmp55 - tmp19 = einsum(l2, (0, 1, 2, 3), tmp15, (2, 4, 1, 5), (3, 4, 0, 5)) - tmp19 += einsum(l2, (0, 1, 2, 3), tmp16, (3, 4, 1, 5), (2, 4, 0, 5)) * 2 - tmp19 += einsum(tmp18, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) * 2 - tmp32 = np.copy(tmp29) * -1 - tmp32 += np.transpose(tmp29, (1, 0, 2, 3)) * 0.5 - del tmp29 - tmp32 += einsum(tmp16, (0, 1, 2, 3), tmp10, (4, 0, 5, 2), (4, 1, 5, 3)) * -4 - del tmp10 - tmp32 += einsum(t1, (0, 1), tmp30, (2, 3, 1, 4), (0, 3, 2, 4)) * -1 - del tmp30 - tmp32 += einsum(tmp31, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - del tmp31 - tmp53 = np.copy(v.ooov) * 2 - tmp53 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp20 = einsum(t1, (0, 1), l2, (2, 3, 4, 0), (4, 2, 3, 1)) - tmp54 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp54 += v.oovv * -1 - tmp49 = np.copy(t1) * -0.5 - tmp49 += einsum(tmp17, (0, 1, 2, 3), tmp16, (1, 0, 4, 3), (2, 4)) - tmp49 += einsum(l1, (0, 1), tmp15, (1, 2, 3, 0), (2, 3)) * -0.5 - del tmp15 - tmp49 += einsum(tmp48, (0, 1), t1, (0, 2), (1, 2)) - del tmp48 - tmp24 = np.copy(np.transpose(l2, (3, 2, 0, 1))) - tmp24 += einsum(tmp23, (0, 1, 2, 3), tmp22, (0, 4, 2, 5), (4, 1, 5, 3)) * -1 - del tmp22 - tmp60 = np.copy(f.oo) - tmp60 += einsum(v.ovov, (0, 1, 2, 3), tmp23, (2, 4, 3, 1), (4, 0)) - tmp60 += einsum(tmp58, (0, 1, 2, 3), t1, (0, 3), (1, 2)) * 2 - del tmp58 - tmp60 += einsum(tmp59, (0, 1), t1, (2, 1), (2, 0)) - del tmp59 - tmp46 = np.copy(v.ovvv) * -1 - tmp46 += np.transpose(v.ovvv, (0, 2, 3, 1)) * 2 - tmp43 = np.copy(tmp35) * -0.5 - tmp43 += np.transpose(tmp35, (0, 1, 3, 2)) - tmp52 = np.copy(tmp47) - del tmp47 - tmp52 += tmp51 - del tmp51 - tmp21 = np.copy(np.transpose(v.vvvv, (0, 2, 1, 3))) * 2 - tmp21 += v.vvvv * -1 - tmp45 = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) - tmp45 += einsum(l2, (0, 1, 2, 3), tmp16, (3, 2, 1, 4), (0, 4)) * 2 - del tmp16 - tmp33 = np.copy(np.transpose(l2, (2, 3, 0, 1))) - tmp33 += einsum(tmp18, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) * -1 - tmp39 = np.copy(np.transpose(tmp17, (0, 2, 1, 3))) * 0.5 - tmp39 += np.transpose(tmp17, (1, 2, 0, 3)) * -1 - del tmp17 - tmp39 += np.transpose(tmp37, (0, 2, 1, 3)) - tmp39 += tmp37 * -0.5 - del tmp37 - tmp39 += einsum(tmp38, (0, 1, 2, 3), tmp23, (1, 4, 3, 5), (0, 2, 4, 5)) * -0.5 - del tmp23 - tmp41 = np.copy(tmp40) * -2 - tmp41 += np.transpose(tmp40, (0, 2, 1, 3)) - del tmp40 - tmp41 += einsum(t2, (0, 1, 2, 3), tmp38, (4, 1, 5, 3), (4, 5, 0, 2)) - del tmp38 - tmp41 += einsum(tmp18, (0, 1, 2, 3), t2, (4, 1, 3, 5), (0, 2, 4, 5)) * 2 - del tmp18 - l2new = einsum(v.vvvv, (0, 1, 2, 3), l2, (1, 3, 4, 5), (0, 2, 4, 5)) - l2new += einsum(v.ovov, (0, 1, 2, 3), tmp35, (4, 5, 2, 0), (1, 3, 5, 4)) - del tmp35 - l2new += np.transpose(v.ovov, (1, 3, 0, 2)) - l2new += np.transpose(tmp71, (3, 2, 0, 1)) - l2new += np.transpose(tmp71, (2, 3, 1, 0)) - del tmp71 - l2new += np.transpose(tmp91, (2, 3, 0, 1)) - l2new += np.transpose(tmp91, (3, 2, 1, 0)) - del tmp91 - l2new += np.transpose(tmp95, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp95, (3, 2, 1, 0)) * -1 - del tmp95 - l2new += np.transpose(tmp97, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp97, (3, 2, 1, 0)) * -1 - del tmp97 - l2new += np.transpose(tmp101, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp101, (2, 3, 1, 0)) * -1 - del tmp101 - l2new += einsum(tmp102, (0, 1, 2, 3), l2, (4, 5, 3, 0), (4, 5, 2, 1)) - del tmp102 - l1new = np.copy(np.transpose(f.ov, (1, 0))) - l1new += einsum(tmp14, (0, 1, 2, 3), l2, (4, 3, 1, 0), (4, 2)) - del tmp14 - l1new += einsum(tmp19, (0, 1, 2, 3), v.ovvv, (1, 4, 3, 2), (4, 0)) * -1 - del tmp19 - l1new += einsum(tmp21, (0, 1, 2, 3), tmp20, (4, 0, 3, 1), (2, 4)) - del tmp21, tmp20 - l1new += einsum(v.ovvv, (0, 1, 2, 3), tmp24, (4, 0, 3, 1), (2, 4)) * -1 - del tmp24 - l1new += einsum(tmp32, (0, 1, 2, 3), l2, (4, 3, 0, 1), (4, 2)) - del tmp32 - l1new += einsum(v.ovvv, (0, 1, 2, 3), tmp33, (4, 0, 3, 1), (2, 4)) * 2 - del tmp33 - l1new += einsum(tmp39, (0, 1, 2, 3), v.ovov, (2, 3, 1, 4), (4, 0)) * 2 - del tmp39 - l1new += einsum(tmp41, (0, 1, 2, 3), v.ovov, (2, 4, 1, 3), (4, 0)) - del tmp41 - l1new += einsum(v.oovv, (0, 1, 2, 3), tmp42, (0, 4, 1, 3), (2, 4)) * -1 - del tmp42 - l1new += einsum(v.ooov, (0, 1, 2, 3), tmp43, (4, 0, 1, 2), (3, 4)) * 2 - del tmp43 - l1new += einsum(v.ooov, (0, 1, 2, 3), tmp44, (1, 4, 0, 2), (3, 4)) - del tmp44 - l1new += einsum(tmp45, (0, 1), tmp46, (2, 1, 0, 3), (3, 2)) - del tmp45, tmp46 - l1new += einsum(tmp49, (0, 1), tmp50, (0, 2, 3, 1), (3, 2)) * -2 - del tmp50, tmp49 - l1new += einsum(tmp53, (0, 1, 2, 3), tmp52, (1, 0), (3, 2)) * -1 - del tmp53 - l1new += einsum(l1, (0, 1), tmp54, (1, 2, 0, 3), (3, 2)) - del tmp54 - l1new += einsum(l1, (0, 1), tmp56, (0, 2), (2, 1)) - del tmp56 - l1new += einsum(tmp52, (0, 1), tmp57, (1, 2), (2, 0)) * -2 - del tmp52, tmp57 - l1new += einsum(tmp60, (0, 1), l1, (2, 0), (2, 1)) * -1 - del tmp60 - - return {f"l1new": l1new, f"l2new": l2new} - -def make_rdm1_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:31:45.848778. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm1 : array - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp5 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp5 += t2 - tmp0 = einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - tmp2 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - tmp7 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp7 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp4 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp4 += t2 * -1 - tmp6 = np.copy(tmp0) - tmp6 += einsum(l2, (0, 1, 2, 3), tmp5, (2, 4, 0, 1), (3, 4)) * 2 - del tmp5 - tmp3 = np.copy(tmp2) - tmp3 += np.transpose(tmp2, (1, 0, 2, 3)) * -0.5 - del tmp2 - tmp1 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp1 += t2 * -0.5 - rdm1.vv = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) * 2 - rdm1.vv += einsum(t2, (0, 1, 2, 3), tmp7, (0, 1, 4, 3), (4, 2)) * 2 - del tmp7 - rdm1.vo = np.copy(l1) * 2 - rdm1.ov = np.copy(t1) * 2 - rdm1.ov += einsum(t2, (0, 1, 2, 3), tmp3, (1, 0, 4, 3), (4, 2)) * -4 - del tmp3 - rdm1.ov += einsum(tmp4, (0, 1, 2, 3), l1, (3, 0), (1, 2)) * 2 - del tmp4 - rdm1.ov += einsum(t1, (0, 1), tmp6, (0, 2), (2, 1)) * -2 - del tmp6 - rdm1.oo = np.copy(np.transpose(tmp0, (1, 0))) * -2 - del tmp0 - rdm1.oo += delta.oo * 2 - del delta - rdm1.oo += einsum(l2, (0, 1, 2, 3), tmp1, (2, 4, 1, 0), (4, 3)) * -4 - del tmp1 - rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]]) - - return rdm1 - -def make_rdm2_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:32:58.107243. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm2 : array - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp1 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - tmp74 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp74 += t2 - tmp76 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp76 += t2 * 2 - tmp5 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp5 += t2 - tmp12 = np.copy(tmp1) * -1 - tmp12 += np.transpose(tmp1, (1, 0, 2, 3)) * 2 - tmp10 = np.copy(tmp1) * -1 - tmp10 += np.transpose(tmp1, (1, 0, 2, 3)) - tmp57 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp57 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp75 = einsum(l2, (0, 1, 2, 3), tmp74, (2, 4, 1, 5), (4, 3, 5, 0)) - del tmp74 - tmp83 = einsum(tmp1, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - tmp77 = einsum(l2, (0, 1, 2, 3), tmp76, (3, 4, 1, 5), (4, 2, 5, 0)) - del tmp76 - tmp42 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp42 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp2 = einsum(tmp1, (0, 1, 2, 3), t1, (4, 3), (1, 0, 2, 4)) - tmp0 = einsum(t2, (0, 1, 2, 3), l2, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp26 = einsum(tmp1, (0, 1, 2, 3), t2, (4, 1, 3, 5), (0, 2, 4, 5)) - tmp8 = einsum(l1, (0, 1), t2, (2, 3, 4, 0), (1, 2, 3, 4)) - tmp6 = einsum(l2, (0, 1, 2, 3), tmp5, (2, 4, 0, 1), (3, 4)) * 2 - tmp15 = np.copy(tmp1) * 2 - tmp15 += np.transpose(tmp1, (1, 0, 2, 3)) * -1 - tmp25 = einsum(tmp1, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 2, 4, 5)) - tmp13 = einsum(tmp12, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 2, 4, 5)) - del tmp12 - tmp45 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp45 += np.transpose(l2, (2, 3, 0, 1)) - tmp20 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp20 += t2 * -1 - tmp4 = einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - tmp11 = einsum(t2, (0, 1, 2, 3), tmp10, (4, 1, 5, 2), (4, 5, 0, 3)) - tmp31 = einsum(l2, (0, 1, 2, 3), tmp5, (2, 4, 0, 1), (3, 4)) - del tmp5 - tmp106 = einsum(t1, (0, 1), l2, (2, 3, 4, 0), (4, 2, 3, 1)) - tmp79 = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) - tmp80 = einsum(tmp57, (0, 1, 2, 3), t2, (0, 1, 4, 3), (2, 4)) - tmp100 = np.copy(tmp83) - tmp100 += np.transpose(tmp75, (1, 0, 3, 2)) - tmp100 += np.transpose(tmp77, (1, 0, 3, 2)) * -1 - tmp43 = einsum(tmp42, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - del tmp42 - tmp62 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 1, 5), (2, 4, 0, 5)) - tmp97 = einsum(tmp57, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - tmp90 = np.copy(np.transpose(tmp77, (1, 0, 3, 2))) - tmp90 += np.transpose(tmp75, (1, 0, 3, 2)) * -1 - tmp3 = np.copy(np.transpose(tmp0, (1, 0, 3, 2))) - tmp3 += tmp2 - tmp69 = np.copy(tmp8) - tmp69 += tmp26 * -1 - tmp58 = einsum(tmp57, (0, 1, 2, 3), t2, (0, 1, 4, 3), (2, 4)) * 0.5 - del tmp57 - tmp17 = einsum(t1, (0, 1), tmp6, (0, 2), (2, 1)) * 0.5 - tmp16 = einsum(tmp15, (0, 1, 2, 3), t2, (0, 1, 3, 4), (2, 4)) * 0.5 - tmp23 = einsum(tmp0, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - tmp66 = np.copy(tmp25) - tmp66 += tmp13 * -1 - tmp9 = einsum(tmp2, (0, 1, 2, 3), t1, (0, 4), (1, 3, 2, 4)) - tmp46 = einsum(t2, (0, 1, 2, 3), tmp45, (1, 4, 2, 5), (4, 0, 5, 3)) - del tmp45 - tmp21 = einsum(l1, (0, 1), tmp20, (1, 2, 3, 0), (2, 3)) - del tmp20 - tmp19 = einsum(tmp4, (0, 1), t1, (0, 2), (1, 2)) - tmp51 = np.copy(tmp8) - tmp51 += tmp11 - tmp51 += tmp13 * -1 - tmp29 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp29 += t2 * -1 - tmp32 = np.copy(tmp4) * 0.5 - tmp32 += tmp31 - del tmp31 - tmp108 = einsum(tmp106, (0, 1, 2, 3), t1, (0, 4), (2, 1, 3, 4)) - tmp107 = einsum(l2, (0, 1, 2, 3), t2, (3, 2, 4, 5), (0, 1, 5, 4)) - tmp81 = np.copy(tmp79) - tmp81 += tmp80 - del tmp80 - tmp93 = einsum(t2, (0, 1, 2, 3), tmp1, (1, 0, 4, 5), (4, 5, 3, 2)) - tmp101 = einsum(t1, (0, 1), tmp100, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp100 - tmp89 = einsum(l1, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) - tmp104 = np.copy(tmp62) - tmp104 += tmp83 - tmp104 += tmp43 * -1 - tmp64 = einsum(l2, (0, 1, 2, 3), t2, (4, 2, 1, 5), (3, 4, 0, 5)) - tmp98 = np.copy(tmp62) - tmp98 += tmp83 - tmp98 += tmp97 * -1 - del tmp97 - tmp91 = einsum(t1, (0, 1), tmp90, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp90 - tmp84 = np.copy(tmp1) - tmp84 += np.transpose(tmp1, (1, 0, 2, 3)) * -1 - tmp86 = np.copy(np.transpose(l2, (3, 2, 0, 1))) - tmp86 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp27 = einsum(tmp3, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - tmp70 = einsum(tmp69, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp69 - tmp49 = einsum(tmp4, (0, 1), t2, (2, 0, 3, 4), (1, 2, 3, 4)) - tmp60 = einsum(tmp6, (0, 1), t2, (2, 0, 3, 4), (2, 1, 4, 3)) - tmp59 = einsum(t2, (0, 1, 2, 3), tmp58, (2, 4), (0, 1, 4, 3)) * 2 - tmp18 = np.copy(tmp16) - del tmp16 - tmp18 += tmp17 - del tmp17 - tmp55 = einsum(tmp3, (0, 1, 2, 3), t2, (0, 1, 4, 5), (2, 3, 4, 5)) - tmp54 = einsum(t1, (0, 1), tmp23, (0, 2, 3, 4), (3, 2, 4, 1)) - tmp50 = einsum(t2, (0, 1, 2, 3), tmp43, (1, 4, 2, 5), (4, 0, 5, 3)) - tmp67 = einsum(t1, (0, 1), tmp66, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp66 - tmp41 = einsum(tmp9, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - tmp44 = einsum(tmp43, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - tmp47 = einsum(t2, (0, 1, 2, 3), tmp46, (1, 4, 2, 5), (4, 0, 5, 3)) - tmp22 = np.copy(tmp19) - tmp22 += tmp21 * -1 - tmp52 = einsum(tmp51, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp51 - tmp30 = einsum(l1, (0, 1), tmp29, (1, 2, 3, 0), (2, 3)) - del tmp29 - tmp33 = einsum(tmp32, (0, 1), t1, (0, 2), (1, 2)) * 2 - del tmp32 - tmp28 = einsum(tmp15, (0, 1, 2, 3), t2, (0, 1, 3, 4), (2, 4)) - del tmp15 - tmp39 = np.copy(tmp1) * 2 - tmp39 += np.transpose(tmp1, (1, 0, 2, 3)) * -1 - tmp109 = np.copy(np.transpose(tmp107, (1, 0, 3, 2))) - tmp109 += np.transpose(tmp108, (1, 0, 3, 2)) - tmp103 = np.copy(tmp93) - tmp103 += einsum(t1, (0, 1), tmp81, (2, 3), (0, 2, 1, 3)) - tmp102 = np.copy(tmp89) - tmp102 += np.transpose(tmp101, (0, 1, 3, 2)) - del tmp101 - tmp105 = einsum(t1, (0, 1), tmp104, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp104 - tmp88 = np.copy(tmp79) * 0.5 - tmp88 += tmp58 - tmp96 = einsum(t1, (0, 1), tmp64, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp99 = einsum(t1, (0, 1), tmp98, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp98 - tmp94 = np.copy(tmp93) - tmp94 += einsum(t1, (0, 1), tmp58, (2, 3), (0, 2, 1, 3)) * 2 - del tmp58 - tmp92 = np.copy(tmp89) - tmp92 += einsum(t1, (0, 1), tmp79, (2, 3), (0, 2, 1, 3)) - del tmp79 - tmp92 += np.transpose(tmp91, (0, 1, 3, 2)) * -1 - del tmp91 - tmp95 = einsum(t1, (0, 1), tmp83, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp82 = einsum(t1, (0, 1), tmp1, (0, 2, 3, 4), (2, 3, 4, 1)) - tmp85 = einsum(tmp84, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp84 - tmp87 = einsum(t2, (0, 1, 2, 3), tmp86, (1, 4, 2, 5), (4, 0, 5, 3)) - del tmp86 - tmp78 = einsum(tmp10, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp10 - tmp72 = einsum(tmp27, (0, 1, 2, 3), t1, (0, 4), (2, 1, 3, 4)) - tmp63 = einsum(t2, (0, 1, 2, 3), tmp62, (1, 4, 2, 5), (0, 4, 3, 5)) - tmp71 = np.copy(tmp49) - tmp71 += np.transpose(tmp70, (0, 1, 3, 2)) - del tmp70 - tmp61 = np.copy(np.transpose(tmp59, (1, 0, 3, 2))) - del tmp59 - tmp61 += np.transpose(tmp60, (0, 1, 3, 2)) - del tmp60 - tmp61 += einsum(tmp18, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - tmp56 = np.copy(tmp54) - del tmp54 - tmp56 += np.transpose(tmp55, (1, 0, 3, 2)) - tmp73 = np.copy(t1) - tmp73 += tmp19 * -1 - tmp65 = einsum(t2, (0, 1, 2, 3), tmp64, (1, 4, 2, 5), (0, 4, 3, 5)) - tmp68 = np.copy(tmp50) * -1 - tmp68 += np.transpose(tmp67, (0, 1, 3, 2)) - del tmp67 - tmp68 += einsum(tmp21, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp48 = np.copy(tmp41) - del tmp41 - tmp48 += np.transpose(tmp44, (1, 0, 3, 2)) * 2 - tmp48 += tmp47 - del tmp47 - tmp53 = np.copy(tmp49) - del tmp49 - tmp53 += tmp50 * -1 - del tmp50 - tmp53 += np.transpose(tmp52, (0, 1, 3, 2)) - del tmp52 - tmp53 += einsum(tmp22, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -1 - tmp37 = einsum(t1, (0, 1), tmp4, (2, 3), (2, 0, 3, 1)) - tmp37 += tmp11 - tmp37 += tmp13 * -1 - tmp35 = np.copy(tmp4) - tmp35 += tmp6 - tmp34 = np.copy(t1) * -1 - tmp34 += tmp28 - tmp34 += tmp30 * -1 - del tmp30 - tmp34 += tmp33 - tmp40 = einsum(t2, (0, 1, 2, 3), tmp39, (1, 4, 5, 3), (4, 5, 0, 2)) - del tmp39 - tmp38 = np.copy(tmp28) - del tmp28 - tmp38 += tmp33 - del tmp33 - tmp36 = np.copy(tmp8) - tmp36 += np.transpose(tmp27, (0, 2, 1, 3)) - tmp36 += einsum(t1, (0, 1), tmp6, (2, 3), (2, 0, 3, 1)) - tmp14 = np.copy(tmp8) - tmp14 += tmp9 - del tmp9 - tmp14 += tmp11 - del tmp11 - tmp14 += tmp13 * -1 - tmp24 = np.copy(tmp23) - del tmp23 - tmp24 += einsum(t1, (0, 1), tmp6, (2, 3), (2, 0, 3, 1)) - tmp7 = np.copy(delta.oo) - tmp7 += tmp4 * -1 - rdm2.vvvv = np.copy(np.transpose(tmp109, (0, 1, 3, 2))) * -2 - rdm2.vvvv += tmp109 * 2 - del tmp109 - rdm2.vvvv += np.transpose(tmp107, (1, 0, 3, 2)) * 2 - del tmp107 - rdm2.vvvv += np.transpose(tmp108, (1, 0, 3, 2)) * 2 - del tmp108 - rdm2.vvvo = np.copy(np.transpose(tmp106, (1, 2, 3, 0))) * -2 - rdm2.vvvo += np.transpose(tmp106, (2, 1, 3, 0)) * 4 - rdm2.vvov = np.copy(np.transpose(tmp106, (1, 2, 0, 3))) * 4 - rdm2.vvov += np.transpose(tmp106, (2, 1, 0, 3)) * -2 - del tmp106 - rdm2.vovv = np.copy(np.transpose(tmp102, (1, 0, 2, 3))) * -2 - rdm2.vovv += np.transpose(tmp102, (1, 0, 3, 2)) * 2 - del tmp102 - rdm2.vovv += np.transpose(tmp103, (1, 0, 2, 3)) * -2 - rdm2.vovv += np.transpose(tmp103, (1, 0, 3, 2)) * 2 - del tmp103 - rdm2.vovv += np.transpose(tmp89, (1, 0, 3, 2)) * 2 - rdm2.vovv += np.transpose(tmp96, (1, 0, 3, 2)) * -2 - rdm2.vovv += np.transpose(tmp93, (1, 0, 2, 3)) * -2 - rdm2.vovv += np.transpose(tmp105, (1, 0, 3, 2)) * -2 - del tmp105 - rdm2.vovv += einsum(t1, (0, 1), tmp88, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.ovvv = np.copy(tmp92) * 2 - rdm2.ovvv += np.transpose(tmp92, (0, 1, 3, 2)) * -2 - del tmp92 - rdm2.ovvv += tmp94 * 2 - rdm2.ovvv += np.transpose(tmp94, (0, 1, 3, 2)) * -2 - del tmp94 - rdm2.ovvv += tmp95 * 2 - rdm2.ovvv += np.transpose(tmp95, (0, 1, 3, 2)) * -2 - del tmp95 - rdm2.ovvv += tmp89 * 2 - del tmp89 - rdm2.ovvv += np.transpose(tmp93, (0, 1, 3, 2)) * -2 - del tmp93 - rdm2.ovvv += tmp96 * -2 - del tmp96 - rdm2.ovvv += tmp99 * -2 - del tmp99 - rdm2.ovvv += einsum(t1, (0, 1), tmp81, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.vvoo = np.copy(np.transpose(l2, (0, 1, 3, 2))) * -2 - rdm2.vvoo += l2 * 4 - rdm2.vovo = einsum(t1, (0, 1), l1, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.vovo += np.transpose(tmp43, (2, 1, 3, 0)) * -2 - rdm2.vovo += np.transpose(tmp87, (2, 1, 3, 0)) * -2 - del tmp87 - rdm2.vovo += np.transpose(tmp85, (2, 1, 3, 0)) * -2 - rdm2.vovo += einsum(delta.oo, (0, 1), tmp88, (2, 3), (2, 0, 3, 1)) * 8 - del tmp88 - rdm2.vovo += np.transpose(tmp64, (2, 1, 3, 0)) * -2 - rdm2.vovo += np.transpose(tmp82, (2, 1, 3, 0)) * -2 - rdm2.voov = einsum(t1, (0, 1), l1, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.voov += np.transpose(tmp77, (3, 0, 1, 2)) * 2 - rdm2.voov += np.transpose(tmp75, (3, 0, 1, 2)) * -2 - rdm2.voov += np.transpose(tmp85, (2, 1, 0, 3)) * 2 - del tmp85 - rdm2.voov += einsum(delta.oo, (0, 1), tmp81, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.voov += np.transpose(tmp62, (2, 1, 0, 3)) * -2 - rdm2.voov += np.transpose(tmp83, (2, 1, 0, 3)) * -2 - rdm2.voov += np.transpose(tmp43, (2, 1, 0, 3)) * 2 - rdm2.ovvo = einsum(t1, (0, 1), l1, (2, 3), (0, 2, 1, 3)) * 4 - rdm2.ovvo += np.transpose(tmp43, (1, 2, 3, 0)) * 4 - del tmp43 - rdm2.ovvo += np.transpose(tmp46, (1, 2, 3, 0)) * -2 - del tmp46 - rdm2.ovvo += np.transpose(tmp78, (1, 2, 3, 0)) * -2 - rdm2.ovvo += einsum(delta.oo, (0, 1), tmp81, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.ovvo += np.transpose(tmp62, (1, 2, 3, 0)) * -2 - del tmp62 - rdm2.ovvo += np.transpose(tmp83, (1, 2, 3, 0)) * -2 - del tmp83 - rdm2.ovov = einsum(t1, (0, 1), l1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.ovov += np.transpose(tmp75, (0, 3, 1, 2)) * 2 - del tmp75 - rdm2.ovov += np.transpose(tmp77, (0, 3, 1, 2)) * -2 - del tmp77 - rdm2.ovov += np.transpose(tmp78, (1, 2, 0, 3)) * 2 - del tmp78 - rdm2.ovov += einsum(delta.oo, (0, 1), tmp81, (2, 3), (0, 2, 1, 3)) * 4 - del tmp81 - rdm2.ovov += np.transpose(tmp64, (1, 2, 0, 3)) * -2 - del tmp64 - rdm2.ovov += np.transpose(tmp82, (1, 2, 0, 3)) * -2 - del tmp82 - rdm2.oovv = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -2 - rdm2.oovv += t2 * 4 - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.oovv += tmp48 * 2 - rdm2.oovv += np.transpose(tmp48, (0, 1, 3, 2)) * -2 - del tmp48 - rdm2.oovv += tmp53 * 2 - rdm2.oovv += np.transpose(tmp53, (0, 1, 3, 2)) * -2 - rdm2.oovv += np.transpose(tmp53, (1, 0, 2, 3)) * -2 - rdm2.oovv += np.transpose(tmp53, (1, 0, 3, 2)) * 2 - del tmp53 - rdm2.oovv += tmp56 * 2 - rdm2.oovv += np.transpose(tmp56, (0, 1, 3, 2)) * -2 - del tmp56 - rdm2.oovv += tmp61 * -4 - rdm2.oovv += np.transpose(tmp61, (0, 1, 3, 2)) * 2 - rdm2.oovv += np.transpose(tmp61, (1, 0, 2, 3)) * 2 - rdm2.oovv += np.transpose(tmp61, (1, 0, 3, 2)) * -4 - del tmp61 - rdm2.oovv += tmp63 * 2 - del tmp63 - rdm2.oovv += np.transpose(tmp65, (0, 1, 3, 2)) * 2 - del tmp65 - rdm2.oovv += einsum(tmp19, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -2 - del tmp19 - rdm2.oovv += tmp68 * 2 - rdm2.oovv += np.transpose(tmp68, (1, 0, 3, 2)) * 2 - del tmp68 - rdm2.oovv += np.transpose(tmp71, (0, 1, 3, 2)) * -2 - rdm2.oovv += np.transpose(tmp71, (1, 0, 2, 3)) * -2 - del tmp71 - rdm2.oovv += np.transpose(tmp44, (1, 0, 3, 2)) * 4 - del tmp44 - rdm2.oovv += np.transpose(tmp55, (1, 0, 3, 2)) * 2 - del tmp55 - rdm2.oovv += np.transpose(tmp72, (0, 1, 3, 2)) * 2 - del tmp72 - rdm2.oovv += einsum(tmp73, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 2 - del tmp73 - rdm2.vooo = np.copy(np.transpose(tmp1, (3, 2, 0, 1))) * -4 - rdm2.vooo += np.transpose(tmp1, (3, 2, 1, 0)) * 2 - rdm2.vooo += einsum(l1, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 4 - rdm2.vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.ovoo = np.copy(np.transpose(tmp1, (2, 3, 0, 1))) * 2 - rdm2.ovoo += np.transpose(tmp1, (2, 3, 1, 0)) * -4 - del tmp1 - rdm2.ovoo += einsum(l1, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 1, 3)) * 4 - rdm2.oovo = np.copy(np.transpose(tmp36, (1, 2, 3, 0))) * -2 - rdm2.oovo += np.transpose(tmp36, (2, 1, 3, 0)) * 2 - del tmp36 - rdm2.oovo += np.transpose(tmp37, (1, 2, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp37, (2, 1, 3, 0)) * 2 - del tmp37 - rdm2.oovo += einsum(delta.oo, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.oovo += einsum(delta.oo, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.oovo += einsum(delta.oo, (0, 1), tmp38, (2, 3), (2, 0, 3, 1)) * -2 - rdm2.oovo += einsum(tmp38, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * 2 - del tmp38 - rdm2.oovo += einsum(tmp21, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.oovo += einsum(tmp21, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -2 - del tmp21 - rdm2.oovo += np.transpose(tmp8, (1, 2, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp26, (1, 2, 3, 0)) * 2 - rdm2.oovo += np.transpose(tmp25, (2, 1, 3, 0)) * 2 - rdm2.oovo += np.transpose(tmp40, (2, 1, 3, 0)) * -2 - del tmp40 - rdm2.oovo += np.transpose(tmp27, (1, 2, 3, 0)) * 2 - rdm2.oovo += einsum(tmp34, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * -2 - rdm2.oovo += einsum(tmp35, (0, 1), t1, (2, 3), (2, 1, 3, 0)) * -2 - rdm2.ooov = np.copy(np.transpose(tmp14, (1, 2, 0, 3))) * 2 - rdm2.ooov += np.transpose(tmp14, (2, 1, 0, 3)) * -2 - del tmp14 - rdm2.ooov += einsum(tmp4, (0, 1), t1, (2, 3), (2, 1, 0, 3)) * 2 - rdm2.ooov += einsum(tmp4, (0, 1), t1, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.ooov += einsum(delta.oo, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.ooov += einsum(delta.oo, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.ooov += einsum(delta.oo, (0, 1), tmp18, (2, 3), (2, 0, 1, 3)) * 4 - rdm2.ooov += einsum(tmp18, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * -4 - del tmp18 - rdm2.ooov += einsum(tmp22, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * 2 - rdm2.ooov += einsum(tmp22, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * -2 - del tmp22 - rdm2.ooov += np.transpose(tmp24, (1, 2, 0, 3)) * 2 - rdm2.ooov += np.transpose(tmp24, (2, 1, 0, 3)) * -2 - del tmp24 - rdm2.ooov += np.transpose(tmp8, (2, 1, 0, 3)) * -2 - del tmp8 - rdm2.ooov += np.transpose(tmp25, (1, 2, 0, 3)) * 2 - del tmp25 - rdm2.ooov += np.transpose(tmp26, (2, 1, 0, 3)) * 2 - del tmp26 - rdm2.ooov += np.transpose(tmp13, (1, 2, 0, 3)) * -2 - del tmp13 - rdm2.ooov += np.transpose(tmp27, (2, 1, 0, 3)) * 2 - del tmp27 - rdm2.ooov += einsum(tmp34, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * -2 - del tmp34 - rdm2.ooov += einsum(t1, (0, 1), tmp35, (2, 3), (3, 0, 2, 1)) * -2 - del tmp35 - rdm2.oooo = np.copy(np.transpose(tmp3, (3, 2, 0, 1))) * -2 - rdm2.oooo += np.transpose(tmp3, (2, 3, 0, 1)) * 2 - del tmp3 - rdm2.oooo += einsum(tmp4, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.oooo += einsum(tmp4, (0, 1), delta.oo, (2, 3), (2, 1, 0, 3)) * 2 - rdm2.oooo += einsum(tmp4, (0, 1), delta.oo, (2, 3), (1, 2, 3, 0)) * 2 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp4, (2, 3), (0, 3, 1, 2)) * -4 - del tmp4 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp6, (2, 3), (3, 0, 2, 1)) * -4 - rdm2.oooo += einsum(tmp6, (0, 1), delta.oo, (2, 3), (2, 1, 0, 3)) * 2 - rdm2.oooo += einsum(tmp6, (0, 1), delta.oo, (2, 3), (1, 2, 3, 0)) * 2 - rdm2.oooo += einsum(tmp6, (0, 1), delta.oo, (2, 3), (2, 1, 3, 0)) * -4 - del tmp6 - rdm2.oooo += np.transpose(tmp0, (3, 2, 1, 0)) * 2 - del tmp0 - rdm2.oooo += np.transpose(tmp2, (3, 2, 1, 0)) * 2 - del tmp2 - rdm2.oooo += einsum(tmp7, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * 2 - del delta, tmp7 - rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv) - rdm2 = np.transpose(rdm2, (0, 2, 1, 3)) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:33:10.694438. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp12 : array - tmp14 : array - tmp16 : array - tmp17 : array - tmp19 : array - tmp21 : array - tmp25 : array - tmp26 : array - tmp28 : array - tmp29 : array - tmp3 : array - tmp31 : array - tmp32 : array - tmp33 : array - tmp34 : array - tmp35 : array - tmp37 : array - tmp39 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp42 : array - tmp43 : array - tmp45 : array - tmp5 : array - tmp51 : array - tmp52 : array - tmp53 : array - tmp54 : array - tmp6 : array - tmp9 : array - """ - - tmp0 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp6 = einsum(t1, (0, 1), v.ovov, (2, 3, 0, 1), (2, 3)) - tmp5 = einsum(v.ovov, (0, 1, 2, 3), t1, (2, 1), (0, 3)) - tmp54 = einsum(tmp0, (0, 1), t1, (0, 2), (1, 2)) - tmp53 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 3), (0, 4)) - tmp52 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 2), (0, 4)) - tmp51 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp45 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 3), (4, 1)) - tmp43 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 1), (4, 3)) - tmp42 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) - tmp41 = einsum(v.ooov, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) - tmp40 = einsum(v.ooov, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp39 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp37 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - tmp35 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp34 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp33 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp32 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp31 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 2, 3, 5), (4, 0, 1, 5)) - tmp29 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp28 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp26 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp25 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp21 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp19 = einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp17 = einsum(tmp6, (0, 1), t1, (2, 1), (2, 0)) - tmp16 = einsum(tmp5, (0, 1), t1, (2, 1), (2, 0)) - tmp14 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 3), (0, 4)) - tmp12 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 2), (0, 4)) - tmp9 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp4 = einsum(v.ooov, (0, 1, 2, 3), t1, (2, 3), (0, 1)) - tmp3 = einsum(t1, (0, 1), v.ooov, (2, 0, 3, 1), (2, 3)) - - return {f"tmp0": tmp0, f"tmp12": tmp12, f"tmp14": tmp14, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp19": tmp19, f"tmp21": tmp21, f"tmp25": tmp25, f"tmp26": tmp26, f"tmp28": tmp28, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp31": tmp31, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp34": tmp34, f"tmp35": tmp35, f"tmp37": tmp37, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp42": tmp42, f"tmp43": tmp43, f"tmp45": tmp45, f"tmp5": tmp5, f"tmp51": tmp51, f"tmp52": tmp52, f"tmp53": tmp53, f"tmp54": tmp54, f"tmp6": tmp6, f"tmp9": tmp9} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:33:10.724699. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp8 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -0.5 - tmp8 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp4 = np.copy(r2) * -0.5 - tmp4 += np.transpose(r2, (1, 0, 2)) - tmp11 = np.copy(f.oo) - tmp11 += ints.tmp0 - tmp11 += np.transpose(ints.tmp14, (1, 0)) * 2 - tmp11 += np.transpose(ints.tmp12, (1, 0)) * -1 - tmp6 = np.copy(ints.tmp32) - del ints.tmp32 - tmp6 += v.oovv * -1 - tmp5 = np.copy(ints.tmp35) * 2 - del ints.tmp35 - tmp5 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp5 += ints.tmp33 * -1 - del ints.tmp33 - tmp5 += ints.tmp34 * -1 - del ints.tmp34 - tmp9 = einsum(r2, (0, 1, 2), tmp8, (1, 0, 3, 2), (3,)) - del tmp8 - tmp10 = np.copy(ints.tmp19) - del ints.tmp19 - tmp10 += np.transpose(ints.tmp29, (1, 0, 2, 3)) * 2 - del ints.tmp29 - tmp10 += np.transpose(ints.tmp39, (2, 1, 0, 3)) - del ints.tmp39 - tmp10 += np.transpose(v.ooov, (0, 2, 1, 3)) - tmp10 += np.transpose(ints.tmp28, (1, 0, 2, 3)) * -1 - del ints.tmp28 - tmp10 += np.transpose(ints.tmp31, (1, 0, 2, 3)) * -1 - del ints.tmp31 - tmp10 += ints.tmp42 * -1 - del ints.tmp42 - tmp12 = np.copy(f.ov) - tmp12 += ints.tmp26 * 2 - del ints.tmp26 - tmp12 += ints.tmp40 - del ints.tmp40 - tmp12 += ints.tmp51 - del ints.tmp51 - tmp12 += ints.tmp52 * 2 - del ints.tmp52 - tmp12 += ints.tmp25 * -1 - del ints.tmp25 - tmp12 += ints.tmp37 * -1 - del ints.tmp37 - tmp12 += ints.tmp41 * -2 - del ints.tmp41 - tmp12 += ints.tmp53 * -1 - del ints.tmp53 - tmp12 += ints.tmp54 * -1 - del ints.tmp54 - tmp7 = np.copy(np.transpose(ints.tmp45, (1, 0))) * 2 - del ints.tmp45 - tmp7 += f.vv * -1 - tmp7 += np.transpose(ints.tmp43, (1, 0)) * -1 - del ints.tmp43 - tmp7 += einsum(t1, (0, 1), f.ov, (0, 2), (2, 1)) - tmp1 = np.copy(f.ov) * 0.5 - tmp1 += ints.tmp6 - del ints.tmp6 - tmp1 += ints.tmp5 * -0.5 - del ints.tmp5 - tmp3 = np.copy(f.oo) - tmp3 += ints.tmp0 - del ints.tmp0 - tmp3 += np.transpose(ints.tmp14, (1, 0)) * 2 - del ints.tmp14 - tmp3 += np.transpose(ints.tmp17, (1, 0)) * 2 - del ints.tmp17 - tmp3 += np.transpose(ints.tmp4, (1, 0)) * 2 - del ints.tmp4 - tmp3 += np.transpose(ints.tmp12, (1, 0)) * -1 - del ints.tmp12 - tmp3 += np.transpose(ints.tmp16, (1, 0)) * -1 - del ints.tmp16 - tmp3 += np.transpose(ints.tmp3, (1, 0)) * -1 - del ints.tmp3 - tmp0 = np.copy(ints.tmp9) - tmp0 += v.ooov * -0.5 - tmp0 += np.transpose(v.ooov, (0, 2, 1, 3)) - tmp2 = np.copy(r2) * -1 - tmp2 += np.transpose(r2, (1, 0, 2)) * 2 - r2new = einsum(r2, (0, 1, 2), v.oooo, (3, 0, 4, 1), (3, 4, 2)) - r2new += einsum(ints.tmp21, (0, 1, 2, 3), r2, (3, 2, 4), (1, 0, 4)) - del ints.tmp21 - r2new += einsum(tmp5, (0, 1, 2, 3), tmp4, (4, 1, 3), (0, 4, 2)) * 2 - del tmp5, tmp4 - r2new += einsum(r2, (0, 1, 2), tmp6, (3, 1, 4, 2), (0, 3, 4)) - r2new += einsum(r2, (0, 1, 2), tmp6, (3, 0, 4, 2), (3, 1, 4)) - del tmp6 - r2new += einsum(tmp7, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp7 - r2new += einsum(tmp9, (0,), t2, (1, 2, 3, 0), (1, 2, 3)) * -2 - del tmp9 - r2new += einsum(tmp10, (0, 1, 2, 3), r1, (2,), (1, 0, 3)) - del tmp10 - r2new += einsum(tmp11, (0, 1), r2, (0, 2, 3), (1, 2, 3)) * -1 - r2new += einsum(r2, (0, 1, 2), tmp11, (1, 3), (0, 3, 2)) * -1 - del tmp11 - r2new += einsum(r1, (0,), tmp12, (1, 2), (1, 0, 2)) * -1 - del tmp12 - r1new = einsum(r2, (0, 1, 2), ints.tmp9, (3, 1, 0, 2), (3,)) * -1 - del ints.tmp9 - r1new += einsum(r2, (0, 1, 2), tmp0, (3, 0, 1, 2), (3,)) * 2 - del tmp0 - r1new += einsum(tmp1, (0, 1), tmp2, (2, 0, 1), (2,)) * -2 - del tmp1, tmp2 - r1new += einsum(tmp3, (0, 1), r1, (0,), (1,)) * -1 - del tmp3 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:33:23.509700. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp14 : array - tmp16 : array - tmp22 : array - tmp25 : array - tmp26 : array - tmp3 : array - tmp32 : array - tmp33 : array - tmp35 : array - tmp36 : array - tmp37 : array - tmp39 : array - tmp41 : array - tmp42 : array - tmp43 : array - tmp44 : array - tmp46 : array - tmp47 : array - tmp48 : array - tmp49 : array - tmp5 : array - tmp50 : array - tmp53 : array - tmp54 : array - tmp55 : array - tmp6 : array - tmp7 : array - """ - - tmp33 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp55 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp54 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp53 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp50 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 1, 5), (4, 5, 2, 3)) - tmp49 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp48 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp47 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp46 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp44 = einsum(v.ooov, (0, 1, 2, 3), t2, (2, 1, 3, 4), (0, 4)) - tmp43 = einsum(v.ooov, (0, 1, 2, 3), t2, (1, 2, 3, 4), (0, 4)) - tmp42 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - tmp41 = einsum(tmp33, (0, 1), t1, (0, 2), (1, 2)) - tmp39 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 3), (4, 0)) - tmp37 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 1), (4, 0)) - tmp36 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 1, 3), (4, 2)) - tmp35 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 3, 1), (4, 2)) - tmp32 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp26 = einsum(v.ooov, (0, 1, 2, 3), t2, (2, 1, 4, 5), (0, 5, 4, 3)) - tmp25 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp22 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 2), (0, 3, 4, 5)) - tmp16 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 3), (4, 1)) - tmp14 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 1), (4, 3)) - tmp7 = einsum(t1, (0, 1), v.ovov, (2, 3, 0, 1), (2, 3)) - tmp6 = einsum(v.ovov, (0, 1, 2, 3), t1, (2, 1), (0, 3)) - tmp5 = einsum(t1, (0, 1), v.ovvv, (0, 2, 3, 1), (2, 3)) - tmp3 = einsum(t1, (0, 1), v.ovvv, (0, 1, 2, 3), (2, 3)) - - return {f"tmp14": tmp14, f"tmp16": tmp16, f"tmp22": tmp22, f"tmp25": tmp25, f"tmp26": tmp26, f"tmp3": tmp3, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp35": tmp35, f"tmp36": tmp36, f"tmp37": tmp37, f"tmp39": tmp39, f"tmp41": tmp41, f"tmp42": tmp42, f"tmp43": tmp43, f"tmp44": tmp44, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp48": tmp48, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp50": tmp50, f"tmp53": tmp53, f"tmp54": tmp54, f"tmp55": tmp55, f"tmp6": tmp6, f"tmp7": tmp7} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:33:23.536514. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp12 = einsum(t1, (0, 1), f.ov, (0, 2), (2, 1)) - tmp4 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp4 += np.transpose(v.ovov, (0, 2, 1, 3)) * 2 - tmp5 = np.copy(f.ov) - tmp5 += ints.tmp7 * 2 - tmp5 += ints.tmp6 * -1 - tmp14 = np.copy(f.oo) - tmp14 += ints.tmp33 - del ints.tmp33 - tmp14 += np.transpose(ints.tmp39, (1, 0)) * 2 - del ints.tmp39 - tmp14 += np.transpose(ints.tmp37, (1, 0)) * -1 - del ints.tmp37 - tmp8 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp8 += np.transpose(r2, (2, 1, 0)) * -0.5 - tmp9 = np.copy(ints.tmp55) * 2 - del ints.tmp55 - tmp9 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp9 += ints.tmp53 * -1 - del ints.tmp53 - tmp9 += ints.tmp54 * -1 - del ints.tmp54 - tmp11 = np.copy(np.transpose(ints.tmp26, (0, 2, 3, 1))) - del ints.tmp26 - tmp11 += np.transpose(ints.tmp48, (0, 2, 3, 1)) * 2 - del ints.tmp48 - tmp11 += np.transpose(v.ovvv, (0, 2, 3, 1)) - tmp11 += ints.tmp22 * -1 - del ints.tmp22 - tmp11 += np.transpose(ints.tmp49, (0, 3, 2, 1)) * -1 - del ints.tmp49 - tmp11 += np.transpose(ints.tmp50, (0, 2, 3, 1)) * -1 - del ints.tmp50 - tmp10 = np.copy(ints.tmp25) - del ints.tmp25 - tmp10 += v.oovv * -1 - tmp7 = einsum(v.ovov, (0, 1, 2, 3), r2, (1, 3, 4), (4, 0, 2)) - tmp13 = np.copy(np.transpose(ints.tmp16, (1, 0))) * 2 - tmp13 += f.vv * -1 - tmp13 += np.transpose(ints.tmp14, (1, 0)) * -1 - tmp13 += tmp12 - del tmp12 - tmp15 = einsum(f.ov, (0, 1), r1, (1,), (0,)) * 0.5 - tmp15 += einsum(r2, (0, 1, 2), tmp4, (2, 3, 0, 1), (3,)) * -0.5 - tmp16 = np.copy(f.ov) - tmp16 += ints.tmp32 - del ints.tmp32 - tmp16 += ints.tmp35 * 2 - del ints.tmp35 - tmp16 += ints.tmp43 - del ints.tmp43 - tmp16 += ints.tmp47 * 2 - del ints.tmp47 - tmp16 += ints.tmp36 * -1 - del ints.tmp36 - tmp16 += ints.tmp41 * -1 - del ints.tmp41 - tmp16 += ints.tmp42 * -1 - del ints.tmp42 - tmp16 += ints.tmp44 * -2 - del ints.tmp44 - tmp16 += ints.tmp46 * -1 - del ints.tmp46 - tmp1 = np.copy(f.ov) * 0.5 - tmp1 += ints.tmp7 - del ints.tmp7 - tmp1 += ints.tmp6 * -0.5 - del ints.tmp6 - tmp6 = einsum(r2, (0, 1, 2), tmp4, (2, 3, 0, 1), (3,)) * -1 - del tmp4 - tmp6 += einsum(tmp5, (0, 1), r1, (1,), (0,)) - del tmp5 - tmp3 = np.copy(f.vv) - tmp3 += np.transpose(ints.tmp14, (1, 0)) - del ints.tmp14 - tmp3 += np.transpose(ints.tmp3, (1, 0)) * 2 - del ints.tmp3 - tmp3 += np.transpose(ints.tmp16, (1, 0)) * -2 - del ints.tmp16 - tmp3 += ints.tmp5 * -1 - del ints.tmp5 - tmp2 = np.copy(np.transpose(r2, (2, 0, 1))) * -1 - tmp2 += np.transpose(r2, (2, 1, 0)) * 2 - tmp0 = np.copy(v.ovvv) * -1 - tmp0 += np.transpose(v.ovvv, (0, 2, 1, 3)) * 2 - r2new = einsum(tmp7, (0, 1, 2), t2, (2, 1, 3, 4), (4, 3, 0)) - del tmp7 - r2new += einsum(r2, (0, 1, 2), v.vvvv, (3, 0, 4, 1), (3, 4, 2)) - r2new += einsum(tmp9, (0, 1, 2, 3), tmp8, (1, 3, 4), (2, 4, 0)) * 2 - del tmp9, tmp8 - r2new += einsum(tmp10, (0, 1, 2, 3), r2, (4, 3, 1), (4, 2, 0)) - r2new += einsum(r2, (0, 1, 2), tmp10, (3, 2, 4, 0), (4, 1, 3)) - del tmp10 - r2new += einsum(r1, (0,), tmp11, (1, 2, 0, 3), (3, 2, 1)) * -1 - del tmp11 - r2new += einsum(tmp13, (0, 1), r2, (0, 2, 3), (1, 2, 3)) * -1 - r2new += einsum(tmp13, (0, 1), r2, (2, 0, 3), (2, 1, 3)) * -1 - del tmp13 - r2new += einsum(r2, (0, 1, 2), tmp14, (2, 3), (0, 1, 3)) * -1 - del tmp14 - r2new += einsum(tmp15, (0,), t2, (1, 0, 2, 3), (2, 3, 1)) * 2 - del tmp15 - r2new += einsum(r1, (0,), tmp16, (1, 2), (2, 0, 1)) * -1 - del tmp16 - r1new = einsum(r2, (0, 1, 2), tmp0, (2, 1, 0, 3), (3,)) * -1 - del tmp0 - r1new += einsum(tmp2, (0, 1, 2), tmp1, (0, 2), (1,)) * -2 - del tmp2, tmp1 - r1new += einsum(r1, (0,), tmp3, (0, 1), (1,)) - del tmp3 - r1new += einsum(tmp6, (0,), t1, (0, 1), (1,)) * -1 - del tmp6 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:34:09.605351. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp100 : array - tmp103 : array - tmp104 : array - tmp108 : array - tmp111 : array - tmp112 : array - tmp114 : array - tmp115 : array - tmp12 : array - tmp129 : array - tmp13 : array - tmp131 : array - tmp14 : array - tmp17 : array - tmp19 : array - tmp2 : array - tmp20 : array - tmp21 : array - tmp22 : array - tmp24 : array - tmp26 : array - tmp29 : array - tmp3 : array - tmp32 : array - tmp33 : array - tmp35 : array - tmp36 : array - tmp38 : array - tmp4 : array - tmp41 : array - tmp44 : array - tmp48 : array - tmp49 : array - tmp51 : array - tmp54 : array - tmp57 : array - tmp6 : array - tmp60 : array - tmp63 : array - tmp66 : array - tmp69 : array - tmp70 : array - tmp72 : array - tmp73 : array - tmp75 : array - tmp78 : array - tmp81 : array - tmp82 : array - tmp85 : array - tmp86 : array - tmp87 : array - tmp88 : array - tmp9 : array - tmp91 : array - tmp92 : array - tmp94 : array - tmp98 : array - """ - - tmp20 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp17 = einsum(t1, (0, 1), v.ovov, (2, 3, 0, 1), (2, 3)) - tmp47 = einsum(v.ovov, (0, 1, 2, 3), t1, (2, 1), (0, 3)) - tmp107 = einsum(tmp20, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp86 = einsum(tmp17, (0, 1), t1, (2, 1), (2, 0)) - tmp85 = einsum(tmp47, (0, 1), t1, (2, 1), (2, 0)) - tmp99 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp97 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp93 = einsum(t1, (0, 1), v.ovvv, (0, 1, 2, 3), (2, 3)) - tmp90 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp13 = einsum(v.ooov, (0, 1, 2, 3), t1, (2, 3), (0, 1)) - tmp12 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp81 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp22 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 1), (4, 0)) - tmp24 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 3), (4, 0)) - tmp0 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp131 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 3), (4, 1)) - tmp129 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 1), (4, 3)) - tmp115 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp114 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp112 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp111 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp108 = einsum(tmp107, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - del tmp107 - tmp104 = einsum(tmp86, (0, 1), t1, (1, 2), (0, 2)) - tmp103 = einsum(t1, (0, 1), tmp85, (2, 0), (2, 1)) - tmp100 = einsum(t1, (0, 1), tmp99, (2, 3, 1, 4), (0, 2, 3, 4)) - del tmp99 - tmp98 = einsum(t1, (0, 1), tmp97, (1, 2), (0, 2)) - del tmp97 - tmp94 = einsum(t1, (0, 1), tmp93, (2, 1), (0, 2)) - del tmp93 - tmp92 = einsum(tmp90, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp91 = einsum(tmp90, (0, 1, 2, 3), t1, (2, 4), (0, 1, 3, 4)) - del tmp90 - tmp88 = einsum(tmp13, (0, 1), t1, (1, 2), (0, 2)) - tmp87 = einsum(t1, (0, 1), tmp12, (2, 0), (2, 1)) - tmp82 = einsum(tmp81, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp78 = einsum(t1, (0, 1), tmp22, (2, 0), (2, 1)) - tmp75 = einsum(tmp24, (0, 1), t1, (1, 2), (0, 2)) - tmp73 = einsum(tmp20, (0, 1, 2, 3), t2, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp72 = einsum(t2, (0, 1, 2, 3), tmp20, (4, 5, 1, 2), (4, 0, 5, 3)) - tmp70 = einsum(t2, (0, 1, 2, 3), tmp20, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp69 = einsum(t2, (0, 1, 2, 3), tmp20, (4, 1, 5, 2), (4, 0, 5, 3)) - tmp66 = einsum(tmp20, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) - tmp63 = einsum(tmp20, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp60 = einsum(t2, (0, 1, 2, 3), tmp17, (4, 3), (0, 1, 4, 2)) - tmp57 = einsum(t2, (0, 1, 2, 3), tmp47, (4, 3), (0, 1, 4, 2)) - tmp54 = einsum(tmp17, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp51 = einsum(tmp17, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp49 = einsum(tmp47, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp48 = einsum(tmp47, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - del tmp47 - tmp44 = einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp41 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 3), (0, 4)) - tmp38 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 3, 1), (4, 2)) - tmp36 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp35 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 1, 2), (0, 4, 5, 3)) - tmp33 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp32 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 2), (0, 4, 5, 3)) - tmp29 = einsum(v.ooov, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) - tmp26 = einsum(v.ooov, (0, 1, 2, 3), t2, (1, 2, 3, 4), (0, 4)) - tmp21 = einsum(t1, (0, 1), v.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp19 = einsum(v.oovv, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp14 = einsum(v.oooo, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp9 = einsum(tmp0, (0, 1), t1, (0, 2), (1, 2)) - tmp6 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp4 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp3 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp2 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp1 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp100": tmp100, f"tmp103": tmp103, f"tmp104": tmp104, f"tmp108": tmp108, f"tmp111": tmp111, f"tmp112": tmp112, f"tmp114": tmp114, f"tmp115": tmp115, f"tmp12": tmp12, f"tmp129": tmp129, f"tmp13": tmp13, f"tmp131": tmp131, f"tmp14": tmp14, f"tmp17": tmp17, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp24": tmp24, f"tmp26": tmp26, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp35": tmp35, f"tmp36": tmp36, f"tmp38": tmp38, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp44": tmp44, f"tmp48": tmp48, f"tmp49": tmp49, f"tmp51": tmp51, f"tmp54": tmp54, f"tmp57": tmp57, f"tmp6": tmp6, f"tmp60": tmp60, f"tmp63": tmp63, f"tmp66": tmp66, f"tmp69": tmp69, f"tmp70": tmp70, f"tmp72": tmp72, f"tmp73": tmp73, f"tmp75": tmp75, f"tmp78": tmp78, f"tmp81": tmp81, f"tmp82": tmp82, f"tmp85": tmp85, f"tmp86": tmp86, f"tmp87": tmp87, f"tmp88": tmp88, f"tmp9": tmp9, f"tmp91": tmp91, f"tmp92": tmp92, f"tmp94": tmp94, f"tmp98": tmp98} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:34:09.656859. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp12 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp12 += t2 - tmp14 = np.copy(f.oo) - tmp14 += np.transpose(ints.tmp0, (1, 0)) - tmp14 += ints.tmp24 * 2 - tmp14 += ints.tmp22 * -1 - tmp8 = np.copy(ints.tmp115) * 2 - del ints.tmp115 - tmp8 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp8 += ints.tmp112 * -1 - del ints.tmp112 - tmp8 += ints.tmp114 * -1 - del ints.tmp114 - tmp9 = np.copy(ints.tmp111) - del ints.tmp111 - tmp9 += v.oovv * -1 - tmp11 = np.copy(ints.tmp131) * 2 - del ints.tmp131 - tmp11 += f.vv * -1 - tmp11 += ints.tmp129 * -1 - del ints.tmp129 - tmp11 += einsum(f.ov, (0, 1), t1, (0, 2), (2, 1)) - tmp10 = np.copy(ints.tmp81) - del ints.tmp81 - tmp10 += np.transpose(v.oooo, (0, 2, 1, 3)) - tmp13 = einsum(tmp12, (0, 1, 2, 3), r2, (1, 0, 3), (2,)) - del tmp12 - tmp0 = np.copy(r2) * -0.5 - tmp0 += np.transpose(r2, (1, 0, 2)) - tmp4 = np.copy(v.ooov) * -0.5 - tmp4 += np.transpose(v.ovoo, (0, 2, 3, 1)) - tmp1 = np.copy(ints.tmp108) - del ints.tmp108 - tmp1 += np.transpose(ints.tmp14, (1, 2, 0, 3)) - del ints.tmp14 - tmp1 += ints.tmp32 - del ints.tmp32 - tmp1 += ints.tmp69 - del ints.tmp69 - tmp1 += ints.tmp73 - del ints.tmp73 - tmp1 += ints.tmp82 - del ints.tmp82 - tmp1 += ints.tmp91 - del ints.tmp91 - tmp1 += ints.tmp100 * -1 - del ints.tmp100 - tmp1 += ints.tmp20 * -1 - del ints.tmp20 - tmp1 += ints.tmp44 * -1 - del ints.tmp44 - tmp1 += ints.tmp70 * -2 - del ints.tmp70 - tmp5 = np.copy(ints.tmp104) * 2 - del ints.tmp104 - tmp5 += ints.tmp19 - del ints.tmp19 - tmp5 += ints.tmp1 - del ints.tmp1 - tmp5 += ints.tmp29 * 2 - del ints.tmp29 - tmp5 += ints.tmp3 - del ints.tmp3 - tmp5 += ints.tmp41 - del ints.tmp41 - tmp5 += ints.tmp49 * 2 - del ints.tmp49 - tmp5 += ints.tmp51 * 2 - del ints.tmp51 - tmp5 += ints.tmp63 * 2 - del ints.tmp63 - tmp5 += ints.tmp75 * 2 - del ints.tmp75 - tmp5 += ints.tmp88 * 2 - del ints.tmp88 - tmp5 += ints.tmp98 - del ints.tmp98 - tmp5 += ints.tmp9 - del ints.tmp9 - tmp5 += f.ov * -1 - tmp5 += ints.tmp103 * -1 - del ints.tmp103 - tmp5 += ints.tmp17 * -2 - del ints.tmp17 - tmp5 += ints.tmp26 * -1 - del ints.tmp26 - tmp5 += ints.tmp2 * -1 - del ints.tmp2 - tmp5 += ints.tmp38 * -2 - del ints.tmp38 - tmp5 += ints.tmp48 * -1 - del ints.tmp48 - tmp5 += ints.tmp4 * -2 - del ints.tmp4 - tmp5 += ints.tmp54 * -4 - del ints.tmp54 - tmp5 += ints.tmp66 * -1 - del ints.tmp66 - tmp5 += ints.tmp78 * -1 - del ints.tmp78 - tmp5 += ints.tmp87 * -1 - del ints.tmp87 - tmp5 += ints.tmp94 * -2 - del ints.tmp94 - tmp6 = np.copy(r2) * -1 - tmp6 += np.transpose(r2, (1, 0, 2)) * 2 - tmp7 = np.copy(f.oo) - tmp7 += np.transpose(ints.tmp0, (1, 0)) - del ints.tmp0 - tmp7 += np.transpose(ints.tmp13, (1, 0)) * 2 - del ints.tmp13 - tmp7 += ints.tmp24 * 2 - del ints.tmp24 - tmp7 += ints.tmp86 * 2 - del ints.tmp86 - tmp7 += ints.tmp12 * -1 - del ints.tmp12 - tmp7 += ints.tmp22 * -1 - del ints.tmp22 - tmp7 += ints.tmp85 * -1 - del ints.tmp85 - tmp3 = np.copy(np.transpose(ints.tmp33, (0, 2, 1, 3))) - del ints.tmp33 - tmp3 += ints.tmp35 - del ints.tmp35 - tmp3 += np.transpose(ints.tmp57, (0, 2, 1, 3)) - del ints.tmp57 - tmp3 += np.transpose(ints.tmp72, (0, 2, 1, 3)) - del ints.tmp72 - tmp3 += ints.tmp92 - del ints.tmp92 - tmp3 += ints.tmp21 * -1 - del ints.tmp21 - tmp3 += ints.tmp36 * -2 - del ints.tmp36 - tmp3 += np.transpose(ints.tmp60, (0, 2, 1, 3)) * -2 - del ints.tmp60 - tmp3 += np.transpose(ints.tmp6, (1, 0, 2, 3)) * -1 - del ints.tmp6 - tmp2 = np.copy(r2) * 2 - tmp2 += np.transpose(r2, (1, 0, 2)) * -1 - r2new = einsum(f.ov, (0, 1), r1, (2,), (0, 2, 1)) * -1 - r2new += einsum(r1, (0,), v.ovoo, (1, 2, 3, 0), (1, 3, 2)) - r2new += einsum(tmp8, (0, 1, 2, 3), tmp0, (4, 0, 2), (1, 4, 3)) * 2 - del tmp8 - r2new += einsum(r2, (0, 1, 2), tmp9, (1, 3, 2, 4), (0, 3, 4)) - r2new += einsum(r2, (0, 1, 2), tmp9, (0, 3, 2, 4), (3, 1, 4)) - del tmp9 - r2new += einsum(r2, (0, 1, 2), tmp10, (0, 1, 3, 4), (3, 4, 2)) - del tmp10 - r2new += einsum(tmp11, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp11 - r2new += einsum(tmp13, (0,), v.ovov, (1, 2, 3, 0), (1, 3, 2)) * -2 - del tmp13 - r2new += einsum(tmp14, (0, 1), r2, (0, 2, 3), (1, 2, 3)) * -1 - r2new += einsum(r2, (0, 1, 2), tmp14, (1, 3), (0, 3, 2)) * -1 - del tmp14 - r1new = einsum(tmp1, (0, 1, 2, 3), tmp0, (0, 1, 3), (2,)) * -2 - del tmp0, tmp1 - r1new += einsum(tmp3, (0, 1, 2, 3), tmp2, (0, 2, 3), (1,)) * -1 - del tmp3, tmp2 - r1new += einsum(r2, (0, 1, 2), tmp4, (0, 3, 1, 2), (3,)) * 2 - del tmp4 - r1new += einsum(tmp5, (0, 1), tmp6, (2, 0, 1), (2,)) - del tmp5, tmp6 - r1new += einsum(tmp7, (0, 1), r1, (0,), (1,)) * -1 - del tmp7 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:35:01.209629. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp103 : array - tmp106 : array - tmp107 : array - tmp109 : array - tmp11 : array - tmp111 : array - tmp113 : array - tmp14 : array - tmp16 : array - tmp17 : array - tmp19 : array - tmp2 : array - tmp24 : array - tmp27 : array - tmp29 : array - tmp3 : array - tmp31 : array - tmp34 : array - tmp37 : array - tmp4 : array - tmp40 : array - tmp43 : array - tmp46 : array - tmp48 : array - tmp51 : array - tmp53 : array - tmp55 : array - tmp56 : array - tmp57 : array - tmp59 : array - tmp62 : array - tmp69 : array - tmp70 : array - tmp73 : array - tmp76 : array - tmp79 : array - tmp80 : array - tmp83 : array - tmp84 : array - tmp87 : array - tmp88 : array - tmp90 : array - tmp92 : array - tmp96 : array - tmp98 : array - """ - - tmp17 = einsum(t1, (0, 1), v.ovov, (2, 3, 0, 1), (2, 3)) - tmp55 = einsum(v.ovov, (0, 1, 2, 3), t1, (2, 1), (0, 3)) - tmp112 = einsum(tmp17, (0, 1), t1, (2, 1), (2, 0)) - tmp110 = einsum(tmp55, (0, 1), t1, (2, 1), (2, 0)) - tmp16 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp14 = einsum(t1, (0, 1), v.ovvv, (0, 1, 2, 3), (2, 3)) - tmp97 = einsum(v.ooov, (0, 1, 2, 3), t1, (2, 3), (0, 1)) - tmp95 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp83 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 1), (4, 0)) - tmp79 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 3), (4, 0)) - tmp69 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp10 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp113 = einsum(t1, (0, 1), tmp112, (2, 0), (2, 1)) - del tmp112 - tmp111 = einsum(tmp110, (0, 1), t1, (1, 2), (0, 2)) - del tmp110 - tmp109 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp107 = einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp106 = einsum(t1, (0, 1), tmp16, (1, 2), (0, 2)) - tmp103 = einsum(t1, (0, 1), tmp14, (2, 1), (0, 2)) - tmp98 = einsum(tmp97, (0, 1), t1, (1, 2), (0, 2)) - del tmp97 - tmp96 = einsum(t1, (0, 1), tmp95, (2, 0), (2, 1)) - del tmp95 - tmp92 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp90 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp88 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp87 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp84 = einsum(t1, (0, 1), tmp83, (2, 0), (2, 1)) - tmp80 = einsum(tmp79, (0, 1), t1, (1, 2), (0, 2)) - tmp76 = einsum(tmp69, (0, 1, 2, 3), t2, (2, 1, 4, 5), (0, 5, 4, 3)) - tmp73 = einsum(tmp69, (0, 1, 2, 3), t2, (2, 1, 3, 4), (0, 4)) - tmp70 = einsum(tmp69, (0, 1, 2, 3), t2, (1, 2, 3, 4), (0, 4)) - tmp62 = einsum(tmp17, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp59 = einsum(tmp17, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp57 = einsum(t2, (0, 1, 2, 3), tmp55, (1, 3), (0, 2)) - tmp56 = einsum(t2, (0, 1, 2, 3), tmp55, (1, 2), (0, 3)) - tmp53 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp51 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 2), (0, 3, 4, 5)) - tmp48 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp46 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 5), (0, 3, 4, 5)) - tmp43 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 1, 3), (4, 2)) - tmp40 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 2), (0, 4)) - tmp37 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 0, 5), (4, 3, 2, 5)) - tmp34 = einsum(v.ooov, (0, 1, 2, 3), t2, (2, 1, 3, 4), (0, 4)) - tmp31 = einsum(v.ooov, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp29 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 3), (4, 1)) - tmp27 = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 4, 1, 2), (3, 4)) - tmp24 = einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp19 = einsum(v.oovv, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp11 = einsum(tmp10, (0, 1), t1, (0, 2), (1, 2)) - tmp4 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp3 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp2 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp1 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp103": tmp103, f"tmp106": tmp106, f"tmp107": tmp107, f"tmp109": tmp109, f"tmp11": tmp11, f"tmp111": tmp111, f"tmp113": tmp113, f"tmp14": tmp14, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp24": tmp24, f"tmp27": tmp27, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp31": tmp31, f"tmp34": tmp34, f"tmp37": tmp37, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp43": tmp43, f"tmp46": tmp46, f"tmp48": tmp48, f"tmp51": tmp51, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp62": tmp62, f"tmp69": tmp69, f"tmp70": tmp70, f"tmp73": tmp73, f"tmp76": tmp76, f"tmp79": tmp79, f"tmp80": tmp80, f"tmp83": tmp83, f"tmp84": tmp84, f"tmp87": tmp87, f"tmp88": tmp88, f"tmp90": tmp90, f"tmp92": tmp92, f"tmp96": tmp96, f"tmp98": tmp98} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:35:01.254922. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp9 = einsum(r2, (0, 1, 2), t1, (3, 1), (2, 3, 0)) - tmp23 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp23 += t2 - tmp20 = einsum(t1, (0, 1), f.ov, (0, 2), (2, 1)) - tmp2 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp2 += np.transpose(r2, (2, 1, 0)) * -0.5 - tmp10 = einsum(t1, (0, 1), tmp9, (2, 3, 1), (2, 0, 3)) - del tmp9 - tmp14 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp14 += t2 * 2 - tmp22 = np.copy(f.oo) - tmp22 += np.transpose(ints.tmp10, (1, 0)) - del ints.tmp10 - tmp22 += ints.tmp79 * 2 - del ints.tmp79 - tmp22 += ints.tmp83 * -1 - del ints.tmp83 - tmp17 = einsum(t2, (0, 1, 2, 3), r2, (2, 3, 4), (4, 0, 1)) - tmp24 = einsum(r2, (0, 1, 2), tmp23, (2, 3, 0, 1), (3,)) - del tmp23 - tmp21 = np.copy(ints.tmp29) * 2 - tmp21 += f.vv * -1 - tmp21 += ints.tmp27 * -1 - tmp21 += np.transpose(tmp20, (1, 0)) - del tmp20 - tmp19 = np.copy(ints.tmp90) - tmp19 += v.oovv * -1 - tmp18 = np.copy(ints.tmp88) * 2 - tmp18 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp18 += ints.tmp87 * -1 - tmp18 += ints.tmp92 * -1 - tmp4 = np.copy(ints.tmp107) - del ints.tmp107 - tmp4 += v.oovv - tmp4 += np.transpose(ints.tmp90, (0, 1, 3, 2)) * -1 - del ints.tmp90 - tmp8 = np.copy(np.transpose(r2, (2, 0, 1))) * -1 - tmp8 += np.transpose(r2, (2, 1, 0)) * 2 - tmp1 = np.copy(ints.tmp24) - tmp1 += np.transpose(ints.tmp46, (0, 2, 1, 3)) * 0.5 - tmp1 += np.transpose(ints.tmp53, (0, 2, 1, 3)) * 0.5 - tmp1 += np.transpose(ints.tmp76, (0, 3, 1, 2)) - tmp1 += np.transpose(ints.tmp37, (0, 3, 1, 2)) * -0.5 - tmp1 += np.transpose(ints.tmp48, (0, 2, 1, 3)) * -1 - tmp1 += np.transpose(ints.tmp51, (0, 2, 1, 3)) * -1 - tmp3 = einsum(tmp2, (0, 1, 2), t1, (3, 1), (0, 3, 2)) - tmp5 = einsum(tmp2, (0, 1, 2), t1, (3, 2), (0, 3, 1)) * 2 - tmp11 = np.copy(tmp10) - tmp11 += np.transpose(tmp10, (0, 2, 1)) * -0.5 - tmp6 = np.copy(ints.tmp109) - del ints.tmp109 - tmp6 += np.transpose(ints.tmp88, (0, 1, 3, 2)) * 2 - del ints.tmp88 - tmp6 += np.transpose(v.ovov, (0, 2, 3, 1)) - tmp6 += np.transpose(ints.tmp87, (0, 1, 3, 2)) * -1 - del ints.tmp87 - tmp6 += np.transpose(ints.tmp92, (0, 1, 3, 2)) * -1 - del ints.tmp92 - tmp12 = np.copy(tmp10) * -1 - tmp12 += np.transpose(tmp10, (0, 2, 1)) * 2 - del tmp10 - tmp7 = np.copy(ints.tmp106) - del ints.tmp106 - tmp7 += ints.tmp113 * 2 - del ints.tmp113 - tmp7 += ints.tmp11 - del ints.tmp11 - tmp7 += ints.tmp19 - del ints.tmp19 - tmp7 += ints.tmp1 - del ints.tmp1 - tmp7 += ints.tmp34 * 2 - del ints.tmp34 - tmp7 += ints.tmp3 - del ints.tmp3 - tmp7 += ints.tmp43 - del ints.tmp43 - tmp7 += ints.tmp57 * 2 - del ints.tmp57 - tmp7 += ints.tmp59 * 2 - del ints.tmp59 - tmp7 += ints.tmp70 * 2 - del ints.tmp70 - tmp7 += ints.tmp80 * 2 - del ints.tmp80 - tmp7 += ints.tmp98 * 2 - del ints.tmp98 - tmp7 += f.ov * -1 - tmp7 += ints.tmp103 * -2 - del ints.tmp103 - tmp7 += ints.tmp111 * -1 - del ints.tmp111 - tmp7 += ints.tmp17 * -2 - tmp7 += ints.tmp2 * -1 - del ints.tmp2 - tmp7 += ints.tmp31 * -1 - del ints.tmp31 - tmp7 += ints.tmp40 * -2 - del ints.tmp40 - tmp7 += ints.tmp4 * -2 - del ints.tmp4 - tmp7 += ints.tmp56 * -1 - del ints.tmp56 - tmp7 += ints.tmp62 * -4 - del ints.tmp62 - tmp7 += ints.tmp73 * -1 - del ints.tmp73 - tmp7 += ints.tmp84 * -1 - del ints.tmp84 - tmp7 += ints.tmp96 * -1 - del ints.tmp96 - tmp13 = np.copy(f.vv) - tmp13 += np.transpose(ints.tmp14, (1, 0)) * 2 - del ints.tmp14 - tmp13 += ints.tmp27 - del ints.tmp27 - tmp13 += np.transpose(ints.tmp16, (1, 0)) * -1 - del ints.tmp16 - tmp13 += ints.tmp29 * -2 - del ints.tmp29 - tmp15 = einsum(t1, (0, 1), r1, (1,), (0,)) * 0.5 - tmp15 += einsum(r2, (0, 1, 2), tmp14, (2, 3, 0, 1), (3,)) * -0.5 - del tmp14 - tmp0 = np.copy(ints.tmp24) - del ints.tmp24 - tmp0 += np.transpose(ints.tmp46, (0, 2, 1, 3)) * 2 - del ints.tmp46 - tmp0 += np.transpose(ints.tmp53, (0, 2, 1, 3)) * 2 - del ints.tmp53 - tmp0 += np.transpose(ints.tmp76, (0, 3, 1, 2)) - del ints.tmp76 - tmp0 += np.transpose(ints.tmp37, (0, 3, 1, 2)) * -2 - del ints.tmp37 - tmp0 += np.transpose(ints.tmp48, (0, 2, 1, 3)) * -4 - del ints.tmp48 - tmp0 += np.transpose(ints.tmp51, (0, 2, 1, 3)) * -1 - del ints.tmp51 - tmp0 += np.transpose(v.ovvv, (0, 2, 1, 3)) * -2 - tmp0 += np.transpose(v.ovvv, (0, 2, 3, 1)) - tmp16 = np.copy(f.ov) - tmp16 += ints.tmp17 * 2 - del ints.tmp17 - tmp16 += ints.tmp55 * -1 - del ints.tmp55 - r2new = einsum(tmp17, (0, 1, 2), v.ovov, (2, 3, 1, 4), (4, 3, 0)) - del tmp17 - r2new += einsum(r1, (0,), v.ovvv, (1, 2, 3, 0), (2, 3, 1)) * -1 - r2new += einsum(r2, (0, 1, 2), v.vvvv, (3, 0, 4, 1), (3, 4, 2)) - r2new += einsum(r1, (0,), f.ov, (1, 2), (2, 0, 1)) * -1 - r2new += einsum(tmp18, (0, 1, 2, 3), tmp2, (0, 2, 4), (3, 4, 1)) * 2 - del tmp2, tmp18 - r2new += einsum(tmp19, (0, 1, 2, 3), r2, (4, 2, 0), (4, 3, 1)) - r2new += einsum(tmp19, (0, 1, 2, 3), r2, (2, 4, 0), (3, 4, 1)) - del tmp19 - r2new += einsum(tmp21, (0, 1), r2, (0, 2, 3), (1, 2, 3)) * -1 - r2new += einsum(r2, (0, 1, 2), tmp21, (1, 3), (0, 3, 2)) * -1 - del tmp21 - r2new += einsum(r2, (0, 1, 2), tmp22, (2, 3), (0, 1, 3)) * -1 - del tmp22 - r2new += einsum(tmp24, (0,), v.ovov, (1, 2, 0, 3), (2, 3, 1)) * -2 - del tmp24 - r1new = einsum(tmp0, (0, 1, 2, 3), r2, (2, 3, 0), (1,)) - del tmp0 - r1new += einsum(r2, (0, 1, 2), tmp1, (2, 3, 1, 0), (3,)) * -2 - del tmp1 - r1new += einsum(tmp4, (0, 1, 2, 3), tmp3, (0, 1, 3), (2,)) * 2 - del tmp4, tmp3 - r1new += einsum(tmp5, (0, 1, 2), tmp6, (0, 1, 3, 2), (3,)) - del tmp5, tmp6 - r1new += einsum(tmp8, (0, 1, 2), tmp7, (0, 2), (1,)) - del tmp8, tmp7 - r1new += einsum(ints.tmp69, (0, 1, 2, 3), tmp11, (0, 2, 1), (3,)) * -2 - del ints.tmp69, tmp11 - r1new += einsum(v.ooov, (0, 1, 2, 3), tmp12, (0, 2, 1), (3,)) * -1 - del tmp12 - r1new += einsum(r1, (0,), tmp13, (0, 1), (1,)) - del tmp13 - r1new += einsum(tmp15, (0,), tmp16, (0, 1), (1,)) * -2 - del tmp15, tmp16 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/RCC3.py b/ebcc/codegen/RCC3.py deleted file mode 100644 index 40b1baae..00000000 --- a/ebcc/codegen/RCC3.py +++ /dev/null @@ -1,583 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:11:19.393637 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:11:20.097058. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp0 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp1 = np.copy(f.ov) - tmp1 += einsum(tmp0, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - del tmp0 - e_cc = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 2, 1, 3), ()) * 2 - e_cc += einsum(t2, (0, 1, 2, 3), v.ovov, (0, 3, 1, 2), ()) * -1 - e_cc += einsum(t1, (0, 1), tmp1, (0, 1), ()) * 2 - del tmp1 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, t3=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:12:13.059035. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - t3 : array - T3 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - t3new : array - Updated T3 residuals. - """ - - tmp2 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp4 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * 2 - tmp4 += np.transpose(v.ovov, (0, 2, 1, 3)) * -1 - tmp17 = einsum(tmp2, (0, 1, 2, 3), t1, (4, 3), (0, 4, 2, 1)) - tmp70 = np.copy(tmp2) * -1 - tmp70 += np.transpose(tmp2, (0, 2, 1, 3)) * 2 - tmp5 = einsum(tmp4, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp51 = einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp51 += np.transpose(t2, (0, 1, 3, 2)) * -2 - tmp51 += t2 - tmp44 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp94 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - tmp19 = einsum(t1, (0, 1), v.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp106 = einsum(tmp2, (0, 1, 2, 3), t2, (4, 5, 6, 3), (0, 4, 5, 2, 1, 6)) - tmp78 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp87 = einsum(t1, (0, 1), tmp17, (2, 3, 0, 4), (3, 2, 4, 1)) - tmp80 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp32 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -0.5 - tmp32 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp71 = einsum(tmp70, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 1, 5)) - del tmp70 - tmp69 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) - tmp66 = np.copy(v.ovvv) * 2 - tmp66 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -1 - tmp74 = np.copy(v.ooov) * -1 - tmp74 += np.transpose(v.ovoo, (0, 2, 3, 1)) * 2 - tmp60 = einsum(tmp4, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 1, 5, 2)) - del tmp4 - tmp59 = einsum(t1, (0, 1), tmp2, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp63 = einsum(v.ovov, (0, 1, 2, 3), t1, (2, 3), (0, 1)) - tmp49 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp53 = einsum(tmp5, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) - tmp48 = einsum(t1, (0, 1), v.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp52 = einsum(tmp51, (0, 1, 2, 3), v.ooov, (4, 5, 0, 3), (4, 5, 1, 2)) - del tmp51 - tmp50 = einsum(tmp2, (0, 1, 2, 3), t2, (4, 2, 3, 5), (0, 4, 1, 5)) - tmp96 = einsum(tmp44, (0, 1, 2, 3), t2, (4, 5, 6, 2), (0, 4, 5, 1, 6, 3)) - tmp95 = einsum(t1, (0, 1), tmp94, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - del tmp94 - tmp93 = einsum(tmp19, (0, 1, 2, 3), t2, (4, 3, 5, 6), (0, 4, 2, 1, 5, 6)) - tmp103 = einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp101 = einsum(t1, (0, 1), v.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp40 = einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp107 = einsum(t1, (0, 1), tmp106, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - del tmp106 - tmp109 = np.copy(np.transpose(tmp78, (2, 1, 0, 3))) * -1 - tmp109 += tmp87 - tmp123 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 6, 3), (4, 5, 0, 2, 6, 1)) - tmp81 = np.copy(f.oo) - tmp81 += tmp80 - tmp28 = einsum(v.ovov, (0, 1, 2, 3), t3, (4, 5, 2, 3, 6, 1), (4, 5, 0, 6)) * -1 - tmp33 = einsum(tmp32, (0, 1, 2, 3), t2, (0, 1, 2, 4), (4, 3)) - tmp37 = einsum(t2, (0, 1, 2, 3), tmp32, (1, 4, 3, 2), (0, 4)) * 2 - del tmp32 - tmp35 = np.copy(np.transpose(t3, (0, 2, 1, 3, 5, 4))) - tmp35 += einsum(t1, (0, 1), t2, (2, 3, 4, 5), (0, 2, 3, 4, 1, 5)) * -1 - tmp30 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp23 = einsum(t3, (0, 1, 2, 3, 4, 5), v.ovov, (6, 4, 2, 5), (0, 1, 6, 3)) - tmp72 = np.copy(tmp2) - tmp72 += tmp69 * -1 - del tmp69 - tmp72 += np.transpose(tmp71, (1, 0, 2, 3)) - del tmp71 - tmp67 = einsum(t1, (0, 1), tmp66, (0, 1, 2, 3), (2, 3)) - del tmp66 - tmp75 = einsum(tmp74, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - del tmp74 - tmp61 = np.copy(tmp59) - del tmp59 - tmp61 += tmp60 * -1 - tmp64 = np.copy(f.ov) - tmp64 += tmp63 * 2 - del tmp63 - tmp54 = np.copy(np.transpose(tmp48, (0, 2, 1, 3))) * -1 - tmp54 += np.transpose(tmp49, (0, 2, 1, 3)) - del tmp49 - tmp54 += np.transpose(tmp50, (0, 2, 1, 3)) - del tmp50 - tmp54 += np.transpose(tmp52, (2, 1, 0, 3)) - del tmp52 - tmp54 += np.transpose(tmp53, (1, 2, 0, 3)) * -1 - del tmp53 - tmp56 = einsum(tmp5, (0, 1), t1, (2, 1), (2, 0)) - tmp46 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp46 += t2 * 2 - tmp13 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp13 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp97 = np.copy(np.transpose(tmp93, (0, 1, 3, 2, 4, 5))) - del tmp93 - tmp97 += np.transpose(tmp95, (0, 1, 3, 2, 4, 5)) - del tmp95 - tmp97 += np.transpose(tmp96, (0, 1, 3, 2, 4, 5)) * -1 - del tmp96 - tmp104 = einsum(tmp103, (0, 1, 2, 3), t2, (4, 5, 6, 2), (0, 4, 5, 6, 3, 1)) - del tmp103 - tmp102 = einsum(t2, (0, 1, 2, 3), tmp101, (4, 1, 5, 6), (0, 5, 4, 6, 2, 3)) - del tmp101 - tmp91 = einsum(t1, (0, 1), tmp44, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp117 = einsum(t1, (0, 1), tmp19, (2, 3, 4, 0), (2, 4, 3, 1)) - tmp126 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 5, 6, 3), (4, 5, 0, 1, 6, 2)) - tmp99 = einsum(tmp40, (0, 1, 2, 3), t2, (4, 5, 6, 3), (0, 4, 5, 1, 6, 2)) - tmp113 = np.copy(f.oo) - tmp113 += tmp80 - del tmp80 - tmp119 = einsum(f.ov, (0, 1), t3, (2, 3, 4, 5, 6, 1), (0, 2, 4, 3, 5, 6)) - tmp108 = einsum(t1, (0, 1), tmp107, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp107 - tmp110 = einsum(t2, (0, 1, 2, 3), tmp109, (4, 5, 1, 6), (0, 4, 5, 3, 2, 6)) - del tmp109 - tmp122 = einsum(tmp2, (0, 1, 2, 3), t2, (4, 2, 5, 6), (0, 4, 1, 5, 6, 3)) - tmp124 = einsum(t1, (0, 1), tmp123, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp123 - tmp82 = einsum(t2, (0, 1, 2, 3), tmp81, (1, 4), (0, 4, 3, 2)) - del tmp81 - tmp79 = einsum(tmp78, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - del tmp78 - tmp16 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 5), (4, 0, 5, 1)) - tmp26 = einsum(v.ooov, (0, 1, 2, 3), t3, (4, 1, 2, 5, 6, 3), (4, 0, 5, 6)) - tmp29 = einsum(tmp28, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp28 - tmp27 = einsum(tmp2, (0, 1, 2, 3), t3, (1, 4, 2, 5, 6, 3), (0, 4, 5, 6)) * -1 - tmp34 = einsum(tmp33, (0, 1), t2, (2, 3, 1, 4), (2, 3, 4, 0)) * 2 - del tmp33 - tmp38 = einsum(t2, (0, 1, 2, 3), tmp37, (4, 1), (0, 4, 3, 2)) - del tmp37 - tmp36 = einsum(tmp35, (0, 1, 2, 3, 4, 5), v.ovvv, (0, 3, 6, 5), (1, 2, 6, 4)) - del tmp35 - tmp31 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp30, (2, 5), (0, 1, 3, 4)) - del tmp30 - tmp41 = np.copy(t2) - tmp41 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp18 = einsum(t3, (0, 1, 2, 3, 4, 5), v.ooov, (6, 2, 0, 5), (1, 6, 3, 4)) * -1 - tmp24 = einsum(tmp23, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp23 - tmp22 = einsum(tmp2, (0, 1, 2, 3), t3, (4, 2, 1, 5, 6, 3), (0, 4, 5, 6)) - tmp20 = einsum(tmp19, (0, 1, 2, 3), t2, (3, 2, 4, 5), (0, 1, 5, 4)) - del tmp19 - tmp21 = einsum(v.ovvv, (0, 1, 2, 3), t3, (4, 5, 0, 3, 6, 1), (4, 5, 6, 2)) * -1 - tmp73 = einsum(t1, (0, 1), tmp72, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp72 - tmp68 = einsum(tmp67, (0, 1), t2, (2, 3, 1, 4), (2, 3, 4, 0)) - del tmp67 - tmp76 = einsum(t2, (0, 1, 2, 3), tmp75, (4, 1), (0, 4, 3, 2)) - del tmp75 - tmp62 = einsum(tmp61, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 5, 2)) - del tmp61 - tmp65 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp64, (2, 5), (0, 1, 3, 4)) - del tmp64 - tmp45 = einsum(tmp40, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp55 = einsum(t1, (0, 1), tmp54, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp54 - tmp57 = einsum(t2, (0, 1, 2, 3), tmp56, (4, 1), (0, 4, 3, 2)) - del tmp56 - tmp47 = einsum(tmp44, (0, 1, 2, 3), tmp46, (1, 4, 2, 5), (4, 0, 5, 3)) - del tmp46 - tmp43 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp9 = np.copy(v.ovvv) - tmp9 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -0.5 - tmp12 = np.copy(v.ooov) * -0.5 - tmp12 += np.transpose(v.ovoo, (0, 2, 3, 1)) - tmp11 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp11 += np.transpose(v.ovov, (0, 2, 1, 3)) * 2 - tmp14 = np.copy(f.ov) * 0.5 - tmp14 += einsum(tmp13, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - del tmp13 - tmp98 = einsum(tmp97, (0, 1, 2, 3, 4, 5), t1, (2, 6), (0, 1, 3, 6, 4, 5)) - del tmp97 - tmp115 = einsum(t3, (0, 1, 2, 3, 4, 5), f.vv, (6, 5), (0, 2, 1, 6, 3, 4)) - tmp105 = np.copy(tmp102) - del tmp102 - tmp105 += tmp104 - del tmp104 - tmp92 = einsum(t2, (0, 1, 2, 3), tmp91, (4, 5, 1, 6), (4, 5, 0, 2, 3, 6)) - del tmp91 - tmp112 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 6), (0, 4, 5, 2, 3, 6)) - tmp121 = einsum(tmp48, (0, 1, 2, 3), t2, (4, 2, 5, 6), (0, 4, 1, 5, 6, 3)) - del tmp48 - tmp116 = einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 5, 6, 3), (0, 1, 4, 2, 5, 6)) - tmp128 = np.copy(f.vv) - tmp128 += einsum(t1, (0, 1), f.ov, (0, 2), (2, 1)) * -1 - tmp118 = einsum(tmp117, (0, 1, 2, 3), t2, (4, 1, 5, 6), (0, 4, 2, 3, 5, 6)) - del tmp117 - tmp127 = einsum(t1, (0, 1), tmp126, (2, 3, 0, 4, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp126 - tmp100 = einsum(t1, (0, 1), tmp99, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp99 - tmp114 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp113, (2, 6), (0, 1, 6, 3, 5, 4)) * -1 - tmp120 = einsum(t1, (0, 1), tmp119, (0, 2, 3, 4, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp119 - tmp111 = np.copy(tmp108) - del tmp108 - tmp111 += np.transpose(tmp110, (2, 1, 0, 5, 4, 3)) - del tmp110 - tmp125 = np.copy(tmp122) - del tmp122 - tmp125 += tmp124 - del tmp124 - tmp83 = np.copy(tmp79) - del tmp79 - tmp83 += np.transpose(tmp82, (1, 0, 3, 2)) - del tmp82 - tmp89 = np.copy(v.oovv) * -1 - tmp89 += einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp90 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * -1 - tmp90 += tmp16 - tmp84 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp84 += v.oovv * -1 - tmp84 += tmp60 * 2 - del tmp60 - tmp85 = np.copy(v.oooo) - tmp85 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp39 = np.copy(tmp26) - del tmp26 - tmp39 += tmp27 - del tmp27 - tmp39 += tmp29 - del tmp29 - tmp39 += tmp31 - del tmp31 - tmp39 += np.transpose(tmp34, (1, 0, 2, 3)) - del tmp34 - tmp39 += np.transpose(tmp36, (0, 1, 3, 2)) * -1 - del tmp36 - tmp39 += np.transpose(tmp38, (0, 1, 3, 2)) - del tmp38 - tmp86 = np.copy(t2) - tmp86 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp42 = einsum(tmp40, (0, 1, 2, 3), tmp41, (1, 4, 5, 2), (0, 4, 3, 5)) - del tmp40, tmp41 - tmp25 = np.copy(tmp18) - del tmp18 - tmp25 += tmp20 * -1 - del tmp20 - tmp25 += tmp21 - del tmp21 - tmp25 += tmp22 - del tmp22 - tmp25 += tmp24 - del tmp24 - tmp77 = np.copy(np.transpose(tmp62, (1, 0, 3, 2))) - del tmp62 - tmp77 += tmp65 - del tmp65 - tmp77 += np.transpose(tmp68, (1, 0, 2, 3)) - del tmp68 - tmp77 += tmp73 * -1 - del tmp73 - tmp77 += np.transpose(tmp76, (0, 1, 3, 2)) * -1 - del tmp76 - tmp88 = np.copy(np.transpose(v.ooov, (0, 2, 1, 3))) * -1 - tmp88 += tmp87 - del tmp87 - tmp58 = np.copy(tmp43) - del tmp43 - tmp58 += tmp44 - del tmp44 - tmp58 += tmp45 * -1 - del tmp45 - tmp58 += np.transpose(tmp47, (1, 0, 2, 3)) - del tmp47 - tmp58 += tmp55 - del tmp55 - tmp58 += np.transpose(tmp57, (1, 0, 3, 2)) * -1 - del tmp57 - tmp10 = np.copy(f.vv) * 0.5 - tmp10 += einsum(t1, (0, 1), tmp9, (0, 1, 2, 3), (3, 2)) - del tmp9 - tmp1 = np.copy(v.ovvv) - tmp1 += np.transpose(v.ovvv, (0, 2, 1, 3)) * -0.5 - tmp15 = np.copy(f.oo) - tmp15 += einsum(tmp11, (0, 1, 2, 3), t2, (4, 0, 3, 2), (1, 4)) - del tmp11 - tmp15 += einsum(t1, (0, 1), tmp12, (0, 2, 3, 1), (3, 2)) * 2 - del tmp12 - tmp15 += einsum(tmp14, (0, 1), t1, (2, 1), (0, 2)) * 2 - del tmp14 - tmp8 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp8 += v.oovv * -1 - tmp6 = np.copy(f.ov) - tmp6 += tmp5 - del tmp5 - tmp7 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp7 += t2 * -1 - tmp3 = np.copy(v.ooov) - tmp3 += np.transpose(v.ooov, (0, 2, 1, 3)) * -0.5 - tmp3 += tmp2 * -0.5 - tmp3 += np.transpose(tmp2, (0, 2, 1, 3)) - del tmp2 - tmp0 = np.copy(np.transpose(t3, (0, 2, 1, 3, 5, 4))) * -3 - tmp0 += np.transpose(t3, (0, 2, 1, 3, 4, 5)) - tmp0 += t3 * -1 - t3new = np.copy(np.transpose(tmp92, (0, 1, 2, 3, 5, 4))) - t3new += np.transpose(tmp92, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp92, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp92, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp92, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp92, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp92, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp92, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp92, (1, 2, 0, 4, 3, 5)) - t3new += np.transpose(tmp92, (1, 2, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp92, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp92, (2, 1, 0, 4, 5, 3)) - del tmp92 - t3new += tmp98 * -1 - t3new += np.transpose(tmp98, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp98, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp98, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp98, (1, 0, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp98, (1, 0, 2, 4, 5, 3)) - t3new += np.transpose(tmp98, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp98, (2, 0, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp98, (1, 2, 0, 4, 3, 5)) - t3new += np.transpose(tmp98, (1, 2, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp98, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp98, (2, 1, 0, 5, 4, 3)) * -1 - del tmp98 - t3new += tmp100 * -1 - t3new += np.transpose(tmp100, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp100, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp100, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp100, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp100, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp100, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp100, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp100, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp100, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp100, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp100, (2, 1, 0, 5, 4, 3)) * -1 - del tmp100 - t3new += np.transpose(tmp105, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp105, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp105, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp105, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp105, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp105, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp105, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp105, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp105, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp105, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp105, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp105, (2, 1, 0, 5, 3, 4)) - del tmp105 - t3new += np.transpose(tmp111, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp111, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp111, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp111, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp111, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp111, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp111, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp111, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp111, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp111, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp111, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp111, (2, 1, 0, 4, 5, 3)) - del tmp111 - t3new += tmp112 * -1 - t3new += np.transpose(tmp112, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp112, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp112, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp112, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp112, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp112, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp112, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp112, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp112, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp112, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp112, (2, 1, 0, 5, 4, 3)) * -1 - del tmp112 - t3new += np.transpose(tmp114, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp114, (0, 1, 2, 4, 5, 3)) * -1 - del tmp114 - t3new += np.transpose(tmp115, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp115, (0, 2, 1, 4, 5, 3)) - del tmp115 - t3new += np.transpose(tmp116, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp116, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp116, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp116, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp116, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp116, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp116, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp116, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp116, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp116, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp116, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp116, (2, 1, 0, 4, 5, 3)) - del tmp116 - t3new += tmp118 - t3new += np.transpose(tmp118, (0, 1, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp118, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp118, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp118, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp118, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp118, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp118, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp118, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp118, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp118, (2, 1, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp118, (2, 1, 0, 5, 4, 3)) - del tmp118 - t3new += np.transpose(tmp120, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp120, (0, 2, 1, 4, 5, 3)) * -1 - del tmp120 - t3new += np.transpose(tmp121, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp121, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp121, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp121, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp121, (1, 0, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp121, (1, 0, 2, 4, 5, 3)) - t3new += np.transpose(tmp121, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp121, (2, 0, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp121, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp121, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp121, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp121, (2, 1, 0, 5, 3, 4)) - del tmp121 - t3new += np.transpose(tmp125, (0, 1, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp125, (0, 1, 2, 5, 3, 4)) - t3new += np.transpose(tmp125, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp125, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp125, (1, 0, 2, 3, 4, 5)) * -1 - t3new += np.transpose(tmp125, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp125, (2, 0, 1, 3, 4, 5)) - t3new += np.transpose(tmp125, (2, 0, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp125, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp125, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp125, (2, 1, 0, 4, 3, 5)) - t3new += np.transpose(tmp125, (2, 1, 0, 5, 3, 4)) * -1 - del tmp125 - t3new += np.transpose(tmp127, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp127, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp127, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp127, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp127, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp127, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp127, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp127, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp127, (1, 2, 0, 4, 3, 5)) - t3new += np.transpose(tmp127, (1, 2, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp127, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp127, (2, 1, 0, 4, 5, 3)) - del tmp127 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp128, (4, 6), (0, 1, 2, 3, 6, 5)) - del tmp128 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp113, (1, 6), (0, 6, 2, 3, 4, 5)) * -1 - del tmp113 - t2new = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - t2new += tmp16 * -1 - del tmp16 - t2new += einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) * -1 - t2new += einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (0, 4, 1, 5)) * 2 - t2new += np.transpose(v.ovov, (0, 2, 1, 3)) - t2new += einsum(v.ovoo, (0, 1, 2, 3), t1, (3, 4), (0, 2, 1, 4)) * -1 - t2new += einsum(tmp17, (0, 1, 2, 3), t2, (2, 3, 4, 5), (1, 0, 5, 4)) - del tmp17 - t2new += np.transpose(tmp25, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp25, (1, 0, 2, 3)) * -1 - del tmp25 - t2new += tmp39 * -1 - t2new += np.transpose(tmp39, (1, 0, 3, 2)) * -1 - del tmp39 - t2new += np.transpose(tmp42, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp42, (1, 0, 2, 3)) * -1 - del tmp42 - t2new += np.transpose(tmp58, (0, 1, 3, 2)) - t2new += np.transpose(tmp58, (1, 0, 2, 3)) - del tmp58 - t2new += tmp77 - t2new += np.transpose(tmp77, (1, 0, 3, 2)) - del tmp77 - t2new += np.transpose(tmp83, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp83, (1, 0, 2, 3)) * -1 - del tmp83 - t2new += einsum(t2, (0, 1, 2, 3), tmp84, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp84 - t2new += einsum(tmp86, (0, 1, 2, 3), tmp85, (0, 4, 5, 1), (5, 4, 3, 2)) - del tmp85 - t2new += einsum(tmp86, (0, 1, 2, 3), v.vvvv, (4, 3, 5, 2), (1, 0, 4, 5)) - del tmp86 - t2new += einsum(t1, (0, 1), tmp88, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp88 - t2new += einsum(tmp89, (0, 1, 2, 3), t2, (4, 1, 3, 5), (0, 4, 5, 2)) - del tmp89 - t2new += einsum(tmp90, (0, 1, 2, 3), t2, (4, 1, 3, 5), (0, 4, 2, 5)) - del tmp90 - t1new = np.copy(f.ov) - t1new += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 2, 0, 5, 1, 3), (4, 5)) * -0.5 - t1new += einsum(tmp0, (0, 1, 2, 3, 4, 5), v.ovov, (0, 3, 2, 5), (1, 4)) * -0.5 - del tmp0 - t1new += einsum(t2, (0, 1, 2, 3), tmp1, (1, 3, 2, 4), (0, 4)) * 2 - del tmp1 - t1new += einsum(tmp3, (0, 1, 2, 3), t2, (2, 1, 3, 4), (0, 4)) * -2 - del tmp3 - t1new += einsum(tmp7, (0, 1, 2, 3), tmp6, (0, 3), (1, 2)) - del tmp7, tmp6 - t1new += einsum(t1, (0, 1), tmp8, (0, 2, 1, 3), (2, 3)) - del tmp8 - t1new += einsum(t1, (0, 1), tmp10, (1, 2), (0, 2)) * 2 - del tmp10 - t1new += einsum(t1, (0, 1), tmp15, (0, 2), (2, 1)) * -1 - del tmp15 - - return {f"t1new": t1new, f"t2new": t2new, f"t3new": t3new} - diff --git a/ebcc/codegen/RCCD.py b/ebcc/codegen/RCCD.py deleted file mode 100644 index 3fbb8a70..00000000 --- a/ebcc/codegen/RCCD.py +++ /dev/null @@ -1,1107 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:17:14.243541 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:17:14.507838. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - e_cc = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 1, 3), ()) * 2 - e_cc += einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 3, 1), ()) * -1 - - return e_cc - -def update_amps(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:17:18.171621. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t2new : array - Updated T2 residuals. - """ - - tmp5 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp5 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp2 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp2 += np.transpose(v.ovov, (0, 2, 1, 3)) * 2 - tmp6 = einsum(tmp5, (0, 1, 2, 3), t2, (0, 1, 3, 4), (4, 2)) - tmp8 = einsum(t2, (0, 1, 2, 3), tmp5, (1, 4, 2, 3), (0, 4)) * 2 - del tmp5 - tmp3 = einsum(t2, (0, 1, 2, 3), tmp2, (1, 4, 3, 5), (0, 4, 2, 5)) - del tmp2 - tmp0 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp7 = einsum(tmp6, (0, 1), t2, (2, 3, 1, 4), (2, 3, 4, 0)) * 2 - del tmp6 - tmp9 = einsum(t2, (0, 1, 2, 3), tmp8, (4, 1), (0, 4, 3, 2)) - del tmp8 - tmp11 = einsum(t2, (0, 1, 2, 3), f.vv, (4, 3), (0, 1, 4, 2)) - tmp4 = einsum(tmp3, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 5, 2)) - tmp1 = einsum(f.oo, (0, 1), t2, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp15 = np.copy(v.oovv) * -1 - tmp15 += einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp13 = np.copy(v.oooo) - tmp13 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp12 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp12 += v.oovv * -1 - tmp12 += tmp3 * 2 - del tmp3 - tmp14 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * -1 - tmp14 += tmp0 - tmp10 = np.copy(np.transpose(tmp7, (1, 0, 2, 3))) - del tmp7 - tmp10 += np.transpose(tmp9, (0, 1, 3, 2)) - del tmp9 - t2new = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) - t2new += einsum(v.vvvv, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - t2new += einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) * -1 - t2new += tmp0 * -1 - del tmp0 - t2new += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 2), (0, 4, 5, 3)) * -1 - t2new += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) * 2 - t2new += np.transpose(tmp1, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp1, (1, 0, 2, 3)) * -1 - del tmp1 - t2new += np.transpose(tmp4, (1, 0, 3, 2)) * -1 - t2new += tmp4 * -1 - del tmp4 - t2new += tmp10 * -1 - t2new += np.transpose(tmp10, (1, 0, 3, 2)) * -1 - del tmp10 - t2new += np.transpose(tmp11, (0, 1, 3, 2)) - t2new += np.transpose(tmp11, (1, 0, 2, 3)) - del tmp11 - t2new += einsum(tmp12, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp12 - t2new += einsum(tmp13, (0, 1, 2, 3), t2, (0, 3, 4, 5), (2, 1, 5, 4)) - del tmp13 - t2new += einsum(t2, (0, 1, 2, 3), tmp14, (4, 1, 5, 2), (4, 0, 5, 3)) - del tmp14 - t2new += einsum(tmp15, (0, 1, 2, 3), t2, (4, 1, 3, 5), (0, 4, 5, 2)) - del tmp15 - - return {f"t2new": t2new} - -def update_lams(f=None, l2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:17:24.207741. - - Parameters - ---------- - f : array - Fock matrix. - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - l2new : array - Updated L2 residuals. - """ - - tmp5 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp5 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp10 = einsum(l2, (0, 1, 2, 3), t2, (4, 2, 1, 5), (3, 4, 0, 5)) - tmp4 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 1, 5), (2, 4, 0, 5)) - tmp6 = einsum(t2, (0, 1, 2, 3), tmp5, (1, 4, 3, 5), (0, 4, 2, 5)) - del tmp5 - tmp26 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp26 += t2 * -0.5 - tmp15 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp19 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp19 += t2 * 2 - tmp22 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp22 += t2 * -1 - tmp11 = np.copy(tmp10) - del tmp10 - tmp11 += np.transpose(l2, (3, 2, 0, 1)) * -1 - tmp11 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp8 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp8 += np.transpose(v.ovov, (0, 2, 1, 3)) * 2 - tmp7 = np.copy(tmp4) - del tmp4 - tmp7 += np.transpose(tmp6, (1, 0, 3, 2)) * -1 - del tmp6 - tmp29 = einsum(l2, (0, 1, 2, 3), tmp26, (2, 4, 1, 0), (3, 4)) * 2 - tmp27 = einsum(l2, (0, 1, 2, 3), tmp26, (3, 2, 4, 1), (0, 4)) * 2 - del tmp26 - tmp16 = np.copy(v.oovv) * -1 - tmp16 += tmp15 - del tmp15 - tmp20 = einsum(v.ovov, (0, 1, 2, 3), tmp19, (0, 2, 1, 4), (3, 4)) * 0.5 - del tmp19 - tmp23 = einsum(tmp22, (0, 1, 2, 3), v.ovov, (4, 2, 0, 3), (4, 1)) - del tmp22 - tmp12 = einsum(tmp11, (0, 1, 2, 3), v.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) - del tmp11 - tmp3 = einsum(v.oovv, (0, 1, 2, 3), l2, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp9 = einsum(tmp7, (0, 1, 2, 3), tmp8, (1, 4, 3, 5), (0, 4, 2, 5)) - del tmp7, tmp8 - tmp30 = einsum(tmp29, (0, 1), v.ovov, (2, 3, 1, 4), (2, 0, 4, 3)) - del tmp29 - tmp28 = einsum(tmp27, (0, 1), v.ovov, (2, 1, 3, 4), (2, 3, 4, 0)) - del tmp27 - tmp14 = einsum(l2, (0, 1, 2, 3), f.vv, (4, 1), (2, 3, 4, 0)) - tmp17 = einsum(tmp16, (0, 1, 2, 3), l2, (4, 2, 0, 5), (5, 1, 4, 3)) - del tmp16 - tmp21 = einsum(l2, (0, 1, 2, 3), tmp20, (4, 1), (3, 2, 0, 4)) * 2 - del tmp20 - tmp24 = einsum(l2, (0, 1, 2, 3), tmp23, (4, 2), (3, 4, 0, 1)) - del tmp23 - tmp13 = np.copy(tmp3) - del tmp3 - tmp13 += tmp9 - del tmp9 - tmp13 += np.transpose(tmp12, (1, 0, 3, 2)) * -1 - del tmp12 - tmp31 = np.copy(np.transpose(tmp28, (1, 0, 3, 2))) - del tmp28 - tmp31 += np.transpose(tmp30, (1, 0, 3, 2)) - del tmp30 - tmp18 = np.copy(tmp14) - del tmp14 - tmp18 += tmp17 - del tmp17 - tmp1 = einsum(t2, (0, 1, 2, 3), l2, (3, 2, 4, 5), (5, 4, 0, 1)) - tmp25 = np.copy(np.transpose(tmp21, (1, 0, 2, 3))) - del tmp21 - tmp25 += np.transpose(tmp24, (0, 1, 3, 2)) - del tmp24 - tmp2 = einsum(f.oo, (0, 1), l2, (2, 3, 4, 1), (0, 4, 2, 3)) - tmp0 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - l2new = einsum(v.oooo, (0, 1, 2, 3), l2, (4, 5, 1, 3), (4, 5, 0, 2)) - l2new += np.transpose(v.ovov, (1, 3, 0, 2)) - l2new += einsum(v.vvvv, (0, 1, 2, 3), l2, (1, 3, 4, 5), (0, 2, 4, 5)) - l2new += einsum(l2, (0, 1, 2, 3), tmp0, (2, 3, 4, 5), (0, 1, 4, 5)) - del tmp0 - l2new += einsum(tmp1, (0, 1, 2, 3), v.ovov, (3, 4, 2, 5), (5, 4, 0, 1)) - del tmp1 - l2new += np.transpose(tmp2, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp2, (2, 3, 1, 0)) * -1 - del tmp2 - l2new += np.transpose(tmp13, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp13, (3, 2, 1, 0)) * -1 - del tmp13 - l2new += np.transpose(tmp18, (3, 2, 0, 1)) - l2new += np.transpose(tmp18, (2, 3, 1, 0)) - del tmp18 - l2new += np.transpose(tmp25, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp25, (3, 2, 1, 0)) * -1 - del tmp25 - l2new += np.transpose(tmp31, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp31, (2, 3, 1, 0)) * -1 - del tmp31 - - return {f"l2new": l2new} - -def make_rdm1_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:17:24.707963. - - Parameters - ---------- - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm1 : array - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp1 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp1 += t2 * -0.5 - tmp0 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp0 += t2 - rdm1.vv = einsum(l2, (0, 1, 2, 3), tmp1, (3, 2, 4, 1), (0, 4)) * 4 - del tmp1 - rdm1.oo = np.copy(delta.oo) * 2 - del delta - rdm1.oo += einsum(tmp0, (0, 1, 2, 3), l2, (2, 3, 0, 4), (1, 4)) * -4 - del tmp0 - rdm1.ov = np.zeros((t2.shape[0], t2.shape[-1])) - rdm1.vo = np.zeros((t2.shape[-1], t2.shape[0])) - rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]]) - - return rdm1 - -def make_rdm2_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:17:43.110088. - - Parameters - ---------- - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm2 : array - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp12 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp12 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp1 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp1 += t2 - tmp6 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp6 += np.transpose(l2, (2, 3, 0, 1)) - tmp3 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp3 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp13 = einsum(tmp12, (0, 1, 2, 3), t2, (0, 1, 2, 4), (4, 3)) * 0.5 - tmp2 = einsum(l2, (0, 1, 2, 3), tmp1, (2, 4, 0, 1), (3, 4)) * 2 - del tmp1 - tmp7 = einsum(t2, (0, 1, 2, 3), tmp6, (1, 4, 2, 5), (0, 4, 3, 5)) - del tmp6 - tmp4 = einsum(tmp3, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - del tmp3 - tmp26 = np.copy(np.transpose(l2, (3, 2, 0, 1))) - tmp26 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp21 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp21 += t2 * -1 - tmp23 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp23 += t2 * -1 - tmp0 = einsum(l2, (0, 1, 2, 3), t2, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp17 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 1, 5), (2, 4, 0, 5)) - tmp19 = einsum(l2, (0, 1, 2, 3), t2, (4, 2, 1, 5), (3, 4, 0, 5)) - tmp14 = einsum(tmp13, (0, 1), t2, (2, 3, 1, 4), (2, 3, 4, 0)) * 2 - tmp15 = einsum(t2, (0, 1, 2, 3), tmp2, (1, 4), (4, 0, 3, 2)) - tmp8 = einsum(t2, (0, 1, 2, 3), tmp7, (4, 1, 5, 2), (4, 0, 5, 3)) - tmp5 = einsum(tmp4, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - tmp28 = einsum(l2, (0, 1, 2, 3), t2, (3, 2, 4, 5), (0, 1, 5, 4)) - tmp27 = einsum(t2, (0, 1, 2, 3), tmp26, (1, 4, 2, 5), (0, 4, 3, 5)) - del tmp26 - tmp25 = einsum(tmp12, (0, 1, 2, 3), t2, (0, 1, 2, 4), (4, 3)) - del tmp12 - tmp22 = einsum(tmp21, (0, 1, 2, 3), l2, (4, 3, 0, 5), (5, 1, 4, 2)) - del tmp21 - tmp24 = einsum(l2, (0, 1, 2, 3), tmp23, (3, 4, 5, 1), (2, 4, 0, 5)) - del tmp23 - tmp11 = einsum(tmp0, (0, 1, 2, 3), t2, (1, 0, 4, 5), (3, 2, 4, 5)) - tmp18 = einsum(t2, (0, 1, 2, 3), tmp17, (1, 4, 2, 5), (0, 4, 3, 5)) - tmp20 = einsum(tmp19, (0, 1, 2, 3), t2, (4, 0, 2, 5), (4, 1, 5, 3)) - tmp10 = einsum(t2, (0, 1, 2, 3), tmp4, (1, 4, 2, 5), (4, 0, 5, 3)) - tmp16 = np.copy(np.transpose(tmp14, (1, 0, 2, 3))) - del tmp14 - tmp16 += np.transpose(tmp15, (1, 0, 3, 2)) - del tmp15 - tmp9 = np.copy(np.transpose(tmp5, (1, 0, 3, 2))) * 2 - tmp9 += tmp8 - del tmp8 - rdm2.vvvv = np.copy(np.transpose(tmp28, (1, 0, 2, 3))) * -2 - rdm2.vvvv += np.transpose(tmp28, (1, 0, 3, 2)) * 4 - del tmp28 - rdm2.vvoo = np.copy(np.transpose(l2, (0, 1, 3, 2))) * -2 - rdm2.vvoo += l2 * 4 - rdm2.vovo = np.copy(np.transpose(tmp4, (2, 1, 3, 0))) * -2 - rdm2.vovo += np.transpose(tmp27, (3, 0, 2, 1)) * -2 - del tmp27 - rdm2.vovo += einsum(delta.oo, (0, 1), tmp25, (2, 3), (3, 0, 2, 1)) * 4 - rdm2.vovo += np.transpose(tmp19, (2, 1, 3, 0)) * -2 - rdm2.voov = np.copy(np.transpose(tmp24, (2, 1, 0, 3))) * 2 - rdm2.voov += np.transpose(tmp22, (2, 1, 0, 3)) * -2 - rdm2.voov += einsum(delta.oo, (0, 1), tmp25, (2, 3), (3, 0, 1, 2)) * -2 - del tmp25 - rdm2.voov += np.transpose(tmp17, (2, 1, 0, 3)) * -2 - rdm2.voov += np.transpose(tmp4, (2, 1, 0, 3)) * 2 - rdm2.ovvo = np.copy(np.transpose(tmp4, (1, 2, 3, 0))) * 4 - del tmp4 - rdm2.ovvo += np.transpose(tmp7, (0, 3, 2, 1)) * -2 - del tmp7 - rdm2.ovvo += einsum(tmp13, (0, 1), delta.oo, (2, 3), (2, 1, 0, 3)) * -4 - rdm2.ovvo += np.transpose(tmp17, (1, 2, 3, 0)) * -2 - del tmp17 - rdm2.ovov = np.copy(np.transpose(tmp22, (1, 2, 0, 3))) * 2 - del tmp22 - rdm2.ovov += np.transpose(tmp24, (1, 2, 0, 3)) * -2 - del tmp24 - rdm2.ovov += einsum(tmp13, (0, 1), delta.oo, (2, 3), (2, 1, 3, 0)) * 8 - del tmp13 - rdm2.ovov += np.transpose(tmp19, (1, 2, 0, 3)) * -2 - del tmp19 - rdm2.oovv = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -2 - rdm2.oovv += t2 * 4 - rdm2.oovv += tmp9 * 2 - rdm2.oovv += np.transpose(tmp9, (0, 1, 3, 2)) * -2 - del tmp9 - rdm2.oovv += tmp10 * -4 - rdm2.oovv += np.transpose(tmp10, (0, 1, 3, 2)) * 2 - rdm2.oovv += np.transpose(tmp10, (1, 0, 2, 3)) * 2 - rdm2.oovv += np.transpose(tmp10, (1, 0, 3, 2)) * -4 - del tmp10 - rdm2.oovv += tmp11 * 4 - rdm2.oovv += np.transpose(tmp11, (0, 1, 3, 2)) * -2 - del tmp11 - rdm2.oovv += tmp16 * -4 - rdm2.oovv += np.transpose(tmp16, (0, 1, 3, 2)) * 2 - rdm2.oovv += np.transpose(tmp16, (1, 0, 2, 3)) * 2 - rdm2.oovv += np.transpose(tmp16, (1, 0, 3, 2)) * -4 - del tmp16 - rdm2.oovv += tmp18 * 2 - del tmp18 - rdm2.oovv += np.transpose(tmp20, (0, 1, 3, 2)) * 2 - del tmp20 - rdm2.oovv += np.transpose(tmp5, (1, 0, 3, 2)) * 4 - del tmp5 - rdm2.oooo = np.copy(np.transpose(tmp0, (2, 3, 1, 0))) * -2 - rdm2.oooo += np.transpose(tmp0, (3, 2, 1, 0)) * 4 - del tmp0 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp2, (2, 3), (3, 0, 2, 1)) * -4 - rdm2.oooo += einsum(tmp2, (0, 1), delta.oo, (2, 3), (2, 1, 0, 3)) * 2 - rdm2.oooo += einsum(tmp2, (0, 1), delta.oo, (2, 3), (1, 2, 3, 0)) * 2 - rdm2.oooo += einsum(tmp2, (0, 1), delta.oo, (2, 3), (2, 1, 3, 0)) * -4 - del tmp2, delta - rdm2.ooov = np.zeros((t2.shape[0], t2.shape[0], t2.shape[0], t2.shape[-1])) - rdm2.oovo = np.zeros((t2.shape[0], t2.shape[0], t2.shape[-1], t2.shape[0])) - rdm2.ovoo = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[0], t2.shape[0])) - rdm2.vooo = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[0], t2.shape[0])) - rdm2.ovvv = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[-1], t2.shape[-1])) - rdm2.vovv = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[-1], t2.shape[-1])) - rdm2.vvov = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[0], t2.shape[-1])) - rdm2.vvvo = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[-1], t2.shape[0])) - rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv) - rdm2 = np.transpose(rdm2, (0, 2, 1, 3)) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:17:52.146081. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp14 : array - tmp15 : array - tmp17 : array - tmp18 : array - tmp2 : array - tmp20 : array - tmp21 : array - tmp22 : array - tmp23 : array - tmp24 : array - tmp26 : array - tmp27 : array - tmp28 : array - tmp29 : array - tmp30 : array - tmp32 : array - tmp38 : array - tmp39 : array - tmp4 : array - tmp6 : array - tmp8 : array - """ - - tmp39 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 3), (0, 4)) - tmp38 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 2), (0, 4)) - tmp32 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 3), (4, 1)) - tmp30 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 1), (4, 3)) - tmp29 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 2), (0, 4, 5, 3)) - tmp28 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 3), (4, 2)) - tmp27 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 0, 3), (4, 2)) - tmp26 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp24 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp23 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp22 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp21 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp20 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 1, 2), (0, 4, 5, 3)) - tmp18 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp17 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp15 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp14 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 2), (0, 3)) - tmp8 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp6 = einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp4 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 3), (0, 4)) - tmp2 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 2), (0, 4)) - - return {f"tmp14": tmp14, f"tmp15": tmp15, f"tmp17": tmp17, f"tmp18": tmp18, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp24": tmp24, f"tmp26": tmp26, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp29": tmp29, f"tmp30": tmp30, f"tmp32": tmp32, f"tmp38": tmp38, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp6": tmp6, f"tmp8": tmp8} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:17:52.168000. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp7 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp7 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp4 = np.copy(ints.tmp24) * 2 - del ints.tmp24 - tmp4 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp4 += ints.tmp22 * -1 - del ints.tmp22 - tmp4 += ints.tmp23 * -1 - del ints.tmp23 - tmp3 = np.copy(r2) * -0.5 - tmp3 += np.transpose(r2, (1, 0, 2)) - tmp5 = np.copy(ints.tmp21) - del ints.tmp21 - tmp5 += v.oovv * -1 - tmp8 = einsum(tmp7, (0, 1, 2, 3), r2, (0, 1, 3), (2,)) - del tmp7 - tmp6 = np.copy(f.vv) - tmp6 += np.transpose(ints.tmp30, (1, 0)) - del ints.tmp30 - tmp6 += np.transpose(ints.tmp32, (1, 0)) * -2 - del ints.tmp32 - tmp10 = np.copy(f.ov) - tmp10 += ints.tmp15 * 2 - del ints.tmp15 - tmp10 += ints.tmp27 - del ints.tmp27 - tmp10 += ints.tmp38 * 2 - del ints.tmp38 - tmp10 += ints.tmp14 * -1 - del ints.tmp14 - tmp10 += ints.tmp28 * -2 - del ints.tmp28 - tmp10 += ints.tmp39 * -1 - del ints.tmp39 - tmp2 = np.copy(f.oo) - tmp2 += np.transpose(ints.tmp4, (1, 0)) * 2 - del ints.tmp4 - tmp2 += np.transpose(ints.tmp2, (1, 0)) * -1 - del ints.tmp2 - tmp9 = np.copy(ints.tmp18) * 2 - del ints.tmp18 - tmp9 += np.transpose(ints.tmp26, (1, 2, 0, 3)) - del ints.tmp26 - tmp9 += np.transpose(ints.tmp6, (1, 0, 2, 3)) - del ints.tmp6 - tmp9 += np.transpose(v.ovoo, (0, 2, 3, 1)) - tmp9 += ints.tmp17 * -1 - del ints.tmp17 - tmp9 += ints.tmp20 * -1 - del ints.tmp20 - tmp9 += np.transpose(ints.tmp29, (1, 0, 2, 3)) * -1 - del ints.tmp29 - tmp1 = np.copy(r2) * -1 - tmp1 += np.transpose(r2, (1, 0, 2)) * 2 - tmp0 = np.copy(v.ooov) - tmp0 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -0.5 - r2new = einsum(v.oooo, (0, 1, 2, 3), r2, (1, 3, 4), (0, 2, 4)) - r2new += einsum(r2, (0, 1, 2), ints.tmp8, (3, 4, 1, 0), (4, 3, 2)) - del ints.tmp8 - r2new += einsum(tmp3, (0, 1, 2), tmp4, (3, 1, 4, 2), (3, 0, 4)) * 2 - del tmp3, tmp4 - r2new += einsum(tmp5, (0, 1, 2, 3), r2, (4, 1, 3), (4, 0, 2)) - r2new += einsum(tmp5, (0, 1, 2, 3), r2, (1, 4, 3), (0, 4, 2)) - del tmp5 - r2new += einsum(tmp6, (0, 1), r2, (2, 3, 0), (2, 3, 1)) - del tmp6 - r2new += einsum(tmp8, (0,), t2, (1, 2, 3, 0), (1, 2, 3)) * -2 - del tmp8 - r2new += einsum(r1, (0,), tmp9, (1, 2, 0, 3), (1, 2, 3)) - del tmp9 - r2new += einsum(r2, (0, 1, 2), tmp2, (0, 3), (3, 1, 2)) * -1 - r2new += einsum(tmp2, (0, 1), r2, (2, 0, 3), (2, 1, 3)) * -1 - r2new += einsum(r1, (0,), tmp10, (1, 2), (1, 0, 2)) * -1 - del tmp10 - r1new = einsum(tmp0, (0, 1, 2, 3), r2, (2, 0, 3), (1,)) * 2 - del tmp0 - r1new += einsum(tmp1, (0, 1, 2), f.ov, (1, 2), (0,)) * -1 - del tmp1 - r1new += einsum(tmp2, (0, 1), r1, (0,), (1,)) * -1 - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:18:01.418383. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp11 : array - tmp2 : array - tmp20 : array - tmp21 : array - tmp22 : array - tmp24 : array - tmp26 : array - tmp27 : array - tmp28 : array - tmp29 : array - tmp30 : array - tmp33 : array - tmp34 : array - tmp35 : array - tmp37 : array - tmp38 : array - tmp4 : array - tmp6 : array - tmp9 : array - """ - - tmp38 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 0, 2), (4, 3)) - tmp37 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 2), (4, 3)) - tmp35 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp34 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp33 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp30 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 1, 5), (4, 5, 2, 3)) - tmp29 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp28 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp27 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp26 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 2), (0, 3)) - tmp24 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 3), (4, 0)) - tmp22 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 1), (4, 0)) - tmp21 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 3), (0, 4)) - tmp20 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 2), (0, 4)) - tmp11 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 0, 5), (4, 3, 2, 5)) - tmp9 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp6 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 3, 5), (4, 5, 1, 2)) - tmp4 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 3), (4, 1)) - tmp2 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 1), (4, 3)) - - return {f"tmp11": tmp11, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp24": tmp24, f"tmp26": tmp26, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp29": tmp29, f"tmp30": tmp30, f"tmp33": tmp33, f"tmp34": tmp34, f"tmp35": tmp35, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp4": tmp4, f"tmp6": tmp6, f"tmp9": tmp9} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:18:01.439201. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp8 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp8 += np.transpose(v.ovov, (0, 2, 1, 3)) * 2 - tmp11 = np.copy(f.ov) - tmp11 += ints.tmp20 * 2 - del ints.tmp20 - tmp11 += ints.tmp27 * 2 - del ints.tmp27 - tmp11 += ints.tmp37 - del ints.tmp37 - tmp11 += ints.tmp21 * -1 - del ints.tmp21 - tmp11 += ints.tmp26 * -1 - del ints.tmp26 - tmp11 += ints.tmp38 * -2 - del ints.tmp38 - tmp4 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp4 += np.transpose(r2, (2, 1, 0)) * -0.5 - tmp3 = einsum(v.ovov, (0, 1, 2, 3), r2, (1, 3, 4), (4, 0, 2)) - tmp5 = np.copy(ints.tmp35) * 2 - del ints.tmp35 - tmp5 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp5 += ints.tmp33 * -1 - del ints.tmp33 - tmp5 += ints.tmp34 * -1 - del ints.tmp34 - tmp7 = np.copy(ints.tmp11) - del ints.tmp11 - tmp7 += ints.tmp28 * 2 - del ints.tmp28 - tmp7 += v.ovvv - tmp7 += np.transpose(ints.tmp29, (0, 1, 3, 2)) * -1 - del ints.tmp29 - tmp7 += ints.tmp30 * -1 - del ints.tmp30 - tmp7 += np.transpose(ints.tmp6, (0, 3, 1, 2)) * -1 - del ints.tmp6 - tmp6 = np.copy(ints.tmp9) - del ints.tmp9 - tmp6 += v.oovv * -1 - tmp10 = np.copy(f.oo) - tmp10 += np.transpose(ints.tmp24, (1, 0)) * 2 - del ints.tmp24 - tmp10 += np.transpose(ints.tmp22, (1, 0)) * -1 - del ints.tmp22 - tmp2 = np.copy(f.vv) - tmp2 += np.transpose(ints.tmp2, (1, 0)) - del ints.tmp2 - tmp2 += np.transpose(ints.tmp4, (1, 0)) * -2 - del ints.tmp4 - tmp9 = einsum(f.ov, (0, 1), r1, (1,), (0,)) - tmp9 += einsum(tmp8, (0, 1, 2, 3), r2, (2, 3, 0), (1,)) * -1 - del tmp8 - tmp1 = np.copy(np.transpose(r2, (2, 0, 1))) * 2 - tmp1 += np.transpose(r2, (2, 1, 0)) * -1 - tmp0 = np.copy(v.ovvv) * -1 - tmp0 += np.transpose(v.ovvv, (0, 2, 1, 3)) * 2 - r2new = einsum(r2, (0, 1, 2), v.vvvv, (3, 0, 4, 1), (3, 4, 2)) - r2new += einsum(t2, (0, 1, 2, 3), tmp3, (4, 1, 0), (3, 2, 4)) - del tmp3 - r2new += einsum(tmp5, (0, 1, 2, 3), tmp4, (1, 3, 4), (2, 4, 0)) * 2 - del tmp5, tmp4 - r2new += einsum(r2, (0, 1, 2), tmp6, (3, 2, 4, 1), (0, 4, 3)) - r2new += einsum(tmp6, (0, 1, 2, 3), r2, (3, 4, 1), (2, 4, 0)) - del tmp6 - r2new += einsum(tmp7, (0, 1, 2, 3), r1, (3,), (1, 2, 0)) * -1 - del tmp7 - r2new += einsum(tmp2, (0, 1), r2, (0, 2, 3), (1, 2, 3)) - r2new += einsum(r2, (0, 1, 2), tmp2, (1, 3), (0, 3, 2)) - r2new += einsum(tmp9, (0,), t2, (1, 0, 2, 3), (2, 3, 1)) - del tmp9 - r2new += einsum(tmp10, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp10 - r2new += einsum(r1, (0,), tmp11, (1, 2), (2, 0, 1)) * -1 - del tmp11 - r1new = einsum(r2, (0, 1, 2), tmp0, (2, 1, 0, 3), (3,)) * -1 - del tmp0 - r1new += einsum(f.ov, (0, 1), tmp1, (0, 1, 2), (2,)) * -1 - del tmp1 - r1new += einsum(tmp2, (0, 1), r1, (0,), (1,)) - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:18:14.801837. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp10 : array - tmp12 : array - tmp15 : array - tmp18 : array - tmp19 : array - tmp21 : array - tmp22 : array - tmp24 : array - tmp27 : array - tmp3 : array - tmp30 : array - tmp33 : array - tmp34 : array - tmp36 : array - tmp37 : array - tmp49 : array - tmp51 : array - tmp53 : array - tmp8 : array - """ - - tmp53 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 3), (4, 1)) - tmp51 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 3, 4), (4, 1)) - tmp49 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp37 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp36 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp34 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp33 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp30 = einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp27 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 3), (0, 4)) - tmp24 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 3, 1), (4, 2)) - tmp22 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp21 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 1, 2), (0, 4, 5, 3)) - tmp19 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp18 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 2), (0, 4, 5, 3)) - tmp15 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 3), (4, 2)) - tmp12 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 2), (4, 3)) - tmp10 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 3), (0, 4)) - tmp8 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 1), (4, 0)) - tmp3 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp1 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp0 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 2), (0, 3)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp10": tmp10, f"tmp12": tmp12, f"tmp15": tmp15, f"tmp18": tmp18, f"tmp19": tmp19, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp24": tmp24, f"tmp27": tmp27, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp33": tmp33, f"tmp34": tmp34, f"tmp36": tmp36, f"tmp37": tmp37, f"tmp49": tmp49, f"tmp51": tmp51, f"tmp53": tmp53, f"tmp8": tmp8} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:18:14.824736. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp9 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp9 += t2 * -0.5 - tmp4 = np.copy(f.oo) - tmp4 += ints.tmp10 * 2 - del ints.tmp10 - tmp4 += ints.tmp8 * -1 - del ints.tmp8 - tmp5 = np.copy(r2) * -0.5 - tmp5 += np.transpose(r2, (1, 0, 2)) - tmp7 = np.copy(ints.tmp33) - del ints.tmp33 - tmp7 += v.oovv * -1 - tmp10 = einsum(tmp9, (0, 1, 2, 3), r2, (0, 1, 3), (2,)) - del tmp9 - tmp8 = np.copy(f.vv) - tmp8 += ints.tmp51 - del ints.tmp51 - tmp8 += ints.tmp53 * -2 - del ints.tmp53 - tmp6 = np.copy(ints.tmp37) * 2 - del ints.tmp37 - tmp6 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp6 += ints.tmp34 * -1 - del ints.tmp34 - tmp6 += ints.tmp36 * -1 - del ints.tmp36 - tmp3 = np.copy(r2) * -1 - tmp3 += np.transpose(r2, (1, 0, 2)) * 2 - tmp1 = np.copy(ints.tmp18) - tmp1 += np.transpose(ints.tmp22, (0, 2, 1, 3)) - tmp1 += np.transpose(ints.tmp3, (1, 2, 0, 3)) * 0.5 - tmp1 += ints.tmp19 * -0.5 - tmp1 += np.transpose(ints.tmp21, (0, 2, 1, 3)) * -0.5 - tmp1 += ints.tmp30 * -1 - tmp2 = np.copy(f.ov) * 0.5 - tmp2 += ints.tmp12 * 0.5 - del ints.tmp12 - tmp2 += ints.tmp1 - del ints.tmp1 - tmp2 += ints.tmp24 - del ints.tmp24 - tmp2 += ints.tmp0 * -0.5 - del ints.tmp0 - tmp2 += ints.tmp15 * -1 - del ints.tmp15 - tmp2 += ints.tmp27 * -0.5 - del ints.tmp27 - tmp0 = np.copy(ints.tmp18) - del ints.tmp18 - tmp0 += np.transpose(ints.tmp22, (0, 2, 1, 3)) * 4 - del ints.tmp22 - tmp0 += np.transpose(ints.tmp3, (1, 2, 0, 3)) * 2 - del ints.tmp3 - tmp0 += ints.tmp19 * -2 - del ints.tmp19 - tmp0 += np.transpose(ints.tmp21, (0, 2, 1, 3)) * -2 - del ints.tmp21 - tmp0 += ints.tmp30 * -1 - del ints.tmp30 - tmp0 += np.transpose(v.ooov, (0, 2, 1, 3)) * -1 - tmp0 += np.transpose(v.ovoo, (0, 2, 3, 1)) * 2 - r2new = einsum(r1, (0,), v.ovoo, (1, 2, 3, 0), (1, 3, 2)) - r2new += einsum(v.oooo, (0, 1, 2, 3), r2, (1, 3, 4), (0, 2, 4)) - r2new += einsum(r2, (0, 1, 2), ints.tmp49, (1, 0, 3, 4), (4, 3, 2)) - del ints.tmp49 - r2new += einsum(f.ov, (0, 1), r1, (2,), (0, 2, 1)) * -1 - r2new += einsum(tmp6, (0, 1, 2, 3), tmp5, (4, 0, 2), (1, 4, 3)) * 2 - del tmp6, tmp5 - r2new += einsum(r2, (0, 1, 2), tmp7, (1, 3, 2, 4), (0, 3, 4)) - r2new += einsum(r2, (0, 1, 2), tmp7, (0, 3, 2, 4), (3, 1, 4)) - del tmp7 - r2new += einsum(tmp8, (0, 1), r2, (2, 3, 0), (2, 3, 1)) - del tmp8 - r2new += einsum(v.ovov, (0, 1, 2, 3), tmp10, (3,), (0, 2, 1)) * -2 - del tmp10 - r2new += einsum(tmp4, (0, 1), r2, (0, 2, 3), (1, 2, 3)) * -1 - r2new += einsum(tmp4, (0, 1), r2, (2, 0, 3), (2, 1, 3)) * -1 - r1new = einsum(r2, (0, 1, 2), tmp0, (0, 1, 3, 2), (3,)) - del tmp0 - r1new += einsum(r2, (0, 1, 2), tmp1, (1, 0, 3, 2), (3,)) * -2 - del tmp1 - r1new += einsum(tmp2, (0, 1), tmp3, (2, 0, 1), (2,)) * -2 - del tmp2, tmp3 - r1new += einsum(r1, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:18:28.911011. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp11 : array - tmp13 : array - tmp16 : array - tmp19 : array - tmp22 : array - tmp25 : array - tmp28 : array - tmp30 : array - tmp33 : array - tmp35 : array - tmp37 : array - tmp39 : array - tmp41 : array - tmp42 : array - tmp44 : array - tmp45 : array - tmp9 : array - """ - - tmp45 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp44 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp42 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp41 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp39 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 3), (4, 0)) - tmp37 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 2), (0, 4)) - tmp35 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp33 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 2), (0, 3, 4, 5)) - tmp30 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp28 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 1, 5), (4, 5, 2, 3)) - tmp25 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 3), (0, 4)) - tmp22 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 2), (0, 4)) - tmp19 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 0, 5), (4, 3, 2, 5)) - tmp16 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 0, 2), (4, 3)) - tmp13 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 0, 3), (4, 2)) - tmp11 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 3), (4, 1)) - tmp9 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 3, 4), (4, 1)) - tmp1 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) - tmp0 = einsum(t2, (0, 1, 2, 3), f.ov, (1, 2), (0, 3)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp11": tmp11, f"tmp13": tmp13, f"tmp16": tmp16, f"tmp19": tmp19, f"tmp22": tmp22, f"tmp25": tmp25, f"tmp28": tmp28, f"tmp30": tmp30, f"tmp33": tmp33, f"tmp35": tmp35, f"tmp37": tmp37, f"tmp39": tmp39, f"tmp41": tmp41, f"tmp42": tmp42, f"tmp44": tmp44, f"tmp45": tmp45, f"tmp9": tmp9} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:18:28.933027. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp6 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp6 += t2 * -0.5 - tmp13 = einsum(tmp6, (0, 1, 2, 3), r2, (3, 2, 0), (1,)) - tmp11 = np.copy(ints.tmp41) - del ints.tmp41 - tmp11 += v.oovv * -1 - tmp5 = np.copy(f.vv) - tmp5 += ints.tmp9 - del ints.tmp9 - tmp5 += ints.tmp11 * -2 - del ints.tmp11 - tmp12 = np.copy(f.oo) - tmp12 += ints.tmp39 * 2 - del ints.tmp39 - tmp12 += ints.tmp37 * -1 - del ints.tmp37 - tmp10 = np.copy(ints.tmp45) * 2 - del ints.tmp45 - tmp10 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp10 += ints.tmp42 * -1 - del ints.tmp42 - tmp10 += ints.tmp44 * -1 - del ints.tmp44 - tmp8 = einsum(r2, (0, 1, 2), t2, (3, 4, 0, 1), (2, 3, 4)) - tmp9 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp9 += np.transpose(r2, (2, 1, 0)) * -0.5 - tmp4 = np.copy(np.transpose(r2, (2, 0, 1))) * 2 - tmp4 += np.transpose(r2, (2, 1, 0)) * -1 - tmp3 = np.copy(f.ov) * 0.5 - tmp3 += ints.tmp13 * 0.5 - del ints.tmp13 - tmp3 += ints.tmp1 - del ints.tmp1 - tmp3 += ints.tmp22 - del ints.tmp22 - tmp3 += ints.tmp0 * -0.5 - del ints.tmp0 - tmp3 += ints.tmp16 * -1 - del ints.tmp16 - tmp3 += ints.tmp25 * -0.5 - del ints.tmp25 - tmp1 = np.copy(ints.tmp19) - del ints.tmp19 - tmp1 += np.transpose(ints.tmp30, (0, 1, 3, 2)) * 2 - del ints.tmp30 - tmp1 += np.transpose(ints.tmp28, (0, 1, 3, 2)) * -1 - del ints.tmp28 - tmp1 += np.transpose(ints.tmp35, (0, 1, 3, 2)) * -1 - del ints.tmp35 - tmp7 = einsum(tmp6, (0, 1, 2, 3), r2, (3, 2, 0), (1,)) * 2 - del tmp6 - tmp2 = np.copy(ints.tmp33) - tmp2 += v.ovvv * 2 - tmp2 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -1 - tmp0 = np.copy(np.transpose(r2, (2, 0, 1))) * -1 - tmp0 += np.transpose(r2, (2, 1, 0)) * 2 - r2new = einsum(f.ov, (0, 1), r1, (2,), (1, 2, 0)) * -1 - r2new += einsum(r2, (0, 1, 2), v.vvvv, (3, 0, 4, 1), (3, 4, 2)) - r2new += einsum(r1, (0,), v.ovvv, (1, 2, 3, 0), (2, 3, 1)) * -1 - r2new += einsum(tmp8, (0, 1, 2), v.ovov, (2, 3, 1, 4), (4, 3, 0)) - del tmp8 - r2new += einsum(tmp9, (0, 1, 2), tmp10, (0, 3, 1, 4), (4, 2, 3)) * 2 - del tmp9, tmp10 - r2new += einsum(r2, (0, 1, 2), tmp11, (2, 3, 1, 4), (0, 4, 3)) - r2new += einsum(tmp11, (0, 1, 2, 3), r2, (2, 4, 0), (3, 4, 1)) - del tmp11 - r2new += einsum(r2, (0, 1, 2), tmp5, (0, 3), (3, 1, 2)) - r2new += einsum(r2, (0, 1, 2), tmp5, (1, 3), (0, 3, 2)) - r2new += einsum(tmp12, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp12 - r2new += einsum(v.ovov, (0, 1, 2, 3), tmp13, (2,), (1, 3, 0)) * -2 - del tmp13 - r1new = einsum(r2, (0, 1, 2), ints.tmp33, (2, 1, 3, 0), (3,)) * 2 - del ints.tmp33 - r1new += einsum(tmp0, (0, 1, 2), tmp1, (0, 2, 1, 3), (3,)) * -1 - del tmp0, tmp1 - r1new += einsum(r2, (0, 1, 2), tmp2, (2, 0, 3, 1), (3,)) * -1 - del tmp2 - r1new += einsum(tmp3, (0, 1), tmp4, (0, 1, 2), (2,)) * -2 - del tmp3, tmp4 - r1new += einsum(tmp5, (0, 1), r1, (0,), (1,)) - del tmp5 - r1new += einsum(tmp7, (0,), f.ov, (0, 1), (1,)) - del tmp7 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/RCCSD.py b/ebcc/codegen/RCCSD.py deleted file mode 100644 index 2db55eab..00000000 --- a/ebcc/codegen/RCCSD.py +++ /dev/null @@ -1,2486 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:31:16.748192 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:31:17.460418. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -0.5 - tmp0 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp1 = np.copy(f.ov) - tmp1 += einsum(t1, (0, 1), tmp0, (0, 2, 1, 3), (2, 3)) - del tmp0 - e_cc = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 1, 3), ()) * 2 - e_cc += einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 3, 1), ()) * -1 - e_cc += einsum(t1, (0, 1), tmp1, (0, 1), ()) * 2 - del tmp1 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:31:34.060609. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - """ - - tmp2 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp4 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp4 += np.transpose(v.ovov, (0, 2, 1, 3)) * 2 - tmp43 = np.copy(tmp2) * -1 - tmp43 += np.transpose(tmp2, (0, 2, 1, 3)) * 2 - tmp5 = einsum(t1, (0, 1), tmp4, (0, 2, 1, 3), (2, 3)) - tmp25 = einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp25 += np.transpose(t2, (0, 1, 3, 2)) * -2 - tmp25 += t2 - tmp9 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp42 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) - tmp44 = einsum(t2, (0, 1, 2, 3), tmp43, (4, 5, 1, 3), (4, 5, 0, 2)) - del tmp43 - tmp47 = np.copy(v.ooov) * -1 - tmp47 += np.transpose(v.ovoo, (0, 2, 3, 1)) * 2 - tmp36 = einsum(tmp4, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - del tmp4 - tmp35 = einsum(t1, (0, 1), tmp2, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp39 = np.copy(v.ovvv) * -1 - tmp39 += np.transpose(v.ovvv, (0, 2, 1, 3)) * 2 - tmp22 = einsum(t1, (0, 1), v.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp27 = einsum(tmp5, (0, 1), t2, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp26 = einsum(v.ooov, (0, 1, 2, 3), tmp25, (2, 4, 5, 3), (0, 1, 4, 5)) - del tmp25 - tmp23 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp24 = einsum(t2, (0, 1, 2, 3), tmp2, (4, 5, 1, 2), (4, 0, 5, 3)) - tmp56 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp56 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp53 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -0.5 - tmp53 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp60 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp62 = np.copy(f.oo) - tmp62 += tmp9 - tmp45 = np.copy(tmp2) - tmp45 += tmp42 * -1 - del tmp42 - tmp45 += np.transpose(tmp44, (0, 2, 1, 3)) - del tmp44 - tmp48 = einsum(tmp47, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - del tmp47 - tmp37 = np.copy(tmp35) - del tmp35 - tmp37 += np.transpose(tmp36, (1, 0, 3, 2)) * -1 - tmp40 = einsum(tmp39, (0, 1, 2, 3), t1, (0, 2), (1, 3)) - del tmp39 - tmp28 = np.copy(np.transpose(tmp22, (0, 2, 1, 3))) * -1 - del tmp22 - tmp28 += np.transpose(tmp23, (0, 2, 1, 3)) - del tmp23 - tmp28 += np.transpose(tmp24, (0, 2, 1, 3)) - del tmp24 - tmp28 += np.transpose(tmp26, (2, 1, 0, 3)) - del tmp26 - tmp28 += np.transpose(tmp27, (2, 0, 1, 3)) * -1 - del tmp27 - tmp20 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp20 += t2 * -1 - tmp17 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp30 = einsum(t1, (0, 1), tmp5, (2, 1), (2, 0)) - tmp18 = einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp57 = einsum(tmp56, (0, 1, 2, 3), t2, (4, 0, 2, 3), (1, 4)) * 2 - del tmp56 - tmp54 = einsum(tmp53, (0, 1, 2, 3), t2, (0, 1, 2, 4), (3, 4)) - del tmp53 - tmp51 = einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp65 = einsum(t1, (0, 1), v.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp61 = einsum(t1, (0, 1), tmp60, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp60 - tmp63 = einsum(t2, (0, 1, 2, 3), tmp62, (1, 4), (4, 0, 3, 2)) - del tmp62 - tmp46 = einsum(t1, (0, 1), tmp45, (2, 3, 0, 4), (2, 3, 4, 1)) - del tmp45 - tmp49 = einsum(t2, (0, 1, 2, 3), tmp48, (4, 1), (4, 0, 3, 2)) - del tmp48 - tmp38 = einsum(tmp37, (0, 1, 2, 3), t2, (4, 1, 3, 5), (0, 4, 2, 5)) - del tmp37 - tmp41 = einsum(tmp40, (0, 1), t2, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp40 - tmp16 = einsum(t2, (0, 1, 2, 3), f.vv, (4, 3), (0, 1, 4, 2)) - tmp29 = einsum(t1, (0, 1), tmp28, (2, 0, 3, 4), (2, 3, 4, 1)) - del tmp28 - tmp21 = einsum(tmp20, (0, 1, 2, 3), tmp17, (4, 0, 3, 5), (1, 4, 2, 5)) - del tmp20 - tmp31 = einsum(t2, (0, 1, 2, 3), tmp30, (1, 4), (4, 0, 3, 2)) - del tmp30 - tmp19 = einsum(t2, (0, 1, 2, 3), tmp18, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp14 = einsum(t1, (0, 1), tmp2, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp33 = np.copy(t2) - tmp33 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp15 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp58 = einsum(tmp57, (0, 1), t2, (2, 0, 3, 4), (1, 2, 4, 3)) - del tmp57 - tmp55 = einsum(tmp54, (0, 1), t2, (2, 3, 0, 4), (2, 3, 1, 4)) * 2 - del tmp54 - tmp52 = einsum(tmp51, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp51 - tmp11 = np.copy(v.ooov) * -0.5 - tmp11 += np.transpose(v.ovoo, (0, 2, 3, 1)) - tmp10 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp10 += np.transpose(v.ovov, (0, 2, 1, 3)) * 2 - tmp0 = np.copy(t2) - tmp0 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp66 = einsum(t2, (0, 1, 2, 3), tmp65, (4, 5, 1, 0), (4, 5, 3, 2)) - del tmp65 - tmp64 = np.copy(tmp61) - del tmp61 - tmp64 += np.transpose(tmp63, (0, 1, 3, 2)) - del tmp63 - tmp13 = einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp50 = np.copy(tmp38) - del tmp38 - tmp50 += np.transpose(tmp41, (1, 0, 3, 2)) - del tmp41 - tmp50 += np.transpose(tmp46, (0, 1, 3, 2)) * -1 - del tmp46 - tmp50 += np.transpose(tmp49, (1, 0, 3, 2)) * -1 - del tmp49 - tmp67 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp67 += v.oovv * -1 - tmp67 += np.transpose(tmp36, (1, 0, 3, 2)) * 2 - del tmp36 - tmp32 = np.copy(tmp16) - del tmp16 - tmp32 += tmp17 - del tmp17 - tmp32 += tmp19 * -1 - del tmp19 - tmp32 += np.transpose(tmp21, (1, 0, 2, 3)) - del tmp21 - tmp32 += np.transpose(tmp29, (0, 1, 3, 2)) - del tmp29 - tmp32 += np.transpose(tmp31, (0, 1, 3, 2)) * -1 - del tmp31 - tmp69 = np.copy(np.transpose(v.ooov, (0, 2, 1, 3))) * -1 - tmp69 += einsum(tmp14, (0, 1, 2, 3), t1, (2, 4), (1, 0, 3, 4)) - tmp70 = np.copy(v.oovv) * -1 - tmp70 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp34 = einsum(tmp18, (0, 1, 2, 3), tmp33, (1, 4, 5, 2), (0, 4, 3, 5)) - del tmp18, tmp33 - tmp68 = np.copy(v.oooo) - tmp68 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp71 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * -1 - tmp71 += tmp15 - tmp59 = np.copy(tmp52) - del tmp52 - tmp59 += np.transpose(tmp55, (1, 0, 3, 2)) - del tmp55 - tmp59 += np.transpose(tmp58, (1, 0, 3, 2)) - del tmp58 - tmp12 = np.copy(f.oo) - tmp12 += tmp9 - del tmp9 - tmp12 += einsum(tmp10, (0, 1, 2, 3), tmp0, (0, 4, 2, 3), (1, 4)) - del tmp10 - tmp12 += einsum(tmp11, (0, 1, 2, 3), t1, (0, 3), (2, 1)) * 2 - del tmp11 - tmp6 = np.copy(f.ov) - tmp6 += tmp5 - del tmp5 - tmp1 = np.copy(v.ovvv) * -0.5 - tmp1 += np.transpose(v.ovvv, (0, 2, 1, 3)) - tmp3 = np.copy(v.ooov) * -0.5 - tmp3 += np.transpose(v.ooov, (0, 2, 1, 3)) - tmp3 += tmp2 - tmp3 += np.transpose(tmp2, (0, 2, 1, 3)) * -0.5 - del tmp2 - tmp8 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp8 += v.oovv * -1 - tmp7 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp7 += t2 * 2 - t2new = einsum(t2, (0, 1, 2, 3), v.vvvv, (4, 2, 5, 3), (0, 1, 4, 5)) - t2new += einsum(t1, (0, 1), tmp13, (2, 3, 1, 4), (0, 2, 3, 4)) - del tmp13 - t2new += einsum(t1, (0, 1), v.ovoo, (2, 3, 4, 0), (2, 4, 3, 1)) * -1 - t2new += np.transpose(v.ovov, (0, 2, 1, 3)) - t2new += einsum(t2, (0, 1, 2, 3), tmp14, (4, 5, 0, 1), (5, 4, 3, 2)) - del tmp14 - t2new += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - t2new += tmp15 * -1 - del tmp15 - t2new += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 2), (4, 0, 3, 5)) * -1 - t2new += einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) * 2 - t2new += np.transpose(tmp32, (0, 1, 3, 2)) - t2new += np.transpose(tmp32, (1, 0, 2, 3)) - del tmp32 - t2new += np.transpose(tmp34, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp34, (1, 0, 2, 3)) * -1 - del tmp34 - t2new += tmp50 - t2new += np.transpose(tmp50, (1, 0, 3, 2)) - del tmp50 - t2new += tmp59 * -1 - t2new += np.transpose(tmp59, (1, 0, 3, 2)) * -1 - del tmp59 - t2new += np.transpose(tmp64, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp64, (1, 0, 2, 3)) * -1 - del tmp64 - t2new += np.transpose(tmp66, (0, 1, 3, 2)) - t2new += np.transpose(tmp66, (1, 0, 2, 3)) - del tmp66 - t2new += einsum(tmp67, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp67 - t2new += einsum(tmp68, (0, 1, 2, 3), tmp0, (0, 3, 4, 5), (2, 1, 5, 4)) - del tmp68 - t2new += einsum(t1, (0, 1), tmp69, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp69 - t2new += einsum(t2, (0, 1, 2, 3), tmp70, (4, 1, 5, 2), (0, 4, 5, 3)) - del tmp70 - t2new += einsum(t2, (0, 1, 2, 3), tmp71, (4, 1, 5, 2), (4, 0, 5, 3)) - del tmp71 - t1new = np.copy(f.ov) - t1new += einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - t1new += einsum(tmp0, (0, 1, 2, 3), tmp1, (0, 3, 2, 4), (1, 4)) * 2 - del tmp0, tmp1 - t1new += einsum(tmp3, (0, 1, 2, 3), t2, (1, 2, 3, 4), (0, 4)) * -2 - del tmp3 - t1new += einsum(tmp6, (0, 1), tmp7, (0, 2, 1, 3), (2, 3)) - del tmp6, tmp7 - t1new += einsum(t1, (0, 1), tmp8, (0, 2, 1, 3), (2, 3)) - del tmp8 - t1new += einsum(t1, (0, 1), tmp12, (0, 2), (2, 1)) * -1 - del tmp12 - - return {f"t1new": t1new, f"t2new": t2new} - -def update_lams(f=None, l1=None, l2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:32:31.373193. - - Parameters - ---------- - f : array - Fock matrix. - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - l1new : array - Updated L1 residuals. - l2new : array - Updated L2 residuals. - """ - - tmp51 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp51 += np.transpose(v.ovov, (0, 2, 1, 3)) * 2 - tmp5 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp20 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp20 += t2 - tmp46 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp46 += t2 * 2 - tmp82 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp82 += t2 * 2 - tmp92 = einsum(t1, (0, 1), tmp51, (0, 2, 1, 3), (2, 3)) - tmp6 = einsum(t1, (0, 1), tmp5, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp4 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp47 = einsum(t1, (0, 1), l1, (1, 2), (2, 0)) - tmp57 = einsum(tmp20, (0, 1, 2, 3), l2, (2, 3, 0, 4), (4, 1)) * 2 - tmp110 = einsum(tmp46, (0, 1, 2, 3), v.ovov, (4, 3, 0, 2), (4, 1)) * 0.5 - tmp109 = einsum(t1, (0, 1), v.ooov, (2, 3, 0, 1), (2, 3)) - tmp70 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp2 = einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp21 = einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp83 = einsum(tmp82, (0, 1, 2, 3), v.ovov, (4, 5, 0, 2), (4, 1, 5, 3)) - del tmp82 - tmp80 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp81 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp93 = einsum(t1, (0, 1), tmp92, (2, 1), (0, 2)) - tmp91 = einsum(t1, (0, 1), v.ooov, (2, 0, 3, 1), (2, 3)) - tmp10 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -0.5 - tmp10 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp7 = np.copy(np.transpose(tmp4, (1, 0, 3, 2))) - del tmp4 - tmp7 += tmp6 - del tmp6 - tmp58 = np.copy(tmp47) - tmp58 += tmp57 - del tmp57 - tmp102 = einsum(l2, (0, 1, 2, 3), tmp20, (3, 2, 1, 4), (0, 4)) * 2 - tmp107 = einsum(v.ovov, (0, 1, 2, 3), tmp46, (0, 2, 1, 4), (3, 4)) * 0.5 - tmp111 = np.copy(np.transpose(tmp109, (1, 0))) - del tmp109 - tmp111 += np.transpose(tmp110, (1, 0)) - del tmp110 - tmp71 = np.copy(v.oovv) - tmp71 += np.transpose(tmp2, (0, 1, 3, 2)) - tmp71 += tmp70 * -1 - del tmp70 - tmp87 = np.copy(tmp21) * -1 - tmp87 += np.transpose(tmp21, (1, 0, 2, 3)) * 2 - tmp79 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp79 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp84 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) - tmp84 += np.transpose(tmp80, (0, 1, 3, 2)) - del tmp80 - tmp84 += tmp81 * -1 - del tmp81 - tmp84 += np.transpose(tmp83, (1, 0, 3, 2)) - del tmp83 - tmp75 = einsum(t1, (0, 1), v.ovvv, (0, 1, 2, 3), (2, 3)) - tmp94 = np.copy(tmp91) - del tmp91 - tmp94 += tmp93 * -1 - del tmp93 - tmp89 = np.copy(tmp5) * -1 - tmp89 += np.transpose(tmp5, (0, 2, 1, 3)) * 2 - tmp64 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp16 = einsum(t1, (0, 1), v.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp11 = einsum(t1, (0, 1), tmp10, (0, 2, 1, 3), (2, 3)) * 2 - tmp8 = einsum(tmp7, (0, 1, 2, 3), t1, (2, 4), (0, 1, 3, 4)) - tmp1 = einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp3 = einsum(t1, (0, 1), tmp2, (2, 3, 4, 1), (2, 0, 3, 4)) - del tmp2 - tmp36 = einsum(tmp21, (0, 1, 2, 3), t1, (4, 3), (1, 0, 2, 4)) - tmp48 = einsum(tmp20, (0, 1, 2, 3), l2, (2, 3, 0, 4), (4, 1)) - tmp39 = einsum(l2, (0, 1, 2, 3), t2, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp98 = einsum(t1, (0, 1), v.ovvv, (0, 2, 3, 1), (2, 3)) - tmp101 = einsum(l1, (0, 1), tmp5, (1, 2, 3, 4), (2, 3, 0, 4)) - tmp104 = einsum(v.ovov, (0, 1, 2, 3), tmp58, (4, 2), (0, 4, 3, 1)) - tmp103 = einsum(tmp102, (0, 1), v.ovov, (2, 1, 3, 4), (2, 3, 4, 0)) - del tmp102 - tmp100 = einsum(l2, (0, 1, 2, 3), f.oo, (4, 3), (4, 2, 0, 1)) - tmp108 = einsum(tmp107, (0, 1), l2, (2, 1, 3, 4), (4, 3, 2, 0)) * 2 - del tmp107 - tmp106 = einsum(v.ooov, (0, 1, 2, 3), l1, (4, 1), (0, 2, 4, 3)) - tmp112 = einsum(tmp111, (0, 1), l2, (2, 3, 0, 4), (4, 1, 2, 3)) * 2 - del tmp111 - tmp74 = einsum(tmp21, (0, 1, 2, 3), v.ooov, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp86 = einsum(l2, (0, 1, 2, 3), tmp71, (3, 4, 1, 5), (2, 4, 0, 5)) - tmp88 = einsum(v.ovoo, (0, 1, 2, 3), tmp87, (2, 4, 3, 5), (0, 4, 1, 5)) - del tmp87 - tmp78 = einsum(tmp5, (0, 1, 2, 3), tmp21, (0, 4, 2, 5), (4, 1, 5, 3)) - tmp85 = einsum(tmp79, (0, 1, 2, 3), tmp84, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp79, tmp84 - tmp76 = einsum(tmp75, (0, 1), l2, (2, 1, 3, 4), (3, 4, 2, 0)) - del tmp75 - tmp96 = einsum(tmp92, (0, 1), tmp21, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp95 = einsum(tmp94, (0, 1), l2, (2, 3, 0, 4), (4, 1, 2, 3)) - del tmp94 - tmp90 = einsum(tmp21, (0, 1, 2, 3), tmp89, (1, 2, 4, 5), (0, 4, 3, 5)) - del tmp89 - tmp77 = einsum(tmp21, (0, 1, 2, 3), v.ovvv, (2, 4, 5, 3), (1, 0, 4, 5)) - tmp66 = einsum(tmp21, (0, 1, 2, 3), f.ov, (2, 4), (0, 1, 4, 3)) - tmp62 = einsum(l2, (0, 1, 2, 3), f.vv, (4, 1), (2, 3, 4, 0)) - tmp63 = einsum(l1, (0, 1), v.ovvv, (2, 3, 4, 0), (1, 2, 3, 4)) - tmp68 = einsum(v.ooov, (0, 1, 2, 3), tmp21, (1, 4, 2, 5), (4, 0, 5, 3)) - tmp65 = einsum(tmp64, (0, 1), l2, (2, 3, 4, 1), (0, 4, 2, 3)) - del tmp64 - tmp72 = einsum(tmp71, (0, 1, 2, 3), l2, (4, 2, 0, 5), (5, 1, 4, 3)) - del tmp71 - tmp67 = einsum(l2, (0, 1, 2, 3), tmp16, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp69 = einsum(tmp5, (0, 1, 2, 3), tmp21, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp60 = np.copy(f.ov) - tmp60 += tmp11 - tmp59 = np.copy(v.ooov) * -0.5 - tmp59 += np.transpose(v.ovoo, (0, 2, 3, 1)) - tmp12 = einsum(tmp11, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) * 0.5 - del tmp11 - tmp9 = np.copy(tmp1) - del tmp1 - tmp9 += tmp3 - del tmp3 - tmp9 += np.transpose(tmp8, (1, 0, 2, 3)) * -1 - del tmp8 - tmp14 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp14 += t2 * -0.5 - tmp17 = np.copy(np.transpose(v.oooo, (0, 2, 1, 3))) * -1 - tmp17 += v.oooo * 2 - tmp17 += np.transpose(tmp16, (2, 1, 0, 3)) * 2 - tmp17 += np.transpose(tmp16, (3, 2, 0, 1)) * -1 - tmp0 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp13 = np.copy(v.ooov) - tmp13 += np.transpose(v.ooov, (0, 2, 1, 3)) * -0.5 - tmp13 += tmp5 * -0.5 - tmp13 += np.transpose(tmp5, (0, 2, 1, 3)) - tmp15 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp15 += v.oovv * -1 - tmp26 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp26 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp33 = np.copy(tmp21) * 2 - tmp33 += np.transpose(tmp21, (1, 0, 2, 3)) * -1 - tmp35 = einsum(l1, (0, 1), t2, (2, 3, 4, 0), (1, 2, 3, 4)) - tmp37 = einsum(tmp36, (0, 1, 2, 3), t1, (0, 4), (1, 3, 2, 4)) - tmp49 = np.copy(tmp47) * 0.5 - del tmp47 - tmp49 += tmp48 - del tmp48 - tmp29 = np.copy(v.ooov) * -1 - tmp29 += np.transpose(v.ooov, (0, 2, 1, 3)) * 2 - tmp29 += tmp5 * 2 - tmp29 += np.transpose(tmp5, (0, 2, 1, 3)) * -1 - tmp28 = np.copy(v.ooov) * 2 - tmp28 += np.transpose(v.ooov, (0, 2, 1, 3)) * -1 - tmp28 += tmp5 * -1 - tmp28 += np.transpose(tmp5, (0, 2, 1, 3)) * 2 - del tmp5 - tmp31 = np.copy(np.transpose(tmp16, (0, 2, 1, 3))) * -1 - tmp31 += np.transpose(tmp16, (0, 3, 2, 1)) * 2 - del tmp16 - tmp30 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * -1 - tmp30 += v.oovv * 2 - tmp22 = np.copy(tmp21) * -0.5 - tmp22 += np.transpose(tmp21, (1, 0, 2, 3)) - tmp40 = einsum(tmp39, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - tmp19 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp19 += t2 * -1 - tmp54 = np.copy(v.ovvv) * -0.5 - tmp54 += np.transpose(v.ovvv, (0, 2, 1, 3)) - tmp99 = einsum(tmp98, (0, 1), l2, (2, 1, 3, 4), (3, 4, 2, 0)) - del tmp98 - tmp105 = np.copy(tmp100) - del tmp100 - tmp105 += tmp101 - del tmp101 - tmp105 += np.transpose(tmp103, (1, 0, 3, 2)) - del tmp103 - tmp105 += np.transpose(tmp104, (1, 0, 3, 2)) - del tmp104 - tmp113 = np.copy(tmp106) - del tmp106 - tmp113 += np.transpose(tmp108, (1, 0, 2, 3)) - del tmp108 - tmp113 += np.transpose(tmp112, (0, 1, 3, 2)) - del tmp112 - tmp97 = einsum(l1, (0, 1), f.ov, (2, 3), (2, 1, 3, 0)) - tmp97 += tmp74 - del tmp74 - tmp97 += tmp76 * 2 - del tmp76 - tmp97 += tmp77 * -1 - del tmp77 - tmp97 += tmp78 - del tmp78 - tmp97 += tmp85 - del tmp85 - tmp97 += tmp86 * -1 - del tmp86 - tmp97 += np.transpose(tmp88, (1, 0, 3, 2)) * -1 - del tmp88 - tmp97 += tmp90 * -1 - del tmp90 - tmp97 += np.transpose(tmp95, (0, 1, 3, 2)) - del tmp95 - tmp97 += tmp96 * -1 - del tmp96 - tmp97 += einsum(l1, (0, 1), tmp92, (2, 3), (1, 2, 0, 3)) - del tmp92 - tmp73 = np.copy(tmp62) - del tmp62 - tmp73 += tmp63 - del tmp63 - tmp73 += tmp65 * -1 - del tmp65 - tmp73 += tmp66 * -1 - del tmp66 - tmp73 += tmp67 - del tmp67 - tmp73 += tmp68 - del tmp68 - tmp73 += tmp69 - del tmp69 - tmp73 += tmp72 * -1 - del tmp72 - tmp45 = np.copy(v.ovvv) * 2 - tmp45 += np.transpose(v.ovvv, (0, 2, 1, 3)) * -1 - tmp61 = np.copy(f.oo) - tmp61 += einsum(tmp46, (0, 1, 2, 3), v.ovov, (4, 3, 0, 2), (1, 4)) - tmp61 += einsum(t1, (0, 1), tmp59, (0, 2, 3, 1), (2, 3)) * 2 - del tmp59 - tmp61 += einsum(tmp60, (0, 1), t1, (2, 1), (2, 0)) - del tmp60 - tmp53 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp53 += v.oovv * -1 - tmp18 = np.copy(np.transpose(v.ooov, (0, 2, 1, 3))) * -1 - tmp18 += np.transpose(v.ovoo, (0, 2, 3, 1)) * 0.5 - tmp18 += np.transpose(tmp0, (1, 2, 0, 3)) * 0.5 - tmp18 += np.transpose(tmp0, (2, 1, 0, 3)) * -1 - del tmp0 - tmp18 += tmp9 * -1 - tmp18 += np.transpose(tmp9, (1, 0, 2, 3)) * 0.5 - del tmp9 - tmp18 += np.transpose(tmp12, (1, 0, 2, 3)) - tmp18 += tmp12 * -2 - del tmp12 - tmp18 += einsum(tmp13, (0, 1, 2, 3), tmp14, (2, 4, 5, 3), (0, 4, 1, 5)) * -2 - del tmp13 - tmp18 += einsum(t1, (0, 1), tmp15, (2, 3, 1, 4), (0, 3, 2, 4)) * -0.5 - del tmp15 - tmp18 += einsum(tmp17, (0, 1, 2, 3), t1, (0, 4), (2, 1, 3, 4)) * 0.5 - del tmp17 - tmp27 = np.copy(np.transpose(l2, (2, 3, 0, 1))) - tmp27 += einsum(tmp26, (0, 1, 2, 3), tmp20, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp26 - tmp38 = np.copy(tmp35) * -0.5 - tmp38 += np.transpose(tmp35, (0, 2, 1, 3)) - del tmp35 - tmp38 += np.transpose(tmp21, (0, 2, 1, 3)) * -0.5 - tmp38 += np.transpose(tmp21, (1, 2, 0, 3)) - tmp38 += tmp37 * -1 - tmp38 += np.transpose(tmp37, (0, 2, 1, 3)) * 0.5 - del tmp37 - tmp38 += einsum(tmp20, (0, 1, 2, 3), tmp33, (0, 4, 5, 2), (4, 5, 1, 3)) - tmp42 = np.copy(tmp21) * 2 - tmp42 += np.transpose(tmp21, (1, 0, 2, 3)) * -1 - tmp50 = np.copy(t1) * -1 - tmp50 += einsum(tmp14, (0, 1, 2, 3), tmp21, (0, 1, 4, 3), (4, 2)) * 2 - del tmp21, tmp14 - tmp50 += einsum(tmp46, (0, 1, 2, 3), l1, (2, 0), (1, 3)) * -1 - del tmp46 - tmp50 += einsum(t1, (0, 1), tmp49, (0, 2), (2, 1)) * 2 - tmp52 = np.copy(v.ooov) - tmp52 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -0.5 - tmp32 = einsum(t2, (0, 1, 2, 3), tmp28, (4, 5, 1, 3), (4, 0, 5, 2)) - del tmp28 - tmp32 += einsum(tmp29, (0, 1, 2, 3), t2, (4, 2, 3, 5), (0, 4, 1, 5)) - del tmp29 - tmp32 += einsum(t1, (0, 1), tmp30, (2, 3, 1, 4), (0, 3, 2, 4)) * -1 - del tmp30 - tmp32 += einsum(tmp31, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - del tmp31 - tmp24 = einsum(t1, (0, 1), l2, (2, 3, 4, 0), (4, 2, 3, 1)) - tmp43 = np.copy(np.transpose(tmp39, (1, 0, 2, 3))) - tmp43 += np.transpose(tmp39, (1, 0, 3, 2)) * -0.5 - tmp43 += np.transpose(tmp36, (2, 1, 3, 0)) - tmp43 += np.transpose(tmp36, (3, 1, 2, 0)) * -0.5 - tmp44 = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) * 0.5 - tmp44 += einsum(l2, (0, 1, 2, 3), tmp20, (3, 2, 1, 4), (0, 4)) - tmp41 = np.copy(tmp40) * -1 - tmp41 += np.transpose(tmp40, (0, 2, 1, 3)) * 2 - del tmp40 - tmp41 += einsum(t2, (0, 1, 2, 3), tmp33, (1, 4, 5, 3), (4, 5, 0, 2)) - tmp41 += einsum(t2, (0, 1, 2, 3), tmp22, (1, 4, 5, 2), (4, 5, 0, 3)) * 2 - tmp56 = np.copy(f.ov) * 0.5 - tmp56 += einsum(t1, (0, 1), tmp10, (0, 2, 1, 3), (2, 3)) - del tmp10 - tmp23 = einsum(tmp19, (0, 1, 2, 3), l2, (4, 2, 0, 5), (5, 1, 4, 3)) - del tmp19 - tmp23 += einsum(l2, (0, 1, 2, 3), tmp20, (3, 4, 1, 5), (2, 4, 0, 5)) * 2 - del tmp20 - tmp23 += einsum(tmp22, (0, 1, 2, 3), t1, (1, 4), (0, 2, 4, 3)) * 2 - del tmp22 - tmp25 = np.copy(np.transpose(v.vvvv, (0, 2, 1, 3))) * -1 - tmp25 += v.vvvv * 2 - tmp34 = np.copy(np.transpose(l2, (3, 2, 0, 1))) - tmp34 += einsum(t1, (0, 1), tmp33, (2, 0, 3, 4), (2, 3, 4, 1)) - del tmp33 - tmp55 = np.copy(f.vv) - tmp55 += einsum(t1, (0, 1), tmp54, (0, 2, 1, 3), (3, 2)) * 2 - del tmp54 - l2new = einsum(v.oooo, (0, 1, 2, 3), l2, (4, 5, 1, 3), (4, 5, 0, 2)) - l2new += einsum(l2, (0, 1, 2, 3), v.vvvv, (4, 1, 5, 0), (4, 5, 3, 2)) - l2new += np.transpose(v.ovov, (1, 3, 0, 2)) - l2new += einsum(v.ovov, (0, 1, 2, 3), tmp39, (4, 5, 2, 0), (3, 1, 4, 5)) - del tmp39 - l2new += einsum(tmp36, (0, 1, 2, 3), v.ovov, (3, 4, 2, 5), (4, 5, 1, 0)) - del tmp36 - l2new += np.transpose(tmp73, (3, 2, 0, 1)) - l2new += np.transpose(tmp73, (2, 3, 1, 0)) - del tmp73 - l2new += np.transpose(tmp97, (2, 3, 0, 1)) - l2new += np.transpose(tmp97, (3, 2, 1, 0)) - del tmp97 - l2new += np.transpose(tmp99, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp99, (3, 2, 1, 0)) * -1 - del tmp99 - l2new += np.transpose(tmp105, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp105, (2, 3, 1, 0)) * -1 - del tmp105 - l2new += np.transpose(tmp113, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp113, (3, 2, 1, 0)) * -1 - del tmp113 - l2new += einsum(l2, (0, 1, 2, 3), tmp7, (3, 2, 4, 5), (0, 1, 5, 4)) - del tmp7 - l1new = np.copy(np.transpose(f.ov, (1, 0))) - l1new += einsum(l2, (0, 1, 2, 3), tmp18, (2, 3, 4, 1), (0, 4)) * 2 - del tmp18 - l1new += einsum(tmp23, (0, 1, 2, 3), v.ovvv, (1, 4, 3, 2), (4, 0)) * -1 - del tmp23 - l1new += einsum(tmp24, (0, 1, 2, 3), tmp25, (2, 3, 4, 1), (4, 0)) - del tmp24, tmp25 - l1new += einsum(v.ovvv, (0, 1, 2, 3), tmp27, (4, 0, 3, 1), (2, 4)) * 2 - del tmp27 - l1new += einsum(tmp32, (0, 1, 2, 3), l2, (4, 3, 1, 0), (4, 2)) - del tmp32 - l1new += einsum(tmp34, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 2), (4, 0)) * -1 - del tmp34 - l1new += einsum(tmp38, (0, 1, 2, 3), v.ovov, (2, 3, 1, 4), (4, 0)) * -2 - del tmp38 - l1new += einsum(v.ovov, (0, 1, 2, 3), tmp41, (4, 2, 0, 3), (1, 4)) - del tmp41 - l1new += einsum(tmp42, (0, 1, 2, 3), v.oovv, (1, 2, 4, 3), (4, 0)) * -1 - del tmp42 - l1new += einsum(tmp43, (0, 1, 2, 3), v.ooov, (3, 0, 2, 4), (4, 1)) * 2 - del tmp43 - l1new += einsum(tmp45, (0, 1, 2, 3), tmp44, (3, 2), (1, 0)) * 2 - del tmp45, tmp44 - l1new += einsum(tmp50, (0, 1), tmp51, (0, 2, 1, 3), (3, 2)) * -1 - del tmp51, tmp50 - l1new += einsum(tmp52, (0, 1, 2, 3), tmp49, (1, 0), (3, 2)) * -4 - del tmp49, tmp52 - l1new += einsum(tmp53, (0, 1, 2, 3), l1, (2, 0), (3, 1)) - del tmp53 - l1new += einsum(l1, (0, 1), tmp55, (0, 2), (2, 1)) - del tmp55 - l1new += einsum(tmp58, (0, 1), tmp56, (1, 2), (2, 0)) * -2 - del tmp58, tmp56 - l1new += einsum(tmp61, (0, 1), l1, (2, 0), (2, 1)) * -1 - del tmp61 - - return {f"l1new": l1new, f"l2new": l2new} - -def make_rdm1_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:32:32.938478. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm1 : array - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp0 = einsum(t1, (0, 1), l1, (1, 2), (2, 0)) - tmp5 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp5 += t2 - tmp2 = einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp7 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp7 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp6 = np.copy(tmp0) - tmp6 += einsum(tmp5, (0, 1, 2, 3), l2, (2, 3, 0, 4), (4, 1)) * 2 - del tmp5 - tmp4 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp4 += t2 * 2 - tmp3 = np.copy(tmp2) * -0.5 - tmp3 += np.transpose(tmp2, (1, 0, 2, 3)) - del tmp2 - tmp1 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp1 += t2 * -0.5 - rdm1.vv = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) * 2 - rdm1.vv += einsum(t2, (0, 1, 2, 3), tmp7, (0, 1, 2, 4), (4, 3)) * 2 - del tmp7 - rdm1.vo = np.copy(l1) * 2 - rdm1.ov = np.copy(t1) * 2 - rdm1.ov += einsum(t2, (0, 1, 2, 3), tmp3, (1, 0, 4, 2), (4, 3)) * -4 - del tmp3 - rdm1.ov += einsum(l1, (0, 1), tmp4, (1, 2, 0, 3), (2, 3)) * 2 - del tmp4 - rdm1.ov += einsum(t1, (0, 1), tmp6, (0, 2), (2, 1)) * -2 - del tmp6 - rdm1.oo = np.copy(delta.oo) * 2 - del delta - rdm1.oo += np.transpose(tmp0, (1, 0)) * -2 - del tmp0 - rdm1.oo += einsum(tmp1, (0, 1, 2, 3), l2, (3, 2, 0, 4), (1, 4)) * -4 - del tmp1 - rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]]) - - return rdm1 - -def make_rdm2_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:33:45.706624. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm2 : array - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp3 = einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp98 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp98 += t2 - tmp9 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp9 += t2 * 2 - tmp0 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp0 += t2 - tmp20 = np.copy(tmp3) * 2 - tmp20 += np.transpose(tmp3, (1, 0, 2, 3)) * -1 - tmp18 = np.copy(tmp3) - tmp18 += np.transpose(tmp3, (1, 0, 2, 3)) * -1 - tmp45 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp45 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp62 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * 2 - tmp62 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp99 = einsum(l2, (0, 1, 2, 3), tmp98, (2, 4, 1, 5), (4, 3, 5, 0)) - del tmp98 - tmp91 = einsum(tmp3, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - tmp97 = einsum(l2, (0, 1, 2, 3), tmp9, (3, 4, 1, 5), (4, 2, 5, 0)) - tmp107 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp107 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp12 = np.copy(tmp3) * 2 - tmp12 += np.transpose(tmp3, (1, 0, 2, 3)) * -1 - tmp1 = einsum(tmp0, (0, 1, 2, 3), l2, (2, 3, 0, 4), (4, 1)) * 2 - tmp21 = einsum(tmp20, (0, 1, 2, 3), t2, (4, 0, 5, 3), (1, 2, 4, 5)) - del tmp20 - tmp25 = einsum(t2, (0, 1, 2, 3), tmp3, (1, 4, 5, 2), (4, 5, 0, 3)) - tmp48 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp48 += np.transpose(l2, (2, 3, 0, 1)) - tmp4 = einsum(t1, (0, 1), tmp3, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp6 = einsum(t1, (0, 1), l1, (1, 2), (2, 0)) - tmp16 = einsum(l1, (0, 1), t2, (2, 3, 4, 0), (1, 2, 3, 4)) - tmp19 = einsum(t2, (0, 1, 2, 3), tmp18, (1, 4, 5, 2), (4, 5, 0, 3)) - tmp26 = einsum(tmp3, (0, 1, 2, 3), t2, (4, 1, 3, 5), (0, 2, 4, 5)) - tmp33 = einsum(tmp0, (0, 1, 2, 3), l2, (2, 3, 0, 4), (4, 1)) - del tmp0 - tmp2 = einsum(t2, (0, 1, 2, 3), l2, (3, 2, 4, 5), (5, 4, 0, 1)) - tmp117 = einsum(t1, (0, 1), l2, (2, 3, 4, 0), (4, 2, 3, 1)) - tmp67 = einsum(t2, (0, 1, 2, 3), l2, (4, 2, 5, 1), (5, 0, 4, 3)) - tmp46 = einsum(tmp45, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - tmp83 = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) - tmp84 = einsum(t2, (0, 1, 2, 3), tmp62, (0, 1, 3, 4), (4, 2)) - tmp111 = np.copy(tmp91) - tmp111 += np.transpose(tmp99, (1, 0, 3, 2)) - tmp111 += np.transpose(tmp97, (1, 0, 3, 2)) * -1 - tmp100 = np.copy(np.transpose(tmp97, (1, 0, 3, 2))) - del tmp97 - tmp100 += np.transpose(tmp99, (1, 0, 3, 2)) * -1 - del tmp99 - tmp108 = einsum(tmp107, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - del tmp107 - tmp13 = einsum(t2, (0, 1, 2, 3), tmp12, (0, 1, 4, 2), (4, 3)) * 0.5 - tmp14 = einsum(t1, (0, 1), tmp1, (0, 2), (2, 1)) * 0.5 - tmp63 = einsum(t2, (0, 1, 2, 3), tmp62, (0, 1, 3, 4), (4, 2)) * 0.5 - del tmp62 - tmp71 = np.copy(tmp25) - tmp71 += tmp21 * -1 - tmp53 = einsum(tmp45, (0, 1, 2, 3), t2, (4, 0, 2, 5), (1, 4, 3, 5)) - del tmp45 - tmp59 = np.copy(t2) - tmp59 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp49 = einsum(t2, (0, 1, 2, 3), tmp48, (1, 4, 2, 5), (4, 0, 5, 3)) - tmp17 = einsum(tmp4, (0, 1, 2, 3), t1, (0, 4), (1, 3, 2, 4)) - tmp8 = einsum(t1, (0, 1), tmp6, (0, 2), (2, 1)) - tmp10 = einsum(l1, (0, 1), tmp9, (1, 2, 0, 3), (2, 3)) - del tmp9 - tmp55 = np.copy(tmp16) - tmp55 += tmp19 - tmp55 += tmp21 * -1 - tmp74 = np.copy(tmp16) - tmp74 += tmp26 * -1 - tmp34 = np.copy(tmp6) * 0.5 - tmp34 += tmp33 - del tmp33 - tmp31 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp31 += t2 * 2 - tmp5 = np.copy(np.transpose(tmp2, (1, 0, 3, 2))) - tmp5 += tmp4 - tmp119 = einsum(tmp117, (0, 1, 2, 3), t1, (0, 4), (2, 1, 3, 4)) - tmp118 = einsum(l2, (0, 1, 2, 3), t2, (3, 2, 4, 5), (0, 1, 5, 4)) - tmp69 = einsum(l2, (0, 1, 2, 3), t2, (4, 2, 1, 5), (3, 4, 0, 5)) - tmp115 = np.copy(tmp67) - tmp115 += tmp91 - tmp115 += tmp46 * -1 - tmp85 = np.copy(tmp83) - tmp85 += tmp84 - del tmp84 - tmp103 = einsum(tmp3, (0, 1, 2, 3), t2, (0, 1, 4, 5), (2, 3, 4, 5)) - tmp96 = einsum(t2, (0, 1, 2, 3), l1, (4, 1), (0, 4, 2, 3)) - tmp112 = einsum(t1, (0, 1), tmp111, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp111 - tmp101 = einsum(tmp100, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp100 - tmp109 = np.copy(tmp67) - tmp109 += tmp91 - tmp109 += tmp108 * -1 - del tmp108 - tmp87 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * 2 - tmp87 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp92 = np.copy(tmp3) * -1 - tmp92 += np.transpose(tmp3, (1, 0, 2, 3)) - tmp80 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp80 += t2 * -1 - tmp78 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp78 += t2 * -1 - tmp89 = np.copy(np.transpose(l2, (3, 2, 0, 1))) - tmp89 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp65 = einsum(t2, (0, 1, 2, 3), tmp1, (1, 4), (0, 4, 3, 2)) - tmp15 = np.copy(tmp13) - tmp15 += tmp14 - del tmp14 - tmp64 = einsum(tmp63, (0, 1), t2, (2, 3, 0, 4), (2, 3, 1, 4)) * 2 - tmp72 = einsum(t1, (0, 1), tmp71, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp71 - tmp54 = einsum(tmp53, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - del tmp53 - tmp58 = einsum(t2, (0, 1, 2, 3), tmp4, (0, 1, 4, 5), (5, 4, 3, 2)) - tmp60 = einsum(tmp59, (0, 1, 2, 3), tmp2, (0, 1, 4, 5), (4, 5, 2, 3)) - del tmp59 - tmp47 = einsum(tmp46, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - del tmp46 - tmp50 = einsum(t2, (0, 1, 2, 3), tmp49, (1, 4, 2, 5), (4, 0, 5, 3)) - del tmp49 - tmp44 = einsum(tmp17, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - tmp11 = np.copy(tmp8) - tmp11 += tmp10 * -1 - tmp56 = einsum(t1, (0, 1), tmp55, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp55 - tmp52 = einsum(t2, (0, 1, 2, 3), tmp6, (1, 4), (4, 0, 2, 3)) - tmp75 = einsum(t1, (0, 1), tmp74, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp74 - tmp42 = einsum(t1, (0, 1), tmp34, (0, 2), (2, 1)) - tmp41 = einsum(tmp31, (0, 1, 2, 3), l1, (2, 0), (1, 3)) * 0.5 - tmp29 = einsum(tmp5, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - tmp35 = einsum(t1, (0, 1), tmp34, (0, 2), (2, 1)) * 2 - del tmp34 - tmp30 = einsum(t2, (0, 1, 2, 3), tmp12, (0, 1, 4, 2), (4, 3)) - del tmp12 - tmp27 = np.copy(tmp3) * -1 - tmp27 += np.transpose(tmp3, (1, 0, 2, 3)) * 2 - tmp32 = einsum(tmp31, (0, 1, 2, 3), l1, (2, 0), (1, 3)) - del tmp31 - tmp23 = einsum(tmp2, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - tmp120 = np.copy(np.transpose(tmp118, (1, 0, 3, 2))) - tmp120 += np.transpose(tmp119, (1, 0, 3, 2)) - tmp106 = einsum(t1, (0, 1), tmp69, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp116 = einsum(t1, (0, 1), tmp115, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp115 - tmp114 = np.copy(tmp103) - tmp114 += einsum(t1, (0, 1), tmp85, (2, 3), (0, 2, 1, 3)) - tmp95 = np.copy(tmp83) * 0.5 - tmp95 += tmp63 - tmp113 = np.copy(tmp96) - tmp113 += np.transpose(tmp112, (0, 1, 3, 2)) - del tmp112 - tmp102 = np.copy(tmp96) - tmp102 += einsum(t1, (0, 1), tmp83, (2, 3), (0, 2, 1, 3)) - del tmp83 - tmp102 += np.transpose(tmp101, (0, 1, 3, 2)) * -1 - del tmp101 - tmp104 = np.copy(tmp103) - tmp104 += einsum(t1, (0, 1), tmp63, (2, 3), (0, 2, 1, 3)) * 2 - del tmp63 - tmp105 = einsum(t1, (0, 1), tmp91, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp110 = einsum(t1, (0, 1), tmp109, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp109 - tmp86 = einsum(t1, (0, 1), tmp3, (0, 2, 3, 4), (2, 3, 4, 1)) - tmp88 = einsum(tmp87, (0, 1, 2, 3), t2, (4, 0, 5, 3), (1, 4, 2, 5)) - del tmp87 - tmp94 = einsum(tmp48, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 4, 2, 5)) - del tmp48 - tmp93 = einsum(t1, (0, 1), tmp92, (2, 0, 3, 4), (2, 3, 4, 1)) - del tmp92 - tmp81 = einsum(l2, (0, 1, 2, 3), tmp80, (3, 4, 5, 1), (4, 2, 5, 0)) - del tmp80 - tmp79 = einsum(l2, (0, 1, 2, 3), tmp78, (2, 4, 5, 1), (4, 3, 5, 0)) - del tmp78 - tmp82 = einsum(tmp18, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - del tmp18 - tmp90 = einsum(tmp89, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 4, 2, 5)) - del tmp89 - tmp66 = np.copy(np.transpose(tmp64, (1, 0, 3, 2))) - del tmp64 - tmp66 += np.transpose(tmp65, (0, 1, 3, 2)) - del tmp65 - tmp66 += einsum(t1, (0, 1), tmp15, (2, 3), (0, 2, 1, 3)) * 2 - tmp70 = einsum(t2, (0, 1, 2, 3), tmp69, (1, 4, 2, 5), (0, 4, 3, 5)) - tmp73 = np.copy(np.transpose(tmp54, (1, 0, 3, 2))) * -1 - tmp73 += np.transpose(tmp72, (0, 1, 3, 2)) - del tmp72 - tmp73 += einsum(t1, (0, 1), tmp10, (2, 3), (0, 2, 1, 3)) - tmp61 = np.copy(tmp58) - tmp61 += np.transpose(tmp60, (1, 0, 3, 2)) - tmp68 = einsum(t2, (0, 1, 2, 3), tmp67, (1, 4, 2, 5), (0, 4, 3, 5)) - tmp51 = np.copy(tmp44) - tmp51 += np.transpose(tmp47, (1, 0, 3, 2)) * 2 - tmp51 += tmp50 - del tmp50 - tmp57 = np.copy(tmp52) - tmp57 += np.transpose(tmp54, (1, 0, 3, 2)) * -1 - del tmp54 - tmp57 += np.transpose(tmp56, (0, 1, 3, 2)) - del tmp56 - tmp57 += einsum(t1, (0, 1), tmp11, (2, 3), (0, 2, 1, 3)) * -1 - tmp76 = np.copy(tmp52) - del tmp52 - tmp76 += np.transpose(tmp75, (0, 1, 3, 2)) - del tmp75 - tmp77 = np.copy(t1) - tmp77 += tmp8 * -1 - tmp43 = np.copy(t1) * -0.5 - tmp43 += tmp13 - del tmp13 - tmp43 += tmp41 * -1 - del tmp41 - tmp43 += tmp42 - del tmp42 - tmp40 = np.copy(tmp16) - tmp40 += np.transpose(tmp29, (0, 2, 1, 3)) - tmp40 += einsum(t1, (0, 1), tmp1, (2, 3), (2, 0, 3, 1)) - tmp39 = einsum(t1, (0, 1), tmp6, (2, 3), (2, 0, 3, 1)) - tmp39 += tmp19 - tmp39 += tmp21 * -1 - tmp38 = np.copy(tmp30) - tmp38 += tmp35 - tmp37 = np.copy(tmp6) - tmp37 += tmp1 - tmp22 = np.copy(tmp16) - tmp22 += tmp17 - del tmp17 - tmp22 += tmp19 - del tmp19 - tmp22 += tmp21 * -1 - tmp28 = einsum(t2, (0, 1, 2, 3), tmp27, (4, 1, 5, 3), (4, 5, 0, 2)) - del tmp27 - tmp36 = np.copy(t1) * -1 - tmp36 += tmp30 - del tmp30 - tmp36 += tmp32 * -1 - del tmp32 - tmp36 += tmp35 - del tmp35 - tmp24 = np.copy(tmp23) - del tmp23 - tmp24 += einsum(t1, (0, 1), tmp1, (2, 3), (2, 0, 3, 1)) - tmp7 = np.copy(delta.oo) - tmp7 += tmp6 * -1 - rdm2.vvvv = np.copy(np.transpose(tmp120, (0, 1, 3, 2))) * -2 - rdm2.vvvv += tmp120 * 2 - del tmp120 - rdm2.vvvv += np.transpose(tmp118, (1, 0, 3, 2)) * 2 - del tmp118 - rdm2.vvvv += np.transpose(tmp119, (1, 0, 3, 2)) * 2 - del tmp119 - rdm2.vvvo = np.copy(np.transpose(tmp117, (1, 2, 3, 0))) * -2 - rdm2.vvvo += np.transpose(tmp117, (2, 1, 3, 0)) * 4 - rdm2.vvov = np.copy(np.transpose(tmp117, (1, 2, 0, 3))) * 4 - rdm2.vvov += np.transpose(tmp117, (2, 1, 0, 3)) * -2 - del tmp117 - rdm2.vovv = np.copy(np.transpose(tmp113, (1, 0, 2, 3))) * -2 - rdm2.vovv += np.transpose(tmp113, (1, 0, 3, 2)) * 2 - del tmp113 - rdm2.vovv += np.transpose(tmp114, (1, 0, 2, 3)) * -2 - rdm2.vovv += np.transpose(tmp114, (1, 0, 3, 2)) * 2 - del tmp114 - rdm2.vovv += np.transpose(tmp96, (1, 0, 3, 2)) * 2 - rdm2.vovv += np.transpose(tmp106, (1, 0, 3, 2)) * -2 - rdm2.vovv += np.transpose(tmp103, (1, 0, 2, 3)) * -2 - rdm2.vovv += np.transpose(tmp116, (1, 0, 3, 2)) * -2 - del tmp116 - rdm2.vovv += einsum(t1, (0, 1), tmp95, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.ovvv = np.copy(tmp102) * 2 - rdm2.ovvv += np.transpose(tmp102, (0, 1, 3, 2)) * -2 - del tmp102 - rdm2.ovvv += tmp104 * 2 - rdm2.ovvv += np.transpose(tmp104, (0, 1, 3, 2)) * -2 - del tmp104 - rdm2.ovvv += tmp105 * 2 - rdm2.ovvv += np.transpose(tmp105, (0, 1, 3, 2)) * -2 - del tmp105 - rdm2.ovvv += tmp96 * 2 - del tmp96 - rdm2.ovvv += np.transpose(tmp103, (0, 1, 3, 2)) * -2 - del tmp103 - rdm2.ovvv += tmp106 * -2 - del tmp106 - rdm2.ovvv += tmp110 * -2 - del tmp110 - rdm2.ovvv += einsum(t1, (0, 1), tmp85, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.vvoo = np.copy(np.transpose(l2, (0, 1, 3, 2))) * -2 - rdm2.vvoo += l2 * 4 - rdm2.vovo = einsum(t1, (0, 1), l1, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.vovo += np.transpose(tmp88, (2, 1, 3, 0)) * -2 - rdm2.vovo += np.transpose(tmp94, (2, 1, 3, 0)) * -2 - del tmp94 - rdm2.vovo += np.transpose(tmp93, (2, 1, 3, 0)) * -2 - rdm2.vovo += einsum(delta.oo, (0, 1), tmp95, (2, 3), (2, 0, 3, 1)) * 8 - del tmp95 - rdm2.vovo += np.transpose(tmp69, (2, 1, 3, 0)) * -2 - rdm2.vovo += np.transpose(tmp86, (2, 1, 3, 0)) * -2 - rdm2.voov = einsum(t1, (0, 1), l1, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.voov += np.transpose(tmp81, (3, 0, 1, 2)) * 2 - rdm2.voov += np.transpose(tmp79, (3, 0, 1, 2)) * -2 - rdm2.voov += np.transpose(tmp93, (2, 1, 0, 3)) * 2 - del tmp93 - rdm2.voov += einsum(tmp85, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.voov += np.transpose(tmp67, (2, 1, 0, 3)) * -2 - rdm2.voov += np.transpose(tmp91, (2, 1, 0, 3)) * -2 - rdm2.voov += np.transpose(tmp88, (2, 1, 0, 3)) * 2 - rdm2.ovvo = einsum(t1, (0, 1), l1, (2, 3), (0, 2, 1, 3)) * 4 - rdm2.ovvo += np.transpose(tmp88, (1, 2, 3, 0)) * 4 - del tmp88 - rdm2.ovvo += np.transpose(tmp90, (1, 2, 3, 0)) * -2 - del tmp90 - rdm2.ovvo += np.transpose(tmp82, (1, 2, 3, 0)) * -2 - rdm2.ovvo += einsum(tmp85, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.ovvo += np.transpose(tmp67, (1, 2, 3, 0)) * -2 - del tmp67 - rdm2.ovvo += np.transpose(tmp91, (1, 2, 3, 0)) * -2 - del tmp91 - rdm2.ovov = einsum(t1, (0, 1), l1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.ovov += np.transpose(tmp79, (0, 3, 1, 2)) * 2 - del tmp79 - rdm2.ovov += np.transpose(tmp81, (0, 3, 1, 2)) * -2 - del tmp81 - rdm2.ovov += np.transpose(tmp82, (1, 2, 0, 3)) * 2 - del tmp82 - rdm2.ovov += einsum(tmp85, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * 4 - del tmp85 - rdm2.ovov += np.transpose(tmp69, (1, 2, 0, 3)) * -2 - del tmp69 - rdm2.ovov += np.transpose(tmp86, (1, 2, 0, 3)) * -2 - del tmp86 - rdm2.oovv = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -2 - rdm2.oovv += t2 * 4 - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.oovv += tmp51 * 2 - rdm2.oovv += np.transpose(tmp51, (0, 1, 3, 2)) * -2 - del tmp51 - rdm2.oovv += tmp57 * 2 - rdm2.oovv += np.transpose(tmp57, (0, 1, 3, 2)) * -2 - rdm2.oovv += np.transpose(tmp57, (1, 0, 2, 3)) * -2 - rdm2.oovv += np.transpose(tmp57, (1, 0, 3, 2)) * 2 - del tmp57 - rdm2.oovv += tmp61 * 2 - rdm2.oovv += np.transpose(tmp61, (0, 1, 3, 2)) * -2 - del tmp61 - rdm2.oovv += tmp66 * -4 - rdm2.oovv += np.transpose(tmp66, (0, 1, 3, 2)) * 2 - rdm2.oovv += np.transpose(tmp66, (1, 0, 2, 3)) * 2 - rdm2.oovv += np.transpose(tmp66, (1, 0, 3, 2)) * -4 - del tmp66 - rdm2.oovv += tmp68 * 2 - del tmp68 - rdm2.oovv += np.transpose(tmp70, (0, 1, 3, 2)) * 2 - del tmp70 - rdm2.oovv += tmp58 * 2 - del tmp58 - rdm2.oovv += tmp44 * 2 - del tmp44 - rdm2.oovv += einsum(t1, (0, 1), tmp8, (2, 3), (0, 2, 1, 3)) * -2 - del tmp8 - rdm2.oovv += tmp73 * 2 - rdm2.oovv += np.transpose(tmp73, (1, 0, 3, 2)) * 2 - del tmp73 - rdm2.oovv += np.transpose(tmp76, (0, 1, 3, 2)) * -2 - rdm2.oovv += np.transpose(tmp76, (1, 0, 2, 3)) * -2 - del tmp76 - rdm2.oovv += tmp47 * 4 - del tmp47 - rdm2.oovv += np.transpose(tmp60, (1, 0, 3, 2)) * 2 - del tmp60 - rdm2.oovv += einsum(t1, (0, 1), tmp77, (2, 3), (2, 0, 3, 1)) * 2 - del tmp77 - rdm2.vooo = einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.vooo += np.transpose(tmp3, (3, 2, 0, 1)) * -4 - rdm2.vooo += np.transpose(tmp3, (3, 2, 1, 0)) * 2 - rdm2.ovoo = einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 1, 3)) * 4 - rdm2.ovoo += np.transpose(tmp3, (2, 3, 0, 1)) * 2 - rdm2.ovoo += np.transpose(tmp3, (2, 3, 1, 0)) * -4 - del tmp3 - rdm2.oovo = einsum(delta.oo, (0, 1), tmp10, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.oovo += einsum(delta.oo, (0, 1), tmp10, (2, 3), (0, 2, 3, 1)) * -2 - del tmp10 - rdm2.oovo += einsum(delta.oo, (0, 1), tmp38, (2, 3), (2, 0, 3, 1)) * -2 - rdm2.oovo += einsum(delta.oo, (0, 1), tmp38, (2, 3), (0, 2, 3, 1)) * 2 - del tmp38 - rdm2.oovo += einsum(t1, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.oovo += einsum(t1, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.oovo += np.transpose(tmp39, (1, 2, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp39, (2, 1, 3, 0)) * 2 - del tmp39 - rdm2.oovo += np.transpose(tmp40, (1, 2, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp40, (2, 1, 3, 0)) * 2 - del tmp40 - rdm2.oovo += np.transpose(tmp26, (1, 2, 3, 0)) * 2 - rdm2.oovo += np.transpose(tmp25, (2, 1, 3, 0)) * 2 - rdm2.oovo += np.transpose(tmp16, (1, 2, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp21, (2, 1, 3, 0)) * -2 - del tmp21 - rdm2.oovo += np.transpose(tmp29, (1, 2, 3, 0)) * 2 - rdm2.oovo += einsum(tmp43, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * -4 - del tmp43 - rdm2.oovo += einsum(t1, (0, 1), tmp37, (2, 3), (0, 3, 1, 2)) * -2 - rdm2.ooov = einsum(tmp11, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * 2 - rdm2.ooov += einsum(delta.oo, (0, 1), tmp11, (2, 3), (0, 2, 1, 3)) * -2 - del tmp11 - rdm2.ooov += einsum(t1, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.ooov += einsum(t1, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.ooov += einsum(delta.oo, (0, 1), tmp15, (2, 3), (2, 0, 1, 3)) * 4 - rdm2.ooov += einsum(delta.oo, (0, 1), tmp15, (2, 3), (0, 2, 1, 3)) * -4 - del tmp15 - rdm2.ooov += np.transpose(tmp22, (1, 2, 0, 3)) * 2 - rdm2.ooov += np.transpose(tmp22, (2, 1, 0, 3)) * -2 - del tmp22 - rdm2.ooov += np.transpose(tmp24, (1, 2, 0, 3)) * 2 - rdm2.ooov += np.transpose(tmp24, (2, 1, 0, 3)) * -2 - del tmp24 - rdm2.ooov += einsum(tmp6, (0, 1), t1, (2, 3), (2, 1, 0, 3)) * 2 - rdm2.ooov += einsum(t1, (0, 1), tmp6, (2, 3), (3, 0, 2, 1)) * -2 - rdm2.ooov += np.transpose(tmp25, (1, 2, 0, 3)) * 2 - del tmp25 - rdm2.ooov += np.transpose(tmp26, (2, 1, 0, 3)) * 2 - del tmp26 - rdm2.ooov += np.transpose(tmp16, (2, 1, 0, 3)) * -2 - del tmp16 - rdm2.ooov += np.transpose(tmp28, (1, 2, 0, 3)) * -2 - del tmp28 - rdm2.ooov += np.transpose(tmp29, (2, 1, 0, 3)) * 2 - del tmp29 - rdm2.ooov += einsum(delta.oo, (0, 1), tmp36, (2, 3), (0, 2, 1, 3)) * -2 - del tmp36 - rdm2.ooov += einsum(t1, (0, 1), tmp37, (2, 3), (3, 0, 2, 1)) * -2 - del tmp37 - rdm2.oooo = einsum(tmp1, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * -4 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp1, (2, 3), (0, 3, 2, 1)) * 2 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp1, (2, 3), (3, 0, 1, 2)) * 2 - rdm2.oooo += einsum(tmp1, (0, 1), delta.oo, (2, 3), (2, 1, 3, 0)) * -4 - del tmp1 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.oooo += np.transpose(tmp5, (3, 2, 0, 1)) * -2 - rdm2.oooo += np.transpose(tmp5, (2, 3, 0, 1)) * 2 - del tmp5 - rdm2.oooo += einsum(tmp6, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.oooo += einsum(tmp6, (0, 1), delta.oo, (2, 3), (2, 1, 0, 3)) * 2 - rdm2.oooo += einsum(tmp6, (0, 1), delta.oo, (2, 3), (1, 2, 3, 0)) * 2 - rdm2.oooo += einsum(tmp6, (0, 1), delta.oo, (2, 3), (2, 1, 3, 0)) * -4 - del tmp6 - rdm2.oooo += np.transpose(tmp2, (3, 2, 1, 0)) * 2 - del tmp2 - rdm2.oooo += np.transpose(tmp4, (3, 2, 1, 0)) * 2 - del tmp4 - rdm2.oooo += einsum(tmp7, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * 2 - del delta, tmp7 - rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv) - rdm2 = np.transpose(rdm2, (0, 2, 1, 3)) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:34:14.090594. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp100 : array - tmp101 : array - tmp102 : array - tmp103 : array - tmp108 : array - tmp109 : array - tmp12 : array - tmp14 : array - tmp16 : array - tmp17 : array - tmp19 : array - tmp21 : array - tmp22 : array - tmp23 : array - tmp25 : array - tmp27 : array - tmp29 : array - tmp3 : array - tmp30 : array - tmp34 : array - tmp35 : array - tmp36 : array - tmp37 : array - tmp39 : array - tmp4 : array - tmp40 : array - tmp42 : array - tmp45 : array - tmp46 : array - tmp48 : array - tmp49 : array - tmp5 : array - tmp50 : array - tmp51 : array - tmp52 : array - tmp54 : array - tmp55 : array - tmp56 : array - tmp57 : array - tmp58 : array - tmp6 : array - tmp60 : array - tmp64 : array - tmp65 : array - tmp66 : array - tmp67 : array - tmp69 : array - tmp75 : array - tmp76 : array - tmp77 : array - tmp78 : array - tmp82 : array - tmp83 : array - tmp85 : array - tmp86 : array - tmp87 : array - tmp88 : array - tmp89 : array - tmp9 : array - tmp90 : array - tmp92 : array - tmp93 : array - tmp94 : array - tmp98 : array - tmp99 : array - """ - - tmp6 = einsum(t1, (0, 1), v.ovov, (2, 3, 0, 1), (2, 3)) - tmp5 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp9 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp17 = einsum(t1, (0, 1), tmp6, (2, 1), (0, 2)) - tmp16 = einsum(tmp5, (0, 1), t1, (2, 1), (2, 0)) - tmp30 = einsum(t1, (0, 1), v.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp12 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 1), (4, 0)) - tmp14 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 3), (4, 0)) - tmp0 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp90 = einsum(t1, (0, 1), tmp9, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp83 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp21 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp19 = einsum(t1, (0, 1), v.ovvv, (0, 1, 2, 3), (2, 3)) - tmp4 = einsum(t1, (0, 1), v.ooov, (2, 3, 0, 1), (2, 3)) - tmp3 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp25 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp109 = einsum(t1, (0, 1), tmp17, (2, 0), (2, 1)) - tmp108 = einsum(t1, (0, 1), tmp16, (2, 0), (2, 1)) - tmp103 = einsum(tmp30, (0, 1, 2, 3), t1, (3, 4), (0, 2, 1, 4)) - tmp102 = einsum(t1, (0, 1), tmp12, (2, 0), (2, 1)) - tmp101 = einsum(t1, (0, 1), tmp14, (2, 0), (2, 1)) - tmp100 = einsum(t2, (0, 1, 2, 3), tmp9, (4, 5, 1, 2), (4, 0, 5, 3)) - tmp99 = einsum(t2, (0, 1, 2, 3), tmp9, (4, 1, 0, 2), (4, 3)) - tmp98 = einsum(t2, (0, 1, 2, 3), tmp9, (4, 0, 1, 2), (4, 3)) - tmp94 = einsum(t1, (0, 1), v.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp93 = einsum(t1, (0, 1), tmp0, (0, 2), (2, 1)) - tmp92 = einsum(tmp90, (0, 1, 2, 3), t1, (2, 4), (1, 0, 3, 4)) - tmp89 = einsum(t1, (0, 1), tmp83, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp88 = einsum(t1, (0, 1), tmp21, (1, 2), (0, 2)) - tmp87 = einsum(t1, (0, 1), tmp19, (2, 1), (0, 2)) - tmp86 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 3), (0, 4)) - tmp85 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 2), (0, 4)) - tmp82 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp78 = einsum(t1, (0, 1), tmp4, (2, 0), (2, 1)) - tmp77 = einsum(t1, (0, 1), tmp3, (2, 0), (2, 1)) - tmp76 = einsum(tmp6, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp75 = einsum(tmp5, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp69 = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 2, 1, 4), (3, 4)) - tmp67 = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 4, 1, 2), (3, 4)) - tmp66 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) - tmp65 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 0, 2), (4, 3)) - tmp64 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 2), (4, 3)) - tmp60 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp58 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - tmp57 = einsum(tmp6, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp56 = einsum(tmp6, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp55 = einsum(tmp5, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp54 = einsum(tmp5, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp52 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp51 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp50 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp49 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp48 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 1, 2), (0, 4, 5, 3)) - tmp46 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp45 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp42 = einsum(v.oooo, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp40 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp39 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp37 = einsum(tmp30, (0, 1, 2, 3), t1, (2, 4), (0, 1, 3, 4)) - tmp36 = einsum(t2, (0, 1, 2, 3), tmp9, (4, 1, 5, 2), (4, 0, 5, 3)) - tmp35 = einsum(tmp9, (0, 1, 2, 3), t2, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp34 = einsum(t2, (0, 1, 2, 3), tmp9, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp29 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp27 = einsum(tmp25, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp23 = einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp22 = einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - - return {f"tmp0": tmp0, f"tmp100": tmp100, f"tmp101": tmp101, f"tmp102": tmp102, f"tmp103": tmp103, f"tmp108": tmp108, f"tmp109": tmp109, f"tmp12": tmp12, f"tmp14": tmp14, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp19": tmp19, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp25": tmp25, f"tmp27": tmp27, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp34": tmp34, f"tmp35": tmp35, f"tmp36": tmp36, f"tmp37": tmp37, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp42": tmp42, f"tmp45": tmp45, f"tmp46": tmp46, f"tmp48": tmp48, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp50": tmp50, f"tmp51": tmp51, f"tmp52": tmp52, f"tmp54": tmp54, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp57": tmp57, f"tmp58": tmp58, f"tmp6": tmp6, f"tmp60": tmp60, f"tmp64": tmp64, f"tmp65": tmp65, f"tmp66": tmp66, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp75": tmp75, f"tmp76": tmp76, f"tmp77": tmp77, f"tmp78": tmp78, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp85": tmp85, f"tmp86": tmp86, f"tmp87": tmp87, f"tmp88": tmp88, f"tmp89": tmp89, f"tmp9": tmp9, f"tmp90": tmp90, f"tmp92": tmp92, f"tmp93": tmp93, f"tmp94": tmp94, f"tmp98": tmp98, f"tmp99": tmp99} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:34:14.144384. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp1 = np.copy(f.ov) * 0.5 - tmp1 += ints.tmp6 - tmp1 += ints.tmp5 * -0.5 - tmp12 = np.copy(ints.tmp9) - tmp12 += np.transpose(v.ooov, (0, 2, 1, 3)) - tmp2 = np.copy(r2) * 2 - tmp2 += np.transpose(r2, (1, 0, 2)) * -1 - tmp14 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp14 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp16 = np.copy(ints.tmp101) * 2 - tmp16 += ints.tmp109 * 2 - tmp16 += ints.tmp29 - tmp16 += ints.tmp39 - tmp16 += ints.tmp55 * 2 - tmp16 += ints.tmp56 * 2 - tmp16 += ints.tmp58 - tmp16 += ints.tmp65 * 2 - tmp16 += ints.tmp78 * 2 - tmp16 += ints.tmp86 - tmp16 += ints.tmp88 - tmp16 += ints.tmp93 - tmp16 += ints.tmp98 * 2 - tmp16 += f.ov * -1 - tmp16 += ints.tmp102 * -1 - tmp16 += ints.tmp108 * -1 - tmp16 += ints.tmp40 * -2 - tmp16 += ints.tmp54 * -1 - tmp16 += ints.tmp57 * -4 - tmp16 += ints.tmp64 * -1 - tmp16 += ints.tmp6 * -2 - tmp16 += ints.tmp77 * -1 - tmp16 += ints.tmp82 * -1 - tmp16 += ints.tmp85 * -2 - tmp16 += ints.tmp87 * -2 - tmp16 += ints.tmp99 * -1 - tmp11 = np.copy(f.oo) * 0.5 - tmp11 += ints.tmp0 * 0.5 - tmp11 += np.transpose(ints.tmp14, (1, 0)) - tmp11 += np.transpose(ints.tmp17, (1, 0)) - tmp11 += np.transpose(ints.tmp4, (1, 0)) - tmp11 += np.transpose(ints.tmp12, (1, 0)) * -0.5 - tmp11 += np.transpose(ints.tmp16, (1, 0)) * -0.5 - tmp11 += np.transpose(ints.tmp3, (1, 0)) * -0.5 - tmp9 = np.copy(ints.tmp21) - tmp9 += np.transpose(ints.tmp69, (1, 0)) * 2 - tmp9 += f.vv * -1 - tmp9 += np.transpose(ints.tmp19, (1, 0)) * -2 - tmp9 += np.transpose(ints.tmp67, (1, 0)) * -1 - tmp9 += einsum(t1, (0, 1), tmp1, (0, 2), (2, 1)) * 2 - tmp6 = np.copy(ints.tmp22) - tmp6 += v.oovv - tmp6 += ints.tmp49 * -1 - tmp10 = np.copy(ints.tmp100) - tmp10 += np.transpose(ints.tmp103, (0, 2, 1, 3)) - tmp10 += np.transpose(ints.tmp27, (1, 0, 2, 3)) - tmp10 += np.transpose(ints.tmp35, (1, 0, 2, 3)) - tmp10 += np.transpose(ints.tmp36, (1, 0, 2, 3)) - tmp10 += np.transpose(ints.tmp37, (1, 0, 2, 3)) - tmp10 += np.transpose(ints.tmp42, (2, 0, 1, 3)) - tmp10 += ints.tmp45 - tmp10 += ints.tmp48 - tmp10 += np.transpose(ints.tmp66, (1, 0, 2, 3)) - tmp10 += ints.tmp75 - tmp10 += np.transpose(ints.tmp92, (1, 0, 2, 3)) - tmp10 += np.transpose(ints.tmp23, (1, 0, 2, 3)) * -1 - tmp10 += np.transpose(ints.tmp34, (1, 0, 2, 3)) * -2 - tmp10 += ints.tmp46 * -2 - tmp10 += np.transpose(ints.tmp60, (1, 2, 0, 3)) * -1 - tmp10 += ints.tmp76 * -2 - tmp10 += np.transpose(ints.tmp89, (1, 0, 2, 3)) * -1 - tmp10 += ints.tmp94 * -1 - tmp10 += np.transpose(ints.tmp9, (1, 0, 2, 3)) * -1 - tmp10 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -1 - tmp4 = np.copy(r2) - tmp4 += np.transpose(r2, (1, 0, 2)) * -0.5 - tmp8 = np.copy(ints.tmp30) - tmp8 += np.transpose(ints.tmp90, (1, 0, 2, 3)) - tmp5 = np.copy(ints.tmp52) * 2 - tmp5 += np.transpose(ints.tmp83, (0, 1, 3, 2)) - tmp5 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp5 += ints.tmp50 * -1 - tmp5 += ints.tmp51 * -1 - tmp7 = np.copy(ints.tmp25) - tmp7 += np.transpose(ints.tmp30, (1, 0, 2, 3)) - tmp7 += np.transpose(v.oooo, (0, 2, 1, 3)) - tmp13 = einsum(tmp12, (0, 1, 2, 3), tmp2, (1, 4, 3), (4, 2, 0)) * -1 - tmp13 += einsum(r2, (0, 1, 2), tmp12, (3, 4, 1, 2), (3, 4, 0)) - tmp13 += einsum(r2, (0, 1, 2), tmp12, (3, 4, 0, 2), (1, 4, 3)) - del tmp12 - tmp15 = einsum(tmp14, (0, 1, 2, 3), r2, (1, 0, 2), (3,)) - del tmp14 - tmp3 = np.copy(f.oo) - tmp3 += ints.tmp0 - tmp3 += np.transpose(ints.tmp14, (1, 0)) * 2 - tmp3 += np.transpose(ints.tmp17, (1, 0)) * 2 - tmp3 += np.transpose(ints.tmp4, (1, 0)) * 2 - tmp3 += np.transpose(ints.tmp12, (1, 0)) * -1 - tmp3 += np.transpose(ints.tmp16, (1, 0)) * -1 - tmp3 += np.transpose(ints.tmp3, (1, 0)) * -1 - tmp0 = np.copy(ints.tmp9) - tmp0 += v.ooov * -0.5 - tmp0 += np.transpose(v.ooov, (0, 2, 1, 3)) - r2new = einsum(tmp4, (0, 1, 2), tmp5, (3, 0, 4, 2), (3, 1, 4)) * 2 - del tmp4, tmp5 - r2new += einsum(r2, (0, 1, 2), tmp6, (3, 1, 4, 2), (0, 3, 4)) * -1 - r2new += einsum(tmp6, (0, 1, 2, 3), r2, (1, 4, 3), (0, 4, 2)) * -1 - del tmp6 - r2new += einsum(r2, (0, 1, 2), tmp7, (3, 4, 0, 1), (3, 4, 2)) - del tmp7 - r2new += einsum(r2, (0, 1, 2), tmp8, (3, 4, 1, 0), (3, 4, 2)) - del tmp8 - r2new += einsum(tmp9, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp9 - r2new += einsum(r1, (0,), tmp10, (1, 2, 0, 3), (1, 2, 3)) * -1 - del tmp10 - r2new += einsum(r2, (0, 1, 2), tmp11, (0, 3), (3, 1, 2)) * -2 - r2new += einsum(r2, (0, 1, 2), tmp11, (1, 3), (0, 3, 2)) * -2 - del tmp11 - r2new += einsum(t1, (0, 1), tmp13, (2, 0, 3), (3, 2, 1)) - del tmp13 - r2new += einsum(tmp15, (0,), t2, (1, 2, 3, 0), (1, 2, 3)) * -2 - del tmp15 - r2new += einsum(r1, (0,), tmp16, (1, 2), (1, 0, 2)) - del tmp16 - r1new = einsum(r2, (0, 1, 2), ints.tmp9, (3, 1, 0, 2), (3,)) * -1 - r1new += einsum(tmp0, (0, 1, 2, 3), r2, (1, 2, 3), (0,)) * 2 - del tmp0 - r1new += einsum(tmp1, (0, 1), tmp2, (0, 2, 1), (2,)) * -2 - del tmp1, tmp2 - r1new += einsum(r1, (0,), tmp3, (0, 1), (1,)) * -1 - del tmp3 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:34:44.744561. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp102 : array - tmp103 : array - tmp104 : array - tmp106 : array - tmp107 : array - tmp108 : array - tmp109 : array - tmp14 : array - tmp16 : array - tmp25 : array - tmp28 : array - tmp3 : array - tmp32 : array - tmp33 : array - tmp34 : array - tmp36 : array - tmp46 : array - tmp47 : array - tmp49 : array - tmp5 : array - tmp51 : array - tmp52 : array - tmp54 : array - tmp55 : array - tmp56 : array - tmp58 : array - tmp6 : array - tmp60 : array - tmp61 : array - tmp63 : array - tmp64 : array - tmp66 : array - tmp67 : array - tmp7 : array - tmp72 : array - tmp73 : array - tmp74 : array - tmp75 : array - tmp76 : array - tmp81 : array - tmp82 : array - tmp83 : array - tmp88 : array - tmp89 : array - tmp90 : array - tmp91 : array - tmp93 : array - tmp94 : array - tmp97 : array - tmp98 : array - tmp99 : array - """ - - tmp7 = einsum(t1, (0, 1), v.ovov, (2, 3, 0, 1), (2, 3)) - tmp6 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp34 = einsum(t1, (0, 1), v.ooov, (2, 3, 0, 1), (2, 3)) - tmp33 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp67 = einsum(t1, (0, 1), tmp7, (2, 1), (0, 2)) - tmp66 = einsum(t1, (0, 1), tmp6, (2, 1), (0, 2)) - tmp56 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 2), (0, 4)) - tmp58 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 3), (0, 4)) - tmp60 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp47 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp5 = einsum(v.ovvv, (0, 1, 2, 3), t1, (0, 3), (1, 2)) - tmp3 = einsum(t1, (0, 1), v.ovvv, (0, 1, 2, 3), (2, 3)) - tmp109 = einsum(tmp7, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp108 = einsum(tmp7, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp107 = einsum(tmp6, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp106 = einsum(tmp6, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp104 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp103 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp102 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp99 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 5), (0, 3, 4, 5)) - tmp98 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp97 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp94 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp93 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp91 = einsum(t1, (0, 1), tmp34, (2, 0), (2, 1)) - tmp90 = einsum(t1, (0, 1), tmp33, (2, 0), (2, 1)) - tmp89 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 3), (4, 2)) - tmp88 = einsum(v.ooov, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp83 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - tmp82 = einsum(t1, (0, 1), tmp67, (2, 0), (2, 1)) - tmp81 = einsum(t1, (0, 1), tmp66, (2, 0), (2, 1)) - tmp76 = einsum(t1, (0, 1), tmp56, (2, 0), (2, 1)) - tmp75 = einsum(t1, (0, 1), tmp58, (2, 0), (2, 1)) - tmp74 = einsum(tmp60, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) - tmp73 = einsum(t2, (0, 1, 2, 3), tmp60, (4, 1, 0, 3), (4, 2)) - tmp72 = einsum(t1, (0, 1), tmp47, (0, 2), (2, 1)) - tmp64 = einsum(t1, (0, 1), tmp5, (1, 2), (0, 2)) - tmp63 = einsum(tmp3, (0, 1), t1, (2, 1), (2, 0)) - tmp61 = einsum(tmp60, (0, 1, 2, 3), t2, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp55 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 3), (0, 4)) - tmp54 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 2), (0, 4)) - tmp52 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp51 = einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp49 = einsum(v.vvvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp46 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp36 = einsum(v.ooov, (0, 1, 2, 3), t2, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp32 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp28 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp25 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 2), (0, 3, 4, 5)) - tmp16 = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 2, 1, 4), (3, 4)) - tmp14 = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 4, 1, 2), (3, 4)) - - return {f"tmp102": tmp102, f"tmp103": tmp103, f"tmp104": tmp104, f"tmp106": tmp106, f"tmp107": tmp107, f"tmp108": tmp108, f"tmp109": tmp109, f"tmp14": tmp14, f"tmp16": tmp16, f"tmp25": tmp25, f"tmp28": tmp28, f"tmp3": tmp3, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp34": tmp34, f"tmp36": tmp36, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp51": tmp51, f"tmp52": tmp52, f"tmp54": tmp54, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp58": tmp58, f"tmp6": tmp6, f"tmp60": tmp60, f"tmp61": tmp61, f"tmp63": tmp63, f"tmp64": tmp64, f"tmp66": tmp66, f"tmp67": tmp67, f"tmp7": tmp7, f"tmp72": tmp72, f"tmp73": tmp73, f"tmp74": tmp74, f"tmp75": tmp75, f"tmp76": tmp76, f"tmp81": tmp81, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp88": tmp88, f"tmp89": tmp89, f"tmp90": tmp90, f"tmp91": tmp91, f"tmp93": tmp93, f"tmp94": tmp94, f"tmp97": tmp97, f"tmp98": tmp98, f"tmp99": tmp99} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:34:44.788904. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp1 = np.copy(f.ov) * 0.5 - tmp1 += ints.tmp7 - tmp1 += ints.tmp6 * -0.5 - tmp4 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * 2 - tmp4 += np.transpose(v.ovov, (0, 2, 1, 3)) * -1 - tmp6 = np.copy(f.ov) - tmp6 += ints.tmp7 * 2 - tmp6 += ints.tmp6 * -1 - tmp12 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp12 += einsum(t1, (0, 1), r1, (2,), (0, 1, 2)) * -1 - tmp9 = einsum(r2, (0, 1, 2), v.ovov, (3, 0, 4, 1), (2, 3, 4)) - tmp20 = np.copy(ints.tmp60) - tmp20 += np.transpose(v.ooov, (0, 2, 1, 3)) - tmp16 = einsum(t1, (0, 1), tmp1, (0, 2), (1, 2)) * 2 - tmp5 = einsum(r2, (0, 1, 2), tmp4, (2, 3, 1, 0), (3,)) - del tmp4 - tmp7 = einsum(tmp6, (0, 1), r1, (1,), (0,)) - del tmp6 - tmp14 = np.copy(ints.tmp60) * -0.5 - tmp14 += np.transpose(ints.tmp60, (0, 2, 1, 3)) - tmp14 += v.ooov - tmp14 += np.transpose(v.ooov, (0, 2, 1, 3)) * -0.5 - tmp11 = np.copy(ints.tmp104) * 2 - tmp11 += np.transpose(ints.tmp52, (0, 1, 3, 2)) - tmp11 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp11 += ints.tmp102 * -1 - tmp11 += ints.tmp103 * -1 - tmp21 = einsum(v.ovvv, (0, 1, 2, 3), r2, (1, 3, 4), (4, 0, 2)) * -1 - tmp21 += einsum(t1, (0, 1), tmp9, (2, 3, 0), (2, 3, 1)) - tmp21 += einsum(tmp20, (0, 1, 2, 3), tmp12, (1, 4, 3), (0, 2, 4)) - tmp10 = einsum(t1, (0, 1), r1, (2,), (0, 2, 1)) * 0.5 - tmp10 += np.transpose(r2, (2, 0, 1)) - tmp10 += np.transpose(r2, (2, 1, 0)) * -0.5 - tmp18 = np.copy(np.transpose(ints.tmp36, (0, 2, 3, 1))) - tmp18 += ints.tmp49 - tmp18 += np.transpose(ints.tmp61, (0, 1, 3, 2)) - tmp18 += np.transpose(ints.tmp97, (0, 2, 3, 1)) * 2 - tmp18 += np.transpose(v.ovvv, (0, 2, 3, 1)) - tmp18 += ints.tmp25 * -1 - tmp18 += np.transpose(ints.tmp98, (0, 3, 2, 1)) * -1 - tmp18 += np.transpose(ints.tmp99, (0, 2, 3, 1)) * -1 - tmp17 = np.copy(np.transpose(ints.tmp16, (1, 0))) * 2 - tmp17 += ints.tmp5 - tmp17 += f.vv * -1 - tmp17 += np.transpose(ints.tmp14, (1, 0)) * -1 - tmp17 += np.transpose(ints.tmp3, (1, 0)) * -2 - tmp17 += np.transpose(tmp16, (1, 0)) - del tmp16 - tmp8 = np.copy(tmp5) * -1 - del tmp5 - tmp8 += tmp7 - del tmp7 - tmp23 = np.copy(ints.tmp107) * 2 - tmp23 += ints.tmp108 * 2 - tmp23 += ints.tmp32 - tmp23 += ints.tmp55 - tmp23 += ints.tmp64 - tmp23 += ints.tmp72 - tmp23 += ints.tmp73 * 2 - tmp23 += ints.tmp75 * 2 - tmp23 += ints.tmp82 * 2 - tmp23 += ints.tmp83 - tmp23 += ints.tmp89 * 2 - tmp23 += ints.tmp91 * 2 - tmp23 += ints.tmp93 - tmp23 += f.ov * -1 - tmp23 += ints.tmp106 * -1 - tmp23 += ints.tmp109 * -4 - tmp23 += ints.tmp46 * -1 - tmp23 += ints.tmp54 * -2 - tmp23 += ints.tmp63 * -2 - tmp23 += ints.tmp74 * -1 - tmp23 += ints.tmp76 * -1 - tmp23 += ints.tmp7 * -2 - tmp23 += ints.tmp81 * -1 - tmp23 += ints.tmp88 * -1 - tmp23 += ints.tmp90 * -1 - tmp23 += ints.tmp94 * -2 - tmp19 = np.copy(f.oo) - tmp19 += np.transpose(ints.tmp34, (1, 0)) * 2 - tmp19 += ints.tmp47 - tmp19 += np.transpose(ints.tmp58, (1, 0)) * 2 - tmp19 += np.transpose(ints.tmp67, (1, 0)) * 2 - tmp19 += np.transpose(ints.tmp33, (1, 0)) * -1 - tmp19 += np.transpose(ints.tmp56, (1, 0)) * -1 - tmp19 += np.transpose(ints.tmp66, (1, 0)) * -1 - tmp13 = np.copy(ints.tmp51) - tmp13 += v.oovv - tmp13 += ints.tmp28 * -1 - tmp22 = einsum(v.ovvv, (0, 1, 2, 3), r2, (3, 1, 4), (4, 0, 2)) * -1 - tmp22 += einsum(r2, (0, 1, 2), tmp20, (3, 4, 2, 1), (3, 4, 0)) - del tmp20 - tmp15 = np.copy(ints.tmp51) - tmp15 += v.oovv - tmp15 += ints.tmp28 * -1 - tmp15 += einsum(t1, (0, 1), tmp14, (2, 0, 3, 4), (2, 3, 1, 4)) * 2 - del tmp14 - tmp3 = np.copy(f.vv) - tmp3 += np.transpose(ints.tmp14, (1, 0)) - tmp3 += np.transpose(ints.tmp3, (1, 0)) * 2 - tmp3 += np.transpose(ints.tmp16, (1, 0)) * -2 - tmp3 += ints.tmp5 * -1 - tmp0 = np.copy(v.ovvv) * 2 - tmp0 += np.transpose(v.ovvv, (0, 2, 1, 3)) * -1 - tmp2 = np.copy(np.transpose(r2, (2, 0, 1))) * -1 - tmp2 += np.transpose(r2, (2, 1, 0)) * 2 - r2new = einsum(r2, (0, 1, 2), v.vvvv, (3, 0, 4, 1), (3, 4, 2)) - r2new += einsum(t2, (0, 1, 2, 3), tmp9, (4, 0, 1), (2, 3, 4)) - del tmp9 - r2new += einsum(tmp11, (0, 1, 2, 3), tmp10, (1, 3, 4), (2, 4, 0)) * 2 - del tmp11, tmp10 - r2new += einsum(tmp12, (0, 1, 2), tmp13, (3, 0, 4, 2), (1, 4, 3)) * -1 - del tmp12, tmp13 - r2new += einsum(tmp15, (0, 1, 2, 3), r2, (3, 4, 1), (2, 4, 0)) * -1 - del tmp15 - r2new += einsum(tmp17, (0, 1), r2, (0, 2, 3), (1, 2, 3)) * -1 - r2new += einsum(tmp17, (0, 1), r2, (2, 0, 3), (2, 1, 3)) * -1 - del tmp17 - r2new += einsum(tmp18, (0, 1, 2, 3), r1, (2,), (3, 1, 0)) * -1 - del tmp18 - r2new += einsum(tmp19, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp19 - r2new += einsum(t1, (0, 1), tmp21, (2, 0, 3), (1, 3, 2)) - del tmp21 - r2new += einsum(tmp8, (0,), t2, (1, 0, 2, 3), (2, 3, 1)) - r2new += einsum(t1, (0, 1), tmp22, (2, 0, 3), (3, 1, 2)) - del tmp22 - r2new += einsum(tmp23, (0, 1), r1, (2,), (1, 2, 0)) - del tmp23 - r1new = einsum(r2, (0, 1, 2), tmp0, (2, 0, 1, 3), (3,)) * -1 - del tmp0 - r1new += einsum(tmp2, (0, 1, 2), tmp1, (0, 2), (1,)) * -2 - del tmp1, tmp2 - r1new += einsum(tmp3, (0, 1), r1, (0,), (1,)) - del tmp3 - r1new += einsum(t1, (0, 1), tmp8, (0,), (1,)) * -1 - del tmp8 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:35:36.831483. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp100 : array - tmp103 : array - tmp104 : array - tmp107 : array - tmp108 : array - tmp112 : array - tmp113 : array - tmp114 : array - tmp116 : array - tmp117 : array - tmp12 : array - tmp13 : array - tmp134 : array - tmp136 : array - tmp14 : array - tmp17 : array - tmp19 : array - tmp2 : array - tmp20 : array - tmp21 : array - tmp22 : array - tmp24 : array - tmp26 : array - tmp29 : array - tmp3 : array - tmp32 : array - tmp33 : array - tmp35 : array - tmp36 : array - tmp38 : array - tmp4 : array - tmp41 : array - tmp44 : array - tmp47 : array - tmp48 : array - tmp49 : array - tmp51 : array - tmp54 : array - tmp57 : array - tmp6 : array - tmp60 : array - tmp63 : array - tmp66 : array - tmp69 : array - tmp70 : array - tmp72 : array - tmp73 : array - tmp75 : array - tmp78 : array - tmp81 : array - tmp82 : array - tmp85 : array - tmp86 : array - tmp87 : array - tmp88 : array - tmp9 : array - tmp90 : array - tmp91 : array - tmp92 : array - tmp93 : array - tmp94 : array - tmp97 : array - tmp98 : array - tmp99 : array - """ - - tmp20 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp17 = einsum(t1, (0, 1), v.ovov, (2, 3, 0, 1), (2, 3)) - tmp47 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp107 = einsum(t1, (0, 1), tmp20, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp86 = einsum(t1, (0, 1), tmp17, (2, 1), (0, 2)) - tmp85 = einsum(tmp47, (0, 1), t1, (2, 1), (2, 0)) - tmp99 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp97 = einsum(t1, (0, 1), v.ovvv, (0, 2, 3, 1), (2, 3)) - tmp93 = einsum(t1, (0, 1), v.ovvv, (0, 1, 2, 3), (2, 3)) - tmp90 = einsum(t1, (0, 1), v.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp13 = einsum(t1, (0, 1), v.ooov, (2, 3, 0, 1), (2, 3)) - tmp12 = einsum(t1, (0, 1), v.ooov, (2, 0, 3, 1), (2, 3)) - tmp81 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp22 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 1), (4, 0)) - tmp24 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 3), (0, 4)) - tmp0 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp136 = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 2, 1, 4), (3, 4)) - tmp134 = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 4, 1, 2), (3, 4)) - tmp117 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp116 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 5), (4, 0, 5, 1)) - tmp114 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp113 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp112 = einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp108 = einsum(tmp107, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp104 = einsum(t1, (0, 1), tmp86, (2, 0), (2, 1)) - tmp103 = einsum(t1, (0, 1), tmp85, (2, 0), (2, 1)) - tmp100 = einsum(t1, (0, 1), tmp99, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp98 = einsum(tmp97, (0, 1), t1, (2, 0), (2, 1)) - tmp94 = einsum(t1, (0, 1), tmp93, (2, 1), (0, 2)) - tmp92 = einsum(tmp90, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp91 = einsum(tmp90, (0, 1, 2, 3), t1, (2, 4), (0, 1, 3, 4)) - tmp88 = einsum(t1, (0, 1), tmp13, (2, 0), (2, 1)) - tmp87 = einsum(t1, (0, 1), tmp12, (2, 0), (2, 1)) - tmp82 = einsum(tmp81, (0, 1, 2, 3), t1, (2, 4), (1, 0, 3, 4)) - tmp78 = einsum(t1, (0, 1), tmp22, (2, 0), (2, 1)) - tmp75 = einsum(t1, (0, 1), tmp24, (2, 0), (2, 1)) - tmp73 = einsum(t2, (0, 1, 2, 3), tmp20, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp72 = einsum(t2, (0, 1, 2, 3), tmp20, (4, 5, 1, 2), (4, 0, 5, 3)) - tmp70 = einsum(t2, (0, 1, 2, 3), tmp20, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp69 = einsum(t2, (0, 1, 2, 3), tmp20, (4, 1, 5, 2), (4, 0, 5, 3)) - tmp66 = einsum(t2, (0, 1, 2, 3), tmp20, (4, 1, 0, 2), (4, 3)) - tmp63 = einsum(t2, (0, 1, 2, 3), tmp20, (4, 0, 1, 2), (4, 3)) - tmp60 = einsum(tmp17, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp57 = einsum(tmp47, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp54 = einsum(tmp17, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp51 = einsum(tmp17, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp49 = einsum(tmp47, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp48 = einsum(tmp47, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp44 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp41 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 3), (0, 4)) - tmp38 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 2), (0, 4)) - tmp36 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp35 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 2, 3, 5), (4, 0, 1, 5)) - tmp33 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp32 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) - tmp29 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 0, 2), (4, 3)) - tmp26 = einsum(v.ooov, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp21 = einsum(t1, (0, 1), v.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp19 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp14 = einsum(v.oooo, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp9 = einsum(t1, (0, 1), tmp0, (0, 2), (2, 1)) - tmp6 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp4 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp3 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp2 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp1 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp100": tmp100, f"tmp103": tmp103, f"tmp104": tmp104, f"tmp107": tmp107, f"tmp108": tmp108, f"tmp112": tmp112, f"tmp113": tmp113, f"tmp114": tmp114, f"tmp116": tmp116, f"tmp117": tmp117, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp134": tmp134, f"tmp136": tmp136, f"tmp14": tmp14, f"tmp17": tmp17, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp22": tmp22, f"tmp24": tmp24, f"tmp26": tmp26, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp35": tmp35, f"tmp36": tmp36, f"tmp38": tmp38, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp44": tmp44, f"tmp47": tmp47, f"tmp48": tmp48, f"tmp49": tmp49, f"tmp51": tmp51, f"tmp54": tmp54, f"tmp57": tmp57, f"tmp6": tmp6, f"tmp60": tmp60, f"tmp63": tmp63, f"tmp66": tmp66, f"tmp69": tmp69, f"tmp70": tmp70, f"tmp72": tmp72, f"tmp73": tmp73, f"tmp75": tmp75, f"tmp78": tmp78, f"tmp81": tmp81, f"tmp82": tmp82, f"tmp85": tmp85, f"tmp86": tmp86, f"tmp87": tmp87, f"tmp88": tmp88, f"tmp9": tmp9, f"tmp90": tmp90, f"tmp91": tmp91, f"tmp92": tmp92, f"tmp93": tmp93, f"tmp94": tmp94, f"tmp97": tmp97, f"tmp98": tmp98, f"tmp99": tmp99} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:35:36.884762. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp10 = einsum(t1, (0, 1), r2, (2, 3, 1), (2, 3, 0)) - tmp16 = np.copy(f.ov) - tmp16 += ints.tmp17 * 2 - tmp16 += ints.tmp47 * -1 - tmp19 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp19 += t2 * -0.5 - tmp12 = np.copy(ints.tmp20) - tmp12 += np.transpose(v.ooov, (0, 2, 1, 3)) - tmp11 = np.copy(tmp10) - tmp11 += np.transpose(tmp10, (1, 0, 2)) * -0.5 - tmp9 = np.copy(ints.tmp112) - tmp9 += v.oovv - tmp9 += np.transpose(ints.tmp113, (0, 1, 3, 2)) * -1 - tmp14 = np.copy(ints.tmp81) - tmp14 += np.transpose(ints.tmp90, (0, 1, 3, 2)) - tmp18 = np.copy(f.oo) * 0.5 - tmp18 += np.transpose(ints.tmp0, (1, 0)) * 0.5 - tmp18 += ints.tmp13 - tmp18 += ints.tmp24 - tmp18 += ints.tmp86 - tmp18 += ints.tmp12 * -0.5 - tmp18 += ints.tmp22 * -0.5 - tmp18 += ints.tmp85 * -0.5 - tmp17 = np.copy(ints.tmp136) * 2 - tmp17 += np.transpose(ints.tmp97, (1, 0)) - tmp17 += f.vv * -1 - tmp17 += ints.tmp134 * -1 - tmp17 += ints.tmp93 * -2 - tmp17 += einsum(t1, (0, 1), tmp16, (0, 2), (1, 2)) - tmp20 = einsum(tmp19, (0, 1, 2, 3), r2, (1, 0, 2), (3,)) - del tmp19 - tmp8 = np.copy(ints.tmp117) * 2 - tmp8 += np.transpose(ints.tmp99, (0, 1, 3, 2)) - tmp8 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp8 += ints.tmp114 * -1 - tmp8 += ints.tmp116 * -1 - tmp7 = np.copy(r2) - tmp7 += np.transpose(r2, (1, 0, 2)) * -0.5 - tmp13 = np.copy(ints.tmp107) - tmp13 += np.transpose(ints.tmp90, (0, 1, 3, 2)) - tmp13 += np.transpose(v.oooo, (0, 2, 1, 3)) - tmp15 = np.copy(ints.tmp20) - tmp15 += np.transpose(v.ooov, (0, 2, 1, 3)) - tmp6 = np.copy(f.oo) - tmp6 += np.transpose(ints.tmp0, (1, 0)) - tmp6 += np.transpose(ints.tmp13, (1, 0)) * 2 - tmp6 += ints.tmp24 * 2 - tmp6 += ints.tmp86 * 2 - tmp6 += ints.tmp12 * -1 - tmp6 += ints.tmp22 * -1 - tmp6 += ints.tmp85 * -1 - tmp1 = np.copy(ints.tmp108) - tmp1 += np.transpose(ints.tmp14, (1, 2, 0, 3)) - tmp1 += ints.tmp32 - tmp1 += ints.tmp69 - tmp1 += ints.tmp73 - tmp1 += ints.tmp82 - tmp1 += ints.tmp91 - tmp1 += ints.tmp100 * -1 - tmp1 += ints.tmp20 * -1 - tmp1 += ints.tmp44 * -1 - tmp1 += ints.tmp70 * -2 - tmp4 = np.copy(v.ooov) * -0.5 - tmp4 += np.transpose(v.ovoo, (0, 2, 3, 1)) - tmp3 = np.copy(np.transpose(ints.tmp33, (0, 2, 1, 3))) - tmp3 += ints.tmp35 - tmp3 += np.transpose(ints.tmp57, (0, 2, 1, 3)) - tmp3 += np.transpose(ints.tmp72, (0, 2, 1, 3)) - tmp3 += ints.tmp92 - tmp3 += ints.tmp21 * -1 - tmp3 += ints.tmp36 * -2 - tmp3 += np.transpose(ints.tmp60, (0, 2, 1, 3)) * -2 - tmp3 += np.transpose(ints.tmp6, (1, 0, 2, 3)) * -1 - tmp0 = np.copy(r2) * -0.5 - tmp0 += np.transpose(r2, (1, 0, 2)) - tmp5 = np.copy(ints.tmp104) * 2 - tmp5 += ints.tmp19 - tmp5 += ints.tmp1 - tmp5 += ints.tmp29 * 2 - tmp5 += ints.tmp3 - tmp5 += ints.tmp41 - tmp5 += ints.tmp49 * 2 - tmp5 += ints.tmp51 * 2 - tmp5 += ints.tmp63 * 2 - tmp5 += ints.tmp75 * 2 - tmp5 += ints.tmp88 * 2 - tmp5 += ints.tmp98 - tmp5 += ints.tmp9 - tmp5 += f.ov * -1 - tmp5 += ints.tmp103 * -1 - tmp5 += ints.tmp17 * -2 - tmp5 += ints.tmp26 * -1 - tmp5 += ints.tmp2 * -1 - tmp5 += ints.tmp38 * -2 - tmp5 += ints.tmp48 * -1 - tmp5 += ints.tmp4 * -2 - tmp5 += ints.tmp54 * -4 - tmp5 += ints.tmp66 * -1 - tmp5 += ints.tmp78 * -1 - tmp5 += ints.tmp87 * -1 - tmp5 += ints.tmp94 * -2 - tmp2 = np.copy(r2) * 2 - tmp2 += np.transpose(r2, (1, 0, 2)) * -1 - r2new = einsum(tmp8, (0, 1, 2, 3), tmp7, (0, 4, 2), (1, 4, 3)) * 2 - del tmp8, tmp7 - r2new += einsum(r2, (0, 1, 2), tmp9, (1, 3, 4, 2), (0, 3, 4)) * -1 - r2new += einsum(tmp9, (0, 1, 2, 3), r2, (0, 4, 3), (1, 4, 2)) * -1 - del tmp9 - r2new += einsum(tmp12, (0, 1, 2, 3), tmp11, (0, 4, 2), (1, 4, 3)) * -2 - del tmp12, tmp11 - r2new += einsum(r2, (0, 1, 2), tmp13, (0, 1, 3, 4), (3, 4, 2)) - del tmp13 - r2new += einsum(tmp14, (0, 1, 2, 3), r2, (1, 0, 4), (3, 2, 4)) - del tmp14 - r2new += einsum(tmp15, (0, 1, 2, 3), tmp10, (4, 0, 1), (4, 2, 3)) - r2new += einsum(tmp15, (0, 1, 2, 3), tmp10, (0, 4, 1), (2, 4, 3)) - del tmp10 - r2new += einsum(tmp17, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp17 - r2new += einsum(r2, (0, 1, 2), tmp18, (0, 3), (3, 1, 2)) * -2 - r2new += einsum(r2, (0, 1, 2), tmp18, (1, 3), (0, 3, 2)) * -2 - del tmp18 - r2new += einsum(tmp20, (0,), v.ovov, (1, 2, 3, 0), (1, 3, 2)) * -2 - del tmp20 - r2new += einsum(tmp15, (0, 1, 2, 3), r1, (0,), (1, 2, 3)) - del tmp15 - r2new += einsum(r1, (0,), tmp16, (1, 2), (1, 0, 2)) * -1 - del tmp16 - r1new = einsum(tmp0, (0, 1, 2), tmp1, (0, 1, 3, 2), (3,)) * -2 - del tmp0, tmp1 - r1new += einsum(tmp2, (0, 1, 2), tmp3, (0, 3, 1, 2), (3,)) * -1 - del tmp3 - r1new += einsum(tmp4, (0, 1, 2, 3), r2, (0, 2, 3), (1,)) * 2 - del tmp4 - r1new += einsum(tmp5, (0, 1), tmp2, (0, 2, 1), (2,)) - del tmp2, tmp5 - r1new += einsum(r1, (0,), tmp6, (0, 1), (1,)) * -1 - del tmp6 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:36:34.240753. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp103 : array - tmp106 : array - tmp107 : array - tmp109 : array - tmp11 : array - tmp110 : array - tmp111 : array - tmp112 : array - tmp113 : array - tmp14 : array - tmp16 : array - tmp17 : array - tmp19 : array - tmp2 : array - tmp24 : array - tmp27 : array - tmp29 : array - tmp3 : array - tmp31 : array - tmp34 : array - tmp37 : array - tmp4 : array - tmp40 : array - tmp43 : array - tmp46 : array - tmp48 : array - tmp51 : array - tmp53 : array - tmp55 : array - tmp56 : array - tmp57 : array - tmp59 : array - tmp62 : array - tmp69 : array - tmp70 : array - tmp73 : array - tmp76 : array - tmp79 : array - tmp80 : array - tmp83 : array - tmp84 : array - tmp87 : array - tmp88 : array - tmp90 : array - tmp92 : array - tmp95 : array - tmp96 : array - tmp97 : array - tmp98 : array - """ - - tmp17 = einsum(t1, (0, 1), v.ovov, (2, 3, 0, 1), (2, 3)) - tmp55 = einsum(t1, (0, 1), v.ovov, (2, 1, 0, 3), (2, 3)) - tmp112 = einsum(t1, (0, 1), tmp17, (2, 1), (0, 2)) - tmp110 = einsum(tmp55, (0, 1), t1, (2, 1), (2, 0)) - tmp16 = einsum(t1, (0, 1), v.ovvv, (0, 2, 3, 1), (2, 3)) - tmp14 = einsum(t1, (0, 1), v.ovvv, (0, 1, 2, 3), (2, 3)) - tmp97 = einsum(t1, (0, 1), v.ooov, (2, 3, 0, 1), (2, 3)) - tmp95 = einsum(t1, (0, 1), v.ooov, (2, 0, 3, 1), (2, 3)) - tmp83 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 1), (4, 0)) - tmp79 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 3), (4, 0)) - tmp69 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp10 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp113 = einsum(t1, (0, 1), tmp112, (2, 0), (2, 1)) - tmp111 = einsum(t1, (0, 1), tmp110, (2, 0), (2, 1)) - tmp109 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp107 = einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp106 = einsum(t1, (0, 1), tmp16, (1, 2), (0, 2)) - tmp103 = einsum(t1, (0, 1), tmp14, (2, 1), (0, 2)) - tmp98 = einsum(t1, (0, 1), tmp97, (2, 0), (2, 1)) - tmp96 = einsum(t1, (0, 1), tmp95, (2, 0), (2, 1)) - tmp92 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp90 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp88 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp87 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 5), (4, 0, 5, 1)) - tmp84 = einsum(t1, (0, 1), tmp83, (2, 0), (2, 1)) - tmp80 = einsum(t1, (0, 1), tmp79, (2, 0), (2, 1)) - tmp76 = einsum(tmp69, (0, 1, 2, 3), t2, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp73 = einsum(t2, (0, 1, 2, 3), tmp69, (4, 0, 1, 3), (4, 2)) - tmp70 = einsum(t2, (0, 1, 2, 3), tmp69, (4, 1, 0, 3), (4, 2)) - tmp62 = einsum(tmp17, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp59 = einsum(tmp17, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp57 = einsum(tmp55, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp56 = einsum(tmp55, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp53 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp51 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 0, 3, 5), (4, 5, 1, 2)) - tmp48 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp46 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 5), (0, 3, 4, 5)) - tmp43 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 3), (0, 4)) - tmp40 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 2), (0, 4)) - tmp37 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp34 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 3), (4, 2)) - tmp31 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 2), (4, 3)) - tmp29 = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 2, 1, 4), (3, 4)) - tmp27 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 1), (4, 3)) - tmp24 = einsum(v.vvvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp19 = einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) - tmp11 = einsum(t1, (0, 1), tmp10, (0, 2), (2, 1)) - tmp4 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp3 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp2 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp1 = einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp103": tmp103, f"tmp106": tmp106, f"tmp107": tmp107, f"tmp109": tmp109, f"tmp11": tmp11, f"tmp110": tmp110, f"tmp111": tmp111, f"tmp112": tmp112, f"tmp113": tmp113, f"tmp14": tmp14, f"tmp16": tmp16, f"tmp17": tmp17, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp24": tmp24, f"tmp27": tmp27, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp31": tmp31, f"tmp34": tmp34, f"tmp37": tmp37, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp43": tmp43, f"tmp46": tmp46, f"tmp48": tmp48, f"tmp51": tmp51, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp62": tmp62, f"tmp69": tmp69, f"tmp70": tmp70, f"tmp73": tmp73, f"tmp76": tmp76, f"tmp79": tmp79, f"tmp80": tmp80, f"tmp83": tmp83, f"tmp84": tmp84, f"tmp87": tmp87, f"tmp88": tmp88, f"tmp90": tmp90, f"tmp92": tmp92, f"tmp95": tmp95, f"tmp96": tmp96, f"tmp97": tmp97, f"tmp98": tmp98} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:36:34.286597. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp16 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp16 += t2 * -1 - tmp19 = np.copy(f.ov) - tmp19 += ints.tmp17 * 2 - tmp19 += ints.tmp55 * -1 - tmp21 = np.copy(ints.tmp69) - tmp21 += np.transpose(v.ooov, (0, 2, 1, 3)) - tmp10 = einsum(t1, (0, 1), r2, (2, 1, 3), (3, 0, 2)) - tmp17 = einsum(r2, (0, 1, 2), tmp16, (2, 3, 1, 0), (3,)) - del tmp16 - tmp15 = einsum(t1, (0, 1), r1, (1,), (0,)) - tmp26 = einsum(t1, (0, 1), tmp19, (0, 2), (1, 2)) - tmp23 = einsum(t1, (0, 1), tmp21, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp11 = einsum(t1, (0, 1), tmp10, (2, 3, 1), (2, 0, 3)) - tmp5 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp5 += np.transpose(r2, (2, 1, 0)) * -0.5 - tmp2 = np.copy(np.transpose(r2, (2, 0, 1))) * -0.5 - tmp2 += np.transpose(r2, (2, 1, 0)) - tmp22 = np.copy(np.transpose(ints.tmp87, (0, 1, 3, 2))) - tmp22 += np.transpose(ints.tmp92, (0, 1, 3, 2)) - tmp22 += ints.tmp109 * -1 - tmp22 += np.transpose(ints.tmp88, (0, 1, 3, 2)) * -2 - tmp22 += np.transpose(v.ovov, (0, 2, 3, 1)) * -1 - tmp22 += einsum(t1, (0, 1), tmp21, (2, 3, 0, 4), (2, 3, 4, 1)) - del tmp21 - tmp28 = np.copy(f.oo) - tmp28 += np.transpose(ints.tmp10, (1, 0)) - tmp28 += ints.tmp112 * 2 - tmp28 += ints.tmp79 * 2 - tmp28 += ints.tmp97 * 2 - tmp28 += ints.tmp110 * -1 - tmp28 += ints.tmp83 * -1 - tmp28 += ints.tmp95 * -1 - tmp18 = np.copy(tmp15) - del tmp15 - tmp18 += tmp17 * -1 - del tmp17 - tmp27 = np.copy(np.transpose(ints.tmp16, (1, 0))) - tmp27 += ints.tmp29 * 2 - tmp27 += f.vv * -1 - tmp27 += ints.tmp14 * -2 - tmp27 += ints.tmp27 * -1 - tmp27 += tmp26 - del tmp26 - tmp20 = einsum(t1, (0, 1), r2, (1, 2, 3), (3, 0, 2)) - tmp24 = np.copy(np.transpose(ints.tmp90, (0, 1, 3, 2))) - tmp24 += ints.tmp107 * -1 - tmp24 += v.oovv * -1 - tmp24 += np.transpose(tmp23, (0, 1, 3, 2)) - del tmp23 - tmp25 = einsum(t2, (0, 1, 2, 3), r2, (2, 3, 4), (4, 0, 1)) - tmp25 += tmp11 - tmp12 = np.copy(tmp11) * -0.5 - tmp12 += np.transpose(tmp11, (0, 2, 1)) - tmp9 = np.copy(np.transpose(r2, (2, 0, 1))) * -1 - tmp9 += np.transpose(r2, (2, 1, 0)) * 2 - tmp6 = einsum(t1, (0, 1), tmp5, (2, 3, 1), (2, 0, 3)) * 2 - tmp14 = np.copy(f.vv) - tmp14 += np.transpose(ints.tmp14, (1, 0)) * 2 - tmp14 += ints.tmp27 - tmp14 += np.transpose(ints.tmp16, (1, 0)) * -1 - tmp14 += ints.tmp29 * -2 - tmp1 = np.copy(ints.tmp24) - tmp1 += np.transpose(ints.tmp46, (0, 2, 1, 3)) * 0.5 - tmp1 += np.transpose(ints.tmp53, (0, 2, 1, 3)) * 0.5 - tmp1 += np.transpose(ints.tmp76, (0, 3, 1, 2)) - tmp1 += np.transpose(ints.tmp37, (0, 3, 1, 2)) * -0.5 - tmp1 += np.transpose(ints.tmp48, (0, 2, 1, 3)) * -1 - tmp1 += np.transpose(ints.tmp51, (0, 2, 1, 3)) * -1 - tmp4 = np.copy(ints.tmp107) - tmp4 += v.oovv - tmp4 += np.transpose(ints.tmp90, (0, 1, 3, 2)) * -1 - tmp3 = einsum(t1, (0, 1), tmp2, (2, 3, 1), (2, 0, 3)) - del tmp2 - tmp0 = np.copy(ints.tmp24) - tmp0 += np.transpose(ints.tmp46, (0, 2, 1, 3)) * 2 - tmp0 += np.transpose(ints.tmp53, (0, 2, 1, 3)) * 2 - tmp0 += np.transpose(ints.tmp76, (0, 3, 1, 2)) - tmp0 += np.transpose(ints.tmp37, (0, 3, 1, 2)) * -2 - tmp0 += np.transpose(ints.tmp48, (0, 2, 1, 3)) * -4 - tmp0 += np.transpose(ints.tmp51, (0, 2, 1, 3)) * -1 - tmp0 += np.transpose(v.ovvv, (0, 2, 1, 3)) * -2 - tmp0 += np.transpose(v.ovvv, (0, 2, 3, 1)) - tmp8 = np.copy(ints.tmp106) * 0.5 - tmp8 += ints.tmp113 - tmp8 += ints.tmp11 * 0.5 - tmp8 += ints.tmp19 * 0.5 - tmp8 += ints.tmp1 * 0.5 - tmp8 += ints.tmp34 - tmp8 += ints.tmp3 * 0.5 - tmp8 += ints.tmp43 * 0.5 - tmp8 += ints.tmp57 - tmp8 += ints.tmp59 - tmp8 += ints.tmp70 - tmp8 += ints.tmp80 - tmp8 += ints.tmp98 - tmp8 += f.ov * -0.5 - tmp8 += ints.tmp103 * -1 - tmp8 += ints.tmp111 * -0.5 - tmp8 += ints.tmp17 * -1 - tmp8 += ints.tmp2 * -0.5 - tmp8 += ints.tmp31 * -0.5 - tmp8 += ints.tmp40 * -1 - tmp8 += ints.tmp4 * -1 - tmp8 += ints.tmp56 * -0.5 - tmp8 += ints.tmp62 * -2 - tmp8 += ints.tmp73 * -0.5 - tmp8 += ints.tmp84 * -0.5 - tmp8 += ints.tmp96 * -0.5 - tmp7 = np.copy(ints.tmp109) - tmp7 += np.transpose(ints.tmp88, (0, 1, 3, 2)) * 2 - tmp7 += np.transpose(v.ovov, (0, 2, 3, 1)) - tmp7 += np.transpose(ints.tmp87, (0, 1, 3, 2)) * -1 - tmp7 += np.transpose(ints.tmp92, (0, 1, 3, 2)) * -1 - tmp13 = np.copy(tmp11) * 2 - tmp13 += np.transpose(tmp11, (0, 2, 1)) * -1 - del tmp11 - r2new = einsum(v.ovvv, (0, 1, 2, 3), r1, (3,), (1, 2, 0)) * -1 - r2new += einsum(r2, (0, 1, 2), v.vvvv, (3, 0, 4, 1), (3, 4, 2)) - r2new += einsum(tmp20, (0, 1, 2), v.ovvv, (1, 3, 4, 2), (3, 4, 0)) * -1 - del tmp20 - r2new += einsum(v.ovvv, (0, 1, 2, 3), tmp10, (4, 0, 3), (2, 1, 4)) * -1 - del tmp10 - r2new += einsum(tmp22, (0, 1, 2, 3), tmp5, (0, 3, 4), (2, 4, 1)) * -2 - del tmp5, tmp22 - r2new += einsum(r2, (0, 1, 2), tmp24, (2, 3, 4, 1), (0, 4, 3)) - r2new += einsum(tmp24, (0, 1, 2, 3), r2, (3, 4, 0), (2, 4, 1)) - del tmp24 - r2new += einsum(tmp25, (0, 1, 2), v.ovov, (2, 3, 1, 4), (4, 3, 0)) - del tmp25 - r2new += einsum(tmp27, (0, 1), r2, (0, 2, 3), (1, 2, 3)) * -1 - r2new += einsum(tmp27, (0, 1), r2, (2, 0, 3), (2, 1, 3)) * -1 - del tmp27 - r2new += einsum(r2, (0, 1, 2), tmp28, (2, 3), (0, 1, 3)) * -1 - del tmp28 - r2new += einsum(tmp18, (0,), v.ovov, (1, 2, 0, 3), (2, 3, 1)) - r2new += einsum(r1, (0,), tmp19, (1, 2), (2, 0, 1)) * -1 - r1new = einsum(r2, (0, 1, 2), tmp0, (2, 3, 0, 1), (3,)) - del tmp0 - r1new += einsum(r2, (0, 1, 2), tmp1, (2, 3, 1, 0), (3,)) * -2 - del tmp1 - r1new += einsum(tmp4, (0, 1, 2, 3), tmp3, (0, 1, 3), (2,)) * 2 - del tmp4, tmp3 - r1new += einsum(tmp7, (0, 1, 2, 3), tmp6, (0, 1, 3), (2,)) - del tmp7, tmp6 - r1new += einsum(tmp9, (0, 1, 2), tmp8, (0, 2), (1,)) * 2 - del tmp9, tmp8 - r1new += einsum(ints.tmp69, (0, 1, 2, 3), tmp12, (0, 1, 2), (3,)) * -2 - del tmp12 - r1new += einsum(tmp13, (0, 1, 2), v.ooov, (0, 1, 2, 3), (3,)) * -1 - del tmp13 - r1new += einsum(r1, (0,), tmp14, (0, 1), (1,)) - del tmp14 - r1new += einsum(tmp18, (0,), tmp19, (0, 1), (1,)) * -1 - del tmp19, tmp18 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/RCCSDT.py b/ebcc/codegen/RCCSDT.py deleted file mode 100644 index 28de518e..00000000 --- a/ebcc/codegen/RCCSDT.py +++ /dev/null @@ -1,6763 +0,0 @@ -# Code generated for ebcc. - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, Namespace -from ebcc.precision import types - -def energy(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, **kwargs): - # energy - e_cc = 0 - e_cc += einsum(f.ov, (0, 1), t1, (0, 1), ()) * 2.0 - x0 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x0 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -0.5 - x0 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x1 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x1 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x1 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - e_cc += einsum(x0, (0, 1, 2, 3), x1, (0, 1, 2, 3), ()) * 2.0 - del x0, x1 - - return e_cc - -def update_amps(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, **kwargs): - # T amplitudes - t1new = np.zeros((nocc, nvir), dtype=types[float]) - t1new += einsum(f.ov, (0, 1), (0, 1)) - t1new += einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - t2new = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - t2new += einsum(t2, (0, 1, 2, 3), v.vvvv, (4, 2, 5, 3), (0, 1, 4, 5)) - t2new += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - t2new += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) * 2.0 - t2new += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 2), (4, 0, 3, 5)) * -1.0 - t2new += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (4, 0, 5, 2)) * -1.0 - x0 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x0 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x0 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x1 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x1 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x1 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - t1new += einsum(x0, (0, 1, 2, 3), x1, (1, 4, 0, 2, 3, 5), (4, 5)) * -0.25 - del x1 - x2 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x2 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -0.3333333333333333 - x2 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - t1new += einsum(x2, (0, 1, 2, 3), t3, (4, 0, 1, 5, 2, 3), (4, 5)) * 1.5 - x3 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x3 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x3 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - x4 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x4 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x4 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - t1new += einsum(x3, (0, 1, 2, 3), x4, (0, 2, 3, 4), (1, 4)) * 2.0 - x5 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x5 += einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - x6 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x6 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x6 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x6 += einsum(x5, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x6 += einsum(x5, (0, 1, 2, 3), (0, 2, 1, 3)) * 2.0 - t1new += einsum(t2, (0, 1, 2, 3), x6, (4, 0, 1, 3), (4, 2)) * -1.0 - del x6 - x7 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x7 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -0.5 - x7 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x8 = np.zeros((nocc, nvir), dtype=types[float]) - x8 += einsum(t1, (0, 1), x7, (0, 2, 1, 3), (2, 3)) - x9 = np.zeros((nocc, nvir), dtype=types[float]) - x9 += einsum(f.ov, (0, 1), (0, 1)) * 0.5 - x9 += einsum(x8, (0, 1), (0, 1)) - x10 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x10 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - x10 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - t1new += einsum(x9, (0, 1), x10, (0, 2, 3, 1), (2, 3)) * 2.0 - del x10 - x11 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x11 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x11 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - t1new += einsum(t1, (0, 1), x11, (0, 2, 1, 3), (2, 3)) * 2.0 - del x11 - x12 = np.zeros((nocc, nocc), dtype=types[float]) - x12 += einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - x13 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x13 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x13 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - x14 = np.zeros((nocc, nocc), dtype=types[float]) - x14 += einsum(x13, (0, 1, 2, 3), x3, (0, 4, 3, 2), (4, 1)) * 2.0 - x15 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x15 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x15 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - x16 = np.zeros((nocc, nocc), dtype=types[float]) - x16 += einsum(t1, (0, 1), x15, (2, 3, 0, 1), (2, 3)) * 2.0 - x17 = np.zeros((nocc, nocc), dtype=types[float]) - x17 += einsum(f.oo, (0, 1), (0, 1)) - x17 += einsum(x12, (0, 1), (0, 1)) - x17 += einsum(x14, (0, 1), (1, 0)) - x17 += einsum(x16, (0, 1), (1, 0)) - del x16 - t1new += einsum(t1, (0, 1), x17, (0, 2), (2, 1)) * -1.0 - t3new = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - t3new += einsum(x17, (0, 1), t3, (2, 0, 3, 4, 5, 6), (2, 1, 3, 4, 5, 6)) * -1.0 - del x17 - x18 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x18 += einsum(t1, (0, 1), v.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - t2new += einsum(x18, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - x19 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x19 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - t2new += einsum(t2, (0, 1, 2, 3), x19, (4, 5, 0, 1), (5, 4, 3, 2)) - x20 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x20 += einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - t2new += einsum(t1, (0, 1), x20, (2, 3, 1, 4), (0, 2, 3, 4)) - x21 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x21 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - t2new += einsum(x21, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x22 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x22 += einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - x23 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x23 += einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x24 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x24 += einsum(t1, (0, 1), v.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - x25 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x25 += einsum(t2, (0, 1, 2, 3), x24, (4, 5, 0, 1), (4, 5, 2, 3)) - x26 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x26 += einsum(t2, (0, 1, 2, 3), x23, (4, 1, 2, 5), (4, 0, 3, 5)) - x27 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x27 += einsum(x5, (0, 1, 2, 3), t3, (4, 2, 1, 5, 6, 3), (0, 4, 5, 6)) - x28 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x28 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x28 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) - x29 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x29 += einsum(x28, (0, 1, 2, 3), t3, (4, 5, 0, 1, 6, 2), (4, 5, 6, 3)) * 0.5 - del x28 - x30 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x30 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x30 += einsum(v.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - x31 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x31 += einsum(x30, (0, 1, 2, 3), t3, (0, 4, 2, 5, 6, 3), (4, 1, 5, 6)) * 0.5 - del x30 - x32 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x32 += einsum(t1, (0, 1), x4, (2, 3, 1, 4), (0, 2, 3, 4)) * 2.0 - del x4 - x33 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x33 += einsum(t2, (0, 1, 2, 3), x32, (4, 1, 3, 5), (0, 4, 2, 5)) - del x32 - x34 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x34 += einsum(t1, (0, 1), v.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - x35 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x35 += einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - x36 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x36 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 5, 2, 6, 1, 3), (4, 5, 0, 6)) - x37 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x37 += einsum(t2, (0, 1, 2, 3), x5, (4, 5, 1, 2), (4, 0, 5, 3)) - x38 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x38 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 0.5 - x38 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x38 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x39 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x39 += einsum(v.ooov, (0, 1, 2, 3), x38, (2, 4, 5, 3), (0, 1, 4, 5)) * 2.0 - x40 = np.zeros((nocc, nvir), dtype=types[float]) - x40 += einsum(t1, (0, 1), x7, (0, 2, 1, 3), (2, 3)) * 2.0 - x41 = np.zeros((nocc, nvir), dtype=types[float]) - x41 += einsum(f.ov, (0, 1), (0, 1)) - x41 += einsum(x40, (0, 1), (0, 1)) - del x40 - x42 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x42 += einsum(x41, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) - x43 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x43 += einsum(x34, (0, 1, 2, 3), (2, 0, 1, 3)) - x43 += einsum(x35, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - del x35 - x43 += einsum(x36, (0, 1, 2, 3), (2, 0, 1, 3)) - x43 += einsum(x37, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x43 += einsum(x39, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x39 - x43 += einsum(x42, (0, 1, 2, 3), (2, 1, 0, 3)) - del x42 - x44 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x44 += einsum(t1, (0, 1), x43, (0, 2, 3, 4), (2, 3, 1, 4)) - del x43 - x45 = np.zeros((nocc, nocc), dtype=types[float]) - x45 += einsum(t1, (0, 1), x41, (2, 1), (0, 2)) * 0.5 - del x41 - x46 = np.zeros((nocc, nocc), dtype=types[float]) - x46 += einsum(f.oo, (0, 1), (0, 1)) * 0.5 - x46 += einsum(x45, (0, 1), (0, 1)) - del x45 - x47 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x47 += einsum(x46, (0, 1), t2, (2, 1, 3, 4), (2, 0, 4, 3)) * 2.0 - del x46 - x48 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x48 += einsum(x22, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x22 - x48 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x48 += einsum(x25, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x25 - x48 += einsum(x26, (0, 1, 2, 3), (0, 1, 2, 3)) - del x26 - x48 += einsum(x27, (0, 1, 2, 3), (0, 1, 2, 3)) - del x27 - x48 += einsum(x29, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x29 - x48 += einsum(x31, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x31 - x48 += einsum(x33, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x33 - x48 += einsum(x44, (0, 1, 2, 3), (0, 1, 2, 3)) - del x44 - x48 += einsum(x47, (0, 1, 2, 3), (1, 0, 3, 2)) - del x47 - t2new += einsum(x48, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - t2new += einsum(x48, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x48 - x49 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x49 += einsum(v.ooov, (0, 1, 2, 3), t3, (4, 1, 2, 5, 6, 3), (4, 0, 5, 6)) - x50 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x50 += einsum(x5, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x50 += einsum(x5, (0, 1, 2, 3), (0, 2, 1, 3)) - x51 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x51 += einsum(x50, (0, 1, 2, 3), t3, (2, 4, 1, 5, 6, 3), (4, 0, 5, 6)) * 0.5 - del x50 - x52 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x52 += einsum(x9, (0, 1), t3, (2, 3, 0, 4, 5, 1), (2, 3, 4, 5)) * 2.0 - x53 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x53 += einsum(t1, (0, 1), x5, (2, 3, 0, 4), (2, 3, 1, 4)) - x54 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x54 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x54 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * 2.0 - x55 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x55 += einsum(t2, (0, 1, 2, 3), x54, (1, 4, 3, 5), (0, 4, 2, 5)) * 0.5 - x56 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x56 += einsum(x53, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x56 += einsum(x55, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x55 - x57 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x57 += einsum(t2, (0, 1, 2, 3), x56, (4, 1, 5, 2), (0, 4, 3, 5)) * 2.0 - del x56 - x58 = np.zeros((nvir, nvir), dtype=types[float]) - x58 += einsum(t2, (0, 1, 2, 3), x7, (0, 1, 2, 4), (3, 4)) * 2.0 - x59 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x59 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x59 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x60 = np.zeros((nvir, nvir), dtype=types[float]) - x60 += einsum(t1, (0, 1), x59, (0, 1, 2, 3), (2, 3)) - del x59 - x61 = np.zeros((nvir, nvir), dtype=types[float]) - x61 += einsum(x58, (0, 1), (1, 0)) - del x58 - x61 += einsum(x60, (0, 1), (1, 0)) * -1.0 - x62 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x62 += einsum(x61, (0, 1), t2, (2, 3, 0, 4), (2, 3, 4, 1)) - del x61 - x63 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x63 += einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 2), (0, 4, 5, 3)) - x64 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x64 += einsum(x0, (0, 1, 2, 3), t3, (4, 5, 0, 3, 6, 2), (4, 5, 1, 6)) * 0.5 - x65 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x65 += einsum(x5, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x65 += einsum(x5, (0, 1, 2, 3), (0, 2, 1, 3)) - x66 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x66 += einsum(t2, (0, 1, 2, 3), x65, (4, 5, 1, 3), (0, 4, 5, 2)) * 2.0 - del x65 - x67 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x67 += einsum(v.ovvv, (0, 1, 2, 3), x3, (4, 5, 3, 1), (0, 4, 5, 2)) - x68 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x68 += einsum(x5, (0, 1, 2, 3), (0, 1, 2, 3)) - x68 += einsum(x63, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x68 += einsum(x64, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x64 - x68 += einsum(x66, (0, 1, 2, 3), (1, 0, 2, 3)) - x68 += einsum(x67, (0, 1, 2, 3), (2, 1, 0, 3)) - del x67 - x69 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x69 += einsum(t1, (0, 1), x68, (2, 3, 0, 4), (2, 3, 1, 4)) - del x68 - x70 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x70 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x70 += einsum(t1, (0, 1), t2, (2, 3, 4, 5), (2, 0, 3, 1, 4, 5)) * -1.0 - x71 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x71 += einsum(v.ovvv, (0, 1, 2, 3), x70, (0, 4, 5, 1, 6, 3), (4, 5, 2, 6)) - del x70 - x72 = np.zeros((nocc, nocc), dtype=types[float]) - x72 += einsum(t2, (0, 1, 2, 3), x13, (1, 4, 2, 3), (0, 4)) - x73 = np.zeros((nocc, nocc), dtype=types[float]) - x73 += einsum(t1, (0, 1), x15, (2, 3, 0, 1), (2, 3)) - del x15 - x74 = np.zeros((nocc, nocc), dtype=types[float]) - x74 += einsum(x72, (0, 1), (1, 0)) - del x72 - x74 += einsum(x73, (0, 1), (1, 0)) - x75 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x75 += einsum(x74, (0, 1), t2, (2, 0, 3, 4), (2, 1, 4, 3)) * 2.0 - del x74 - x76 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x76 += einsum(x49, (0, 1, 2, 3), (0, 1, 2, 3)) - del x49 - x76 += einsum(x51, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x51 - x76 += einsum(x52, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x52 - x76 += einsum(x57, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x57 - x76 += einsum(x62, (0, 1, 2, 3), (1, 0, 2, 3)) - del x62 - x76 += einsum(x69, (0, 1, 2, 3), (0, 1, 2, 3)) - del x69 - x76 += einsum(x71, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x71 - x76 += einsum(x75, (0, 1, 2, 3), (0, 1, 3, 2)) - del x75 - t2new += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - t2new += einsum(x76, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x76 - x77 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x77 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x77 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x77 += einsum(t2, (0, 1, 2, 3), x7, (1, 4, 3, 5), (0, 4, 2, 5)) * 2.0 - t2new += einsum(t2, (0, 1, 2, 3), x77, (4, 1, 5, 3), (0, 4, 2, 5)) * 2.0 - del x77 - x78 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x78 += einsum(t1, (0, 1), x5, (2, 3, 4, 1), (2, 0, 4, 3)) - x79 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x79 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x79 += einsum(x78, (0, 1, 2, 3), (3, 1, 2, 0)) - t2new += einsum(t2, (0, 1, 2, 3), x79, (1, 4, 0, 5), (4, 5, 3, 2)) - del x79 - x80 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x80 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x80 += einsum(x19, (0, 1, 2, 3), (3, 1, 0, 2)) - x80 += einsum(x78, (0, 1, 2, 3), (3, 1, 0, 2)) - x81 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x81 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x81 += einsum(t1, (0, 1), x80, (0, 2, 3, 4), (3, 2, 4, 1)) - del x80 - t2new += einsum(t1, (0, 1), x81, (2, 3, 0, 4), (2, 3, 1, 4)) - del x81 - x82 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x82 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x82 += einsum(x21, (0, 1, 2, 3), (0, 1, 2, 3)) - del x21 - t2new += einsum(t2, (0, 1, 2, 3), x82, (4, 1, 5, 2), (4, 0, 5, 3)) - del x82 - x83 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x83 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - x84 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x84 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x84 += einsum(x83, (0, 1, 2, 3), (0, 1, 2, 3)) - del x83 - t2new += einsum(t2, (0, 1, 2, 3), x84, (4, 1, 5, 2), (0, 4, 5, 3)) - x85 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x85 += einsum(v.oooo, (0, 1, 2, 3), t3, (3, 4, 1, 5, 6, 7), (4, 0, 2, 7, 5, 6)) - x86 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x86 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x86 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 0.99999999999999 - x87 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x87 += einsum(v.ovov, (0, 1, 2, 3), x86, (2, 4, 5, 1), (4, 0, 5, 3)) - x88 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x88 += einsum(x87, (0, 1, 2, 3), t3, (4, 1, 5, 6, 7, 3), (4, 5, 0, 6, 7, 2)) * 1.00000000000001 - x89 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x89 += einsum(x85, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * -0.5 - del x85 - x89 += einsum(x88, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) - del x88 - t3new += einsum(x89, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * -1.0 - t3new += einsum(x89, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) - del x89 - x90 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x90 += einsum(v.oooo, (0, 1, 2, 3), t3, (4, 3, 1, 5, 6, 7), (4, 0, 2, 5, 7, 6)) - x91 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x91 += einsum(x24, (0, 1, 2, 3), t3, (4, 2, 3, 5, 6, 7), (0, 4, 1, 5, 7, 6)) - x92 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x92 += einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - x93 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x93 += einsum(x92, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (0, 4, 5, 6, 7, 2)) - x94 = np.zeros((nocc, nocc), dtype=types[float]) - x94 += einsum(f.oo, (0, 1), (0, 1)) - x94 += einsum(x12, (0, 1), (0, 1)) - del x12 - x94 += einsum(x14, (0, 1), (1, 0)) - del x14 - x95 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x95 += einsum(x94, (0, 1), t3, (2, 3, 0, 4, 5, 6), (2, 3, 1, 6, 4, 5)) - del x94 - x96 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x96 += einsum(x90, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x90 - x96 += einsum(x91, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x91 - x96 += einsum(x93, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x93 - x96 += einsum(x95, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) - del x95 - t3new += einsum(x96, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - t3new += einsum(x96, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) * -1.0 - del x96 - x97 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x97 += einsum(v.ovov, (0, 1, 2, 3), x86, (2, 4, 5, 1), (4, 0, 5, 3)) * 1.00000000000001 - x98 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x98 += einsum(x97, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (4, 5, 0, 6, 7, 2)) - x99 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x99 += einsum(t2, (0, 1, 2, 3), v.oooo, (4, 5, 6, 1), (0, 4, 5, 6, 2, 3)) - x100 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x100 += einsum(t2, (0, 1, 2, 3), x24, (4, 5, 1, 6), (4, 0, 5, 6, 2, 3)) - x101 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x101 += einsum(x99, (0, 1, 2, 3, 4, 5), (0, 2, 3, 1, 4, 5)) * -1.0 - del x99 - x101 += einsum(x100, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x100 - x102 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x102 += einsum(t1, (0, 1), x101, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x101 - x103 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x103 += einsum(x98, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) - del x98 - x103 += einsum(x102, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x102 - t3new += einsum(x103, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - t3new += einsum(x103, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - t3new += einsum(x103, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) * -1.0 - t3new += einsum(x103, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 5, 3)) - del x103 - x104 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x104 += einsum(v.oovv, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (4, 5, 0, 6, 7, 2)) - x105 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x105 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x105 += einsum(x63, (0, 1, 2, 3), (0, 1, 2, 3)) - del x63 - x106 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x106 += einsum(t2, (0, 1, 2, 3), x105, (4, 5, 1, 6), (0, 4, 5, 3, 2, 6)) - del x105 - x107 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x107 += einsum(x104, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x104 - x107 += einsum(x106, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x106 - t3new += einsum(x107, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new += einsum(x107, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - t3new += einsum(x107, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new += einsum(x107, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) * -1.0 - del x107 - x108 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x108 += einsum(v.vvvv, (0, 1, 2, 3), t3, (4, 5, 6, 7, 3, 1), (4, 6, 5, 7, 0, 2)) - x109 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x109 += einsum(x19, (0, 1, 2, 3), t3, (3, 4, 2, 5, 6, 7), (1, 0, 4, 5, 7, 6)) - x110 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x110 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 5, 6, 1, 7, 3), (4, 6, 5, 0, 2, 7)) - x111 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x111 += einsum(t2, (0, 1, 2, 3), x110, (4, 5, 6, 0, 1, 7), (4, 5, 6, 2, 3, 7)) - x112 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x112 += einsum(x78, (0, 1, 2, 3), t3, (2, 4, 3, 5, 6, 7), (1, 0, 4, 7, 5, 6)) - del x78 - x113 = np.zeros((nvir, nvir), dtype=types[float]) - x113 += einsum(f.ov, (0, 1), t1, (0, 2), (1, 2)) - x114 = np.zeros((nvir, nvir), dtype=types[float]) - x114 += einsum(x3, (0, 1, 2, 3), x7, (0, 1, 2, 4), (3, 4)) * 2.0 - del x7 - x115 = np.zeros((nvir, nvir), dtype=types[float]) - x115 += einsum(f.vv, (0, 1), (0, 1)) * -1.0 - x115 += einsum(x113, (0, 1), (0, 1)) - x115 += einsum(x114, (0, 1), (1, 0)) - x116 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x116 += einsum(x115, (0, 1), t3, (2, 3, 4, 0, 5, 6), (2, 4, 3, 6, 5, 1)) - del x115 - x117 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x117 += einsum(v.ooov, (0, 1, 2, 3), t3, (4, 1, 5, 6, 7, 3), (4, 5, 0, 2, 6, 7)) - x118 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x118 += einsum(v.ovvv, (0, 1, 2, 3), t3, (4, 5, 6, 7, 3, 1), (4, 6, 5, 0, 7, 2)) - x119 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x119 += einsum(t1, (0, 1), x110, (2, 3, 4, 0, 5, 6), (3, 2, 4, 5, 1, 6)) - del x110 - x120 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x120 += einsum(x117, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x117 - x120 += einsum(x118, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x118 - x120 += einsum(x119, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.5 - del x119 - x121 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x121 += einsum(t1, (0, 1), x120, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x120 - x122 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x122 += einsum(x108, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x108 - x122 += einsum(x109, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.5 - del x109 - x122 += einsum(x111, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.5 - del x111 - x122 += einsum(x112, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.5 - del x112 - x122 += einsum(x116, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - del x116 - x122 += einsum(x121, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x121 - t3new += einsum(x122, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - t3new += einsum(x122, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - del x122 - x123 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x123 += einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - x124 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x124 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x124 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x125 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x125 += einsum(v.ovvv, (0, 1, 2, 3), x124, (0, 4, 1, 5), (4, 2, 3, 5)) - x126 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x126 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x126 += einsum(x123, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x123 - x126 += einsum(x125, (0, 1, 2, 3), (0, 3, 2, 1)) - del x125 - x127 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x127 += einsum(t2, (0, 1, 2, 3), x126, (4, 5, 2, 6), (0, 1, 4, 3, 5, 6)) - del x126 - x128 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x128 += einsum(t2, (0, 1, 2, 3), x5, (4, 0, 1, 5), (4, 2, 3, 5)) - x129 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x129 += einsum(t1, (0, 1), x53, (2, 0, 3, 4), (2, 1, 3, 4)) - del x53 - x130 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x130 += einsum(x128, (0, 1, 2, 3), (0, 1, 2, 3)) - del x128 - x130 += einsum(x129, (0, 1, 2, 3), (0, 1, 2, 3)) - del x129 - x131 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x131 += einsum(t2, (0, 1, 2, 3), x130, (4, 5, 6, 2), (0, 1, 4, 3, 5, 6)) - del x130 - x132 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x132 += einsum(x127, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - del x127 - x132 += einsum(x131, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) - del x131 - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) * -1.0 - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * -1.0 - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) * -1.0 - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 4, 3)) - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new += einsum(x132, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) - del x132 - x133 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x133 += einsum(t2, (0, 1, 2, 3), x54, (1, 4, 3, 5), (0, 4, 2, 5)) - del x54 - x134 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x134 += einsum(v.ovov, (0, 1, 2, 3), x86, (2, 4, 5, 3), (4, 0, 5, 1)) - del x86 - x135 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x135 += einsum(x133, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x133 - x135 += einsum(x134, (0, 1, 2, 3), (0, 1, 2, 3)) - del x134 - x136 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x136 += einsum(x135, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (4, 5, 0, 6, 7, 2)) * 1.00000000000001 - del x135 - x137 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x137 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x137 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x138 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x138 += einsum(x137, (0, 1, 2, 3), t3, (0, 4, 1, 5, 6, 2), (4, 5, 6, 3)) - del x137 - x139 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x139 += einsum(t2, (0, 1, 2, 3), x138, (4, 5, 6, 2), (0, 1, 4, 3, 5, 6)) * -0.5 - del x138 - x140 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x140 += einsum(x0, (0, 1, 2, 3), t3, (4, 5, 0, 3, 6, 2), (4, 5, 1, 6)) - del x0 - x141 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x141 += einsum(t2, (0, 1, 2, 3), x140, (4, 5, 1, 6), (0, 4, 5, 3, 2, 6)) * -0.5 - del x140 - x142 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x142 += einsum(x136, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) - del x136 - x142 += einsum(x139, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - del x139 - x142 += einsum(x141, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x141 - t3new += einsum(x142, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new += einsum(x142, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - t3new += einsum(x142, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - t3new += einsum(x142, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - t3new += einsum(x142, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) - t3new += einsum(x142, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 5, 3)) * -1.0 - t3new += einsum(x142, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new += einsum(x142, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) * -1.0 - del x142 - x143 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x143 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 0, 2, 5, 6, 1), (4, 5, 6, 3)) - x144 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x144 += einsum(t2, (0, 1, 2, 3), x143, (4, 5, 6, 3), (0, 1, 4, 2, 5, 6)) - del x143 - x145 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x145 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 2, 5, 1, 6, 3), (4, 5, 0, 6)) - x146 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x146 += einsum(t2, (0, 1, 2, 3), x145, (4, 5, 1, 6), (0, 4, 5, 2, 3, 6)) - del x145 - x147 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x147 += einsum(x144, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.5 - del x144 - x147 += einsum(x146, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -0.5 - del x146 - t3new += einsum(x147, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - t3new += einsum(x147, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - t3new += einsum(x147, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) - t3new += einsum(x147, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * -1.0 - del x147 - x148 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x148 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 0, 2, 5, 6, 3), (4, 5, 6, 1)) - x149 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x149 += einsum(t2, (0, 1, 2, 3), x148, (4, 5, 6, 3), (0, 1, 4, 2, 5, 6)) - del x148 - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * 0.5 - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -0.5 - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) * -0.5 - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * 0.5 - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 4, 3)) * -1.0 - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) - t3new += einsum(x149, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - del x149 - x150 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x150 += einsum(x2, (0, 1, 2, 3), t3, (4, 0, 1, 5, 2, 6), (4, 6, 5, 3)) - del x2 - x151 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x151 += einsum(t2, (0, 1, 2, 3), x150, (4, 5, 6, 2), (0, 1, 4, 3, 6, 5)) * 1.5 - del x150 - t3new += einsum(x151, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - t3new += einsum(x151, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) * -1.0 - del x151 - x152 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x152 += einsum(v.oovv, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (4, 5, 0, 6, 7, 2)) - x153 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x153 += einsum(v.ovov, (0, 1, 2, 3), x3, (4, 5, 1, 3), (4, 5, 0, 2)) - x154 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x154 += einsum(x153, (0, 1, 2, 3), t3, (4, 3, 2, 5, 6, 7), (4, 1, 0, 7, 5, 6)) - x155 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x155 += einsum(x73, (0, 1), t3, (2, 3, 1, 4, 5, 6), (2, 3, 0, 6, 4, 5)) * 2.0 - del x73 - x156 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x156 += einsum(x152, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x152 - x156 += einsum(x154, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) - del x154 - x156 += einsum(x155, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x155 - t3new += einsum(x156, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - t3new += einsum(x156, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) - del x156 - x157 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x157 += einsum(t2, (0, 1, 2, 3), x36, (4, 5, 1, 6), (0, 4, 5, 2, 3, 6)) - del x36 - t3new += einsum(x157, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - t3new += einsum(x157, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - t3new += einsum(x157, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x157, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - t3new += einsum(x157, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) - t3new += einsum(x157, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 4, 3)) * -1.0 - t3new += einsum(x157, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) - t3new += einsum(x157, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - del x157 - x158 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x158 += einsum(x13, (0, 1, 2, 3), t3, (4, 0, 5, 2, 3, 6), (4, 5, 1, 6)) - del x13 - x159 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x159 += einsum(t2, (0, 1, 2, 3), x158, (4, 5, 1, 6), (0, 5, 4, 3, 2, 6)) * 2.0 - del x158 - t3new += einsum(x159, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - t3new += einsum(x159, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -1.0 - del x159 - x160 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x160 += einsum(v.oovv, (0, 1, 2, 3), t3, (4, 1, 5, 6, 7, 3), (4, 5, 0, 6, 7, 2)) - x161 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x161 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x161 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) * -0.5 - x162 = np.zeros((nvir, nvir), dtype=types[float]) - x162 += einsum(t1, (0, 1), x161, (0, 1, 2, 3), (2, 3)) * 2.0 - del x161 - x163 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x163 += einsum(x162, (0, 1), t3, (2, 3, 4, 1, 5, 6), (2, 4, 3, 6, 5, 0)) - del x162 - x164 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x164 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 5, 6, 7, 3, 1), (4, 6, 5, 0, 2, 7)) - x165 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x165 += einsum(x3, (0, 1, 2, 3), x164, (4, 5, 6, 1, 0, 7), (4, 5, 6, 2, 3, 7)) - del x3, x164 - x166 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x166 += einsum(x160, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x160 - x166 += einsum(x163, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - del x163 - x166 += einsum(x165, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x165 - t3new += einsum(x166, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x166, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - del x166 - x167 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x167 += einsum(x87, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (4, 5, 0, 7, 6, 2)) * 1.00000000000001 - del x87 - t3new += einsum(x167, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - t3new += einsum(x167, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - del x167 - x168 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x168 += einsum(x92, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (0, 4, 5, 6, 7, 2)) - x169 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x169 += einsum(v.ovvv, (0, 1, 2, 3), t3, (4, 5, 6, 1, 7, 3), (4, 6, 5, 0, 7, 2)) - x170 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x170 += einsum(t1, (0, 1), x169, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x169 - x171 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x171 += einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 1, 2), (0, 4, 5, 3)) - x172 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x172 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x172 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x173 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x173 += einsum(t2, (0, 1, 2, 3), x172, (4, 5, 1, 3), (0, 4, 5, 2)) - del x172 - x174 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x174 += einsum(x171, (0, 1, 2, 3), (0, 2, 1, 3)) - del x171 - x174 += einsum(x173, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x173 - x175 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x175 += einsum(t2, (0, 1, 2, 3), x174, (4, 1, 5, 6), (0, 4, 5, 3, 2, 6)) - del x174 - x176 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x176 += einsum(x34, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x176 += einsum(x37, (0, 1, 2, 3), (0, 1, 2, 3)) - del x37 - x177 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x177 += einsum(t2, (0, 1, 2, 3), x176, (4, 5, 1, 6), (0, 4, 5, 3, 2, 6)) - del x176 - x178 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x178 += einsum(x168, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x168 - x178 += einsum(x170, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -0.5 - del x170 - x178 += einsum(x175, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x175 - x178 += einsum(x177, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - del x177 - t3new += einsum(x178, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - t3new += einsum(x178, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) * -1.0 - t3new += einsum(x178, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) * -1.0 - t3new += einsum(x178, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 4, 3)) - del x178 - x179 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x179 += einsum(t1, (0, 1), x23, (2, 3, 1, 4), (0, 2, 3, 4)) - x180 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x180 += einsum(t2, (0, 1, 2, 3), x179, (4, 5, 1, 6), (4, 5, 0, 2, 3, 6)) - del x179 - x181 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x181 += einsum(t2, (0, 1, 2, 3), x5, (4, 1, 5, 2), (4, 0, 5, 3)) - x182 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x182 += einsum(x5, (0, 1, 2, 3), (0, 1, 2, 3)) - x182 += einsum(x181, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x181 - x182 += einsum(x66, (0, 1, 2, 3), (1, 0, 2, 3)) - del x66 - x183 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x183 += einsum(t2, (0, 1, 2, 3), x182, (4, 5, 1, 6), (0, 4, 5, 3, 2, 6)) - del x182 - x184 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x184 += einsum(x180, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x180 - x184 += einsum(x183, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - del x183 - t3new += einsum(x184, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - t3new += einsum(x184, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -1.0 - t3new += einsum(x184, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x184, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 4, 3)) - del x184 - x185 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x185 += einsum(x24, (0, 1, 2, 3), t3, (3, 4, 2, 5, 6, 7), (0, 4, 1, 7, 5, 6)) - x186 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x186 += einsum(v.ooov, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (4, 5, 0, 2, 6, 7)) - x187 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x187 += einsum(t1, (0, 1), x186, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x186 - x188 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x188 += einsum(x9, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) * 2.0 - x189 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x189 += einsum(t1, (0, 1), x153, (2, 3, 4, 0), (3, 2, 4, 1)) - del x153 - x190 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x190 += einsum(x188, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x188 - x190 += einsum(x189, (0, 1, 2, 3), (1, 0, 2, 3)) - del x189 - x191 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x191 += einsum(t2, (0, 1, 2, 3), x190, (4, 5, 1, 6), (0, 4, 5, 3, 2, 6)) - del x190 - x192 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x192 += einsum(x185, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.5 - del x185 - x192 += einsum(x187, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x187 - x192 += einsum(x191, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) * -1.0 - del x191 - t3new += einsum(x192, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - t3new += einsum(x192, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - t3new += einsum(x192, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) - t3new += einsum(x192, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - del x192 - x193 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x193 += einsum(t2, (0, 1, 2, 3), x20, (4, 5, 3, 6), (4, 0, 1, 2, 6, 5)) - del x20 - x194 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x194 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - x195 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x195 += einsum(v.ovov, (0, 1, 2, 3), x124, (2, 4, 3, 5), (4, 0, 5, 1)) - del x124 - x196 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x196 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x196 += einsum(x194, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x196 += einsum(x195, (0, 1, 2, 3), (0, 1, 2, 3)) - del x195 - x197 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x197 += einsum(t2, (0, 1, 2, 3), x196, (4, 5, 6, 2), (0, 1, 4, 5, 3, 6)) - del x196 - x198 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x198 += einsum(t1, (0, 1), x197, (2, 3, 4, 0, 5, 6), (3, 2, 4, 1, 5, 6)) - del x197 - x199 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x199 += einsum(x193, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x193 - x199 += einsum(x198, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x198 - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -1.0 - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 4, 3)) - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 5, 3)) * -1.0 - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) * -1.0 - t3new += einsum(x199, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - del x199 - x200 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x200 += einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - x201 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x201 += einsum(t2, (0, 1, 2, 3), x200, (4, 5, 1, 6), (4, 5, 0, 2, 3, 6)) - del x200 - x202 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x202 += einsum(t2, (0, 1, 2, 3), x84, (4, 5, 6, 2), (0, 1, 4, 5, 3, 6)) - del x84 - x203 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x203 += einsum(t1, (0, 1), x202, (2, 3, 4, 0, 5, 6), (3, 2, 4, 1, 5, 6)) * -1.0 - del x202 - x204 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x204 += einsum(x201, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x201 - x204 += einsum(x203, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x203 - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * -1.0 - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -1.0 - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 4, 3)) - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 3, 5)) - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 3, 4)) * -1.0 - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new += einsum(x204, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) - del x204 - x205 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x205 += einsum(x23, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 2), (0, 4, 5, 6, 7, 3)) - t3new += einsum(x205, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - t3new += einsum(x205, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - t3new += einsum(x205, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x205, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - t3new += einsum(x205, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) - t3new += einsum(x205, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 4, 3)) * -1.0 - t3new += einsum(x205, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) - t3new += einsum(x205, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) * -1.0 - del x205 - x206 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x206 += einsum(x92, (0, 1, 2, 3), t3, (4, 1, 5, 6, 7, 3), (0, 4, 5, 6, 7, 2)) - t3new += einsum(x206, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - t3new += einsum(x206, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) - del x206 - x207 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x207 += einsum(v.vvvv, (0, 1, 2, 3), t3, (4, 5, 6, 1, 7, 3), (4, 6, 5, 7, 0, 2)) - x208 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x208 += einsum(v.ovvv, (0, 1, 2, 3), t3, (4, 5, 6, 7, 1, 3), (4, 6, 5, 0, 7, 2)) - x209 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x209 += einsum(t1, (0, 1), x208, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x208 - x210 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x210 += einsum(x207, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -0.5 - del x207 - x210 += einsum(x209, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x209 - t3new += einsum(x210, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * -1.0 - t3new += einsum(x210, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - del x210 - x211 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x211 += einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 2), (0, 3, 4, 5)) - x212 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x212 += einsum(t2, (0, 1, 2, 3), x211, (4, 5, 3, 6), (0, 1, 4, 2, 5, 6)) - del x211 - x213 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x213 += einsum(t2, (0, 1, 2, 3), x92, (4, 5, 6, 3), (4, 0, 1, 5, 2, 6)) - x214 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x214 += einsum(t1, (0, 1), x213, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x213 - x215 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x215 += einsum(x212, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x212 - x215 += einsum(x214, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x214 - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * -1.0 - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 5, 3)) * -1.0 - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new += einsum(x215, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) * -1.0 - del x215 - x216 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x216 += einsum(t2, (0, 1, 2, 3), x23, (4, 5, 3, 6), (4, 0, 1, 5, 2, 6)) - x217 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x217 += einsum(t1, (0, 1), x216, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x216 - x218 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x218 += einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - x219 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x219 += einsum(t1, (0, 1), v.ooov, (2, 3, 0, 4), (2, 3, 1, 4)) - x220 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x220 += einsum(t1, (0, 1), x219, (2, 0, 3, 4), (2, 1, 3, 4)) - x221 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x221 += einsum(x218, (0, 1, 2, 3), (0, 1, 2, 3)) - del x218 - x221 += einsum(x220, (0, 1, 2, 3), (0, 1, 2, 3)) - del x220 - x222 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x222 += einsum(t2, (0, 1, 2, 3), x221, (4, 5, 6, 2), (0, 1, 4, 3, 5, 6)) - del x221 - x223 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x223 += einsum(x217, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x217 - x223 += einsum(x222, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) - del x222 - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * -1.0 - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) * -1.0 - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * -1.0 - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 3, 5)) - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 3, 4)) * -1.0 - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new += einsum(x223, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) * -1.0 - del x223 - x224 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x224 += einsum(x24, (0, 1, 2, 3), t3, (4, 3, 2, 5, 6, 7), (0, 4, 1, 5, 7, 6)) - t3new += einsum(x224, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) - t3new += einsum(x224, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) * -1.0 - del x224 - x225 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x225 += einsum(v.ooov, (0, 1, 2, 3), t3, (4, 5, 2, 6, 7, 3), (4, 5, 0, 1, 6, 7)) - x226 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x226 += einsum(t1, (0, 1), x225, (2, 3, 0, 4, 5, 6), (2, 3, 4, 1, 5, 6)) - del x225 - t3new += einsum(x226, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new += einsum(x226, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - t3new += einsum(x226, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - t3new += einsum(x226, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -1.0 - t3new += einsum(x226, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * -1.0 - t3new += einsum(x226, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 4, 3)) - t3new += einsum(x226, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new += einsum(x226, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) - del x226 - x227 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x227 += einsum(v.ooov, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (4, 5, 0, 2, 6, 7)) - x228 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x228 += einsum(t1, (0, 1), x227, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x227 - t3new += einsum(x228, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - t3new += einsum(x228, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) * -1.0 - del x228 - x229 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x229 += einsum(t1, (0, 1), x24, (2, 3, 0, 4), (2, 3, 4, 1)) - x230 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x230 += einsum(t2, (0, 1, 2, 3), x229, (4, 5, 1, 6), (4, 0, 5, 6, 2, 3)) - del x229 - t3new += einsum(x230, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) * -1.0 - t3new += einsum(x230, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) - t3new += einsum(x230, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) - t3new += einsum(x230, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * -1.0 - del x230 - x231 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x231 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 5, 2, 6, 7, 3), (4, 5, 0, 6, 7, 1)) - t3new += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -1.0 - t3new += einsum(x231, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - t3new += einsum(x231, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -1.0 - t3new += einsum(x231, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) * -1.0 - t3new += einsum(x231, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) - t3new += einsum(x231, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - t3new += einsum(x231, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) - del x231 - x232 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x232 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 0.499999999999995 - x232 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x232 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x233 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x233 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x233 += einsum(x18, (0, 1, 2, 3), (1, 0, 3, 2)) - del x18 - x233 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x233 += einsum(x194, (0, 1, 2, 3), (1, 0, 3, 2)) * 1.00000000000001 - del x194 - x233 += einsum(v.ovov, (0, 1, 2, 3), x232, (2, 4, 5, 3), (0, 4, 1, 5)) * 2.00000000000002 - del x232 - x234 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x234 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x234 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - x234 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - x234 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) * -1.0 - t3new += einsum(x233, (0, 1, 2, 3), x234, (0, 4, 5, 2, 6, 7), (4, 1, 5, 7, 3, 6)) - del x233, x234 - x235 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x235 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x235 += einsum(x219, (0, 1, 2, 3), (1, 0, 3, 2)) - del x219 - x235 += einsum(x92, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - x235 += einsum(x97, (0, 1, 2, 3), (1, 0, 3, 2)) - del x97 - t3new += einsum(x235, (0, 1, 2, 3), t3, (4, 0, 5, 6, 2, 7), (4, 1, 5, 6, 3, 7)) - del x235 - x236 = np.zeros((nvir, nvir), dtype=types[float]) - x236 += einsum(f.vv, (0, 1), (0, 1)) * -1.0 - x236 += einsum(x113, (0, 1), (0, 1)) - del x113 - x236 += einsum(x114, (0, 1), (1, 0)) - del x114 - x236 += einsum(x60, (0, 1), (1, 0)) * -1.0 - del x60 - t3new += einsum(x236, (0, 1), t3, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) * -1.0 - del x236 - x237 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x237 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x237 += einsum(x5, (0, 1, 2, 3), (0, 1, 2, 3)) - x238 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x238 += einsum(x237, (0, 1, 2, 3), x38, (1, 4, 5, 3), (4, 0, 2, 5)) - x239 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x239 += einsum(t2, (0, 1, 2, 3), x237, (4, 5, 1, 3), (0, 4, 5, 2)) * 0.5 - x240 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x240 += einsum(t2, (0, 1, 2, 3), x237, (4, 5, 1, 2), (0, 4, 5, 3)) * 0.5 - del x237 - x241 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x241 += einsum(x9, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) - del x9 - x242 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x242 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x242 += einsum(x92, (0, 1, 2, 3), (0, 1, 3, 2)) - del x92 - x243 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x243 += einsum(t1, (0, 1), x242, (2, 3, 1, 4), (0, 2, 3, 4)) * 0.5 - del x242 - x244 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x244 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x244 += einsum(x24, (0, 1, 2, 3), (2, 1, 0, 3)) - x244 += einsum(x19, (0, 1, 2, 3), (3, 1, 0, 2)) - x245 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x245 += einsum(t1, (0, 1), x244, (0, 2, 3, 4), (2, 3, 4, 1)) * 0.5 - del x244 - x246 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x246 += einsum(v.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -0.5 - x246 += einsum(x5, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.5 - x246 += einsum(x238, (0, 1, 2, 3), (0, 2, 1, 3)) - del x238 - x246 += einsum(x239, (0, 1, 2, 3), (0, 2, 1, 3)) - del x239 - x246 += einsum(x240, (0, 1, 2, 3), (1, 2, 0, 3)) - del x240 - x246 += einsum(x241, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x241 - x246 += einsum(x243, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x243 - x246 += einsum(x245, (0, 1, 2, 3), (0, 2, 1, 3)) - del x245 - x247 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x247 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x247 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - t3new += einsum(x246, (0, 1, 2, 3), x247, (1, 4, 5, 6), (4, 0, 2, 5, 3, 6)) * -2.0 - x248 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x248 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) - x248 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - t3new += einsum(x246, (0, 1, 2, 3), x248, (1, 4, 5, 6), (2, 0, 4, 5, 3, 6)) * -2.0 - del x246 - x249 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x249 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x249 += einsum(x24, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - x250 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x250 += einsum(t1, (0, 1), x249, (0, 2, 3, 4), (2, 3, 4, 1)) - del x249 - x251 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x251 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x251 += einsum(x250, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x250 - x252 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x252 += einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - x253 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x253 += einsum(t1, (0, 1), x19, (2, 3, 4, 0), (2, 3, 4, 1)) - del x19 - x254 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x254 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - x254 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x254 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x255 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x255 += einsum(v.ooov, (0, 1, 2, 3), x254, (1, 4, 5, 3), (0, 2, 4, 5)) - del x254 - x256 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x256 += einsum(x38, (0, 1, 2, 3), x5, (4, 0, 5, 3), (4, 5, 1, 2)) * 2.0 - del x38 - x257 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x257 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) - x257 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x258 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x258 += einsum(v.ooov, (0, 1, 2, 3), x257, (2, 4, 5, 3), (0, 1, 4, 5)) * 2.0 - del x257 - x259 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x259 += einsum(x247, (0, 1, 2, 3), x5, (4, 5, 0, 3), (4, 5, 1, 2)) - del x247 - x260 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x260 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x260 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x260 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x261 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x261 += einsum(t1, (0, 1), x260, (2, 3, 1, 4), (0, 2, 3, 4)) - del x260 - x262 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x262 += einsum(x8, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) * 2.0 - del x8 - x263 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x263 += einsum(x253, (0, 1, 2, 3), (0, 2, 1, 3)) - x263 += einsum(x255, (0, 1, 2, 3), (2, 1, 0, 3)) - x263 += einsum(x256, (0, 1, 2, 3), (0, 1, 2, 3)) - x263 += einsum(x258, (0, 1, 2, 3), (2, 1, 0, 3)) - x263 += einsum(x259, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x259 - x263 += einsum(x261, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x261 - x263 += einsum(x262, (0, 1, 2, 3), (1, 2, 0, 3)) - x264 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x264 += einsum(x251, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x264 += einsum(x251, (0, 1, 2, 3), (0, 2, 1, 3)) - del x251 - x264 += einsum(x252, (0, 1, 2, 3), (0, 1, 2, 3)) - x264 += einsum(x252, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x264 += einsum(x263, (0, 1, 2, 3), (1, 0, 2, 3)) - x264 += einsum(x263, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x263 - t3new += einsum(t2, (0, 1, 2, 3), x264, (1, 4, 5, 6), (4, 0, 5, 6, 2, 3)) * -1.0 - del x264 - x265 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x265 += einsum(t1, (0, 1), v.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - x266 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x266 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x266 += einsum(x265, (0, 1, 2, 3), (1, 0, 2, 3)) - del x265 - x266 += einsum(x252, (0, 1, 2, 3), (1, 0, 2, 3)) - del x252 - x267 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x267 += einsum(x34, (0, 1, 2, 3), (0, 2, 1, 3)) - del x34 - x267 += einsum(x258, (0, 1, 2, 3), (2, 1, 0, 3)) - del x258 - x268 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x268 += einsum(x248, (0, 1, 2, 3), x5, (4, 5, 0, 2), (4, 5, 1, 3)) - del x5, x248 - x269 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x269 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x269 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) - del x23 - x270 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x270 += einsum(t1, (0, 1), x269, (2, 3, 1, 4), (0, 2, 3, 4)) - del x269 - x271 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x271 += einsum(x253, (0, 1, 2, 3), (0, 1, 2, 3)) - del x253 - x271 += einsum(x255, (0, 1, 2, 3), (2, 0, 1, 3)) - del x255 - x271 += einsum(x256, (0, 1, 2, 3), (0, 2, 1, 3)) - del x256 - x271 += einsum(x268, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x268 - x271 += einsum(x262, (0, 1, 2, 3), (1, 0, 2, 3)) - del x262 - x271 += einsum(x270, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x270 - x272 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x272 += einsum(t1, (0, 1), x24, (2, 3, 4, 0), (2, 4, 3, 1)) - del x24 - x273 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x273 += einsum(x266, (0, 1, 2, 3), (0, 2, 1, 3)) - x273 += einsum(x266, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - del x266 - x273 += einsum(x267, (0, 1, 2, 3), (0, 1, 2, 3)) - x273 += einsum(x267, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x267 - x273 += einsum(x271, (0, 1, 2, 3), (0, 1, 2, 3)) - x273 += einsum(x271, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x271 - x273 += einsum(x272, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x273 += einsum(x272, (0, 1, 2, 3), (1, 0, 2, 3)) - del x272 - t3new += einsum(t2, (0, 1, 2, 3), x273, (4, 5, 1, 6), (5, 0, 4, 3, 2, 6)) * -1.0 - del x273 - - return {"t1new": t1new, "t2new": t2new, "t3new": t3new} - -def update_lams(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, l1=None, l2=None, l3=None, **kwargs): - # L amplitudes - l1new = np.zeros((nvir, nocc), dtype=types[float]) - l1new += einsum(f.ov, (0, 1), (1, 0)) - l2new = np.zeros((nvir, nvir, nocc, nocc), dtype=types[float]) - l2new += einsum(l2, (0, 1, 2, 3), v.vvvv, (4, 1, 5, 0), (4, 5, 3, 2)) - l2new += einsum(v.ovov, (0, 1, 2, 3), (1, 3, 0, 2)) - l2new += einsum(l2, (0, 1, 2, 3), v.oooo, (4, 2, 5, 3), (0, 1, 4, 5)) - l3new = np.zeros((nvir, nvir, nvir, nocc, nocc, nocc), dtype=types[float]) - l3new += einsum(l1, (0, 1), v.ovov, (2, 3, 4, 5), (0, 3, 5, 1, 2, 4)) - l3new += einsum(l1, (0, 1), v.ovov, (2, 3, 4, 5), (5, 3, 0, 1, 2, 4)) * -1.0 - l3new += einsum(l1, (0, 1), v.ovov, (2, 3, 4, 5), (5, 0, 3, 2, 1, 4)) * -1.0 - l3new += einsum(l1, (0, 1), v.ovov, (2, 3, 4, 5), (3, 0, 5, 2, 1, 4)) - l3new += einsum(l1, (0, 1), v.ovov, (2, 3, 4, 5), (0, 5, 3, 2, 4, 1)) * -1.0 - l3new += einsum(l1, (0, 1), v.ovov, (2, 3, 4, 5), (3, 5, 0, 2, 4, 1)) - x0 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x0 += einsum(v.ooov, (0, 1, 2, 3), t3, (4, 5, 2, 6, 7, 3), (4, 5, 0, 1, 6, 7)) - x1 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x1 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x1 += einsum(v.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x2 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x2 += einsum(x1, (0, 1, 2, 3), t3, (4, 5, 0, 6, 3, 7), (4, 5, 1, 2, 7, 6)) * 0.25 - x3 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x3 += einsum(v.ooov, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (4, 5, 0, 2, 6, 7)) - x4 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x4 += einsum(v.ooov, (0, 1, 2, 3), t3, (4, 2, 5, 6, 3, 7), (4, 5, 0, 1, 6, 7)) - x5 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x5 += einsum(t1, (0, 1), v.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - x6 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x6 += einsum(t2, (0, 1, 2, 3), x5, (4, 5, 1, 6), (4, 0, 5, 6, 2, 3)) - x7 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x7 += einsum(t2, (0, 1, 2, 3), x5, (4, 5, 6, 1), (4, 0, 5, 6, 2, 3)) - x8 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x8 += einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - x9 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x9 += einsum(x8, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (0, 4, 5, 2, 6, 7)) - x10 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x10 += einsum(x8, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x10 += einsum(x8, (0, 1, 2, 3), (0, 2, 1, 3)) - x11 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x11 += einsum(x10, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (4, 5, 0, 2, 7, 6)) * 0.25 - x12 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x12 += einsum(x8, (0, 1, 2, 3), t3, (4, 5, 2, 6, 7, 3), (0, 4, 5, 1, 6, 7)) - x13 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x13 += einsum(x8, (0, 1, 2, 3), t3, (4, 1, 5, 6, 3, 7), (0, 4, 5, 2, 6, 7)) - x14 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x14 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -0.5 - x14 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x15 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x15 += einsum(t2, (0, 1, 2, 3), x14, (1, 4, 3, 5), (0, 4, 2, 5)) - x16 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x16 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x16 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x17 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x17 += einsum(t2, (0, 1, 2, 3), x16, (1, 4, 2, 5), (0, 4, 3, 5)) * 0.5 - x18 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x18 += einsum(x15, (0, 1, 2, 3), (0, 1, 2, 3)) - x18 += einsum(x17, (0, 1, 2, 3), (0, 1, 2, 3)) - x19 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x19 += einsum(t2, (0, 1, 2, 3), x18, (4, 5, 6, 2), (0, 1, 4, 5, 3, 6)) * 2.0 - x20 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x20 += einsum(t1, (0, 1), x8, (2, 3, 4, 1), (0, 2, 3, 4)) - x21 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x21 += einsum(t2, (0, 1, 2, 3), x20, (4, 5, 1, 6), (5, 4, 0, 6, 2, 3)) - x22 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x22 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x22 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) - x23 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x23 += einsum(t1, (0, 1), x22, (2, 3, 1, 4), (0, 2, 3, 4)) * -1.0 - x24 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x24 += einsum(t2, (0, 1, 2, 3), x8, (4, 5, 6, 3), (4, 0, 1, 6, 5, 2)) - x25 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x25 += einsum(x24, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - x25 += einsum(x24, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - x26 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x26 += einsum(x0, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * 1.25 - x26 += einsum(x0, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) * -0.25 - x26 += einsum(x0, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -0.25 - x26 += einsum(x0, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * 1.25 - del x0 - x26 += einsum(x2, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) - x26 += einsum(x2, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - del x2 - x26 += einsum(x3, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * -0.25 - x26 += einsum(x3, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) * 0.25 - x26 += einsum(x3, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * 0.25 - x26 += einsum(x3, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.25 - del x3 - x26 += einsum(x4, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -0.25 - x26 += einsum(x4, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * 0.25 - del x4 - x26 += einsum(x6, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * 0.5 - x26 += einsum(x6, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.5 - x26 += einsum(x7, (0, 1, 2, 3, 4, 5), (0, 3, 1, 2, 4, 5)) * -0.5 - x26 += einsum(x7, (0, 1, 2, 3, 4, 5), (0, 3, 1, 2, 5, 4)) * 0.5 - x26 += einsum(x9, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 1.25 - x26 += einsum(x9, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -0.25 - x26 += einsum(x9, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -0.25 - x26 += einsum(x9, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 1.25 - del x9 - x26 += einsum(x11, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) - x26 += einsum(x11, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - del x11 - x26 += einsum(x12, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -0.25 - x26 += einsum(x12, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * 0.25 - x26 += einsum(x12, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * 0.25 - x26 += einsum(x12, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.25 - del x12 - x26 += einsum(x13, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -0.25 - x26 += einsum(x13, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 0.25 - del x13 - x26 += einsum(x19, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - x26 += einsum(x19, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * 0.5 - del x19 - x26 += einsum(x21, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.5 - x26 += einsum(x21, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.5 - x26 += einsum(x21, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -0.5 - x26 += einsum(x21, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) * 0.5 - x26 += einsum(t2, (0, 1, 2, 3), x23, (4, 5, 3, 6), (4, 0, 1, 5, 2, 6)) * -1.0 - del x23 - x26 += einsum(t1, (0, 1), x25, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 6, 1)) * -1.0 - del x25 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x26, (3, 4, 5, 6, 1, 2), (0, 6)) * -1.0 - del x26 - x27 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x27 += einsum(f.ov, (0, 1), t3, (2, 3, 4, 5, 6, 1), (0, 2, 4, 3, 5, 6)) - x28 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x28 += einsum(f.ov, (0, 1), t3, (2, 3, 4, 5, 1, 6), (0, 2, 4, 3, 5, 6)) - x29 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x29 += einsum(x1, (0, 1, 2, 3), t3, (4, 5, 0, 6, 7, 3), (4, 5, 1, 2, 6, 7)) * 1.00000000000004 - x30 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x30 += einsum(v.ovvv, (0, 1, 2, 3), t3, (4, 5, 6, 1, 7, 3), (4, 6, 5, 0, 7, 2)) - x31 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x31 += einsum(t2, (0, 1, 2, 3), x18, (4, 5, 6, 2), (0, 1, 4, 5, 3, 6)) * 2.00000000000008 - del x18 - x32 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x32 += einsum(x30, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x32 += einsum(x31, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - del x31 - x33 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x33 += einsum(x10, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (4, 5, 0, 2, 6, 7)) * 1.00000000000004 - x34 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x34 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 5, 6, 1, 7, 3), (4, 6, 5, 0, 2, 7)) - x35 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x35 += einsum(t1, (0, 1), x34, (2, 3, 4, 0, 5, 6), (3, 2, 4, 5, 1, 6)) - del x34 - x36 = np.zeros((nocc, nvir), dtype=types[float]) - x36 += einsum(t1, (0, 1), x14, (0, 2, 1, 3), (2, 3)) - x37 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x37 += einsum(x36, (0, 1), t3, (2, 3, 4, 5, 1, 6), (2, 4, 3, 0, 5, 6)) * 0.6666666666666666 - x38 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x38 += einsum(x36, (0, 1), t3, (2, 3, 4, 1, 5, 6), (2, 4, 3, 0, 6, 5)) * 0.6666666666666666 - x39 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x39 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x39 += einsum(v.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x39 += einsum(x8, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x39 += einsum(x8, (0, 1, 2, 3), (2, 0, 1, 3)) - x40 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x40 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x40 += einsum(x8, (0, 1, 2, 3), (0, 2, 1, 3)) - x41 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x41 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x41 += einsum(x8, (0, 1, 2, 3), (2, 0, 1, 3)) - x42 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x42 += einsum(x27, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -0.3333333333333333 - x42 += einsum(x27, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * 2.333333333333333 - x42 += einsum(x27, (0, 1, 2, 3, 4, 5), (2, 3, 0, 1, 4, 5)) * 0.3333333333333333 - x42 += einsum(x27, (0, 1, 2, 3, 4, 5), (2, 3, 0, 1, 5, 4)) * -0.3333333333333333 - x42 += einsum(x28, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) * 0.3333333333333333 - x42 += einsum(x28, (0, 1, 2, 3, 4, 5), (1, 3, 0, 2, 5, 4)) * -0.3333333333333333 - del x28 - x42 += einsum(x29, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - x42 += einsum(x29, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x29 - x42 += einsum(x32, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - x42 += einsum(x32, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x32 - x42 += einsum(x33, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - x42 += einsum(x33, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x33 - x42 += einsum(x35, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - x42 += einsum(x35, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 5, 4)) - x42 += einsum(x37, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - x42 += einsum(x37, (0, 1, 2, 3, 4, 5), (1, 2, 3, 0, 4, 5)) * -1.0 - del x37 - x42 += einsum(x38, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - x42 += einsum(x38, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * 6.999999999999999 - x42 += einsum(x38, (0, 1, 2, 3, 4, 5), (0, 2, 3, 1, 4, 5)) - x42 += einsum(x38, (0, 1, 2, 3, 4, 5), (0, 2, 3, 1, 5, 4)) * -1.0 - del x38 - x42 += einsum(x39, (0, 1, 2, 3), t3, (4, 5, 0, 6, 3, 7), (4, 5, 2, 1, 6, 7)) * -1.00000000000004 - del x39 - x42 += einsum(x40, (0, 1, 2, 3), t3, (4, 2, 5, 6, 3, 7), (4, 5, 1, 0, 7, 6)) * 1.00000000000004 - x42 += einsum(x41, (0, 1, 2, 3), t3, (4, 0, 5, 3, 6, 7), (4, 5, 2, 1, 6, 7)) * -2.00000000000008 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x42, (3, 5, 6, 4, 1, 2), (0, 6)) * -0.24999999999999 - del x42 - x43 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x43 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x43 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * 2.0 - x44 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x44 += einsum(t2, (0, 1, 2, 3), x43, (1, 4, 3, 5), (0, 4, 2, 5)) * 1.5000000000000002 - x45 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x45 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x45 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * 3.0000000000000004 - x46 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x46 += einsum(t2, (0, 1, 2, 3), x45, (1, 4, 2, 5), (0, 4, 3, 5)) * 0.5 - del x45 - x47 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x47 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x47 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -2.0 - x47 += einsum(x44, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x44 - x47 += einsum(x46, (0, 1, 2, 3), (0, 1, 2, 3)) - del x46 - x48 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x48 += einsum(t2, (0, 1, 2, 3), x47, (4, 5, 6, 2), (0, 1, 4, 5, 3, 6)) * 6.00000000000024 - del x47 - x49 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x49 += einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - x50 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x50 += einsum(x49, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -0.5 - x50 += einsum(x49, (0, 1, 2, 3, 4, 5), (0, 1, 3, 4, 2, 5)) - x51 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x51 += einsum(t1, (0, 1), x50, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) * 12.00000000000048 - del x50 - x52 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x52 += einsum(v.ovvv, (0, 1, 2, 3), t3, (4, 5, 6, 7, 1, 3), (4, 6, 5, 0, 7, 2)) - x53 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x53 += einsum(v.ovvv, (0, 1, 2, 3), t3, (4, 5, 6, 7, 3, 1), (4, 6, 5, 0, 7, 2)) - x54 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x54 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x54 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - x55 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x55 += einsum(t1, (0, 1), x54, (2, 3, 1, 4), (0, 2, 3, 4)) - x56 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x56 += einsum(t2, (0, 1, 2, 3), x55, (4, 5, 2, 6), (0, 1, 4, 5, 3, 6)) * 12.00000000000048 - del x55 - x57 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x57 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 5, 6, 7, 3, 1), (4, 6, 5, 0, 2, 7)) - x58 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x58 += einsum(t1, (0, 1), x57, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - x59 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x59 += einsum(t1, (0, 1), x57, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 1, 6)) - x60 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x60 += einsum(x24, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x60 += einsum(x24, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -0.5 - x61 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x61 += einsum(t1, (0, 1), x60, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 1, 6)) * 12.00000000000048 - del x60 - x62 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x62 += einsum(x48, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - x62 += einsum(x48, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x48 - x62 += einsum(x51, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - x62 += einsum(x51, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 5, 4)) * -1.0 - del x51 - x62 += einsum(x52, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * 2.0 - x62 += einsum(x52, (0, 1, 2, 3, 4, 5), (2, 1, 3, 0, 4, 5)) * -2.0 - x62 += einsum(x30, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - x62 += einsum(x30, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - x62 += einsum(x30, (0, 1, 2, 3, 4, 5), (2, 0, 3, 1, 4, 5)) * -1.0 - x62 += einsum(x30, (0, 1, 2, 3, 4, 5), (2, 1, 3, 0, 4, 5)) - x62 += einsum(x53, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -8.0 - x62 += einsum(x53, (0, 1, 2, 3, 4, 5), (2, 1, 3, 0, 4, 5)) * 2.0 - del x53 - x62 += einsum(x56, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - x62 += einsum(x56, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x56 - x62 += einsum(x58, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * 8.0 - x62 += einsum(x58, (0, 1, 2, 3, 4, 5), (2, 1, 3, 0, 5, 4)) * -2.0 - del x58 - x62 += einsum(x35, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - x62 += einsum(x35, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 5, 4)) * -1.0 - x62 += einsum(x35, (0, 1, 2, 3, 4, 5), (2, 0, 3, 1, 5, 4)) - x62 += einsum(x35, (0, 1, 2, 3, 4, 5), (2, 1, 3, 0, 5, 4)) * -1.0 - x62 += einsum(x59, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -2.0 - x62 += einsum(x59, (0, 1, 2, 3, 4, 5), (2, 1, 3, 0, 5, 4)) * 2.0 - x62 += einsum(x61, (0, 1, 2, 3, 4, 5), (1, 2, 3, 0, 5, 4)) - x62 += einsum(x61, (0, 1, 2, 3, 4, 5), (2, 1, 3, 0, 5, 4)) * -1.0 - del x61 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x62, (5, 3, 6, 4, 2, 1), (0, 6)) * 0.08333333333333 - del x62 - x63 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x63 += einsum(t2, (0, 1, 2, 3), v.oooo, (4, 5, 6, 1), (0, 4, 5, 6, 2, 3)) - x64 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x64 += einsum(x36, (0, 1), t3, (2, 3, 4, 1, 5, 6), (2, 4, 3, 0, 6, 5)) * 0.11111111111110666 - x65 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x65 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - x66 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x66 += einsum(t2, (0, 1, 2, 3), x65, (4, 5, 6, 1), (4, 5, 0, 6, 2, 3)) - x67 = np.zeros((nocc, nvir), dtype=types[float]) - x67 += einsum(t1, (0, 1), x14, (0, 2, 1, 3), (2, 3)) * 2.0 - x68 = np.zeros((nocc, nvir), dtype=types[float]) - x68 += einsum(f.ov, (0, 1), (0, 1)) - x68 += einsum(x67, (0, 1), (0, 1)) - l3new += einsum(x68, (0, 1), l2, (2, 3, 4, 5), (1, 2, 3, 0, 4, 5)) - l3new += einsum(x68, (0, 1), l2, (2, 3, 4, 5), (2, 3, 1, 4, 5, 0)) - l3new += einsum(x68, (0, 1), l2, (2, 3, 4, 5), (2, 3, 1, 0, 5, 4)) * -1.0 - l3new += einsum(x68, (0, 1), l2, (2, 3, 4, 5), (1, 2, 3, 5, 4, 0)) * -1.0 - x69 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x69 += einsum(x63, (0, 1, 2, 3, 4, 5), (1, 2, 3, 0, 4, 5)) * 0.3333333333333333 - x69 += einsum(x63, (0, 1, 2, 3, 4, 5), (1, 2, 3, 0, 5, 4)) * -1.0 - x69 += einsum(x63, (0, 1, 2, 3, 4, 5), (1, 3, 2, 0, 4, 5)) * -0.3333333333333333 - x69 += einsum(x63, (0, 1, 2, 3, 4, 5), (1, 3, 2, 0, 5, 4)) * 0.3333333333333333 - x69 += einsum(x27, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -0.05555555555555333 - x69 += einsum(x27, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * 0.05555555555555333 - del x27 - x69 += einsum(x7, (0, 1, 2, 3, 4, 5), (2, 3, 0, 1, 4, 5)) * 0.3333333333333333 - x69 += einsum(x7, (0, 1, 2, 3, 4, 5), (2, 3, 0, 1, 5, 4)) * -1.0 - x69 += einsum(x6, (0, 1, 2, 3, 4, 5), (3, 2, 0, 1, 4, 5)) * -0.3333333333333333 - x69 += einsum(x6, (0, 1, 2, 3, 4, 5), (3, 2, 0, 1, 5, 4)) * 0.3333333333333333 - x69 += einsum(x64, (0, 1, 2, 3, 4, 5), (3, 1, 0, 2, 4, 5)) * -1.0 - x69 += einsum(x64, (0, 1, 2, 3, 4, 5), (3, 1, 0, 2, 5, 4)) - del x64 - x69 += einsum(x66, (0, 1, 2, 3, 4, 5), (3, 0, 1, 2, 4, 5)) * 0.3333333333333333 - x69 += einsum(x66, (0, 1, 2, 3, 4, 5), (3, 0, 1, 2, 5, 4)) * -1.0 - x69 += einsum(x66, (0, 1, 2, 3, 4, 5), (3, 1, 0, 2, 4, 5)) * -0.3333333333333333 - x69 += einsum(x66, (0, 1, 2, 3, 4, 5), (3, 1, 0, 2, 5, 4)) * 0.3333333333333333 - x69 += einsum(x68, (0, 1), t3, (2, 3, 4, 5, 1, 6), (0, 2, 4, 3, 5, 6)) * 0.05555555555555333 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x69, (6, 5, 4, 3, 1, 2), (0, 6)) * 1.5 - del x69 - x70 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x70 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - x71 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x71 += einsum(t2, (0, 1, 2, 3), x70, (4, 5, 6, 3), (0, 1, 4, 5, 2, 6)) - x72 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x72 += einsum(t1, (0, 1), x49, (2, 3, 4, 5, 0, 6), (2, 3, 5, 4, 1, 6)) - x73 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x73 += einsum(t1, (0, 1), x24, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - x74 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x74 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x74 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - x74 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - x75 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x75 += einsum(x71, (0, 1, 2, 3, 4, 5), (3, 1, 0, 2, 4, 5)) * 2.0 - x75 += einsum(x66, (0, 1, 2, 3, 4, 5), (3, 2, 1, 0, 5, 4)) * 2.0 - del x66 - x75 += einsum(x59, (0, 1, 2, 3, 4, 5), (3, 0, 1, 2, 5, 4)) * -1.9999999999999198 - del x59 - x75 += einsum(x72, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) * -2.0 - x75 += einsum(x72, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * 2.0 - x75 += einsum(x73, (0, 1, 2, 3, 4, 5), (3, 1, 2, 0, 5, 4)) * -2.0 - x75 += einsum(x73, (0, 1, 2, 3, 4, 5), (3, 2, 1, 0, 5, 4)) * 2.0 - x75 += einsum(x40, (0, 1, 2, 3), x74, (2, 4, 5, 3, 6, 7), (1, 5, 4, 0, 7, 6)) - del x74 - x75 += einsum(x41, (0, 1, 2, 3), t3, (4, 0, 5, 6, 3, 7), (2, 4, 5, 1, 6, 7)) * -1.0 - del x41 - x75 += einsum(x68, (0, 1), t3, (2, 3, 4, 5, 1, 6), (0, 2, 4, 3, 5, 6)) * 0.99999999999996 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x75, (6, 3, 5, 4, 0, 2), (1, 6)) * -0.25 - del x75 - x76 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x76 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - x77 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x77 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x77 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x78 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x78 += einsum(v.ovov, (0, 1, 2, 3), x77, (2, 4, 3, 5), (0, 4, 1, 5)) * 0.5 - x79 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x79 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x79 += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x79 += einsum(x78, (0, 1, 2, 3), (1, 0, 3, 2)) - del x78 - x80 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x80 += einsum(t2, (0, 1, 2, 3), x79, (4, 5, 6, 2), (0, 1, 4, 5, 3, 6)) - del x79 - x81 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x81 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x81 += einsum(x70, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x82 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x82 += einsum(t2, (0, 1, 2, 3), x81, (4, 5, 6, 2), (0, 1, 4, 5, 3, 6)) * 2.0 - del x81 - x83 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x83 += einsum(t1, (0, 1), x49, (2, 3, 0, 4, 5, 6), (2, 3, 4, 5, 1, 6)) - x84 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x84 += einsum(x80, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - x84 += einsum(x80, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x80 - x84 += einsum(x82, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - x84 += einsum(x82, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * 0.5 - del x82 - x84 += einsum(x72, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * 2.0 - x84 += einsum(x72, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 5, 4)) * -1.0 - del x72 - x84 += einsum(x83, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - x84 += einsum(x83, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 5, 4)) - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x84, (3, 4, 6, 5, 2, 1), (0, 6)) * -1.0 - del x84 - x85 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x85 += einsum(x5, (0, 1, 2, 3), (0, 2, 1, 3)) - x85 += einsum(x5, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - x86 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x86 += einsum(t2, (0, 1, 2, 3), x85, (4, 1, 5, 6), (0, 4, 5, 6, 3, 2)) * 6.0 - del x85 - x87 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x87 += einsum(x65, (0, 1, 2, 3), (1, 0, 3, 2)) - x87 += einsum(x20, (0, 1, 2, 3), (0, 1, 2, 3)) - l2new += einsum(l2, (0, 1, 2, 3), x87, (3, 2, 4, 5), (0, 1, 5, 4)) - x88 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x88 += einsum(t2, (0, 1, 2, 3), x87, (4, 5, 1, 6), (0, 4, 5, 6, 3, 2)) * 3.0 - x89 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x89 += einsum(x63, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -3.0 - x89 += einsum(x63, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) - x89 += einsum(x63, (0, 1, 2, 3, 4, 5), (3, 0, 2, 1, 4, 5)) * 3.0 - x89 += einsum(x63, (0, 1, 2, 3, 4, 5), (3, 0, 2, 1, 5, 4)) * -1.0 - x89 += einsum(x86, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 5, 4)) * -1.0 - x89 += einsum(x86, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * 0.3333333333333333 - del x86 - x89 += einsum(x88, (0, 1, 2, 3, 4, 5), (2, 0, 3, 1, 5, 4)) * -1.0 - x89 += einsum(x88, (0, 1, 2, 3, 4, 5), (2, 0, 3, 1, 4, 5)) * 0.3333333333333333 - x89 += einsum(x88, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 5, 4)) - x89 += einsum(x88, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -0.3333333333333333 - del x88 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x89, (3, 4, 6, 5, 1, 2), (0, 6)) * -0.25 - del x89 - x90 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x90 += einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - x91 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x91 += einsum(t2, (0, 1, 2, 3), x90, (4, 5, 6, 3), (4, 0, 1, 5, 2, 6)) - x92 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x92 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x92 += einsum(x5, (0, 1, 2, 3), (2, 1, 0, 3)) - x92 += einsum(x65, (0, 1, 2, 3), (3, 1, 0, 2)) - x93 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x93 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x93 += einsum(x90, (0, 1, 2, 3), (0, 1, 3, 2)) - x93 += einsum(x70, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x94 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x94 += einsum(x63, (0, 1, 2, 3, 4, 5), (3, 0, 2, 1, 5, 4)) * -1.0000000000000402 - del x63 - x94 += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 5, 6, 2), (0, 1, 4, 5, 6, 3)) * 1.0000000000000402 - x94 += einsum(x6, (0, 1, 2, 3, 4, 5), (2, 1, 3, 0, 5, 4)) * -1.0000000000000402 - del x6 - x94 += einsum(x52, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x52 - x94 += einsum(x91, (0, 1, 2, 3, 4, 5), (2, 1, 3, 0, 5, 4)) * 1.0000000000000402 - x94 += einsum(x40, (0, 1, 2, 3), t3, (4, 5, 2, 6, 7, 3), (4, 5, 1, 0, 6, 7)) * 0.5000000000000201 - x94 += einsum(t2, (0, 1, 2, 3), x92, (1, 4, 5, 6), (4, 0, 6, 5, 2, 3)) * 1.0000000000000402 - del x92 - x94 += einsum(t2, (0, 1, 2, 3), x93, (4, 5, 6, 3), (0, 1, 5, 4, 6, 2)) * -1.0000000000000402 - del x93 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x94, (5, 3, 6, 4, 0, 2), (1, 6)) * 0.49999999999997996 - del x94 - x95 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x95 += einsum(t1, (0, 1), x24, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 1, 6)) - del x24 - x96 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x96 += einsum(v.ovov, (0, 1, 2, 3), x77, (2, 4, 3, 5), (0, 4, 1, 5)) - x97 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x97 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x97 += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x97 += einsum(x96, (0, 1, 2, 3), (1, 0, 3, 2)) - x98 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x98 += einsum(x8, (0, 1, 2, 3), t3, (4, 5, 2, 6, 3, 7), (4, 5, 0, 1, 6, 7)) - x98 += einsum(x95, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) * 2.0 - x98 += einsum(x7, (0, 1, 2, 3, 4, 5), (1, 3, 0, 2, 4, 5)) - x98 += einsum(x7, (0, 1, 2, 3, 4, 5), (1, 3, 0, 2, 5, 4)) * -1.0 - del x7 - x98 += einsum(x21, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) - x98 += einsum(x21, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) * -1.0 - del x21 - x98 += einsum(t2, (0, 1, 2, 3), x97, (4, 5, 6, 3), (0, 1, 4, 5, 2, 6)) * -2.0 - del x97 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x98, (3, 4, 5, 6, 0, 2), (1, 6)) * 0.5 - del x98 - x99 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x99 += einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x100 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x100 += einsum(t2, (0, 1, 2, 3), x99, (4, 5, 3, 6), (4, 0, 1, 5, 2, 6)) - x101 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x101 += einsum(x71, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.25 - del x71 - x101 += einsum(x100, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) * 0.5 - x101 += einsum(x100, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -0.5 - x101 += einsum(x91, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) * -1.0 - x101 += einsum(x91, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * 0.5 - del x91 - x101 += einsum(x73, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) - x101 += einsum(x73, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -0.5 - del x73 - x101 += einsum(x95, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) * -0.5 - x101 += einsum(x95, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * 0.5 - del x95 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x101, (5, 4, 3, 6, 2, 1), (0, 6)) * 2.0 - del x101 - x102 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x102 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x102 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x103 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x103 += einsum(x57, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - x103 += einsum(x57, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - x104 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x104 += einsum(x30, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x104 += einsum(x30, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - del x30 - x104 += einsum(x35, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - x104 += einsum(x35, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) - del x35 - x104 += einsum(x102, (0, 1, 2, 3), t3, (4, 5, 6, 7, 1, 2), (4, 6, 5, 0, 7, 3)) * -2.0 - del x102 - x104 += einsum(t1, (0, 1), x103, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 6, 1)) * -2.0 - del x103 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x104, (5, 4, 3, 6, 2, 1), (0, 6)) * 0.08333333333333 - del x104 - x105 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x105 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x105 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x105 += einsum(x15, (0, 1, 2, 3), (0, 1, 2, 3)) - del x15 - x105 += einsum(x17, (0, 1, 2, 3), (0, 1, 2, 3)) - del x17 - x106 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x106 += einsum(x49, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - x106 += einsum(x49, (0, 1, 2, 3, 4, 5), (0, 1, 3, 4, 2, 5)) - del x49 - x107 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x107 += einsum(t2, (0, 1, 2, 3), x105, (4, 5, 6, 3), (0, 1, 5, 4, 2, 6)) * 2.0 - del x105 - x107 += einsum(t1, (0, 1), x106, (2, 3, 4, 5, 0, 6), (2, 3, 5, 4, 6, 1)) * -2.0 - del x106 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x107, (4, 3, 6, 5, 1, 2), (0, 6)) * -0.5 - del x107 - x108 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x108 += einsum(v.ooov, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (4, 5, 0, 2, 6, 7)) * 0.5 - x108 += einsum(x83, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x83 - x108 += einsum(x100, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 5, 4)) - del x100 - l1new += einsum(l3, (0, 1, 2, 3, 4, 5), x108, (3, 4, 5, 6, 0, 2), (1, 6)) - del x108 - x109 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x109 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 6, 5, 7, 1, 2), (4, 6, 0, 7)) - x110 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x110 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 4, 3, 2, 7, 0), (5, 6, 1, 7)) - x111 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x111 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 6, 5, 0, 7, 2), (4, 6, 1, 7)) - x112 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x112 += einsum(t1, (0, 1), l3, (2, 3, 1, 4, 5, 6), (4, 6, 5, 0, 2, 3)) - l3new += einsum(v.ooov, (0, 1, 2, 3), x112, (4, 5, 1, 0, 6, 7), (6, 3, 7, 4, 2, 5)) - x113 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x113 += einsum(t2, (0, 1, 2, 3), x112, (0, 4, 1, 5, 6, 3), (4, 5, 6, 2)) - x114 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x114 += einsum(t2, (0, 1, 2, 3), x112, (0, 4, 1, 5, 2, 6), (4, 5, 6, 3)) - x115 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x115 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - x115 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 5.0 - x115 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - x115 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -1.0 - x115 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - x115 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - x116 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x116 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x116 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - x116 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - x117 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x117 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) - x117 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x118 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x118 += einsum(t1, (0, 1), l3, (2, 1, 3, 4, 5, 6), (4, 6, 5, 0, 2, 3)) - l3new += einsum(x8, (0, 1, 2, 3), x118, (4, 5, 0, 1, 6, 7), (7, 3, 6, 5, 2, 4)) - l3new += einsum(x68, (0, 1), x118, (2, 3, 4, 0, 5, 6), (6, 1, 5, 3, 4, 2)) * -1.0 - x119 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x119 += einsum(x118, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x119 += einsum(x118, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) - x120 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x120 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.5 - x120 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x121 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x121 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - x121 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x122 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x122 += einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - x123 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x123 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 3, 1, 5, 6), (6, 5, 0, 4)) - x124 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x124 += einsum(t2, (0, 1, 2, 3), l3, (4, 3, 2, 1, 5, 6), (6, 5, 0, 4)) - x125 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x125 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.3333333333333333 - x125 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x126 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x126 += einsum(x125, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (6, 5, 1, 4)) * 0.75 - x127 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x127 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) - x127 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.5 - x127 += einsum(x123, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.75 - x127 += einsum(x123, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.25 - x127 += einsum(x124, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - x127 += einsum(x124, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.25 - x127 += einsum(x126, (0, 1, 2, 3), (1, 0, 2, 3)) - x127 += einsum(x117, (0, 1, 2, 3), l3, (2, 4, 3, 0, 5, 6), (5, 6, 1, 4)) * -0.25 - x128 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x128 += einsum(x109, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x128 += einsum(x110, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x128 += einsum(x111, (0, 1, 2, 3), (0, 1, 2, 3)) - x128 += einsum(x113, (0, 1, 2, 3), (0, 1, 3, 2)) * 4.0 - x128 += einsum(x114, (0, 1, 2, 3), (0, 1, 3, 2)) * 4.0 - x128 += einsum(l3, (0, 1, 2, 3, 4, 5), x115, (5, 6, 4, 2, 7, 1), (3, 6, 0, 7)) - x128 += einsum(l3, (0, 1, 2, 3, 4, 5), x116, (3, 6, 5, 1, 7, 2), (4, 6, 0, 7)) - x128 += einsum(x117, (0, 1, 2, 3), x119, (0, 1, 4, 5, 6, 3), (4, 5, 2, 6)) * -4.0 - del x119 - x128 += einsum(l2, (0, 1, 2, 3), x120, (3, 4, 1, 5), (2, 4, 0, 5)) * 8.0 - x128 += einsum(l2, (0, 1, 2, 3), x121, (2, 4, 1, 5), (3, 4, 0, 5)) * 4.0 - x128 += einsum(t1, (0, 1), x127, (0, 2, 3, 4), (2, 3, 1, 4)) * 8.0 - del x127 - l1new += einsum(v.ovvv, (0, 1, 2, 3), x128, (4, 0, 3, 2), (1, 4)) * -0.25 - del x128 - x129 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x129 += einsum(t1, (0, 1), l2, (2, 3, 4, 0), (4, 2, 3, 1)) - x130 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x130 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x130 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x131 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x131 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - x131 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * 0.3333333333333333 - x131 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 1, 2)) * 0.3333333333333333 - x132 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x132 += einsum(x129, (0, 1, 2, 3), (0, 1, 2, 3)) - x132 += einsum(x130, (0, 1, 2, 3), l3, (4, 5, 2, 1, 6, 0), (6, 4, 5, 3)) * -0.125 - x132 += einsum(t2, (0, 1, 2, 3), x131, (0, 4, 1, 5, 2, 6), (4, 5, 6, 3)) * 0.75 - del x131 - l1new += einsum(v.vvvv, (0, 1, 2, 3), x132, (4, 1, 2, 3), (0, 4)) * 2.0 - del x132 - x133 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x133 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - x133 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) - x133 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 1, 2)) - x134 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x134 += einsum(x129, (0, 1, 2, 3), (0, 1, 2, 3)) - del x129 - x134 += einsum(x130, (0, 1, 2, 3), l3, (4, 5, 2, 1, 6, 0), (6, 4, 5, 3)) * -0.75 - x134 += einsum(t2, (0, 1, 2, 3), x133, (0, 4, 1, 5, 2, 6), (4, 5, 6, 3)) * 0.5 - del x133 - l1new += einsum(v.vvvv, (0, 1, 2, 3), x134, (4, 2, 1, 3), (0, 4)) * -1.0 - del x134 - x135 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x135 += einsum(l2, (0, 1, 2, 3), t3, (4, 5, 3, 6, 0, 1), (2, 4, 5, 6)) - x136 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x136 += einsum(l1, (0, 1), t2, (2, 3, 4, 0), (1, 2, 3, 4)) - x137 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x137 += einsum(t1, (0, 1), x122, (2, 3, 4, 1), (3, 2, 4, 0)) - l2new += einsum(v.ovov, (0, 1, 2, 3), x137, (4, 5, 0, 2), (3, 1, 5, 4)) - x138 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x138 += einsum(t1, (0, 1), x137, (0, 2, 3, 4), (2, 4, 3, 1)) - x139 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x139 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 4, 7, 0, 1, 2), (3, 5, 6, 7)) - x140 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x140 += einsum(t1, (0, 1), x139, (0, 2, 3, 4), (2, 4, 3, 1)) - x141 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x141 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - x141 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - x142 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x142 += einsum(t1, (0, 1), x141, (2, 3, 4, 1, 5, 6), (0, 2, 3, 4, 5, 6)) - l3new += einsum(x8, (0, 1, 2, 3), x142, (2, 4, 5, 0, 6, 7), (6, 3, 7, 5, 1, 4)) * -1.0 - x143 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x143 += einsum(t1, (0, 1), x142, (2, 3, 4, 5, 1, 6), (0, 4, 3, 5, 2, 6)) * -1.0 - del x142 - x144 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x144 += einsum(t2, (0, 1, 2, 3), x143, (4, 5, 0, 1, 6, 3), (5, 4, 6, 2)) * -0.25 - del x143 - x145 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x145 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 1, 2)) - x145 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x146 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x146 += einsum(t2, (0, 1, 2, 3), x145, (1, 4, 0, 5, 2, 6), (4, 3, 5, 6)) - del x145 - x147 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x147 += einsum(t2, (0, 1, 2, 3), x146, (4, 5, 3, 2), (0, 1, 4, 5)) * 0.25 - del x146 - x148 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x148 += einsum(x140, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.124999999999995 - del x140 - x148 += einsum(x144, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x144 - x148 += einsum(x147, (0, 1, 2, 3), (2, 1, 0, 3)) - del x147 - x149 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x149 += einsum(t2, (0, 1, 2, 3), l3, (4, 5, 2, 0, 1, 6), (6, 4, 5, 3)) - x150 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x150 += einsum(t2, (0, 1, 2, 3), x149, (4, 2, 3, 5), (4, 0, 1, 5)) - x151 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x151 += einsum(t1, (0, 1), x118, (2, 3, 4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - x152 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x152 += einsum(t2, (0, 1, 2, 3), x151, (1, 4, 0, 5, 6, 3), (4, 5, 6, 2)) - x153 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x153 += einsum(x150, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - del x150 - x153 += einsum(x152, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.25 - del x152 - x154 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x154 += einsum(x130, (0, 1, 2, 3), x151, (0, 1, 4, 5, 6, 2), (4, 5, 6, 3)) * 0.375 - x155 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x155 += einsum(x117, (0, 1, 2, 3), l3, (4, 5, 2, 1, 6, 0), (6, 4, 5, 3)) - x156 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x156 += einsum(t2, (0, 1, 2, 3), x155, (4, 3, 2, 5), (0, 1, 4, 5)) * -0.375 - x157 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x157 += einsum(x154, (0, 1, 2, 3), (0, 1, 2, 3)) - del x154 - x157 += einsum(x156, (0, 1, 2, 3), (2, 1, 0, 3)) - del x156 - x158 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x158 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) * 0.2 - x158 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x158 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -0.2 - x158 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -0.2 - x158 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.2 - x158 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -0.2 - x158 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -0.2 - x158 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - x159 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x159 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x159 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 0, 2)) - x160 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x160 += einsum(t1, (0, 1), x159, (2, 3, 4, 1, 5, 6), (0, 2, 3, 4, 5, 6)) - x161 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x161 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x161 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - x161 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - x162 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x162 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -0.3333333333333333 - x162 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * 0.3333333333333333 - x162 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) - x162 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) * -0.3333333333333333 - x163 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x163 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x163 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * -1.0 - x163 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) * -1.0 - x163 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) * 3.0 - x164 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x164 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - x164 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 2.0 - x164 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - x165 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x165 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) - x166 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x166 += einsum(x125, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (6, 5, 1, 4)) * 0.1875 - x167 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x167 += einsum(t2, (0, 1, 2, 3), l3, (4, 3, 2, 5, 6, 1), (5, 6, 0, 4)) - x168 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x168 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * 1.3333333333333333 - x168 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * -1.0 - x169 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x169 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x169 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x169 += einsum(x165, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.0625 - x169 += einsum(x165, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.75 - x169 += einsum(x166, (0, 1, 2, 3), (1, 0, 2, 3)) - x169 += einsum(x166, (0, 1, 2, 3), (0, 1, 2, 3)) * -3.0 - del x166 - x169 += einsum(x167, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.0625 - x169 += einsum(x167, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.25 - x169 += einsum(x117, (0, 1, 2, 3), x168, (0, 4, 5, 2, 3, 6), (4, 5, 1, 6)) * 0.1875 - x170 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x170 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 7, 4, 1, 0, 2), (5, 3, 6, 7)) - x171 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x171 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 7, 3, 2, 1, 0), (5, 4, 6, 7)) - x172 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x172 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 7, 3, 2, 0, 1), (5, 4, 6, 7)) - x173 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x173 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 7, 3, 1, 2, 0), (5, 4, 6, 7)) - x174 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x174 += einsum(t1, (0, 1), x167, (2, 3, 4, 1), (2, 3, 0, 4)) - x175 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x175 += einsum(x172, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.16666666666666 - x175 += einsum(x173, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.16666666666666 - x175 += einsum(x174, (0, 1, 2, 3), (0, 1, 2, 3)) - del x174 - x176 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x176 += einsum(t1, (0, 1), x165, (2, 3, 4, 1), (2, 3, 0, 4)) - x177 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x177 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x177 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - x178 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x178 += einsum(l3, (0, 1, 2, 3, 4, 5), x177, (4, 6, 7, 0, 2, 1), (3, 5, 6, 7)) * 0.16666666666666 - x179 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x179 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x179 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x180 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x180 += einsum(x179, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (5, 6, 1, 4)) * 0.3333333333333333 - x180 += einsum(x130, (0, 1, 2, 3), l3, (3, 4, 2, 5, 6, 0), (6, 5, 1, 4)) * 0.3333333333333333 - x181 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x181 += einsum(x170, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.16666666666666 - x181 += einsum(x171, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.16666666666662 - x181 += einsum(x171, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.16666666666666 - x181 += einsum(x175, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x181 += einsum(x175, (0, 1, 2, 3), (1, 0, 2, 3)) - x181 += einsum(x176, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x181 += einsum(x176, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x181 += einsum(x178, (0, 1, 2, 3), (1, 0, 2, 3)) - x181 += einsum(t1, (0, 1), x180, (2, 3, 4, 1), (2, 3, 0, 4)) * 3.0 - del x180 - x182 = np.zeros((nocc, nocc), dtype=types[float]) - x182 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 6, 5, 0, 1, 2), (4, 6)) - x183 = np.zeros((nocc, nocc), dtype=types[float]) - x183 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 4, 3, 1, 2, 0), (5, 6)) - x184 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x184 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - x184 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) - x185 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x185 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x185 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - x186 = np.zeros((nocc, nocc), dtype=types[float]) - x186 += einsum(x184, (0, 1, 2, 3, 4, 5), x185, (1, 6, 0, 3, 4, 5), (2, 6)) * 0.041666666666665 - x187 = np.zeros((nocc, nocc), dtype=types[float]) - x187 += einsum(t3, (0, 1, 2, 3, 4, 5), x184, (1, 2, 6, 5, 4, 3), (0, 6)) * 0.041666666666665 - x188 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x188 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x188 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -0.14285714285714288 - x189 = np.zeros((nocc, nocc), dtype=types[float]) - x189 += einsum(l3, (0, 1, 2, 3, 4, 5), x188, (3, 6, 4, 0, 2, 1), (5, 6)) * 0.291666666666655 - x190 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x190 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) - x190 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x191 = np.zeros((nocc, nocc), dtype=types[float]) - x191 += einsum(l2, (0, 1, 2, 3), x190, (3, 4, 0, 1), (2, 4)) - x192 = np.zeros((nocc, nocc), dtype=types[float]) - x192 += einsum(x182, (0, 1), (0, 1)) * 0.124999999999995 - x192 += einsum(x183, (0, 1), (0, 1)) * -0.041666666666665 - x192 += einsum(x186, (0, 1), (0, 1)) * -1.0 - del x186 - x192 += einsum(x187, (0, 1), (1, 0)) - del x187 - x192 += einsum(x189, (0, 1), (0, 1)) - del x189 - x192 += einsum(x191, (0, 1), (0, 1)) - x193 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x193 += einsum(x135, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.75 - x193 += einsum(t3, (0, 1, 2, 3, 4, 5), x112, (1, 2, 6, 7, 4, 5), (6, 0, 7, 3)) * -0.125 - x193 += einsum(t3, (0, 1, 2, 3, 4, 5), x118, (1, 2, 6, 7, 5, 4), (6, 0, 7, 3)) * -0.125 - x193 += einsum(x136, (0, 1, 2, 3), (0, 1, 2, 3)) - x193 += einsum(x136, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - del x136 - x193 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x193 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) - x193 += einsum(x138, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x193 += einsum(x138, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x138 - x193 += einsum(x148, (0, 1, 2, 3), (0, 1, 2, 3)) - x193 += einsum(x148, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x148 - x193 += einsum(x153, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x193 += einsum(x153, (0, 1, 2, 3), (0, 2, 1, 3)) * 3.0 - del x153 - x193 += einsum(x157, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x193 += einsum(x157, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.3333333333333333 - del x157 - x193 += einsum(x112, (0, 1, 2, 3, 4, 5), x158, (0, 6, 2, 4, 7, 5), (1, 6, 3, 7)) * 0.625 - x193 += einsum(x160, (0, 1, 2, 3, 4, 5), x161, (1, 6, 2, 5, 4, 7), (3, 6, 0, 7)) * 0.125 - x193 += einsum(t2, (0, 1, 2, 3), x162, (1, 4, 5, 2, 3, 6), (4, 5, 0, 6)) * 0.75 - del x162 - x193 += einsum(t2, (0, 1, 2, 3), x163, (1, 4, 5, 3, 2, 6), (4, 5, 0, 6)) * 0.25 - del x163 - x193 += einsum(l2, (0, 1, 2, 3), x164, (2, 4, 5, 1, 6, 0), (3, 4, 5, 6)) * -0.125 - del x164 - x193 += einsum(x120, (0, 1, 2, 3), x169, (4, 0, 5, 2), (4, 1, 5, 3)) * -2.0 - del x169 - x193 += einsum(t1, (0, 1), x181, (2, 0, 3, 4), (2, 4, 3, 1)) * -0.25 - del x181 - x193 += einsum(t1, (0, 1), x192, (2, 3), (2, 0, 3, 1)) * 2.0 - l1new += einsum(v.ovov, (0, 1, 2, 3), x193, (4, 0, 2, 1), (3, 4)) * -2.0 - del x193 - x194 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x194 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 5, 3, 7, 2, 1), (4, 6, 0, 7)) - x195 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x195 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 3, 5, 7, 2, 0), (4, 6, 1, 7)) - x196 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x196 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x196 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - x197 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x197 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) * -0.5 - x197 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) - x198 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x198 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) * 8.0 - x198 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 6, 5, 2, 7, 1), (4, 6, 0, 7)) - x198 += einsum(x111, (0, 1, 2, 3), (0, 1, 2, 3)) - del x111 - x198 += einsum(x194, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x198 += einsum(x195, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x198 += einsum(l3, (0, 1, 2, 3, 4, 5), x158, (5, 6, 4, 2, 7, 1), (3, 6, 0, 7)) * 5.0 - del x158 - x198 += einsum(x159, (0, 1, 2, 3, 4, 5), x196, (1, 6, 0, 3, 4, 7), (2, 6, 5, 7)) - x198 += einsum(x120, (0, 1, 2, 3), x197, (0, 4, 2, 5), (4, 1, 5, 3)) * 16.0 - l1new += einsum(v.ovvv, (0, 1, 2, 3), x198, (4, 0, 3, 1), (2, 4)) * 0.25 - del x198 - x199 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x199 += einsum(x117, (0, 1, 2, 3), l3, (2, 4, 3, 0, 5, 6), (6, 5, 1, 4)) * 0.5 - x200 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x200 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) - x200 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) * -2.0 - x200 += einsum(x123, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x200 += einsum(x123, (0, 1, 2, 3), (1, 0, 2, 3)) * 1.5 - x200 += einsum(x124, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x200 += einsum(x124, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.5 - x200 += einsum(x125, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (5, 6, 1, 4)) * 1.5 - x200 += einsum(x199, (0, 1, 2, 3), (0, 1, 2, 3)) - x201 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x201 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) * -2.0 - x201 += einsum(x113, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x113 - x201 += einsum(x130, (0, 1, 2, 3), x160, (4, 1, 0, 5, 2, 6), (5, 4, 6, 3)) * -1.0 - del x160 - x201 += einsum(x190, (0, 1, 2, 3), x118, (4, 1, 0, 5, 2, 6), (4, 5, 6, 3)) * 4.0 - x201 += einsum(t1, (0, 1), x200, (0, 2, 3, 4), (2, 3, 4, 1)) * 2.0 - del x200 - l1new += einsum(v.ovvv, (0, 1, 2, 3), x201, (4, 0, 3, 1), (2, 4)) * 0.5 - del x201 - x202 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x202 += einsum(l2, (0, 1, 2, 3), t3, (4, 3, 5, 6, 1, 0), (2, 4, 5, 6)) - x203 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x203 += einsum(l2, (0, 1, 2, 3), t2, (4, 5, 0, 1), (2, 3, 4, 5)) - l2new += einsum(v.ovov, (0, 1, 2, 3), x203, (4, 5, 0, 2), (1, 3, 4, 5)) - x204 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x204 += einsum(t1, (0, 1), x203, (2, 0, 3, 4), (2, 3, 4, 1)) - x205 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x205 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x205 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - x205 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - x205 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * 2.0 - x206 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x206 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - x206 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 0.6666666666666666 - x206 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - x207 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x207 += einsum(x124, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.75 - del x124 - x207 += einsum(x126, (0, 1, 2, 3), (1, 0, 2, 3)) - x207 += einsum(x126, (0, 1, 2, 3), (0, 1, 2, 3)) * -3.0 - x207 += einsum(x167, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.25 - x207 += einsum(x167, (0, 1, 2, 3), (1, 0, 2, 3)) - x208 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x208 += einsum(t2, (0, 1, 2, 3), l3, (3, 4, 2, 1, 5, 6), (6, 5, 0, 4)) - x209 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x209 += einsum(x208, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - x209 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x209 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) - x209 += einsum(x165, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.0625 - x209 += einsum(x165, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.75 - x209 += einsum(t2, (0, 1, 2, 3), x168, (1, 4, 5, 2, 3, 6), (4, 5, 0, 6)) * -0.1875 - del x168 - x210 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x210 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * 0.4444444444444444 - x210 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 0, 2)) - x211 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x211 += einsum(x208, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.5 - x211 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x211 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) - x211 += einsum(x165, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.375 - x211 += einsum(x165, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - x211 += einsum(t2, (0, 1, 2, 3), x210, (1, 4, 5, 2, 3, 6), (5, 4, 0, 6)) * 1.125 - del x210 - x212 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x212 += einsum(x117, (0, 1, 2, 3), l3, (2, 4, 3, 0, 5, 6), (6, 5, 1, 4)) - x213 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x213 += einsum(x125, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (5, 6, 1, 4)) * 3.0 - x213 += einsum(x212, (0, 1, 2, 3), (0, 1, 2, 3)) - x214 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x214 += einsum(x170, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.16666666666666 - x214 += einsum(x171, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.16666666666666 - x214 += einsum(x171, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.16666666666662 - x214 += einsum(x175, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x214 += einsum(x175, (0, 1, 2, 3), (1, 0, 2, 3)) - del x175 - x214 += einsum(x176, (0, 1, 2, 3), (0, 1, 2, 3)) - x214 += einsum(x176, (0, 1, 2, 3), (1, 0, 2, 3)) * -3.0 - x214 += einsum(x178, (0, 1, 2, 3), (1, 0, 2, 3)) - del x178 - x214 += einsum(t1, (0, 1), x213, (2, 3, 4, 1), (2, 3, 0, 4)) - del x213 - x215 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x215 += einsum(x135, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - del x135 - x215 += einsum(t3, (0, 1, 2, 3, 4, 5), x118, (6, 2, 1, 7, 3, 5), (6, 0, 7, 4)) * 4.0 - x215 += einsum(t3, (0, 1, 2, 3, 4, 5), x118, (2, 0, 6, 7, 5, 3), (6, 1, 7, 4)) * 2.0 - x215 += einsum(x202, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - x215 += einsum(x202, (0, 1, 2, 3), (0, 2, 1, 3)) * -4.0 - del x202 - x215 += einsum(x204, (0, 1, 2, 3), (0, 1, 2, 3)) * 16.0 - x215 += einsum(x204, (0, 1, 2, 3), (0, 2, 1, 3)) * -8.0 - del x204 - x215 += einsum(x112, (0, 1, 2, 3, 4, 5), x115, (0, 6, 2, 4, 7, 5), (1, 6, 3, 7)) * 2.0 - del x115 - x215 += einsum(x112, (0, 1, 2, 3, 4, 5), x205, (1, 6, 0, 5, 7, 4), (2, 6, 3, 7)) * 2.0 - del x205 - x215 += einsum(l2, (0, 1, 2, 3), x206, (2, 4, 5, 1, 6, 0), (3, 4, 5, 6)) * -6.0 - del x206 - x215 += einsum(x117, (0, 1, 2, 3), x207, (4, 0, 5, 2), (4, 1, 5, 3)) * 4.0 - del x207 - x215 += einsum(t2, (0, 1, 2, 3), x209, (4, 1, 5, 3), (4, 0, 5, 2)) * 16.0 - del x209 - x215 += einsum(t2, (0, 1, 2, 3), x211, (4, 1, 5, 2), (4, 0, 5, 3)) * -8.0 - del x211 - x215 += einsum(t1, (0, 1), x214, (2, 0, 3, 4), (2, 4, 3, 1)) * -4.0 - del x214 - x215 += einsum(t1, (0, 1), x192, (2, 3), (2, 0, 3, 1)) * 16.0 - del x192 - l1new += einsum(v.ovov, (0, 1, 2, 3), x215, (4, 0, 2, 3), (1, 4)) * 0.125 - del x215 - x216 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x216 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 5, 2, 6, 1, 3), (4, 5, 0, 6)) - x217 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x217 += einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - x218 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x218 += einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - x219 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x219 += einsum(t1, (0, 1), x90, (2, 3, 4, 1), (2, 0, 3, 4)) - x220 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x220 += einsum(t1, (0, 1), x87, (2, 3, 0, 4), (2, 3, 4, 1)) - del x87 - x221 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x221 += einsum(x218, (0, 1, 2, 3), (0, 1, 2, 3)) - x221 += einsum(x219, (0, 1, 2, 3), (0, 1, 2, 3)) - x221 += einsum(x220, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x220 - x222 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x222 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 2, 5, 6, 3, 1), (4, 5, 0, 6)) - x223 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x223 += einsum(x36, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) - x224 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x224 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -1.5 - x224 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 1.5 - x224 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - x225 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x225 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x225 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x225 += einsum(x8, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x225 += einsum(x8, (0, 1, 2, 3), (0, 2, 1, 3)) * 2.0 - x226 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x226 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * 2.0 - x226 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x227 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x227 += einsum(v.oooo, (0, 1, 2, 3), (0, 2, 3, 1)) - x227 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x227 += einsum(x5, (0, 1, 2, 3), (2, 0, 3, 1)) - x227 += einsum(x5, (0, 1, 2, 3), (3, 0, 2, 1)) * -0.5 - x228 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x228 += einsum(x216, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - x228 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x228 += einsum(v.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * 0.5 - x228 += einsum(x217, (0, 1, 2, 3), (1, 2, 0, 3)) * 0.5 - x228 += einsum(x217, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - x228 += einsum(x221, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x228 += einsum(x221, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - del x221 - x228 += einsum(x222, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - x228 += einsum(x222, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.25 - del x222 - x228 += einsum(x223, (0, 1, 2, 3), (1, 0, 2, 3)) - x228 += einsum(x223, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x228 += einsum(v.ovov, (0, 1, 2, 3), x224, (2, 4, 5, 3, 1, 6), (4, 5, 0, 6)) * -0.25 - del x224 - x228 += einsum(x120, (0, 1, 2, 3), x225, (4, 5, 0, 2), (4, 1, 5, 3)) * -1.0 - x228 += einsum(t1, (0, 1), x226, (2, 3, 1, 4), (0, 3, 2, 4)) * -0.5 - del x226 - x228 += einsum(t1, (0, 1), x227, (0, 2, 3, 4), (2, 4, 3, 1)) - del x227 - l1new += einsum(l2, (0, 1, 2, 3), x228, (2, 3, 4, 1), (0, 4)) * 2.0 - del x228 - x229 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x229 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -0.5 - x229 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 0.5 - x229 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - x230 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x230 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x230 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x230 += einsum(x8, (0, 1, 2, 3), (0, 1, 2, 3)) - x230 += einsum(x8, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - x231 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x231 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x231 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - x232 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x232 += einsum(x5, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x232 += einsum(x5, (0, 1, 2, 3), (0, 3, 2, 1)) * 2.0 - x233 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x233 += einsum(x216, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.5 - x233 += einsum(v.ovov, (0, 1, 2, 3), x229, (2, 4, 5, 3, 1, 6), (4, 5, 0, 6)) * -0.5 - del x229 - x233 += einsum(t2, (0, 1, 2, 3), x225, (4, 5, 1, 3), (4, 0, 5, 2)) * -1.0 - del x225 - x233 += einsum(t2, (0, 1, 2, 3), x230, (4, 5, 1, 2), (4, 0, 5, 3)) * -2.0 - del x230 - x233 += einsum(t1, (0, 1), x231, (2, 3, 1, 4), (0, 3, 2, 4)) * 2.0 - del x231 - x233 += einsum(t1, (0, 1), x232, (2, 0, 3, 4), (2, 3, 4, 1)) * -1.0 - del x232 - l1new += einsum(l2, (0, 1, 2, 3), x233, (3, 2, 4, 1), (0, 4)) * -1.0 - del x233 - x234 = np.zeros((nvir, nvir), dtype=types[float]) - x234 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 4, 5, 0, 6, 2), (1, 6)) - x235 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x235 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -0.14285714285714288 - x235 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * 0.14285714285714288 - x235 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - x235 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * 0.14285714285714288 - x235 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -0.14285714285714288 - x235 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -0.14285714285714288 - x236 = np.zeros((nvir, nvir), dtype=types[float]) - x236 += einsum(x234, (0, 1), (0, 1)) * 3.0 - x236 += einsum(l3, (0, 1, 2, 3, 4, 5), x235, (3, 5, 4, 6, 1, 2), (0, 6)) * 6.999999999999999 - x236 += einsum(l3, (0, 1, 2, 3, 4, 5), x116, (3, 4, 5, 6, 1, 2), (0, 6)) * -1.0 - x237 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x237 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x237 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) * -0.5 - l1new += einsum(x236, (0, 1), x237, (2, 3, 0, 1), (3, 2)) * 0.16666666666666 - del x236, x237 - x238 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x238 += einsum(x130, (0, 1, 2, 3), x159, (0, 4, 5, 2, 3, 6), (1, 4, 5, 6)) * 0.5 - x239 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x239 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) - x239 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.3333333333333333 - x240 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x240 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) - x240 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) * -2.0 - x240 += einsum(x238, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - x240 += einsum(x179, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (5, 6, 1, 4)) * 0.5 - x240 += einsum(x239, (0, 1, 2, 3), l3, (4, 2, 3, 0, 5, 6), (5, 6, 1, 4)) * 1.5 - l1new += einsum(v.oovv, (0, 1, 2, 3), x240, (0, 4, 1, 3), (2, 4)) - del x240 - x241 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x241 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x241 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * 6.999999999999999 - x241 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - x241 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - x241 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -1.0 - x241 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - x242 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x242 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - x242 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x242 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - x243 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x243 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - x243 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 6.0 - x243 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - x243 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -1.0 - x243 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x244 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x244 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) - x244 += einsum(x239, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 0), (5, 6, 1, 4)) * 0.75 - x245 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x245 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) - x245 += einsum(x126, (0, 1, 2, 3), (1, 0, 2, 3)) - x245 += einsum(x126, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x126 - x245 += einsum(x238, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x238 - x246 = np.zeros((nocc, nocc), dtype=types[float]) - x246 += einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - l1new += einsum(x246, (0, 1), x36, (1, 2), (2, 0)) * -2.0 - x247 = np.zeros((nocc, nocc), dtype=types[float]) - x247 += einsum(x246, (0, 1), (0, 1)) - x247 += einsum(x182, (0, 1), (0, 1)) * 0.24999999999999 - x247 += einsum(x183, (0, 1), (0, 1)) * -0.08333333333333 - x247 += einsum(x184, (0, 1, 2, 3, 4, 5), x185, (1, 6, 0, 3, 4, 5), (2, 6)) * -0.08333333333333 - x247 += einsum(t3, (0, 1, 2, 3, 4, 5), x184, (1, 2, 6, 5, 4, 3), (6, 0)) * 0.08333333333333 - x247 += einsum(l3, (0, 1, 2, 3, 4, 5), x188, (3, 6, 4, 0, 2, 1), (5, 6)) * 0.58333333333331 - x247 += einsum(l2, (0, 1, 2, 3), x190, (2, 4, 1, 0), (3, 4)) * 2.0 - x248 = np.zeros((nocc, nvir), dtype=types[float]) - x248 += einsum(t1, (0, 1), (0, 1)) * -4.0 - x248 += einsum(l2, (0, 1, 2, 3), t3, (4, 2, 3, 5, 1, 0), (4, 5)) * 2.0 - x248 += einsum(t3, (0, 1, 2, 3, 4, 5), x118, (2, 0, 1, 6, 5, 3), (6, 4)) * 0.99999999999996 - x248 += einsum(x112, (0, 1, 2, 3, 4, 5), x241, (0, 1, 2, 5, 6, 4), (3, 6)) * 0.33333333333332 - del x241 - x248 += einsum(x112, (0, 1, 2, 3, 4, 5), x242, (0, 2, 1, 4, 6, 5), (3, 6)) * -0.33333333333332 - del x242 - x248 += einsum(l2, (0, 1, 2, 3), x243, (3, 4, 2, 1, 5, 0), (4, 5)) * -1.0 - del x243 - x248 += einsum(t2, (0, 1, 2, 3), x244, (0, 1, 4, 2), (4, 3)) * 8.0 - del x244 - x248 += einsum(t2, (0, 1, 2, 3), x245, (0, 1, 4, 3), (4, 2)) * -4.0 - del x245 - x248 += einsum(l1, (0, 1), x121, (1, 2, 3, 0), (2, 3)) * -4.0 - del x121 - x248 += einsum(t1, (0, 1), x247, (0, 2), (2, 1)) * 4.0 - del x247 - x249 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x249 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * 2.0 - x249 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - l1new += einsum(x248, (0, 1), x249, (0, 2, 3, 1), (3, 2)) * -0.25 - del x248, x249 - x250 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x250 += einsum(x172, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.041666666666665 - x250 += einsum(x173, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.041666666666665 - x251 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x251 += einsum(x130, (0, 1, 2, 3), x159, (0, 4, 5, 2, 3, 6), (4, 5, 1, 6)) * -1.0 - del x159 - x251 += einsum(x179, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (5, 6, 1, 4)) - del x179 - x251 += einsum(x239, (0, 1, 2, 3), l3, (4, 2, 3, 0, 5, 6), (5, 6, 1, 4)) * 3.0 - del x239 - x252 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x252 += einsum(x170, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.041666666666665 - x252 += einsum(x203, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.5 - x252 += einsum(x203, (0, 1, 2, 3), (1, 0, 3, 2)) - del x203 - x252 += einsum(x137, (0, 1, 2, 3), (0, 2, 3, 1)) * -0.5 - x252 += einsum(x137, (0, 1, 2, 3), (0, 3, 2, 1)) - del x137 - x252 += einsum(x171, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.291666666666655 - x252 += einsum(x171, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.041666666666665 - x252 += einsum(x250, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x252 += einsum(x250, (0, 1, 2, 3), (1, 0, 2, 3)) - del x250 - x252 += einsum(l3, (0, 1, 2, 3, 4, 5), x177, (4, 6, 7, 0, 2, 1), (5, 3, 6, 7)) * 0.041666666666665 - x252 += einsum(t1, (0, 1), x251, (2, 3, 4, 1), (2, 0, 4, 3)) * -0.25 - del x251 - l1new += einsum(v.ooov, (0, 1, 2, 3), x252, (4, 1, 2, 0), (3, 4)) * 2.0 - del x252 - x253 = np.zeros((nvir, nvir), dtype=types[float]) - x253 += einsum(l1, (0, 1), t1, (1, 2), (0, 2)) * 0.5 - x253 += einsum(l2, (0, 1, 2, 3), x120, (2, 3, 4, 1), (0, 4)) - x254 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x254 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x254 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) - l1new += einsum(x253, (0, 1), x254, (2, 1, 0, 3), (3, 2)) * 4.0 - del x253, x254 - x255 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x255 += einsum(x172, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.14285714285714288 - del x172 - x255 += einsum(x173, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.14285714285714288 - del x173 - x256 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x256 += einsum(x170, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.14285714285714288 - del x170 - x256 += einsum(x171, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.14285714285714288 - x256 += einsum(x171, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x256 += einsum(x139, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.4285714285714286 - x256 += einsum(x139, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.4285714285714286 - del x139 - x256 += einsum(x255, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x256 += einsum(x255, (0, 1, 2, 3), (1, 0, 2, 3)) - del x255 - x256 += einsum(l3, (0, 1, 2, 3, 4, 5), x177, (4, 6, 7, 0, 2, 1), (5, 3, 6, 7)) * 0.14285714285714288 - del x177 - l1new += einsum(v.ooov, (0, 1, 2, 3), x256, (4, 1, 0, 2), (3, 4)) * -0.58333333333331 - del x256 - x257 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x257 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * 0.3333333333333333 - x257 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * -0.3333333333333333 - x257 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) - x257 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * -0.3333333333333333 - x258 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x258 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - x258 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - x258 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) * -1.0 - x258 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * 3.0 - x259 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x259 += einsum(t2, (0, 1, 2, 3), x257, (1, 4, 5, 6, 3, 2), (5, 4, 0, 6)) - del x257 - x259 += einsum(t2, (0, 1, 2, 3), x258, (1, 4, 5, 6, 2, 3), (5, 4, 0, 6)) * 0.3333333333333333 - del x258 - x260 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x260 += einsum(t1, (0, 1), x259, (2, 3, 4, 1), (2, 3, 0, 4)) * 3.0 - del x259 - l1new += einsum(v.ooov, (0, 1, 2, 3), x260, (4, 0, 2, 1), (3, 4)) * 0.5 - del x260 - x261 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x261 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 3.0 - x261 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) - x261 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) * -1.0 - x262 = np.zeros((nocc, nocc), dtype=types[float]) - x262 += einsum(x246, (0, 1), (0, 1)) * 0.5 - x262 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 3, 5, 1, 2, 0), (4, 6)) * -0.041666666666665 - x262 += einsum(l3, (0, 1, 2, 3, 4, 5), x261, (3, 5, 6, 0, 2, 1), (4, 6)) * 0.041666666666665 - del x261 - x262 += einsum(x191, (0, 1), (0, 1)) - del x191 - x263 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x263 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x263 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * 2.0 - l1new += einsum(x262, (0, 1), x263, (0, 2, 1, 3), (3, 2)) * -2.0 - del x262 - x264 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x264 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x264 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - x264 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * 6.999999999999999 - x264 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - x265 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x265 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x265 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - x266 = np.zeros((nocc, nocc), dtype=types[float]) - x266 += einsum(l3, (0, 1, 2, 3, 4, 5), x264, (4, 6, 3, 0, 2, 1), (5, 6)) - del x264 - x266 += einsum(l3, (0, 1, 2, 3, 4, 5), x265, (4, 6, 3, 0, 1, 2), (5, 6)) * -1.0 - x267 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x267 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x267 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - l1new += einsum(x266, (0, 1), x267, (0, 2, 1, 3), (3, 2)) * -0.16666666666666 - del x266, x267 - x268 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x268 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x268 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - l1new += einsum(l1, (0, 1), x268, (1, 2, 0, 3), (3, 2)) * 2.0 - del x268 - x269 = np.zeros((nocc, nocc), dtype=types[float]) - x269 += einsum(x246, (0, 1), (0, 1)) * 1.714285714285783 - x269 += einsum(x182, (0, 1), (0, 1)) * 0.4285714285714286 - x269 += einsum(x183, (0, 1), (0, 1)) * -0.14285714285714288 - x269 += einsum(x184, (0, 1, 2, 3, 4, 5), x185, (1, 6, 0, 3, 4, 5), (2, 6)) * -0.14285714285714288 - x269 += einsum(t3, (0, 1, 2, 3, 4, 5), x184, (1, 2, 6, 5, 4, 3), (6, 0)) * 0.14285714285714288 - x269 += einsum(l3, (0, 1, 2, 3, 4, 5), x188, (3, 6, 4, 0, 2, 1), (5, 6)) - x269 += einsum(l2, (0, 1, 2, 3), x190, (2, 4, 1, 0), (3, 4)) * 3.428571428571566 - l1new += einsum(f.ov, (0, 1), x269, (2, 0), (1, 2)) * -0.58333333333331 - del x269 - x270 = np.zeros((nvir, nvir), dtype=types[float]) - x270 += einsum(f.vv, (0, 1), (0, 1)) * 0.5 - x270 += einsum(t1, (0, 1), x54, (0, 1, 2, 3), (3, 2)) - l1new += einsum(l1, (0, 1), x270, (0, 2), (2, 1)) * 2.0 - del x270 - x271 = np.zeros((nocc, nocc), dtype=types[float]) - x271 += einsum(v.ovov, (0, 1, 2, 3), x190, (2, 4, 1, 3), (0, 4)) * 2.0 - x272 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x272 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x272 += einsum(v.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -0.5 - x273 = np.zeros((nocc, nocc), dtype=types[float]) - x273 += einsum(t1, (0, 1), x272, (2, 3, 0, 1), (2, 3)) * 2.0 - del x272 - x274 = np.zeros((nocc, nocc), dtype=types[float]) - x274 += einsum(t1, (0, 1), x68, (2, 1), (0, 2)) - x275 = np.zeros((nocc, nocc), dtype=types[float]) - x275 += einsum(f.oo, (0, 1), (0, 1)) - x275 += einsum(x271, (0, 1), (1, 0)) - x275 += einsum(x273, (0, 1), (1, 0)) - x275 += einsum(x274, (0, 1), (0, 1)) - del x274 - l1new += einsum(l1, (0, 1), x275, (1, 2), (0, 2)) * -1.0 - l3new += einsum(x275, (0, 1), l3, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) * -1.0 - del x275 - x276 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x276 += einsum(f.vv, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - x277 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x277 += einsum(l1, (0, 1), v.ovvv, (2, 3, 4, 0), (1, 2, 3, 4)) - x278 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x278 += einsum(l1, (0, 1), x8, (1, 2, 3, 4), (2, 3, 0, 4)) - x279 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x279 += einsum(l2, (0, 1, 2, 3), x5, (2, 4, 3, 5), (4, 5, 0, 1)) - x280 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x280 += einsum(x217, (0, 1, 2, 3), l3, (4, 5, 3, 6, 2, 1), (0, 6, 4, 5)) - x281 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x281 += einsum(x122, (0, 1, 2, 3), x8, (0, 2, 4, 5), (1, 4, 3, 5)) - x282 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x282 += einsum(v.ovvv, (0, 1, 2, 3), x123, (4, 5, 0, 3), (4, 5, 1, 2)) - x283 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x283 += einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x284 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x284 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x284 += einsum(x8, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x285 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x285 += einsum(t2, (0, 1, 2, 3), x284, (0, 4, 1, 5), (4, 2, 3, 5)) - del x284 - x286 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x286 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x286 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x287 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x287 += einsum(x286, (0, 1, 2, 3), t3, (4, 1, 0, 5, 6, 2), (4, 5, 6, 3)) * 0.49999999999998 - del x286 - x288 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x288 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x288 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.3333333333333333 - x289 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x289 += einsum(x288, (0, 1, 2, 3), t3, (4, 1, 0, 5, 2, 6), (4, 6, 5, 3)) * 1.49999999999994 - del x288 - x290 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x290 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x290 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x290 += einsum(x283, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x290 += einsum(x283, (0, 1, 2, 3), (0, 3, 2, 1)) - x290 += einsum(x285, (0, 1, 2, 3), (0, 1, 2, 3)) - x290 += einsum(x285, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x285 - x290 += einsum(x287, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x287 - x290 += einsum(x289, (0, 1, 2, 3), (0, 1, 2, 3)) - del x289 - x291 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x291 += einsum(x290, (0, 1, 2, 3), l3, (2, 4, 1, 0, 5, 6), (6, 5, 4, 3)) * 0.5 - del x290 - x292 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x292 += einsum(x16, (0, 1, 2, 3), t3, (4, 1, 0, 5, 6, 2), (4, 5, 6, 3)) * 0.24999999999999 - x293 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x293 += einsum(v.ovvv, (0, 1, 2, 3), x120, (0, 4, 1, 5), (4, 2, 3, 5)) * 2.0 - x294 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x294 += einsum(v.ovvv, (0, 1, 2, 3), x117, (0, 4, 3, 5), (4, 1, 2, 5)) - x295 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x295 += einsum(x292, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x292 - x295 += einsum(x293, (0, 1, 2, 3), (0, 2, 3, 1)) - del x293 - x295 += einsum(x294, (0, 1, 2, 3), (0, 2, 3, 1)) - del x294 - x296 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x296 += einsum(x295, (0, 1, 2, 3), l3, (1, 4, 2, 0, 5, 6), (6, 5, 4, 3)) - del x295 - x297 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x297 += einsum(t1, (0, 1), v.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - x298 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x298 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x298 += einsum(x297, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.5 - del x297 - x299 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x299 += einsum(t1, (0, 1), x65, (2, 3, 0, 4), (3, 2, 4, 1)) - x300 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x300 += einsum(x218, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x300 += einsum(x299, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x299 - x300 += einsum(x223, (0, 1, 2, 3), (1, 0, 2, 3)) - del x223 - x301 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x301 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -0.5 - x301 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 0.5 - x301 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - x301 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - x302 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x302 += einsum(v.ovov, (0, 1, 2, 3), x301, (2, 4, 5, 3, 1, 6), (0, 4, 5, 6)) * 0.49999999999998 - del x301 - x303 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x303 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x303 += einsum(v.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x304 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x304 += einsum(t2, (0, 1, 2, 3), x303, (4, 5, 1, 3), (0, 4, 5, 2)) - del x303 - x305 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x305 += einsum(t2, (0, 1, 2, 3), x1, (4, 5, 1, 2), (0, 4, 5, 3)) - x306 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x306 += einsum(x216, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.49999999999998 - x306 += einsum(x298, (0, 1, 2, 3), (0, 2, 1, 3)) - x306 += einsum(x298, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - del x298 - x306 += einsum(x300, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x306 += einsum(x300, (0, 1, 2, 3), (1, 0, 2, 3)) - del x300 - x306 += einsum(x302, (0, 1, 2, 3), (1, 2, 0, 3)) - del x302 - x306 += einsum(x304, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x304 - x306 += einsum(x305, (0, 1, 2, 3), (0, 2, 1, 3)) - del x305 - x307 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x307 += einsum(x306, (0, 1, 2, 3), l3, (4, 5, 3, 0, 6, 1), (6, 2, 4, 5)) - del x306 - x308 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x308 += einsum(t1, (0, 1), x20, (2, 3, 4, 0), (2, 3, 4, 1)) - x309 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x309 += einsum(x219, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x219 - x309 += einsum(x308, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x308 - x310 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x310 += einsum(x8, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x310 += einsum(x8, (0, 1, 2, 3), (0, 2, 1, 3)) - x311 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x311 += einsum(t2, (0, 1, 2, 3), x310, (4, 5, 1, 3), (0, 4, 5, 2)) * 2.0 - del x310 - x312 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x312 += einsum(x8, (0, 1, 2, 3), (0, 1, 2, 3)) - x312 += einsum(x8, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x313 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x313 += einsum(t2, (0, 1, 2, 3), x312, (4, 5, 1, 2), (0, 4, 5, 3)) - del x312 - x314 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x314 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x314 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x315 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x315 += einsum(t1, (0, 1), x314, (2, 3, 1, 4), (0, 2, 3, 4)) - del x314 - x316 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x316 += einsum(x5, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x316 += einsum(x5, (0, 1, 2, 3), (0, 3, 2, 1)) - x317 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x317 += einsum(t1, (0, 1), x316, (2, 3, 4, 0), (2, 3, 4, 1)) - del x316 - x318 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x318 += einsum(x309, (0, 1, 2, 3), (0, 1, 2, 3)) - x318 += einsum(x309, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x309 - x318 += einsum(x311, (0, 1, 2, 3), (1, 0, 2, 3)) - del x311 - x318 += einsum(x313, (0, 1, 2, 3), (1, 0, 2, 3)) - del x313 - x318 += einsum(x315, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x315 - x318 += einsum(x317, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x317 - x319 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x319 += einsum(x318, (0, 1, 2, 3), l3, (4, 5, 3, 0, 6, 1), (6, 2, 4, 5)) - del x318 - x320 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x320 += einsum(t2, (0, 1, 2, 3), x14, (1, 4, 3, 5), (0, 4, 2, 5)) * 2.0 - del x14 - x321 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x321 += einsum(t2, (0, 1, 2, 3), x16, (1, 4, 2, 5), (0, 4, 3, 5)) - del x16 - x322 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x322 += einsum(t1, (0, 1), x1, (0, 2, 3, 4), (2, 3, 1, 4)) * 0.5 - del x1 - x323 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x323 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x323 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x323 += einsum(x320, (0, 1, 2, 3), (0, 1, 2, 3)) - del x320 - x323 += einsum(x321, (0, 1, 2, 3), (0, 1, 2, 3)) - del x321 - x323 += einsum(x322, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x322 - x324 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x324 += einsum(x323, (0, 1, 2, 3), x112, (0, 4, 5, 1, 2, 6), (4, 5, 6, 3)) - del x323 - x325 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x325 += einsum(t1, (0, 1), x22, (2, 1, 3, 4), (0, 2, 3, 4)) - del x22 - x326 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x326 += einsum(t1, (0, 1), x10, (2, 3, 0, 4), (2, 3, 1, 4)) * 0.5 - del x10 - x327 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x327 += einsum(x325, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x325 - x327 += einsum(x326, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x326 - x328 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x328 += einsum(x327, (0, 1, 2, 3), x112, (0, 4, 5, 1, 2, 6), (4, 5, 6, 3)) - del x327 - x329 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x329 += einsum(x130, (0, 1, 2, 3), l3, (4, 5, 2, 1, 6, 0), (6, 4, 5, 3)) - x330 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x330 += einsum(x149, (0, 1, 2, 3), (0, 2, 1, 3)) * 2.0 - x330 += einsum(x329, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x329 - x331 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x331 += einsum(v.ovvv, (0, 1, 2, 3), x330, (4, 5, 3, 1), (0, 4, 2, 5)) * 0.5 - del x330 - x332 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x332 += einsum(l2, (0, 1, 2, 3), t2, (4, 2, 1, 5), (3, 4, 0, 5)) - x333 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x333 += einsum(x130, (0, 1, 2, 3), x118, (0, 1, 4, 5, 6, 2), (4, 5, 6, 3)) - del x130 - x334 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x334 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -0.5 - x334 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) - x335 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x335 += einsum(t2, (0, 1, 2, 3), x334, (1, 4, 5, 2, 3, 6), (0, 4, 5, 6)) * 2.0 - del x334 - x336 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x336 += einsum(x208, (0, 1, 2, 3), (1, 0, 2, 3)) - del x208 - x336 += einsum(x335, (0, 1, 2, 3), (2, 1, 0, 3)) - del x335 - x337 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x337 += einsum(t1, (0, 1), x336, (0, 2, 3, 4), (2, 3, 1, 4)) - x338 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x338 += einsum(x332, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x332 - x338 += einsum(x109, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.99999999999996 - del x109 - x338 += einsum(x110, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.99999999999996 - del x110 - x338 += einsum(x114, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x114 - x338 += einsum(x333, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x333 - x338 += einsum(x337, (0, 1, 2, 3), (0, 1, 3, 2)) - del x337 - x339 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x339 += einsum(v.ovov, (0, 1, 2, 3), x338, (4, 2, 5, 1), (0, 4, 3, 5)) * 0.5 - del x338 - x340 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x340 += einsum(x155, (0, 1, 2, 3), x40, (0, 4, 5, 3), (4, 5, 1, 2)) * -0.5 - x341 = np.zeros((nvir, nvir), dtype=types[float]) - x341 += einsum(l3, (0, 1, 2, 3, 4, 5), x235, (3, 5, 4, 6, 1, 2), (0, 6)) * 2.333333333333333 - del x235 - x342 = np.zeros((nvir, nvir), dtype=types[float]) - x342 += einsum(l3, (0, 1, 2, 3, 4, 5), x116, (3, 4, 5, 6, 1, 2), (0, 6)) * 0.3333333333333333 - del x116 - x343 = np.zeros((nvir, nvir), dtype=types[float]) - x343 += einsum(l2, (0, 1, 2, 3), x120, (2, 3, 4, 1), (0, 4)) * 8.00000000000032 - del x120 - x344 = np.zeros((nvir, nvir), dtype=types[float]) - x344 += einsum(x234, (0, 1), (0, 1)) - del x234 - x344 += einsum(x341, (0, 1), (0, 1)) - del x341 - x344 += einsum(x342, (0, 1), (0, 1)) * -1.0 - del x342 - x344 += einsum(x343, (0, 1), (0, 1)) - del x343 - x345 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x345 += einsum(x344, (0, 1), v.ovov, (2, 1, 3, 4), (2, 3, 4, 0)) * 0.24999999999999 - del x344 - x346 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x346 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x346 += einsum(x90, (0, 1, 2, 3), (0, 1, 3, 2)) - x347 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x347 += einsum(l2, (0, 1, 2, 3), x346, (2, 4, 1, 5), (3, 4, 0, 5)) - del x346 - x348 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x348 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x348 += einsum(x123, (0, 1, 2, 3), (0, 1, 2, 3)) - del x123 - x348 += einsum(x199, (0, 1, 2, 3), (1, 0, 2, 3)) - x349 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x349 += einsum(v.ooov, (0, 1, 2, 3), x348, (1, 4, 2, 5), (0, 4, 3, 5)) - del x348 - x350 = np.zeros((nocc, nocc), dtype=types[float]) - x350 += einsum(x184, (0, 1, 2, 3, 4, 5), x185, (1, 6, 0, 3, 4, 5), (2, 6)) * 0.3333333333333333 - del x185 - x351 = np.zeros((nocc, nocc), dtype=types[float]) - x351 += einsum(t3, (0, 1, 2, 3, 4, 5), x184, (1, 2, 6, 5, 4, 3), (0, 6)) * 0.3333333333333333 - del x184 - x352 = np.zeros((nocc, nocc), dtype=types[float]) - x352 += einsum(l3, (0, 1, 2, 3, 4, 5), x188, (3, 6, 4, 0, 2, 1), (5, 6)) * 2.333333333333333 - del x188 - x353 = np.zeros((nocc, nocc), dtype=types[float]) - x353 += einsum(l2, (0, 1, 2, 3), x190, (3, 4, 0, 1), (2, 4)) * 8.00000000000032 - x354 = np.zeros((nocc, nocc), dtype=types[float]) - x354 += einsum(x246, (0, 1), (0, 1)) * 4.00000000000016 - del x246 - x354 += einsum(x182, (0, 1), (0, 1)) - del x182 - x354 += einsum(x183, (0, 1), (0, 1)) * -0.3333333333333333 - del x183 - x354 += einsum(x350, (0, 1), (0, 1)) * -1.0 - del x350 - x354 += einsum(x351, (0, 1), (1, 0)) - del x351 - x354 += einsum(x352, (0, 1), (0, 1)) - del x352 - x354 += einsum(x353, (0, 1), (0, 1)) - del x353 - x355 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x355 += einsum(x354, (0, 1), v.ovov, (2, 3, 1, 4), (2, 0, 4, 3)) * 0.24999999999999 - del x354 - x356 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x356 += einsum(t1, (0, 1), x212, (2, 3, 4, 1), (0, 2, 3, 4)) * -1.0 - x357 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x357 += einsum(v.ovov, (0, 1, 2, 3), x356, (0, 4, 5, 2), (4, 5, 3, 1)) * 0.5 - del x356 - x358 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x358 += einsum(x36, (0, 1), x212, (2, 3, 0, 4), (2, 3, 1, 4)) * -1.0 - x359 = np.zeros((nocc, nocc), dtype=types[float]) - x359 += einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - x360 = np.zeros((nocc, nocc), dtype=types[float]) - x360 += einsum(f.oo, (0, 1), (0, 1)) - x360 += einsum(x359, (0, 1), (1, 0)) - del x359 - x361 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x361 += einsum(x360, (0, 1), l2, (2, 3, 0, 4), (4, 1, 2, 3)) - x362 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x362 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) - x362 += einsum(x165, (0, 1, 2, 3), (0, 1, 2, 3)) - x363 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x363 += einsum(f.ov, (0, 1), x362, (2, 3, 0, 4), (2, 3, 4, 1)) - x364 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x364 += einsum(x276, (0, 1, 2, 3), (0, 1, 2, 3)) - del x276 - x364 += einsum(x277, (0, 1, 2, 3), (0, 1, 2, 3)) - del x277 - x364 += einsum(x278, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x278 - x364 += einsum(x279, (0, 1, 2, 3), (0, 1, 2, 3)) - del x279 - x364 += einsum(x280, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x280 - x364 += einsum(x281, (0, 1, 2, 3), (0, 1, 2, 3)) - del x281 - x364 += einsum(x282, (0, 1, 2, 3), (0, 1, 2, 3)) - del x282 - x364 += einsum(x291, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x291 - x364 += einsum(x296, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x296 - x364 += einsum(x307, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x307 - x364 += einsum(x319, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x319 - x364 += einsum(x324, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x324 - x364 += einsum(x328, (0, 1, 2, 3), (0, 1, 2, 3)) - del x328 - x364 += einsum(x331, (0, 1, 2, 3), (1, 0, 3, 2)) - del x331 - x364 += einsum(x339, (0, 1, 2, 3), (1, 0, 3, 2)) - del x339 - x364 += einsum(x340, (0, 1, 2, 3), (0, 1, 2, 3)) - del x340 - x364 += einsum(x345, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x345 - x364 += einsum(x347, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x347 - x364 += einsum(x349, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x349 - x364 += einsum(x355, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x355 - x364 += einsum(x357, (0, 1, 2, 3), (0, 1, 3, 2)) - del x357 - x364 += einsum(x358, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x358 - x364 += einsum(x361, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x361 - x364 += einsum(x363, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x363 - l2new += einsum(x364, (0, 1, 2, 3), (3, 2, 0, 1)) - l2new += einsum(x364, (0, 1, 2, 3), (2, 3, 1, 0)) - del x364 - x365 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x365 += einsum(l1, (0, 1), v.ooov, (2, 1, 3, 4), (2, 3, 0, 4)) - x366 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x366 += einsum(l2, (0, 1, 2, 3), x99, (2, 4, 5, 1), (3, 4, 0, 5)) - x367 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x367 += einsum(x122, (0, 1, 2, 3), x8, (1, 2, 4, 5), (0, 4, 3, 5)) - x368 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x368 += einsum(v.ooov, (0, 1, 2, 3), x165, (4, 1, 2, 5), (4, 0, 5, 3)) - x369 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x369 += einsum(v.ooov, (0, 1, 2, 3), x149, (1, 4, 5, 3), (0, 2, 4, 5)) - del x149 - x370 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x370 += einsum(x99, (0, 1, 2, 3), x118, (0, 4, 5, 1, 3, 6), (4, 5, 6, 2)) - x371 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x371 += einsum(l3, (0, 1, 2, 3, 4, 5), x57, (5, 3, 4, 6, 7, 2), (6, 7, 0, 1)) - del x57 - x372 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x372 += einsum(t2, (0, 1, 2, 3), l3, (4, 5, 2, 6, 1, 0), (6, 4, 5, 3)) - x373 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x373 += einsum(x372, (0, 1, 2, 3), x8, (0, 4, 5, 3), (5, 4, 1, 2)) - x374 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x374 += einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - x375 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x375 += einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 4, 5, 2), (0, 3, 4, 5)) - x376 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x376 += einsum(v.ovov, (0, 1, 2, 3), t3, (4, 0, 2, 5, 6, 3), (4, 5, 6, 1)) - x377 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x377 += einsum(t2, (0, 1, 2, 3), x8, (4, 0, 1, 5), (4, 2, 3, 5)) - x378 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x378 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -1.0 - x378 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x379 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x379 += einsum(v.ovov, (0, 1, 2, 3), x378, (0, 2, 4, 5, 3, 6), (4, 1, 5, 6)) * 0.49999999999998 - x380 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x380 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x380 += einsum(x283, (0, 1, 2, 3), (0, 3, 2, 1)) - del x283 - x380 += einsum(x374, (0, 1, 2, 3), (0, 1, 2, 3)) - del x374 - x380 += einsum(x375, (0, 1, 2, 3), (0, 3, 1, 2)) * -1.0 - del x375 - x380 += einsum(x376, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.99999999999996 - del x376 - x380 += einsum(x377, (0, 1, 2, 3), (0, 2, 1, 3)) - del x377 - x380 += einsum(x379, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - del x379 - x381 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x381 += einsum(x380, (0, 1, 2, 3), l3, (4, 2, 1, 5, 6, 0), (5, 6, 4, 3)) - del x380 - x382 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x382 += einsum(v.ovov, (0, 1, 2, 3), x378, (2, 4, 5, 3, 1, 6), (0, 4, 5, 6)) * 0.49999999999998 - del x378 - x383 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x383 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x383 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * 2.0 - x383 += einsum(x8, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x383 += einsum(x8, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x384 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x384 += einsum(t2, (0, 1, 2, 3), x383, (4, 1, 5, 3), (0, 4, 5, 2)) - del x383 - x385 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x385 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x385 += einsum(x8, (0, 1, 2, 3), (0, 1, 2, 3)) - x386 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x386 += einsum(t2, (0, 1, 2, 3), x385, (4, 1, 5, 2), (0, 4, 5, 3)) - x387 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x387 += einsum(x67, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) - x388 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x388 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x388 += einsum(x5, (0, 1, 2, 3), (2, 1, 3, 0)) - x388 += einsum(x65, (0, 1, 2, 3), (3, 1, 2, 0)) - x389 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x389 += einsum(t1, (0, 1), x388, (0, 2, 3, 4), (2, 3, 4, 1)) - del x388 - x390 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x390 += einsum(v.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x390 += einsum(x8, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x390 += einsum(x218, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x218 - x390 += einsum(x216, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.99999999999996 - del x216 - x390 += einsum(x382, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x382 - x390 += einsum(x384, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x384 - x390 += einsum(x386, (0, 1, 2, 3), (0, 1, 2, 3)) - del x386 - x390 += einsum(x387, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x387 - x390 += einsum(x389, (0, 1, 2, 3), (0, 2, 1, 3)) - del x389 - x391 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x391 += einsum(x390, (0, 1, 2, 3), l3, (4, 5, 3, 6, 1, 0), (6, 2, 4, 5)) - del x390 - x392 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x392 += einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 5), (0, 3, 4, 5)) - x393 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x393 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x393 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x394 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x394 += einsum(t2, (0, 1, 2, 3), x393, (1, 3, 4, 5), (0, 2, 4, 5)) * 0.5 - x395 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x395 += einsum(x392, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.5 - del x392 - x395 += einsum(x394, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x394 - x396 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x396 += einsum(x395, (0, 1, 2, 3), l3, (4, 3, 1, 5, 6, 0), (5, 6, 4, 2)) * 2.0 - del x395 - x397 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x397 += einsum(t2, (0, 1, 2, 3), x385, (4, 5, 1, 2), (0, 4, 5, 3)) - del x385 - x398 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x398 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x398 += einsum(x90, (0, 1, 2, 3), (1, 0, 3, 2)) - x399 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x399 += einsum(t1, (0, 1), x398, (2, 3, 1, 4), (0, 2, 3, 4)) - del x398 - x400 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x400 += einsum(t1, (0, 1), x40, (2, 3, 4, 1), (0, 2, 3, 4)) - del x40 - x401 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x401 += einsum(t1, (0, 1), x400, (2, 3, 4, 0), (2, 4, 3, 1)) - del x400 - x402 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x402 += einsum(x397, (0, 1, 2, 3), (1, 0, 2, 3)) - del x397 - x402 += einsum(x399, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x399 - x402 += einsum(x401, (0, 1, 2, 3), (0, 2, 1, 3)) - del x401 - x403 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x403 += einsum(x402, (0, 1, 2, 3), l3, (4, 5, 3, 6, 1, 0), (6, 2, 4, 5)) - del x402 - x404 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x404 += einsum(t1, (0, 1), v.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - x405 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x405 += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - x406 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x406 += einsum(t2, (0, 1, 2, 3), x43, (1, 4, 3, 5), (0, 4, 2, 5)) - del x43 - x407 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x407 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x407 += einsum(x404, (0, 1, 2, 3), (0, 1, 2, 3)) - del x404 - x407 += einsum(x405, (0, 1, 2, 3), (0, 1, 2, 3)) - del x405 - x407 += einsum(x406, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x406 - x408 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x408 += einsum(x407, (0, 1, 2, 3), x118, (4, 0, 5, 1, 6, 2), (4, 5, 6, 3)) - del x407 - x409 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x409 += einsum(t2, (0, 1, 2, 3), l3, (4, 5, 3, 1, 6, 0), (6, 4, 5, 2)) - x410 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x410 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 5, 1, 6, 0), (6, 4, 5, 3)) - x411 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x411 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x411 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * -1.0 - x411 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 1, 2)) * 0.5 - x411 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) * 2.0 - x412 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x412 += einsum(t2, (0, 1, 2, 3), x411, (0, 4, 1, 2, 5, 6), (4, 3, 5, 6)) - del x411 - x413 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x413 += einsum(x409, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - del x409 - x413 += einsum(x410, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x413 += einsum(x410, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - x413 += einsum(x412, (0, 1, 2, 3), (0, 2, 3, 1)) - del x412 - x414 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x414 += einsum(v.ovvv, (0, 1, 2, 3), x413, (4, 5, 2, 3), (0, 4, 1, 5)) - del x413 - x415 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x415 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 5.0 - x415 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - x415 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -1.0 - x415 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x415 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -1.0 - x415 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * 5.0 - x416 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x416 += einsum(l3, (0, 1, 2, 3, 4, 5), x415, (5, 6, 4, 2, 7, 1), (3, 6, 0, 7)) - del x415 - x417 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x417 += einsum(l3, (0, 1, 2, 3, 4, 5), x161, (5, 6, 3, 0, 2, 7), (4, 6, 1, 7)) - del x161 - x418 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x418 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x418 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 1, 2)) * -1.0 - x419 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x419 += einsum(t3, (0, 1, 2, 3, 4, 5), x418, (1, 2, 6, 5, 7, 4), (0, 6, 3, 7)) - del x418 - x420 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x420 += einsum(l3, (0, 1, 2, 3, 4, 5), x265, (5, 6, 4, 2, 1, 7), (3, 6, 0, 7)) - del x265 - x421 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x421 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x421 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - x422 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x422 += einsum(l3, (0, 1, 2, 3, 4, 5), x421, (3, 6, 5, 2, 1, 7), (4, 6, 0, 7)) - del x421 - x423 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x423 += einsum(x118, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.5 - x423 += einsum(x112, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -0.5 - x423 += einsum(x112, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - x423 += einsum(x112, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * -0.25 - x423 += einsum(x112, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) * 0.25 - x424 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x424 += einsum(t2, (0, 1, 2, 3), x423, (4, 0, 1, 5, 6, 2), (4, 5, 3, 6)) * 8.00000000000032 - del x423 - x425 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x425 += einsum(x112, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - x425 += einsum(x112, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - x426 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x426 += einsum(t2, (0, 1, 2, 3), x425, (0, 1, 4, 5, 6, 3), (4, 5, 2, 6)) * 2.00000000000008 - del x425 - x427 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x427 += einsum(x197, (0, 1, 2, 3), x77, (0, 4, 2, 5), (4, 1, 5, 3)) * 8.00000000000032 - del x197 - x428 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x428 += einsum(x125, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (6, 5, 1, 4)) - del x125 - x429 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x429 += einsum(x117, (0, 1, 2, 3), l3, (2, 4, 3, 0, 5, 6), (6, 5, 1, 4)) * 0.3333333333333333 - x430 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x430 += einsum(x165, (0, 1, 2, 3), (0, 1, 2, 3)) - x430 += einsum(x165, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.3333333333333333 - x430 += einsum(x167, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.3333333333333333 - x430 += einsum(x167, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.3333333333333333 - x430 += einsum(x428, (0, 1, 2, 3), (1, 0, 2, 3)) - x430 += einsum(x429, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x429 - x431 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x431 += einsum(t1, (0, 1), x430, (2, 0, 3, 4), (2, 3, 1, 4)) * 6.00000000000024 - del x430 - x432 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x432 += einsum(x194, (0, 1, 2, 3), (0, 1, 2, 3)) - del x194 - x432 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) * 4.00000000000016 - x432 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) * -8.00000000000032 - x432 += einsum(x416, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x416 - x432 += einsum(x417, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x417 - x432 += einsum(x419, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x419 - x432 += einsum(x420, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x420 - x432 += einsum(x422, (0, 1, 2, 3), (0, 1, 2, 3)) - del x422 - x432 += einsum(x424, (0, 1, 2, 3), (0, 1, 3, 2)) - del x424 - x432 += einsum(x426, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x426 - x432 += einsum(x427, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x427 - x432 += einsum(x431, (0, 1, 2, 3), (0, 1, 3, 2)) - del x431 - x433 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x433 += einsum(v.ovov, (0, 1, 2, 3), x432, (4, 2, 5, 3), (0, 4, 1, 5)) * 0.24999999999999 - del x432 - x434 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x434 += einsum(l2, (0, 1, 2, 3), t2, (4, 2, 5, 1), (3, 4, 0, 5)) - x435 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x435 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 6, 5, 1, 7, 2), (4, 6, 0, 7)) - x436 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x436 += einsum(t2, (0, 1, 2, 3), x118, (4, 0, 1, 5, 6, 2), (4, 5, 6, 3)) - x437 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x437 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 4.0 - x437 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -1.0 - x437 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x438 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x438 += einsum(l3, (0, 1, 2, 3, 4, 5), x437, (4, 6, 5, 1, 7, 2), (3, 6, 0, 7)) - del x437 - x439 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x439 += einsum(l3, (0, 1, 2, 3, 4, 5), x196, (5, 6, 3, 0, 2, 7), (4, 6, 1, 7)) - del x196 - x440 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x440 += einsum(x117, (0, 1, 2, 3), x112, (0, 1, 4, 5, 2, 6), (4, 5, 6, 3)) * 2.00000000000008 - x441 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x441 += einsum(l2, (0, 1, 2, 3), x77, (3, 4, 1, 5), (2, 4, 0, 5)) * 4.00000000000016 - x442 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x442 += einsum(t1, (0, 1), x336, (2, 0, 3, 4), (2, 3, 1, 4)) * 2.00000000000008 - del x336 - x443 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x443 += einsum(x434, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.00000000000016 - del x434 - x443 += einsum(x435, (0, 1, 2, 3), (0, 1, 2, 3)) - del x435 - x443 += einsum(x195, (0, 1, 2, 3), (0, 1, 2, 3)) - del x195 - x443 += einsum(x436, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.00000000000016 - del x436 - x443 += einsum(x438, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x438 - x443 += einsum(x439, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x439 - x443 += einsum(x440, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x440 - x443 += einsum(x441, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x441 - x443 += einsum(x442, (0, 1, 2, 3), (0, 1, 3, 2)) - del x442 - x444 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x444 += einsum(v.ovov, (0, 1, 2, 3), x443, (4, 2, 5, 1), (0, 4, 3, 5)) * 0.24999999999999 - del x443 - x445 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x445 += einsum(x217, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x445 += einsum(x217, (0, 1, 2, 3), (0, 2, 1, 3)) - del x217 - x446 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x446 += einsum(x445, (0, 1, 2, 3), l3, (4, 5, 3, 1, 6, 2), (6, 0, 4, 5)) * 0.5 - del x445 - x447 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x447 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x447 += einsum(x70, (0, 1, 2, 3), (0, 1, 2, 3)) - x448 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x448 += einsum(x447, (0, 1, 2, 3), x112, (4, 0, 5, 1, 6, 2), (4, 5, 6, 3)) - del x447 - x449 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x449 += einsum(x117, (0, 1, 2, 3), l3, (4, 5, 2, 1, 6, 0), (6, 4, 5, 3)) * 0.5 - del x117 - x450 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x450 += einsum(x372, (0, 1, 2, 3), (0, 1, 2, 3)) - x450 += einsum(x449, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x449 - x451 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x451 += einsum(v.ovvv, (0, 1, 2, 3), x450, (4, 5, 3, 1), (0, 4, 2, 5)) - del x450 - x452 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x452 += einsum(t1, (0, 1), x8, (2, 0, 3, 4), (2, 3, 1, 4)) - x453 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x453 += einsum(x90, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x453 += einsum(x452, (0, 1, 2, 3), (0, 1, 2, 3)) - del x452 - x454 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x454 += einsum(x453, (0, 1, 2, 3), x112, (4, 0, 5, 1, 6, 2), (4, 5, 6, 3)) - del x453 - x455 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x455 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) - x455 += einsum(x199, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x199 - x456 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x456 += einsum(v.ovvv, (0, 1, 2, 3), x455, (4, 5, 0, 3), (4, 5, 1, 2)) - del x455 - x457 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x457 += einsum(v.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x457 += einsum(v.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) * 2.0 - x458 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x458 += einsum(t1, (0, 1), x457, (2, 1, 3, 4), (0, 2, 3, 4)) - del x457 - x459 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x459 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x459 += einsum(x458, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x458 - x460 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x460 += einsum(l2, (0, 1, 2, 3), x459, (3, 4, 5, 1), (2, 4, 0, 5)) - del x459 - x461 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x461 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x461 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x462 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x462 += einsum(x212, (0, 1, 2, 3), x461, (0, 4, 2, 5), (1, 4, 3, 5)) * -0.5 - del x461 - x463 = np.zeros((nvir, nvir), dtype=types[float]) - x463 += einsum(v.ovov, (0, 1, 2, 3), x190, (0, 2, 4, 1), (3, 4)) - x464 = np.zeros((nvir, nvir), dtype=types[float]) - x464 += einsum(t1, (0, 1), x393, (0, 1, 2, 3), (2, 3)) * 0.5 - x465 = np.zeros((nvir, nvir), dtype=types[float]) - x465 += einsum(x463, (0, 1), (0, 1)) - del x463 - x465 += einsum(x464, (0, 1), (1, 0)) * -1.0 - del x464 - x466 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x466 += einsum(x465, (0, 1), l2, (2, 1, 3, 4), (4, 3, 2, 0)) * 2.0 - del x465 - x467 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x467 += einsum(x171, (0, 1, 2, 3), (0, 1, 2, 3)) - del x171 - x467 += einsum(x176, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0000000000000804 - del x176 - x468 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x468 += einsum(v.ovov, (0, 1, 2, 3), x467, (4, 5, 0, 2), (4, 5, 3, 1)) * 0.49999999999997996 - del x467 - x469 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x469 += einsum(x122, (0, 1, 2, 3), x263, (1, 4, 2, 5), (0, 4, 3, 5)) - del x263 - x470 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x470 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x470 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) - x470 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * -3.0 - x471 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x471 += einsum(t2, (0, 1, 2, 3), x470, (1, 4, 5, 6, 2, 3), (0, 4, 5, 6)) - del x470 - x472 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x472 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * 0.3333333333333333 - x472 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) - x472 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * -0.3333333333333333 - x473 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x473 += einsum(t2, (0, 1, 2, 3), x472, (1, 4, 5, 6, 3, 2), (0, 4, 5, 6)) * 3.0 - del x472 - x474 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x474 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - x474 += einsum(x471, (0, 1, 2, 3), (2, 1, 0, 3)) - del x471 - x474 += einsum(x473, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x473 - x475 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x475 += einsum(v.ooov, (0, 1, 2, 3), x474, (4, 0, 1, 5), (2, 4, 3, 5)) * 0.5 - del x474 - x476 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x476 += einsum(x122, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x476 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - x477 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x477 += einsum(x476, (0, 1, 2, 3), x8, (0, 4, 2, 5), (4, 1, 5, 3)) - del x476 - x478 = np.zeros((nocc, nocc), dtype=types[float]) - x478 += einsum(t1, (0, 1), x36, (2, 1), (0, 2)) * 2.0 - x479 = np.zeros((nocc, nocc), dtype=types[float]) - x479 += einsum(x271, (0, 1), (1, 0)) - del x271 - x479 += einsum(x273, (0, 1), (1, 0)) - del x273 - x479 += einsum(x478, (0, 1), (0, 1)) - del x478 - x480 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x480 += einsum(x479, (0, 1), l2, (2, 3, 0, 4), (4, 1, 2, 3)) - x481 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x481 += einsum(x67, (0, 1), x362, (2, 3, 0, 4), (2, 3, 4, 1)) - del x67, x362 - x482 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x482 += einsum(f.ov, (0, 1), x212, (2, 3, 0, 4), (2, 3, 4, 1)) * -0.5 - x483 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x483 += einsum(f.ov, (0, 1), l1, (2, 3), (0, 3, 1, 2)) - x483 += einsum(x365, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x365 - x483 += einsum(x366, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x366 - x483 += einsum(x367, (0, 1, 2, 3), (0, 1, 2, 3)) - del x367 - x483 += einsum(x368, (0, 1, 2, 3), (0, 1, 2, 3)) - del x368 - x483 += einsum(x369, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x369 - x483 += einsum(x370, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x370 - x483 += einsum(x371, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.49999999999997996 - del x371 - x483 += einsum(x373, (0, 1, 2, 3), (0, 1, 2, 3)) - del x373 - x483 += einsum(x381, (0, 1, 2, 3), (0, 1, 2, 3)) - del x381 - x483 += einsum(x391, (0, 1, 2, 3), (0, 1, 2, 3)) - del x391 - x483 += einsum(x396, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x396 - x483 += einsum(x403, (0, 1, 2, 3), (0, 1, 2, 3)) - del x403 - x483 += einsum(x408, (0, 1, 2, 3), (0, 1, 2, 3)) - del x408 - x483 += einsum(x414, (0, 1, 2, 3), (1, 0, 3, 2)) - del x414 - x483 += einsum(x433, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x433 - x483 += einsum(x444, (0, 1, 2, 3), (1, 0, 3, 2)) - del x444 - x483 += einsum(x446, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x446 - x483 += einsum(x448, (0, 1, 2, 3), (0, 1, 2, 3)) - del x448 - x483 += einsum(x451, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x451 - x483 += einsum(x454, (0, 1, 2, 3), (0, 1, 2, 3)) - del x454 - x483 += einsum(x456, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x456 - x483 += einsum(x460, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x460 - x483 += einsum(x462, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x462 - x483 += einsum(x466, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x466 - x483 += einsum(x468, (0, 1, 2, 3), (0, 1, 3, 2)) - del x468 - x483 += einsum(x469, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x469 - x483 += einsum(x475, (0, 1, 2, 3), (1, 0, 3, 2)) - del x475 - x483 += einsum(x477, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x477 - x483 += einsum(x480, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x480 - x483 += einsum(x481, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x481 - x483 += einsum(x482, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x482 - x483 += einsum(l1, (0, 1), x36, (2, 3), (1, 2, 0, 3)) * 2.0 - l2new += einsum(x483, (0, 1, 2, 3), (2, 3, 0, 1)) - l2new += einsum(x483, (0, 1, 2, 3), (3, 2, 1, 0)) - del x483 - x484 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x484 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x484 += einsum(x65, (0, 1, 2, 3), (1, 3, 0, 2)) - x484 += einsum(x20, (0, 1, 2, 3), (0, 2, 1, 3)) - x485 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x485 += einsum(x484, (0, 1, 2, 3), l3, (4, 5, 6, 0, 7, 2), (7, 1, 3, 4, 6, 5)) * 0.5 - del x484 - l3new += einsum(x485, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * -1.0 - l3new += einsum(x485, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 0, 2)) - del x485 - x486 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x486 += einsum(x20, (0, 1, 2, 3), l3, (4, 5, 6, 7, 1, 0), (7, 2, 3, 4, 6, 5)) - del x20 - x487 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x487 += einsum(v.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x487 += einsum(x5, (0, 1, 2, 3), (2, 1, 0, 3)) - x487 += einsum(x65, (0, 1, 2, 3), (1, 3, 0, 2)) - del x65 - x488 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x488 += einsum(x487, (0, 1, 2, 3), l3, (4, 5, 6, 0, 2, 7), (7, 1, 3, 4, 6, 5)) - del x487 - x489 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x489 += einsum(x360, (0, 1), l3, (2, 3, 4, 0, 5, 6), (6, 5, 1, 2, 4, 3)) - del x360 - x490 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x490 += einsum(x486, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x486 - x490 += einsum(x488, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x488 - x490 += einsum(x489, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) - del x489 - l3new += einsum(x490, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - l3new += einsum(x490, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 2, 0)) * -1.0 - del x490 - x491 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x491 += einsum(l2, (0, 1, 2, 3), v.ooov, (4, 3, 5, 6), (2, 4, 5, 0, 1, 6)) - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 1, 2)) * -1.0 - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 1, 2)) - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) * -1.0 - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 0, 1)) - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 0, 1)) * -1.0 - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 2, 0)) - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -1.0 - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) - l3new += einsum(x491, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 1, 0)) * -1.0 - del x491 - x492 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x492 += einsum(f.vv, (0, 1), l3, (2, 3, 1, 4, 5, 6), (4, 6, 5, 0, 2, 3)) - x493 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x493 += einsum(f.ov, (0, 1), x112, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - x494 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x494 += einsum(v.vvvv, (0, 1, 2, 3), l3, (4, 3, 1, 5, 6, 7), (5, 7, 6, 4, 0, 2)) - x495 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x495 += einsum(v.ovvv, (0, 1, 2, 3), x112, (4, 5, 6, 0, 7, 3), (4, 5, 6, 7, 1, 2)) - x496 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x496 += einsum(t2, (0, 1, 2, 3), l3, (4, 3, 2, 5, 6, 7), (5, 7, 6, 0, 1, 4)) - x497 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x497 += einsum(x496, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x496 - x497 += einsum(x151, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x151 - x498 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x498 += einsum(v.ovov, (0, 1, 2, 3), x497, (4, 5, 6, 2, 0, 7), (4, 5, 6, 1, 3, 7)) - del x497 - x499 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x499 += einsum(x492, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x492 - x499 += einsum(x493, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x493 - x499 += einsum(x494, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x494 - x499 += einsum(x495, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x495 - x499 += einsum(x498, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - del x498 - l3new += einsum(x499, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - l3new += einsum(x499, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * -1.0 - del x499 - x500 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x500 += einsum(l2, (0, 1, 2, 3), v.ovvv, (4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - x501 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x501 += einsum(l2, (0, 1, 2, 3), x8, (3, 4, 5, 6), (2, 4, 5, 0, 1, 6)) - x502 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x502 += einsum(v.ovov, (0, 1, 2, 3), x122, (4, 5, 2, 6), (4, 5, 0, 6, 1, 3)) - del x122 - x503 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x503 += einsum(x500, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x500 - x503 += einsum(x501, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x501 - x503 += einsum(x502, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x502 - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 1, 2)) * -1.0 - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * -1.0 - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * -1.0 - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 0, 1)) * -1.0 - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 0, 1)) - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * -1.0 - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (3, 5, 4, 2, 1, 0)) - l3new += einsum(x503, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) * -1.0 - del x503 - x504 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x504 += einsum(v.vvvv, (0, 1, 2, 3), l3, (1, 4, 3, 5, 6, 7), (5, 7, 6, 4, 0, 2)) - x505 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x505 += einsum(t2, (0, 1, 2, 3), l3, (2, 4, 3, 5, 6, 7), (5, 7, 6, 0, 1, 4)) - x506 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x506 += einsum(t1, (0, 1), x112, (2, 3, 4, 5, 1, 6), (2, 3, 4, 0, 5, 6)) - x507 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x507 += einsum(x505, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x505 - x507 += einsum(x506, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x506 - x508 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x508 += einsum(v.ovov, (0, 1, 2, 3), x507, (4, 5, 6, 2, 0, 7), (4, 5, 6, 1, 3, 7)) * 0.5 - del x507 - x509 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x509 += einsum(x504, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.5 - del x504 - x509 += einsum(x508, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - del x508 - l3new += einsum(x509, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) * -1.0 - l3new += einsum(x509, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) - del x509 - x510 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x510 += einsum(v.ovov, (0, 1, 2, 3), x212, (4, 5, 2, 6), (0, 4, 5, 3, 1, 6)) * -0.5 - del x212 - l3new += einsum(x510, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) - l3new += einsum(x510, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 2, 0)) * -1.0 - l3new += einsum(x510, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) * -1.0 - l3new += einsum(x510, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 1, 0)) - l3new += einsum(x510, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 1, 2)) - l3new += einsum(x510, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 1, 2)) * -1.0 - l3new += einsum(x510, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * -1.0 - l3new += einsum(x510, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - del x510 - x511 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x511 += einsum(v.ovov, (0, 1, 2, 3), x165, (4, 5, 2, 6), (4, 5, 0, 6, 1, 3)) - del x165 - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 1, 2)) * -1.0 - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * -0.5 - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) * 0.5 - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * -1.0 - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 0, 1)) * -1.0 - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 0, 1)) - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) * 0.5 - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * -0.5 - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (3, 5, 4, 2, 1, 0)) - l3new += einsum(x511, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) * -1.0 - del x511 - x512 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x512 += einsum(v.ooov, (0, 1, 2, 3), x112, (4, 5, 1, 2, 6, 7), (4, 5, 0, 6, 7, 3)) - x513 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x513 += einsum(v.ovvv, (0, 1, 2, 3), x118, (4, 5, 6, 0, 3, 7), (5, 4, 6, 7, 1, 2)) - x514 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x514 += einsum(x8, (0, 1, 2, 3), x112, (4, 5, 0, 1, 6, 7), (4, 5, 2, 6, 7, 3)) - x515 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x515 += einsum(v.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x515 += einsum(x90, (0, 1, 2, 3), (0, 1, 3, 2)) - del x90 - x515 += einsum(x70, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.00000000000001 - del x70 - l3new += einsum(x515, (0, 1, 2, 3), l3, (4, 2, 5, 6, 0, 7), (4, 3, 5, 6, 1, 7)) * -1.0 - x516 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x516 += einsum(x515, (0, 1, 2, 3), l3, (4, 5, 2, 6, 0, 7), (7, 6, 1, 4, 5, 3)) - x517 = np.zeros((nvir, nvir), dtype=types[float]) - x517 += einsum(v.ovov, (0, 1, 2, 3), x190, (0, 2, 4, 1), (3, 4)) * 2.0 - del x190 - x518 = np.zeros((nvir, nvir), dtype=types[float]) - x518 += einsum(t1, (0, 1), x393, (0, 1, 2, 3), (2, 3)) - del x393 - x519 = np.zeros((nvir, nvir), dtype=types[float]) - x519 += einsum(x517, (0, 1), (0, 1)) - del x517 - x519 += einsum(x518, (0, 1), (1, 0)) * -1.0 - del x518 - x520 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x520 += einsum(x519, (0, 1), l3, (2, 3, 1, 4, 5, 6), (6, 4, 5, 2, 3, 0)) - del x519 - x521 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x521 += einsum(x36, (0, 1), x112, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 6, 1)) * 2.0 - del x36 - x522 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x522 += einsum(v.ovov, (0, 1, 2, 3), x428, (4, 5, 2, 6), (0, 5, 4, 3, 1, 6)) * 1.5 - del x428 - x523 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x523 += einsum(x512, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x512 - x523 += einsum(x513, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x513 - x523 += einsum(x514, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x514 - x523 += einsum(x516, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - del x516 - x523 += einsum(x520, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - del x520 - x523 += einsum(x521, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x521 - x523 += einsum(x522, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 4, 3)) - del x522 - l3new += einsum(x523, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * -1.0 - l3new += einsum(x523, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) - del x523 - x524 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x524 += einsum(v.ovov, (0, 1, 2, 3), x155, (4, 5, 6, 1), (0, 2, 4, 3, 5, 6)) * -0.5 - del x155 - l3new += einsum(x524, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 0, 1)) * -1.0 - l3new += einsum(x524, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 0, 1)) - l3new += einsum(x524, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) - l3new += einsum(x524, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 2, 0)) * -1.0 - l3new += einsum(x524, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * -1.0 - l3new += einsum(x524, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - l3new += einsum(x524, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 0, 2)) - l3new += einsum(x524, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) * -1.0 - del x524 - x525 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x525 += einsum(v.ovov, (0, 1, 2, 3), x410, (4, 5, 6, 3), (4, 0, 2, 6, 5, 1)) - del x410 - l3new += einsum(x525, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 1, 2)) * 0.5 - l3new += einsum(x525, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) * -0.5 - l3new += einsum(x525, (0, 1, 2, 3, 4, 5), (3, 5, 4, 2, 1, 0)) * -0.5 - l3new += einsum(x525, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) * 0.5 - del x525 - x526 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x526 += einsum(v.ovov, (0, 1, 2, 3), x167, (4, 5, 2, 6), (4, 5, 0, 6, 1, 3)) - del x167 - l3new += einsum(x526, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * 0.5 - l3new += einsum(x526, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) * -0.5 - l3new += einsum(x526, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) * -0.5 - l3new += einsum(x526, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * 0.5 - del x526 - x527 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x527 += einsum(x5, (0, 1, 2, 3), l3, (4, 5, 6, 7, 2, 0), (7, 1, 3, 4, 6, 5)) - x528 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x528 += einsum(v.ooov, (0, 1, 2, 3), x118, (4, 1, 5, 2, 6, 7), (4, 5, 0, 6, 7, 3)) - x529 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x529 += einsum(x8, (0, 1, 2, 3), x118, (0, 4, 5, 1, 6, 7), (4, 5, 2, 7, 6, 3)) - x530 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x530 += einsum(x515, (0, 1, 2, 3), l3, (4, 2, 5, 0, 6, 7), (7, 6, 1, 4, 5, 3)) - x531 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x531 += einsum(x479, (0, 1), l3, (2, 3, 4, 0, 5, 6), (6, 5, 1, 2, 4, 3)) - del x479 - x532 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x532 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -0.5 - x532 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) - x533 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x533 += einsum(t2, (0, 1, 2, 3), x532, (0, 4, 1, 5, 6, 2), (4, 3, 5, 6)) * 2.0 - del x532 - x534 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x534 += einsum(v.ovov, (0, 1, 2, 3), x533, (4, 1, 5, 6), (0, 2, 4, 3, 6, 5)) - del x533 - x535 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x535 += einsum(x527, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x527 - x535 += einsum(x528, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x528 - x535 += einsum(x529, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x529 - x535 += einsum(x530, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x530 - x535 += einsum(x531, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x531 - x535 += einsum(x534, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - del x534 - l3new += einsum(x535, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 1, 2)) - l3new += einsum(x535, (0, 1, 2, 3, 4, 5), (3, 5, 4, 2, 1, 0)) * -1.0 - del x535 - x536 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x536 += einsum(v.ovov, (0, 1, 2, 3), x372, (4, 5, 6, 3), (4, 0, 2, 5, 6, 1)) - del x372 - l3new += einsum(x536, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * -1.0 - l3new += einsum(x536, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) - l3new += einsum(x536, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) - l3new += einsum(x536, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * -1.0 - l3new += einsum(x536, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 0, 1)) * -1.0 - l3new += einsum(x536, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 0, 1)) - l3new += einsum(x536, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) - l3new += einsum(x536, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * -1.0 - del x536 - x537 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x537 += einsum(v.ooov, (0, 1, 2, 3), x112, (4, 0, 5, 1, 6, 7), (4, 5, 2, 6, 7, 3)) - x538 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x538 += einsum(x8, (0, 1, 2, 3), x112, (4, 0, 5, 2, 6, 7), (4, 5, 1, 6, 7, 3)) - x539 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x539 += einsum(v.ovov, (0, 1, 2, 3), x77, (2, 4, 3, 5), (0, 4, 1, 5)) * 1.00000000000001 - x540 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x540 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x540 += einsum(x99, (0, 1, 2, 3), (0, 1, 3, 2)) - x540 += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.00000000000001 - x540 += einsum(x539, (0, 1, 2, 3), (1, 0, 3, 2)) - del x539 - x541 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x541 += einsum(x540, (0, 1, 2, 3), l3, (4, 5, 2, 6, 7, 0), (6, 7, 1, 4, 5, 3)) - del x540 - x542 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x542 += einsum(x537, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x537 - x542 += einsum(x538, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x538 - x542 += einsum(x541, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x541 - l3new += einsum(x542, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 1, 2)) * -1.0 - l3new += einsum(x542, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 1, 2)) - l3new += einsum(x542, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - l3new += einsum(x542, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) * -1.0 - l3new += einsum(x542, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - l3new += einsum(x542, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 0, 1)) - l3new += einsum(x542, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 0, 1)) * -1.0 - l3new += einsum(x542, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 2, 0)) - l3new += einsum(x542, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) - l3new += einsum(x542, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 1, 0)) * -1.0 - del x542 - x543 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x543 += einsum(v.ooov, (0, 1, 2, 3), x112, (4, 1, 5, 2, 6, 7), (4, 5, 0, 6, 7, 3)) - x544 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x544 += einsum(x8, (0, 1, 2, 3), x112, (4, 0, 5, 1, 6, 7), (4, 5, 2, 6, 7, 3)) - del x8 - x545 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x545 += einsum(x515, (0, 1, 2, 3), l3, (4, 5, 2, 6, 7, 0), (6, 7, 1, 4, 5, 3)) - del x515 - x546 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x546 += einsum(x543, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x543 - x546 += einsum(x544, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x544 - x546 += einsum(x545, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x545 - l3new += einsum(x546, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 1, 2)) - l3new += einsum(x546, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 1, 2)) * -1.0 - l3new += einsum(x546, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) * -1.0 - l3new += einsum(x546, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 1, 0)) - del x546 - x547 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x547 += einsum(v.ovvv, (0, 1, 2, 3), x112, (4, 5, 6, 0, 3, 7), (5, 4, 6, 7, 1, 2)) - del x112 - l3new += einsum(x547, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 2, 1)) * -1.0 - l3new += einsum(x547, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 2, 1)) - del x547 - x548 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x548 += einsum(x5, (0, 1, 2, 3), l3, (4, 5, 6, 0, 7, 2), (7, 1, 3, 4, 6, 5)) - del x5 - l3new += einsum(x548, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 0, 2)) * -1.0 - l3new += einsum(x548, (0, 1, 2, 3, 4, 5), (3, 5, 4, 2, 0, 1)) - del x548 - x549 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x549 += einsum(v.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.99999999999999 - x549 += einsum(x99, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.99999999999999 - del x99 - x549 += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x76 - x549 += einsum(x96, (0, 1, 2, 3), (1, 0, 3, 2)) - del x96 - l3new += einsum(x549, (0, 1, 2, 3), x141, (4, 5, 0, 2, 6, 7), (6, 3, 7, 5, 1, 4)) * 1.00000000000001 - del x141, x549 - x550 = np.zeros((nvir, nvir), dtype=types[float]) - x550 += einsum(f.vv, (0, 1), (0, 1)) - x550 += einsum(v.ovov, (0, 1, 2, 3), x77, (0, 2, 1, 4), (4, 3)) * -1.0 - del x77 - x550 += einsum(t1, (0, 1), x54, (0, 1, 2, 3), (3, 2)) * 2.0 - del x54 - l3new += einsum(x550, (0, 1), l3, (2, 0, 3, 4, 5, 6), (2, 1, 3, 4, 5, 6)) - del x550 - x551 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x551 += einsum(v.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x551 += einsum(v.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - l3new += einsum(x551, (0, 1, 2, 3), x118, (4, 5, 0, 1, 6, 7), (7, 3, 6, 5, 2, 4)) * -1.0 - del x118, x551 - x552 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x552 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) - x552 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - l3new += einsum(x68, (0, 1), x552, (2, 3, 4, 5), (5, 1, 4, 3, 0, 2)) * -1.0 - del x68, x552 - - return {"l1new": l1new, "l2new": l2new, "l3new": l3new} - -def make_rdm1_f(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, l1=None, l2=None, l3=None, **kwargs): - delta = Namespace(oo=np.eye(nocc), vv=np.eye(nvir)) - - # RDM1 - rdm1_f_oo = np.zeros((nocc, nocc), dtype=types[float]) - rdm1_f_oo += einsum(delta.oo, (0, 1), (0, 1)) * 2.0 - rdm1_f_oo += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 5, 3, 1, 0, 2), (6, 4)) * 0.16666666666666 - rdm1_f_ov = np.zeros((nocc, nvir), dtype=types[float]) - rdm1_f_ov += einsum(t1, (0, 1), (0, 1)) * 2.0 - rdm1_f_vo = np.zeros((nvir, nocc), dtype=types[float]) - rdm1_f_vo += einsum(l1, (0, 1), (0, 1)) * 2.0 - rdm1_f_vv = np.zeros((nvir, nvir), dtype=types[float]) - rdm1_f_vv += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 4, 5, 0, 6, 2), (1, 6)) * 0.49999999999998 - rdm1_f_vv += einsum(l1, (0, 1), t1, (1, 2), (0, 2)) * 2.0 - x0 = np.zeros((nocc, nocc), dtype=types[float]) - x0 += einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - rdm1_f_oo += einsum(x0, (0, 1), (1, 0)) * -2.0 - x1 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x1 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -0.14285714285714288 - x1 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * 0.14285714285714288 - x1 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - x1 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -0.14285714285714288 - rdm1_f_oo += einsum(l3, (0, 1, 2, 3, 4, 5), x1, (4, 6, 3, 0, 2, 1), (6, 5)) * -1.16666666666662 - del x1 - x2 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x2 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 3.0 - x2 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - x2 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -1.0 - rdm1_f_oo += einsum(l3, (0, 1, 2, 3, 4, 5), x2, (3, 5, 6, 0, 2, 1), (6, 4)) * -0.16666666666666 - del x2 - x3 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x3 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x3 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -1.0 - rdm1_f_oo += einsum(l3, (0, 1, 2, 3, 4, 5), x3, (3, 6, 4, 0, 1, 2), (6, 5)) * 0.16666666666666 - del x3 - x4 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x4 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x4 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - rdm1_f_oo += einsum(l2, (0, 1, 2, 3), x4, (2, 4, 0, 1), (4, 3)) * -2.0 - del x4 - x5 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x5 += einsum(t1, (0, 1), l3, (2, 1, 3, 4, 5, 6), (4, 6, 5, 0, 2, 3)) - rdm1_f_ov += einsum(t3, (0, 1, 2, 3, 4, 5), x5, (0, 2, 1, 6, 3, 5), (6, 4)) * -0.49999999999998 - del x5 - x6 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x6 += einsum(t1, (0, 1), l3, (2, 3, 1, 4, 5, 6), (4, 6, 5, 0, 2, 3)) - x7 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x7 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x7 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * 6.999999999999999 - x7 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - x7 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - x7 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -1.0 - x7 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - rdm1_f_ov += einsum(x6, (0, 1, 2, 3, 4, 5), x7, (0, 1, 2, 5, 6, 4), (3, 6)) * -0.16666666666666 - del x7 - x8 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x8 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x8 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - x8 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - rdm1_f_ov += einsum(x6, (0, 1, 2, 3, 4, 5), x8, (0, 2, 1, 5, 4, 6), (3, 6)) * 0.16666666666666 - del x6, x8 - x9 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x9 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x9 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * 6.0 - x9 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - x9 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - rdm1_f_ov += einsum(l2, (0, 1, 2, 3), x9, (2, 4, 3, 1, 0, 5), (4, 5)) * 0.5 - del x9 - x10 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x10 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x10 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * 2.0 - rdm1_f_ov += einsum(l2, (0, 1, 2, 3), x10, (3, 4, 2, 1, 0, 5), (4, 5)) * -0.5 - del x10 - x11 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x11 += einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - x12 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x12 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.3333333333333333 - x12 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x13 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x13 += einsum(x12, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (1, 6, 5, 4)) * 0.75 - del x12 - x14 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x14 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) - x14 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.3333333333333333 - x15 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x15 += einsum(x11, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x15 += einsum(x11, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x11 - x15 += einsum(x13, (0, 1, 2, 3), (2, 1, 0, 3)) - x15 += einsum(x13, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x13 - x15 += einsum(x14, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 0), (5, 6, 1, 4)) * 1.5 - del x14 - rdm1_f_ov += einsum(t2, (0, 1, 2, 3), x15, (0, 1, 4, 2), (4, 3)) * -2.0 - del x15 - x16 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x16 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 2, 1)) * -1.0 - x16 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x16 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 0, 2)) - x17 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x17 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) * -1.0 - x17 += einsum(t2, (0, 1, 2, 3), x16, (1, 4, 5, 3, 2, 6), (4, 5, 0, 6)) - del x16 - rdm1_f_ov += einsum(t2, (0, 1, 2, 3), x17, (0, 1, 4, 3), (4, 2)) * -1.0 - del x17 - x18 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x18 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.5 - x18 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm1_f_ov += einsum(l1, (0, 1), x18, (1, 2, 0, 3), (2, 3)) * 4.0 - del x18 - x19 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x19 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x19 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - x19 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * 6.999999999999999 - x19 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - x20 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x20 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x20 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - x20 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * 3.0 - x21 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x21 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x21 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) - x22 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x22 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) - x22 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x23 = np.zeros((nocc, nocc), dtype=types[float]) - x23 += einsum(x0, (0, 1), (0, 1)) - del x0 - x23 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 5, 4, 1, 0, 2), (3, 6)) * 0.08333333333333 - x23 += einsum(l3, (0, 1, 2, 3, 4, 5), x19, (4, 6, 5, 2, 0, 1), (3, 6)) * 0.08333333333333 - del x19 - x23 += einsum(l3, (0, 1, 2, 3, 4, 5), x20, (3, 6, 5, 1, 0, 2), (4, 6)) * 0.08333333333333 - del x20 - x23 += einsum(t3, (0, 1, 2, 3, 4, 5), x21, (2, 6, 1, 5, 4, 3), (6, 0)) * -0.08333333333333 - del x21 - x23 += einsum(l2, (0, 1, 2, 3), x22, (2, 4, 1, 0), (3, 4)) * 2.0 - del x22 - rdm1_f_ov += einsum(t1, (0, 1), x23, (0, 2), (2, 1)) * -2.0 - del x23 - x24 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x24 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 0.14285714285714288 - x24 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -0.14285714285714288 - x24 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - x24 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -0.14285714285714288 - x24 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * 0.14285714285714288 - x24 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) * -0.14285714285714288 - rdm1_f_vv += einsum(l3, (0, 1, 2, 3, 4, 5), x24, (5, 3, 4, 1, 2, 6), (0, 6)) * 1.16666666666662 - del x24 - x25 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x25 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x25 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - x25 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - rdm1_f_vv += einsum(l3, (0, 1, 2, 3, 4, 5), x25, (5, 4, 3, 1, 6, 2), (0, 6)) * -0.16666666666666 - del x25 - x26 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x26 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) * -0.5 - x26 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) - rdm1_f_vv += einsum(t2, (0, 1, 2, 3), x26, (0, 1, 2, 4), (4, 3)) * 4.0 - del x26 - - rdm1_f = np.block([[rdm1_f_oo, rdm1_f_ov], [rdm1_f_vo, rdm1_f_vv]]) - - return rdm1_f - -def make_rdm2_f(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, l1=None, l2=None, l3=None, **kwargs): - delta = Namespace(oo=np.eye(nocc), vv=np.eye(nvir)) - - # RDM2 - rdm2_f_oooo = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - rdm2_f_oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_ovoo = np.zeros((nocc, nvir, nocc, nocc), dtype=types[float]) - rdm2_f_ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 1, 3)) - rdm2_f_ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 1, 3)) - rdm2_f_ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 1, 3)) - rdm2_f_ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 1, 3)) - rdm2_f_ovoo += einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_vooo = np.zeros((nvir, nocc, nocc, nocc), dtype=types[float]) - rdm2_f_vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 3, 1)) - rdm2_f_vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 3, 1)) - rdm2_f_vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 3, 1)) - rdm2_f_vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_vooo += einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 3, 1)) - rdm2_f_oovv = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - rdm2_f_oovv += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_ovov = np.zeros((nocc, nvir, nocc, nvir), dtype=types[float]) - rdm2_f_ovov += einsum(l1, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_ovov += einsum(l1, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_ovvo = np.zeros((nocc, nvir, nvir, nocc), dtype=types[float]) - rdm2_f_ovvo += einsum(l1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2_f_ovvo += einsum(l1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2_f_ovvo += einsum(l1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2_f_ovvo += einsum(l1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - rdm2_f_voov = np.zeros((nvir, nocc, nocc, nvir), dtype=types[float]) - rdm2_f_voov += einsum(l1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - rdm2_f_voov += einsum(l1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - rdm2_f_voov += einsum(l1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - rdm2_f_voov += einsum(l1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - rdm2_f_vovo = np.zeros((nvir, nocc, nvir, nocc), dtype=types[float]) - rdm2_f_vovo += einsum(l1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_vovo += einsum(l1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_vvoo = np.zeros((nvir, nvir, nocc, nocc), dtype=types[float]) - rdm2_f_vvoo += einsum(l2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_vvoo += einsum(l2, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_vvoo += einsum(l2, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_vvoo += einsum(l2, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_vvoo += einsum(l2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_vvoo += einsum(l2, (0, 1, 2, 3), (0, 1, 2, 3)) - x0 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x0 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 7, 4, 1, 2, 0), (3, 5, 6, 7)) - rdm2_f_oooo += einsum(x0, (0, 1, 2, 3), (3, 2, 1, 0)) * -0.16666666666667 - rdm2_f_oooo += einsum(x0, (0, 1, 2, 3), (3, 2, 1, 0)) * -0.16666666666667 - del x0 - x1 = np.zeros((nocc, nocc), dtype=types[float]) - x1 += einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (3, 0, 1, 2)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (0, 3, 2, 1)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (3, 0, 2, 1)) * -1.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (3, 0, 2, 1)) * -1.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (3, 0, 2, 1)) * -1.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (3, 0, 1, 2)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (0, 3, 2, 1)) - rdm2_f_oooo += einsum(delta.oo, (0, 1), x1, (2, 3), (3, 0, 2, 1)) * -1.0 - x2 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x2 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 7, 5, 1, 0, 2), (3, 4, 6, 7)) - x3 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x3 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x3 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - x4 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x4 += einsum(l3, (0, 1, 2, 3, 4, 5), x3, (5, 6, 7, 1, 0, 2), (3, 4, 6, 7)) * 0.16666666666667 - x5 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x5 += einsum(x2, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.16666666666667 - x5 += einsum(x4, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x4 - rdm2_f_oooo += einsum(x5, (0, 1, 2, 3), (3, 2, 0, 1)) - rdm2_f_oooo += einsum(x5, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - rdm2_f_oooo += einsum(x5, (0, 1, 2, 3), (3, 2, 0, 1)) - rdm2_f_oooo += einsum(x5, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - del x5 - x6 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x6 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) - x6 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x7 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x7 += einsum(x6, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 0), (5, 6, 1, 4)) - x8 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x8 += einsum(t1, (0, 1), x7, (2, 3, 4, 1), (0, 2, 3, 4)) * -0.5 - rdm2_f_oooo += einsum(x8, (0, 1, 2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_oooo += einsum(x8, (0, 1, 2, 3), (3, 0, 1, 2)) - rdm2_f_oooo += einsum(x8, (0, 1, 2, 3), (0, 3, 2, 1)) - rdm2_f_oooo += einsum(x8, (0, 1, 2, 3), (3, 0, 2, 1)) * -1.0 - rdm2_f_oooo += einsum(x8, (0, 1, 2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_oooo += einsum(x8, (0, 1, 2, 3), (3, 0, 1, 2)) - rdm2_f_oooo += einsum(x8, (0, 1, 2, 3), (0, 3, 2, 1)) - rdm2_f_oooo += einsum(x8, (0, 1, 2, 3), (3, 0, 2, 1)) * -1.0 - del x8 - x9 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x9 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.3333333333333333 - x9 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x10 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x10 += einsum(x9, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (6, 5, 1, 4)) - x11 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x11 += einsum(t1, (0, 1), x10, (2, 3, 4, 1), (0, 3, 2, 4)) * 1.5 - rdm2_f_oooo += einsum(x11, (0, 1, 2, 3), (0, 3, 1, 2)) - rdm2_f_oooo += einsum(x11, (0, 1, 2, 3), (3, 0, 1, 2)) * -1.0 - rdm2_f_oooo += einsum(x11, (0, 1, 2, 3), (0, 3, 1, 2)) - rdm2_f_oooo += einsum(x11, (0, 1, 2, 3), (3, 0, 1, 2)) * -1.0 - del x11 - x12 = np.zeros((nocc, nocc), dtype=types[float]) - x12 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 5, 4, 1, 0, 2), (3, 6)) - x13 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x13 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x13 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * 6.999999999999999 - x13 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - x13 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - x14 = np.zeros((nocc, nocc), dtype=types[float]) - x14 += einsum(l3, (0, 1, 2, 3, 4, 5), x13, (3, 6, 4, 1, 2, 0), (5, 6)) * 0.041666666666665 - x15 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x15 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x15 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - x15 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * 3.0 - x16 = np.zeros((nocc, nocc), dtype=types[float]) - x16 += einsum(l3, (0, 1, 2, 3, 4, 5), x15, (5, 6, 3, 0, 2, 1), (4, 6)) * 0.041666666666665 - x17 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x17 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x17 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 2, 1)) - x18 = np.zeros((nocc, nocc), dtype=types[float]) - x18 += einsum(t3, (0, 1, 2, 3, 4, 5), x17, (1, 2, 6, 5, 4, 3), (0, 6)) * 0.041666666666665 - x19 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x19 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) - x19 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x20 = np.zeros((nocc, nocc), dtype=types[float]) - x20 += einsum(l2, (0, 1, 2, 3), x19, (3, 4, 0, 1), (2, 4)) - x21 = np.zeros((nocc, nocc), dtype=types[float]) - x21 += einsum(x12, (0, 1), (0, 1)) * 0.041666666666665 - x21 += einsum(x14, (0, 1), (0, 1)) - del x14 - x21 += einsum(x16, (0, 1), (0, 1)) - del x16 - x21 += einsum(x18, (0, 1), (1, 0)) * -1.0 - del x18 - x21 += einsum(x20, (0, 1), (0, 1)) - del x20 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (0, 3, 1, 2)) * -2.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (0, 3, 2, 1)) * 2.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (3, 0, 1, 2)) * 2.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (3, 0, 2, 1)) * -2.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (0, 3, 1, 2)) * -2.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (3, 0, 2, 1)) * -2.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (0, 3, 1, 2)) * -2.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (3, 0, 2, 1)) * -2.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (0, 3, 1, 2)) * -2.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (0, 3, 2, 1)) * 2.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (3, 0, 1, 2)) * 2.0 - rdm2_f_oooo += einsum(delta.oo, (0, 1), x21, (2, 3), (3, 0, 2, 1)) * -2.0 - x22 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x22 += einsum(l2, (0, 1, 2, 3), t2, (4, 5, 0, 1), (2, 3, 4, 5)) - rdm2_f_oooo += einsum(x22, (0, 1, 2, 3), (3, 2, 1, 0)) - rdm2_f_oooo += einsum(x22, (0, 1, 2, 3), (3, 2, 1, 0)) - x23 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x23 += einsum(t1, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - rdm2_f_ovoo += einsum(x23, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - rdm2_f_ovoo += einsum(x23, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - rdm2_f_vooo += einsum(x23, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - rdm2_f_vooo += einsum(x23, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - x24 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x24 += einsum(t1, (0, 1), x23, (2, 3, 4, 1), (2, 3, 0, 4)) - rdm2_f_oooo += einsum(x24, (0, 1, 2, 3), (3, 2, 1, 0)) - rdm2_f_oooo += einsum(x24, (0, 1, 2, 3), (3, 2, 1, 0)) - x25 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x25 += einsum(x22, (0, 1, 2, 3), (1, 0, 3, 2)) - x25 += einsum(x24, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oooo += einsum(x25, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - rdm2_f_oooo += einsum(x25, (0, 1, 2, 3), (2, 3, 0, 1)) - rdm2_f_oooo += einsum(x25, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - rdm2_f_oooo += einsum(x25, (0, 1, 2, 3), (2, 3, 0, 1)) - x26 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x26 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -0.3333333333333333 - x26 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * 0.3333333333333333 - x26 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) - x27 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x27 += einsum(l3, (0, 1, 2, 3, 4, 5), x26, (4, 6, 7, 1, 0, 2), (5, 3, 6, 7)) * 0.50000000000001 - del x26 - rdm2_f_oooo += einsum(x27, (0, 1, 2, 3), (3, 2, 1, 0)) - rdm2_f_oooo += einsum(x27, (0, 1, 2, 3), (3, 2, 1, 0)) - del x27 - x28 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x28 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 7, 5, 0, 1, 2), (3, 4, 6, 7)) - x29 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x29 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) - rdm2_f_ovoo += einsum(x29, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - rdm2_f_ovoo += einsum(x29, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - rdm2_f_vooo += einsum(x29, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - rdm2_f_vooo += einsum(x29, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - x30 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x30 += einsum(t1, (0, 1), x29, (2, 3, 4, 1), (2, 3, 0, 4)) - x31 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x31 += einsum(x28, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.50000000000001 - x31 += einsum(x30, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oooo += einsum(x31, (0, 1, 2, 3), (2, 3, 0, 1)) - rdm2_f_oooo += einsum(x31, (0, 1, 2, 3), (3, 2, 1, 0)) - rdm2_f_oooo += einsum(x31, (0, 1, 2, 3), (2, 3, 0, 1)) - rdm2_f_oooo += einsum(x31, (0, 1, 2, 3), (3, 2, 1, 0)) - x32 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x32 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x32 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x33 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x33 += einsum(x32, (0, 1, 2, 3), l3, (2, 4, 3, 5, 6, 0), (5, 6, 1, 4)) - x34 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x34 += einsum(t1, (0, 1), x33, (2, 3, 4, 1), (0, 2, 3, 4)) * -0.5 - rdm2_f_oooo += einsum(x34, (0, 1, 2, 3), (3, 0, 1, 2)) - rdm2_f_oooo += einsum(x34, (0, 1, 2, 3), (0, 3, 2, 1)) - rdm2_f_oooo += einsum(x34, (0, 1, 2, 3), (3, 0, 1, 2)) - rdm2_f_oooo += einsum(x34, (0, 1, 2, 3), (0, 3, 2, 1)) - x35 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x35 += einsum(t1, (0, 1), l3, (2, 1, 3, 4, 5, 6), (4, 6, 5, 0, 2, 3)) - x36 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x36 += einsum(t1, (0, 1), x35, (2, 3, 4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - x37 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x37 += einsum(t2, (0, 1, 2, 3), x36, (0, 4, 1, 5, 6, 2), (4, 5, 6, 3)) - rdm2_f_ooov = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - rdm2_f_ooov += einsum(x37, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_ooov += einsum(x37, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_ooov += einsum(x37, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_ooov += einsum(x37, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_oovo = np.zeros((nocc, nocc, nvir, nocc), dtype=types[float]) - rdm2_f_oovo += einsum(x37, (0, 1, 2, 3), (2, 1, 3, 0)) - rdm2_f_oovo += einsum(x37, (0, 1, 2, 3), (2, 1, 3, 0)) - rdm2_f_oovo += einsum(x37, (0, 1, 2, 3), (2, 1, 3, 0)) - rdm2_f_oovo += einsum(x37, (0, 1, 2, 3), (2, 1, 3, 0)) - x38 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x38 += einsum(l1, (0, 1), t2, (2, 3, 4, 0), (1, 2, 3, 4)) - rdm2_f_ooov += einsum(x38, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_ooov += einsum(x38, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_oovo += einsum(x38, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_oovo += einsum(x38, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - x39 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x39 += einsum(l2, (0, 1, 2, 3), t3, (4, 3, 5, 0, 6, 1), (2, 4, 5, 6)) - x40 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x40 += einsum(t3, (0, 1, 2, 3, 4, 5), x35, (0, 2, 6, 7, 3, 5), (6, 7, 1, 4)) - x41 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x41 += einsum(t2, (0, 1, 2, 3), x29, (1, 4, 5, 2), (4, 0, 5, 3)) - x42 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x42 += einsum(t1, (0, 1), l3, (2, 3, 1, 4, 5, 6), (4, 6, 5, 0, 2, 3)) - x43 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x43 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) * -1.0 - x43 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x43 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - x43 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * 5.0 - x43 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - x43 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - x44 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x44 += einsum(x42, (0, 1, 2, 3, 4, 5), x43, (2, 6, 0, 4, 7, 5), (1, 3, 6, 7)) * 0.25 - del x43 - x45 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x45 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x45 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - x45 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - x46 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x46 += einsum(x42, (0, 1, 2, 3, 4, 5), x45, (0, 6, 1, 5, 7, 4), (2, 3, 6, 7)) * 0.25 - x47 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x47 += einsum(t2, (0, 1, 2, 3), l3, (4, 5, 3, 1, 0, 6), (6, 4, 5, 2)) - x48 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x48 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x48 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 0, 2)) - x48 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 0, 2)) * 0.5 - x48 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) * -0.5 - x49 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x49 += einsum(t2, (0, 1, 2, 3), x48, (1, 4, 0, 5, 6, 2), (4, 3, 5, 6)) - del x48 - x50 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x50 += einsum(x47, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x50 += einsum(x49, (0, 1, 2, 3), (0, 3, 2, 1)) - del x49 - x51 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x51 += einsum(t2, (0, 1, 2, 3), x50, (4, 3, 2, 5), (0, 1, 4, 5)) * 0.5 - del x50 - x52 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x52 += einsum(t2, (0, 1, 2, 3), l3, (4, 3, 2, 5, 1, 6), (5, 6, 0, 4)) - x53 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x53 += einsum(t2, (0, 1, 2, 3), l3, (4, 3, 2, 5, 6, 1), (5, 6, 0, 4)) - x54 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x54 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - x54 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) - x55 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x55 += einsum(t2, (0, 1, 2, 3), x54, (1, 4, 5, 3, 6, 2), (0, 4, 5, 6)) - del x54 - x56 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x56 += einsum(x52, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - del x52 - x56 += einsum(x53, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x56 += einsum(x53, (0, 1, 2, 3), (1, 0, 2, 3)) - x56 += einsum(x55, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x55 - x57 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x57 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - x57 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x57 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x58 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x58 += einsum(x56, (0, 1, 2, 3), x57, (1, 4, 5, 3), (0, 2, 4, 5)) * 0.5 - del x57 - x59 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x59 += einsum(x6, (0, 1, 2, 3), l3, (2, 4, 3, 5, 6, 0), (5, 6, 1, 4)) - x60 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x60 += einsum(x29, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x60 += einsum(x59, (0, 1, 2, 3), (1, 0, 2, 3)) - x61 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x61 += einsum(t2, (0, 1, 2, 3), x60, (1, 4, 5, 3), (0, 4, 5, 2)) * 0.5 - del x60 - x62 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x62 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x62 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) - x63 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x63 += einsum(t2, (0, 1, 2, 3), x62, (1, 4, 5, 2), (0, 4, 5, 3)) - del x62 - x64 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x64 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x64 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.5 - x65 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x65 += einsum(t2, (0, 1, 2, 3), x64, (1, 4, 5, 3), (0, 4, 5, 2)) * 2.0 - del x64 - x66 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x66 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x66 += einsum(x29, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.5 - x67 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x67 += einsum(t1, (0, 1), x66, (2, 3, 4, 1), (0, 2, 3, 4)) - del x66 - x68 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x68 += einsum(x22, (0, 1, 2, 3), (1, 0, 3, 2)) - x68 += einsum(x67, (0, 1, 2, 3), (2, 1, 3, 0)) - del x67 - x69 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x69 += einsum(t1, (0, 1), x68, (0, 2, 3, 4), (2, 3, 4, 1)) - del x68 - x70 = np.zeros((nocc, nocc), dtype=types[float]) - x70 += einsum(l3, (0, 1, 2, 3, 4, 5), x13, (3, 6, 4, 1, 2, 0), (5, 6)) * 0.08333333333333 - del x13 - x71 = np.zeros((nocc, nocc), dtype=types[float]) - x71 += einsum(l3, (0, 1, 2, 3, 4, 5), x15, (5, 6, 3, 0, 2, 1), (4, 6)) * 0.08333333333333 - del x15 - x72 = np.zeros((nocc, nocc), dtype=types[float]) - x72 += einsum(t3, (0, 1, 2, 3, 4, 5), x17, (1, 2, 6, 5, 4, 3), (0, 6)) * 0.08333333333333 - del x17 - x73 = np.zeros((nocc, nocc), dtype=types[float]) - x73 += einsum(l2, (0, 1, 2, 3), x19, (3, 4, 0, 1), (2, 4)) * 2.0 - x74 = np.zeros((nocc, nocc), dtype=types[float]) - x74 += einsum(x1, (0, 1), (0, 1)) - x74 += einsum(x12, (0, 1), (0, 1)) * 0.08333333333333 - x74 += einsum(x70, (0, 1), (0, 1)) - x74 += einsum(x71, (0, 1), (0, 1)) - x74 += einsum(x72, (0, 1), (1, 0)) * -1.0 - x74 += einsum(x73, (0, 1), (0, 1)) - rdm2_f_ooov += einsum(t1, (0, 1), x74, (2, 3), (3, 0, 2, 1)) * -1.0 - rdm2_f_ooov += einsum(t1, (0, 1), x74, (2, 3), (3, 0, 2, 1)) * -1.0 - rdm2_f_oovo += einsum(t1, (0, 1), x74, (2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_oovo += einsum(t1, (0, 1), x74, (2, 3), (0, 3, 1, 2)) * -1.0 - x75 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x75 += einsum(delta.oo, (0, 1), t1, (2, 3), (0, 1, 2, 3)) - x75 += einsum(x38, (0, 1, 2, 3), (1, 0, 2, 3)) - x75 += einsum(x39, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - x75 += einsum(x40, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.25 - x75 += einsum(x41, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.5 - x75 += einsum(x44, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x75 += einsum(x46, (0, 1, 2, 3), (1, 0, 2, 3)) - x75 += einsum(x51, (0, 1, 2, 3), (1, 2, 0, 3)) - x75 += einsum(x58, (0, 1, 2, 3), (2, 0, 1, 3)) - del x58 - x75 += einsum(x61, (0, 1, 2, 3), (0, 1, 2, 3)) - x75 += einsum(x63, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x63 - x75 += einsum(x65, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x65 - x75 += einsum(x69, (0, 1, 2, 3), (2, 0, 1, 3)) - del x69 - x75 += einsum(t1, (0, 1), x74, (2, 3), (0, 2, 3, 1)) - rdm2_f_ooov += einsum(x75, (0, 1, 2, 3), (0, 2, 1, 3)) - rdm2_f_ooov += einsum(x75, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_ooov += einsum(x75, (0, 1, 2, 3), (0, 2, 1, 3)) - rdm2_f_ooov += einsum(x75, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_oovo += einsum(x75, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_oovo += einsum(x75, (0, 1, 2, 3), (2, 0, 3, 1)) - rdm2_f_oovo += einsum(x75, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_oovo += einsum(x75, (0, 1, 2, 3), (2, 0, 3, 1)) - del x75 - x76 = np.zeros((nocc, nvir), dtype=types[float]) - x76 += einsum(t3, (0, 1, 2, 3, 4, 5), x35, (2, 0, 1, 6, 5, 3), (6, 4)) - x77 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x77 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x77 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - x77 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * 6.999999999999999 - x77 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -1.0 - x77 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) - x77 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) * -1.0 - x78 = np.zeros((nocc, nvir), dtype=types[float]) - x78 += einsum(x42, (0, 1, 2, 3, 4, 5), x77, (0, 1, 2, 5, 4, 6), (3, 6)) * 0.08333333333333 - x79 = np.zeros((nocc, nvir), dtype=types[float]) - x79 += einsum(x42, (0, 1, 2, 3, 4, 5), x45, (2, 0, 1, 6, 5, 4), (3, 6)) * 0.08333333333333 - x80 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x80 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - x80 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x80 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - x80 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * 6.0 - x81 = np.zeros((nocc, nvir), dtype=types[float]) - x81 += einsum(l2, (0, 1, 2, 3), x80, (2, 3, 4, 1, 0, 5), (4, 5)) * 0.25 - x82 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x82 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) * 0.5 - x82 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x83 = np.zeros((nocc, nvir), dtype=types[float]) - x83 += einsum(l2, (0, 1, 2, 3), x82, (3, 4, 2, 0, 5, 1), (4, 5)) * 0.5 - x84 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x84 += einsum(x9, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (6, 5, 1, 4)) * 0.375 - x85 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x85 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x85 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 1, 2)) * -1.0 - x86 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x86 += einsum(x6, (0, 1, 2, 3), x85, (0, 4, 5, 3, 2, 6), (1, 4, 5, 6)) * 0.25 - del x85 - x87 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x87 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x87 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) - x87 += einsum(x84, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x87 += einsum(x84, (0, 1, 2, 3), (0, 1, 2, 3)) - del x84 - x87 += einsum(x86, (0, 1, 2, 3), (1, 2, 0, 3)) - x88 = np.zeros((nocc, nvir), dtype=types[float]) - x88 += einsum(t2, (0, 1, 2, 3), x87, (0, 1, 4, 3), (4, 2)) * 2.0 - x89 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x89 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) - x89 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.3333333333333333 - x90 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x90 += einsum(x89, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 0), (5, 6, 1, 4)) * 3.0 - x91 = np.zeros((nocc, nvir), dtype=types[float]) - x91 += einsum(t2, (0, 1, 2, 3), x90, (0, 1, 4, 2), (4, 3)) * 0.5 - x92 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x92 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - x92 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x93 = np.zeros((nocc, nvir), dtype=types[float]) - x93 += einsum(l1, (0, 1), x92, (1, 2, 3, 0), (2, 3)) - x94 = np.zeros((nocc, nvir), dtype=types[float]) - x94 += einsum(t1, (0, 1), x74, (0, 2), (2, 1)) - x95 = np.zeros((nocc, nvir), dtype=types[float]) - x95 += einsum(x76, (0, 1), (0, 1)) * 0.24999999999999 - x95 += einsum(x78, (0, 1), (0, 1)) - x95 += einsum(x79, (0, 1), (0, 1)) * -1.0 - x95 += einsum(x81, (0, 1), (0, 1)) * -1.0 - x95 += einsum(x83, (0, 1), (0, 1)) - x95 += einsum(x88, (0, 1), (0, 1)) - x95 += einsum(x91, (0, 1), (0, 1)) - x95 += einsum(x93, (0, 1), (0, 1)) * -1.0 - x95 += einsum(x94, (0, 1), (0, 1)) - rdm2_f_ooov += einsum(delta.oo, (0, 1), x95, (2, 3), (0, 2, 1, 3)) * -1.0 - rdm2_f_ooov += einsum(delta.oo, (0, 1), x95, (2, 3), (2, 0, 1, 3)) - rdm2_f_ooov += einsum(delta.oo, (0, 1), x95, (2, 3), (0, 2, 1, 3)) * -1.0 - rdm2_f_ooov += einsum(delta.oo, (0, 1), x95, (2, 3), (2, 0, 1, 3)) - rdm2_f_oovo += einsum(delta.oo, (0, 1), x95, (2, 3), (0, 2, 3, 1)) - rdm2_f_oovo += einsum(delta.oo, (0, 1), x95, (2, 3), (2, 0, 3, 1)) * -1.0 - rdm2_f_oovo += einsum(delta.oo, (0, 1), x95, (2, 3), (0, 2, 3, 1)) - rdm2_f_oovo += einsum(delta.oo, (0, 1), x95, (2, 3), (2, 0, 3, 1)) * -1.0 - del x95 - x96 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x96 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) * -0.5 - x96 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) - x97 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x97 += einsum(x96, (0, 1, 2, 3), t3, (4, 0, 5, 3, 2, 6), (4, 5, 1, 6)) * 2.0 - rdm2_f_ooov += einsum(x97, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_ooov += einsum(x97, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_oovo += einsum(x97, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - rdm2_f_oovo += einsum(x97, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x97 - x98 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x98 += einsum(t1, (0, 1), x42, (2, 3, 4, 5, 1, 6), (3, 2, 4, 5, 0, 6)) - x99 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x99 += einsum(x98, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 2.0 - x99 += einsum(x36, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 2.0 - x99 += einsum(x36, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - x99 += einsum(x36, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) - x100 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x100 += einsum(t2, (0, 1, 2, 3), x99, (1, 4, 0, 5, 6, 2), (4, 5, 6, 3)) * 0.5 - del x99 - rdm2_f_ooov += einsum(x100, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_ooov += einsum(x100, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_oovo += einsum(x100, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - rdm2_f_oovo += einsum(x100, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - del x100 - x101 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x101 += einsum(l3, (0, 1, 2, 3, 4, 5), x3, (5, 6, 7, 1, 0, 2), (3, 4, 6, 7)) - x102 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x102 += einsum(x2, (0, 1, 2, 3), (0, 1, 2, 3)) - del x2 - x102 += einsum(x101, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x101 - x103 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x103 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -0.3333333333333333 - x103 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - x104 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x104 += einsum(l3, (0, 1, 2, 3, 4, 5), x103, (4, 6, 7, 0, 1, 2), (3, 5, 6, 7)) * 3.0 - del x103 - x105 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x105 += einsum(l3, (0, 1, 2, 3, 4, 5), x3, (4, 6, 7, 1, 0, 2), (5, 3, 6, 7)) - x106 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x106 += einsum(x102, (0, 1, 2, 3), (0, 1, 2, 3)) - x106 += einsum(x102, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x106 += einsum(x104, (0, 1, 2, 3), (1, 0, 2, 3)) - x106 += einsum(x105, (0, 1, 2, 3), (1, 0, 2, 3)) - del x105 - x107 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x107 += einsum(t1, (0, 1), x106, (2, 0, 3, 4), (2, 3, 4, 1)) * 0.16666666666667 - del x106 - rdm2_f_ooov += einsum(x107, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_ooov += einsum(x107, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_oovo += einsum(x107, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - rdm2_f_oovo += einsum(x107, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - del x107 - x108 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x108 += einsum(l2, (0, 1, 2, 3), t3, (4, 5, 3, 6, 0, 1), (2, 4, 5, 6)) - rdm2_f_ooov += einsum(x108, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_ooov += einsum(x108, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_oovo += einsum(x108, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_oovo += einsum(x108, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - x109 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x109 += einsum(t3, (0, 1, 2, 3, 4, 5), x42, (0, 2, 6, 7, 3, 4), (6, 7, 1, 5)) - rdm2_f_ooov += einsum(x109, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.5 - rdm2_f_ooov += einsum(x109, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.5 - rdm2_f_oovo += einsum(x109, (0, 1, 2, 3), (1, 2, 3, 0)) * 0.5 - rdm2_f_oovo += einsum(x109, (0, 1, 2, 3), (1, 2, 3, 0)) * 0.5 - x110 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x110 += einsum(t3, (0, 1, 2, 3, 4, 5), x35, (2, 6, 1, 7, 5, 3), (6, 7, 0, 4)) - rdm2_f_ooov += einsum(x110, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.5 - rdm2_f_ooov += einsum(x110, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.5 - rdm2_f_oovo += einsum(x110, (0, 1, 2, 3), (1, 2, 3, 0)) * 0.5 - rdm2_f_oovo += einsum(x110, (0, 1, 2, 3), (1, 2, 3, 0)) * 0.5 - x111 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x111 += einsum(t3, (0, 1, 2, 3, 4, 5), x42, (0, 2, 6, 7, 5, 3), (6, 7, 1, 4)) - rdm2_f_ooov += einsum(x111, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.25 - rdm2_f_ooov += einsum(x111, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.25 - rdm2_f_oovo += einsum(x111, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.25 - rdm2_f_oovo += einsum(x111, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.25 - x112 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x112 += einsum(t3, (0, 1, 2, 3, 4, 5), x35, (2, 1, 6, 7, 5, 4), (6, 7, 0, 3)) - rdm2_f_ooov += einsum(x112, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.25 - rdm2_f_ooov += einsum(x112, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.25 - del x112 - x113 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x113 += einsum(t2, (0, 1, 2, 3), x47, (4, 2, 3, 5), (4, 0, 1, 5)) - rdm2_f_ooov += einsum(x113, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_ooov += einsum(x113, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_oovo += einsum(x113, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - rdm2_f_oovo += einsum(x113, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x114 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x114 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - x114 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x114 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * 4.0 - x115 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x115 += einsum(x114, (0, 1, 2, 3, 4, 5), x42, (1, 6, 0, 7, 3, 4), (6, 7, 2, 5)) * 0.25 - del x114 - rdm2_f_ooov += einsum(x115, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_ooov += einsum(x115, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x115 - x116 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x116 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - x116 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x117 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x117 += einsum(x116, (0, 1, 2, 3, 4, 5), x35, (2, 0, 6, 7, 3, 5), (6, 7, 1, 4)) * 0.25 - del x116 - rdm2_f_ooov += einsum(x117, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_ooov += einsum(x117, (0, 1, 2, 3), (1, 2, 0, 3)) - del x117 - x118 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x118 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - x118 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x119 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x119 += einsum(l2, (0, 1, 2, 3), x118, (3, 4, 5, 0, 1, 6), (2, 4, 5, 6)) * 0.5 - del x118 - rdm2_f_ooov += einsum(x119, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_ooov += einsum(x119, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x119 - x120 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x120 += einsum(x36, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - x120 += einsum(x36, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - x121 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x121 += einsum(t2, (0, 1, 2, 3), x120, (1, 0, 4, 5, 6, 2), (4, 5, 6, 3)) * 0.5 - rdm2_f_ooov += einsum(x121, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_ooov += einsum(x121, (0, 1, 2, 3), (2, 1, 0, 3)) - del x121 - x122 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x122 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x122 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x123 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x123 += einsum(x122, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (6, 5, 1, 4)) * 0.5 - rdm2_f_vooo += einsum(x123, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - rdm2_f_vooo += einsum(x123, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - x124 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x124 += einsum(x32, (0, 1, 2, 3), l3, (2, 4, 3, 5, 6, 0), (5, 6, 1, 4)) * 0.5 - x125 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x125 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x125 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - x125 += einsum(x53, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x125 += einsum(x53, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.5 - x125 += einsum(x29, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x125 += einsum(x29, (0, 1, 2, 3), (1, 0, 2, 3)) * 1.5 - x125 += einsum(x123, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x125 += einsum(x124, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x126 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x126 += einsum(t2, (0, 1, 2, 3), x125, (4, 1, 5, 3), (0, 4, 5, 2)) - del x125 - rdm2_f_ooov += einsum(x126, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_ooov += einsum(x126, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_oovo += einsum(x126, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_oovo += einsum(x126, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - del x126 - x127 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x127 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 2, 1)) * -1.0 - x127 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x128 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x128 += einsum(t2, (0, 1, 2, 3), x127, (0, 1, 4, 5, 2, 6), (4, 3, 5, 6)) - x129 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x129 += einsum(t2, (0, 1, 2, 3), x128, (4, 5, 2, 3), (0, 1, 4, 5)) * -0.5 - rdm2_f_ooov += einsum(x129, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_ooov += einsum(x129, (0, 1, 2, 3), (1, 0, 2, 3)) - del x129 - x130 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x130 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x130 += einsum(x29, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x130 += einsum(x59, (0, 1, 2, 3), (1, 0, 2, 3)) - x131 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x131 += einsum(t2, (0, 1, 2, 3), x130, (1, 4, 5, 2), (0, 4, 5, 3)) * 0.5 - rdm2_f_ooov += einsum(x131, (0, 1, 2, 3), (2, 0, 1, 3)) - rdm2_f_ooov += einsum(x131, (0, 1, 2, 3), (2, 0, 1, 3)) - del x131 - x132 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x132 += einsum(t2, (0, 1, 2, 3), l3, (2, 4, 3, 1, 5, 6), (6, 5, 0, 4)) - x133 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x133 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x133 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) * -0.5 - x134 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x134 += einsum(t2, (0, 1, 2, 3), x133, (1, 4, 5, 6, 3, 2), (0, 4, 5, 6)) - x135 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x135 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x135 += einsum(x132, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - x135 += einsum(x134, (0, 1, 2, 3), (1, 2, 0, 3)) - del x134 - x136 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x136 += einsum(t2, (0, 1, 2, 3), x135, (4, 1, 5, 2), (0, 4, 5, 3)) - del x135 - rdm2_f_ooov += einsum(x136, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - rdm2_f_ooov += einsum(x136, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - rdm2_f_oovo += einsum(x136, (0, 1, 2, 3), (2, 0, 3, 1)) * -1.0 - rdm2_f_oovo += einsum(x136, (0, 1, 2, 3), (2, 0, 3, 1)) * -1.0 - del x136 - x137 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x137 += einsum(x22, (0, 1, 2, 3), (1, 0, 3, 2)) - x137 += einsum(x24, (0, 1, 2, 3), (0, 1, 2, 3)) - x137 += einsum(x31, (0, 1, 2, 3), (0, 1, 2, 3)) - x137 += einsum(x31, (0, 1, 2, 3), (1, 0, 3, 2)) - del x31 - x137 += einsum(x34, (0, 1, 2, 3), (1, 2, 3, 0)) - x137 += einsum(x34, (0, 1, 2, 3), (2, 1, 0, 3)) - del x34 - x138 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x138 += einsum(t1, (0, 1), x137, (0, 2, 3, 4), (2, 3, 4, 1)) - del x137 - rdm2_f_ooov += einsum(x138, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_ooov += einsum(x138, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_oovo += einsum(x138, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_oovo += einsum(x138, (0, 1, 2, 3), (1, 2, 3, 0)) - del x138 - x139 = np.zeros((nocc, nvir), dtype=types[float]) - x139 += einsum(t1, (0, 1), (0, 1)) * -1.0 - x139 += einsum(x76, (0, 1), (0, 1)) * 0.24999999999999 - x139 += einsum(x78, (0, 1), (0, 1)) - del x78 - x139 += einsum(x79, (0, 1), (0, 1)) * -1.0 - del x79 - x139 += einsum(x81, (0, 1), (0, 1)) * -1.0 - del x81 - x139 += einsum(x83, (0, 1), (0, 1)) - del x83 - x139 += einsum(x88, (0, 1), (0, 1)) - del x88 - x139 += einsum(x91, (0, 1), (0, 1)) - del x91 - x139 += einsum(x93, (0, 1), (0, 1)) * -1.0 - del x93 - x139 += einsum(x94, (0, 1), (0, 1)) - del x94 - rdm2_f_ooov += einsum(delta.oo, (0, 1), x139, (2, 3), (0, 2, 1, 3)) * -1.0 - rdm2_f_ooov += einsum(delta.oo, (0, 1), x139, (2, 3), (0, 2, 1, 3)) * -1.0 - del x139 - x140 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x140 += einsum(t3, (0, 1, 2, 3, 4, 5), x35, (2, 1, 6, 7, 5, 3), (6, 7, 0, 4)) - rdm2_f_oovo += einsum(x140, (0, 1, 2, 3), (2, 1, 3, 0)) * 0.25 - rdm2_f_oovo += einsum(x140, (0, 1, 2, 3), (2, 1, 3, 0)) * 0.25 - x141 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x141 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -1.0 - x141 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x141 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 4.0 - x142 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x142 += einsum(x141, (0, 1, 2, 3, 4, 5), x42, (1, 6, 0, 7, 4, 3), (6, 7, 2, 5)) * 0.25 - del x141 - rdm2_f_oovo += einsum(x142, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - rdm2_f_oovo += einsum(x142, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - del x142 - x143 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x143 += einsum(x35, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x143 += einsum(x35, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - x144 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x144 += einsum(t3, (0, 1, 2, 3, 4, 5), x143, (1, 2, 6, 7, 4, 5), (0, 6, 7, 3)) * 0.25 - rdm2_f_oovo += einsum(x144, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_oovo += einsum(x144, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - del x144 - x145 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x145 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -1.0 - x145 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x146 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x146 += einsum(l2, (0, 1, 2, 3), x145, (2, 4, 5, 0, 1, 6), (3, 4, 5, 6)) * 0.5 - rdm2_f_oovo += einsum(x146, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - rdm2_f_oovo += einsum(x146, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - del x146 - x147 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x147 += einsum(x36, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x147 += einsum(x36, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - x148 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x148 += einsum(t2, (0, 1, 2, 3), x147, (1, 0, 4, 5, 6, 2), (4, 5, 6, 3)) * 0.5 - del x147 - rdm2_f_oovo += einsum(x148, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_oovo += einsum(x148, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - del x148 - x149 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x149 += einsum(t2, (0, 1, 2, 3), x128, (4, 5, 3, 2), (0, 1, 4, 5)) * -0.5 - rdm2_f_oovo += einsum(x149, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_oovo += einsum(x149, (0, 1, 2, 3), (1, 0, 3, 2)) - x150 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x150 += einsum(x6, (0, 1, 2, 3), l3, (2, 4, 3, 5, 6, 0), (5, 6, 1, 4)) * 0.5 - rdm2_f_ovoo += einsum(x150, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - rdm2_f_ovoo += einsum(x150, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - rdm2_f_vooo += einsum(x150, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - rdm2_f_vooo += einsum(x150, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - x151 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x151 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x151 += einsum(x29, (0, 1, 2, 3), (0, 1, 2, 3)) - x151 += einsum(x150, (0, 1, 2, 3), (1, 0, 2, 3)) - del x150 - x152 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x152 += einsum(t2, (0, 1, 2, 3), x151, (1, 4, 5, 2), (0, 4, 5, 3)) - rdm2_f_oovo += einsum(x152, (0, 1, 2, 3), (0, 2, 3, 1)) - rdm2_f_oovo += einsum(x152, (0, 1, 2, 3), (0, 2, 3, 1)) - del x152 - x153 = np.zeros((nocc, nvir), dtype=types[float]) - x153 += einsum(x42, (0, 1, 2, 3, 4, 5), x77, (0, 1, 2, 5, 4, 6), (3, 6)) - x154 = np.zeros((nocc, nvir), dtype=types[float]) - x154 += einsum(x42, (0, 1, 2, 3, 4, 5), x45, (2, 0, 1, 6, 5, 4), (3, 6)) - x155 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x155 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - x155 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x155 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - x155 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * 6.000000000000001 - x156 = np.zeros((nocc, nvir), dtype=types[float]) - x156 += einsum(l2, (0, 1, 2, 3), x155, (2, 3, 4, 1, 0, 5), (4, 5)) * 3.00000000000012 - del x155 - x157 = np.zeros((nocc, nvir), dtype=types[float]) - x157 += einsum(l2, (0, 1, 2, 3), x82, (3, 4, 2, 0, 5, 1), (4, 5)) * 6.00000000000024 - x158 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x158 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.33333333333333326 - x158 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x159 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x159 += einsum(x158, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (6, 5, 1, 4)) * 0.37500000000000006 - del x158 - x160 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x160 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x160 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) - x160 += einsum(x159, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x160 += einsum(x159, (0, 1, 2, 3), (0, 1, 2, 3)) - del x159 - x160 += einsum(x86, (0, 1, 2, 3), (1, 2, 0, 3)) - del x86 - x161 = np.zeros((nocc, nvir), dtype=types[float]) - x161 += einsum(t2, (0, 1, 2, 3), x160, (1, 0, 4, 2), (4, 3)) * 24.00000000000096 - del x160 - x162 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x162 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) - x162 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.33333333333333326 - x163 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x163 += einsum(x162, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 0), (5, 6, 1, 4)) * 3.0000000000000004 - del x162 - x164 = np.zeros((nocc, nvir), dtype=types[float]) - x164 += einsum(t2, (0, 1, 2, 3), x163, (0, 1, 4, 2), (4, 3)) * 6.00000000000024 - del x163 - x165 = np.zeros((nocc, nvir), dtype=types[float]) - x165 += einsum(l1, (0, 1), x92, (1, 2, 3, 0), (2, 3)) * 12.00000000000048 - x166 = np.zeros((nocc, nvir), dtype=types[float]) - x166 += einsum(t1, (0, 1), x74, (0, 2), (2, 1)) * 12.00000000000048 - x167 = np.zeros((nocc, nvir), dtype=types[float]) - x167 += einsum(t1, (0, 1), (0, 1)) * -12.00000000000048 - x167 += einsum(x76, (0, 1), (0, 1)) * 3.0 - x167 += einsum(x153, (0, 1), (0, 1)) - del x153 - x167 += einsum(x154, (0, 1), (0, 1)) * -1.0 - del x154 - x167 += einsum(x156, (0, 1), (0, 1)) * -1.0 - del x156 - x167 += einsum(x157, (0, 1), (0, 1)) - del x157 - x167 += einsum(x161, (0, 1), (0, 1)) - del x161 - x167 += einsum(x164, (0, 1), (0, 1)) - del x164 - x167 += einsum(x165, (0, 1), (0, 1)) * -1.0 - del x165 - x167 += einsum(x166, (0, 1), (0, 1)) - del x166 - rdm2_f_oovo += einsum(delta.oo, (0, 1), x167, (2, 3), (2, 0, 3, 1)) * -0.08333333333333 - rdm2_f_oovo += einsum(delta.oo, (0, 1), x167, (2, 3), (2, 0, 3, 1)) * -0.08333333333333 - del x167 - x168 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x168 += einsum(x32, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 0), (5, 6, 1, 4)) * 0.5 - x169 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x169 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x169 += einsum(x168, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_ovoo += einsum(x169, (0, 1, 2, 3), (2, 3, 0, 1)) - rdm2_f_ovoo += einsum(x169, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - rdm2_f_ovoo += einsum(x169, (0, 1, 2, 3), (2, 3, 0, 1)) - rdm2_f_ovoo += einsum(x169, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - rdm2_f_vooo += einsum(x169, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - rdm2_f_vooo += einsum(x169, (0, 1, 2, 3), (3, 2, 1, 0)) - rdm2_f_vooo += einsum(x169, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - rdm2_f_vooo += einsum(x169, (0, 1, 2, 3), (3, 2, 1, 0)) - del x169 - x170 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x170 += einsum(x9, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (6, 5, 1, 4)) * 1.5 - rdm2_f_ovoo += einsum(x170, (0, 1, 2, 3), (2, 3, 1, 0)) - rdm2_f_ovoo += einsum(x170, (0, 1, 2, 3), (2, 3, 1, 0)) - del x170 - x171 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x171 += einsum(t3, (0, 1, 2, 3, 4, 5), x36, (1, 0, 2, 6, 7, 4), (6, 7, 3, 5)) - rdm2_f_oovv += einsum(x171, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.16666666666667 - rdm2_f_oovv += einsum(x171, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.16666666666667 - del x171 - x172 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x172 += einsum(t3, (0, 1, 2, 3, 4, 5), x36, (0, 1, 2, 6, 7, 4), (6, 7, 3, 5)) - rdm2_f_oovv += einsum(x172, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.16666666666667 - rdm2_f_oovv += einsum(x172, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.16666666666667 - del x172 - x173 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x173 += einsum(x1, (0, 1), t2, (2, 0, 3, 4), (1, 2, 3, 4)) - x174 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x174 += einsum(t2, (0, 1, 2, 3), l3, (4, 3, 2, 5, 6, 7), (5, 7, 6, 0, 1, 4)) - x175 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x175 += einsum(t3, (0, 1, 2, 3, 4, 5), x174, (0, 1, 2, 6, 7, 3), (6, 7, 5, 4)) - x176 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x176 += einsum(t2, (0, 1, 2, 3), x35, (4, 1, 0, 5, 6, 3), (4, 5, 6, 2)) - rdm2_f_ovvo += einsum(x176, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_ovvo += einsum(x176, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_voov += einsum(x176, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_voov += einsum(x176, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - x177 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x177 += einsum(t2, (0, 1, 2, 3), x176, (1, 4, 3, 5), (4, 0, 2, 5)) - x178 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x178 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x178 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - x179 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x179 += einsum(x174, (0, 1, 2, 3, 4, 5), x178, (1, 2, 0, 6, 5, 7), (3, 4, 6, 7)) * 0.08333333333333 - x180 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x180 += einsum(x122, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (5, 6, 1, 4)) * 0.5 - del x122 - x181 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x181 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x181 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) - x181 += einsum(x168, (0, 1, 2, 3), (0, 1, 2, 3)) - x181 += einsum(x180, (0, 1, 2, 3), (1, 0, 2, 3)) - del x180 - x182 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x182 += einsum(x181, (0, 1, 2, 3), t3, (4, 0, 1, 5, 6, 3), (4, 2, 5, 6)) * 0.5 - del x181 - x183 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x183 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (5, 6, 3, 1, 7, 2), (4, 6, 0, 7)) - x184 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x184 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 3, 5, 7, 2, 1), (4, 6, 0, 7)) - rdm2_f_vovo += einsum(x184, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.25 - rdm2_f_vovo += einsum(x184, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.25 - x185 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x185 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) * 0.2 - x185 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x185 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -0.2 - x185 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -0.2 - x185 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.2 - x185 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -0.2 - x185 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -0.2 - x185 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - x186 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x186 += einsum(l3, (0, 1, 2, 3, 4, 5), x185, (5, 6, 4, 2, 7, 1), (3, 6, 0, 7)) * 1.25 - del x185 - x187 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x187 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x187 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 0, 2)) - x188 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x188 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x188 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - x189 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x189 += einsum(x187, (0, 1, 2, 3, 4, 5), x188, (1, 6, 0, 5, 4, 7), (2, 6, 3, 7)) * 0.25 - del x187 - x190 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x190 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x190 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - x191 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x191 += einsum(l3, (0, 1, 2, 3, 4, 5), x190, (3, 5, 6, 0, 2, 7), (4, 6, 1, 7)) * 0.25 - del x190 - x192 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x192 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - x192 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) * 2.0 - x193 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x193 += einsum(t2, (0, 1, 2, 3), x192, (1, 4, 2, 5), (0, 4, 3, 5)) - x194 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x194 += einsum(x183, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - x194 += einsum(x184, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - del x184 - x194 += einsum(x186, (0, 1, 2, 3), (0, 1, 2, 3)) - del x186 - x194 += einsum(x189, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x189 - x194 += einsum(x191, (0, 1, 2, 3), (0, 1, 2, 3)) - del x191 - x194 += einsum(x193, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x193 - x195 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x195 += einsum(t2, (0, 1, 2, 3), x194, (1, 4, 3, 5), (0, 4, 2, 5)) - del x194 - x196 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x196 += einsum(x7, (0, 1, 2, 3), t3, (4, 1, 0, 5, 6, 3), (4, 2, 5, 6)) * -0.25 - x197 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x197 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 6, 5, 0, 7, 2), (4, 6, 1, 7)) - rdm2_f_ovov += einsum(x197, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.25 - rdm2_f_ovov += einsum(x197, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.25 - rdm2_f_ovvo += einsum(x197, (0, 1, 2, 3), (1, 2, 3, 0)) * 0.25 - rdm2_f_ovvo += einsum(x197, (0, 1, 2, 3), (1, 2, 3, 0)) * 0.25 - rdm2_f_voov += einsum(x197, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.25 - rdm2_f_voov += einsum(x197, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.25 - rdm2_f_vovo += einsum(x197, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.25 - rdm2_f_vovo += einsum(x197, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.25 - x198 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x198 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - x198 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 5.0 - x198 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - x198 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -1.0 - x198 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - x198 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - x199 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x199 += einsum(l3, (0, 1, 2, 3, 4, 5), x198, (5, 6, 4, 2, 7, 1), (3, 6, 0, 7)) - x200 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x200 += einsum(l3, (0, 1, 2, 3, 4, 5), x45, (5, 6, 3, 1, 7, 2), (4, 6, 0, 7)) - x201 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x201 += einsum(x197, (0, 1, 2, 3), (0, 1, 2, 3)) - x201 += einsum(x199, (0, 1, 2, 3), (0, 1, 2, 3)) - del x199 - x201 += einsum(x200, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x200 - x202 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x202 += einsum(t2, (0, 1, 2, 3), x201, (1, 4, 2, 5), (0, 4, 3, 5)) * 0.25 - del x201 - x203 = np.zeros((nvir, nvir), dtype=types[float]) - x203 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 4, 5, 0, 6, 2), (1, 6)) - x204 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x204 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x204 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - x204 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - x204 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -1.0 - x204 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) - x204 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * 6.999999999999999 - x205 = np.zeros((nvir, nvir), dtype=types[float]) - x205 += einsum(l3, (0, 1, 2, 3, 4, 5), x204, (4, 3, 5, 1, 6, 2), (0, 6)) * 0.08333333333333 - x206 = np.zeros((nvir, nvir), dtype=types[float]) - x206 += einsum(l3, (0, 1, 2, 3, 4, 5), x45, (4, 5, 3, 6, 1, 2), (0, 6)) * 0.08333333333333 - x207 = np.zeros((nvir, nvir), dtype=types[float]) - x207 += einsum(t2, (0, 1, 2, 3), x96, (0, 1, 2, 4), (3, 4)) * 2.0 - x208 = np.zeros((nvir, nvir), dtype=types[float]) - x208 += einsum(x203, (0, 1), (0, 1)) * 0.24999999999999 - x208 += einsum(x205, (0, 1), (0, 1)) - x208 += einsum(x206, (0, 1), (0, 1)) * -1.0 - x208 += einsum(x207, (0, 1), (1, 0)) - x209 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x209 += einsum(x208, (0, 1), t2, (2, 3, 0, 4), (2, 3, 4, 1)) - del x208 - x210 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x210 += einsum(t1, (0, 1), x56, (0, 2, 3, 4), (2, 3, 1, 4)) - del x56 - x211 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x211 += einsum(x210, (0, 1, 2, 3), x32, (0, 4, 5, 3), (4, 1, 5, 2)) * 0.5 - del x210 - x212 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x212 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x212 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x213 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x213 += einsum(t2, (0, 1, 2, 3), x212, (4, 1, 5, 2), (0, 4, 5, 3)) - del x212 - x214 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x214 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x214 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) - x215 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x215 += einsum(t2, (0, 1, 2, 3), x214, (4, 1, 5, 3), (0, 4, 5, 2)) * 2.0 - del x214 - x216 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x216 += einsum(t1, (0, 1), x7, (2, 3, 4, 1), (0, 2, 3, 4)) * -1.0 - x217 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x217 += einsum(t1, (0, 1), x216, (2, 3, 0, 4), (3, 2, 4, 1)) * 0.5 - del x216 - x218 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x218 += einsum(x38, (0, 1, 2, 3), (0, 1, 2, 3)) - x218 += einsum(x39, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x39 - x218 += einsum(x40, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.25 - del x40 - x218 += einsum(x41, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x41 - x218 += einsum(x44, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x44 - x218 += einsum(x46, (0, 1, 2, 3), (0, 1, 2, 3)) - del x46 - x218 += einsum(x51, (0, 1, 2, 3), (2, 1, 0, 3)) - del x51 - x218 += einsum(x61, (0, 1, 2, 3), (1, 0, 2, 3)) - del x61 - x218 += einsum(x213, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x213 - x218 += einsum(x215, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x215 - x218 += einsum(x217, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x217 - x219 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x219 += einsum(t1, (0, 1), x218, (0, 2, 3, 4), (2, 3, 1, 4)) - del x218 - x220 = np.zeros((nocc, nocc), dtype=types[float]) - x220 += einsum(x12, (0, 1), (0, 1)) * 0.08333333333333 - del x12 - x220 += einsum(x70, (0, 1), (0, 1)) - del x70 - x220 += einsum(x71, (0, 1), (0, 1)) - del x71 - x220 += einsum(x72, (0, 1), (1, 0)) * -1.0 - del x72 - x220 += einsum(x73, (0, 1), (0, 1)) - del x73 - x221 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x221 += einsum(x220, (0, 1), t2, (2, 0, 3, 4), (2, 1, 4, 3)) - del x220 - x222 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x222 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - x222 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 1, 2)) - x223 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x223 += einsum(t2, (0, 1, 2, 3), x222, (1, 4, 5, 6, 2, 3), (4, 5, 0, 6)) - x224 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x224 += einsum(t1, (0, 1), x223, (2, 3, 4, 1), (2, 3, 4, 0)) * -1.0 - del x223 - x225 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x225 += einsum(t2, (0, 1, 2, 3), x224, (0, 1, 4, 5), (5, 4, 3, 2)) * 0.5 - del x224 - x226 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x226 += einsum(t1, (0, 1), x10, (2, 3, 4, 1), (0, 3, 2, 4)) * 3.0 - x227 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x227 += einsum(t2, (0, 1, 2, 3), x226, (4, 0, 1, 5), (4, 5, 2, 3)) * 0.25 - del x226 - x228 = np.zeros((nocc, nvir), dtype=types[float]) - x228 += einsum(x42, (0, 1, 2, 3, 4, 5), x77, (0, 1, 2, 5, 4, 6), (3, 6)) * 0.041666666666665 - del x77 - x229 = np.zeros((nocc, nvir), dtype=types[float]) - x229 += einsum(x42, (0, 1, 2, 3, 4, 5), x45, (2, 0, 1, 6, 5, 4), (3, 6)) * 0.041666666666665 - x230 = np.zeros((nocc, nvir), dtype=types[float]) - x230 += einsum(l2, (0, 1, 2, 3), x80, (2, 3, 4, 1, 0, 5), (4, 5)) * 0.125 - del x80 - x231 = np.zeros((nocc, nvir), dtype=types[float]) - x231 += einsum(l2, (0, 1, 2, 3), x82, (3, 4, 2, 0, 5, 1), (4, 5)) * 0.25 - del x82 - x232 = np.zeros((nocc, nvir), dtype=types[float]) - x232 += einsum(t2, (0, 1, 2, 3), x87, (0, 1, 4, 3), (4, 2)) - del x87 - x233 = np.zeros((nocc, nvir), dtype=types[float]) - x233 += einsum(t2, (0, 1, 2, 3), x90, (0, 1, 4, 2), (4, 3)) * 0.25 - del x90 - x234 = np.zeros((nocc, nvir), dtype=types[float]) - x234 += einsum(l1, (0, 1), x92, (1, 2, 3, 0), (2, 3)) * 0.5 - x235 = np.zeros((nocc, nvir), dtype=types[float]) - x235 += einsum(t1, (0, 1), x74, (0, 2), (2, 1)) * 0.5 - del x74 - x236 = np.zeros((nocc, nvir), dtype=types[float]) - x236 += einsum(x76, (0, 1), (0, 1)) * 0.124999999999995 - x236 += einsum(x228, (0, 1), (0, 1)) - x236 += einsum(x229, (0, 1), (0, 1)) * -1.0 - x236 += einsum(x230, (0, 1), (0, 1)) * -1.0 - x236 += einsum(x231, (0, 1), (0, 1)) - x236 += einsum(x232, (0, 1), (0, 1)) - x236 += einsum(x233, (0, 1), (0, 1)) - x236 += einsum(x234, (0, 1), (0, 1)) * -1.0 - x236 += einsum(x235, (0, 1), (0, 1)) - del x235 - x237 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x237 += einsum(x173, (0, 1, 2, 3), (0, 1, 2, 3)) - x237 += einsum(x175, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.08333333333333 - del x175 - x237 += einsum(x177, (0, 1, 2, 3), (0, 1, 2, 3)) - x237 += einsum(x179, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x179 - x237 += einsum(x182, (0, 1, 2, 3), (1, 0, 2, 3)) - del x182 - x237 += einsum(x195, (0, 1, 2, 3), (0, 1, 2, 3)) - x237 += einsum(x196, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x196 - x237 += einsum(x202, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x202 - x237 += einsum(x209, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x237 += einsum(x211, (0, 1, 2, 3), (0, 1, 3, 2)) - del x211 - x237 += einsum(x219, (0, 1, 2, 3), (0, 1, 2, 3)) - del x219 - x237 += einsum(x221, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x237 += einsum(x225, (0, 1, 2, 3), (0, 1, 3, 2)) - del x225 - x237 += einsum(x227, (0, 1, 2, 3), (0, 1, 2, 3)) - del x227 - x237 += einsum(t1, (0, 1), x236, (2, 3), (0, 2, 1, 3)) * -2.0 - del x236 - rdm2_f_oovv += einsum(x237, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x237, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_oovv += einsum(x237, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x237, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_oovv += einsum(x237, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x237, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_oovv += einsum(x237, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x237, (0, 1, 2, 3), (1, 0, 3, 2)) - del x237 - x238 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x238 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x238 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - x239 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x239 += einsum(x174, (0, 1, 2, 3, 4, 5), x238, (1, 2, 0, 6, 7, 5), (3, 4, 6, 7)) * 0.08333333333333 - x240 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x240 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * 5.000000000000001 - x240 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x241 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x241 += einsum(x240, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 0), (1, 5, 6, 4)) * 0.16666666666666666 - del x240 - x242 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x242 += einsum(x9, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (5, 6, 1, 4)) * 0.5 - x243 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x243 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x243 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.3333333333333333 - x243 += einsum(x241, (0, 1, 2, 3), (1, 2, 0, 3)) - del x241 - x243 += einsum(x242, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x242 - x244 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x244 += einsum(x243, (0, 1, 2, 3), t3, (4, 0, 1, 5, 3, 6), (2, 4, 6, 5)) * 1.5 - del x243 - x245 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x245 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * 2.0 - x245 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 1, 2)) * -1.0 - x246 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x246 += einsum(x6, (0, 1, 2, 3), x245, (0, 4, 5, 3, 2, 6), (4, 5, 1, 6)) - del x245 - x247 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x247 += einsum(x246, (0, 1, 2, 3), t3, (4, 1, 0, 5, 3, 6), (2, 4, 6, 5)) * 0.25 - del x246 - x248 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x248 += einsum(x6, (0, 1, 2, 3), x42, (1, 4, 0, 5, 2, 6), (4, 5, 6, 3)) - x249 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x249 += einsum(x248, (0, 1, 2, 3), x32, (0, 4, 5, 2), (1, 4, 3, 5)) * -1.0 - x250 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x250 += einsum(x42, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x250 += einsum(x42, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - x251 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x251 += einsum(t2, (0, 1, 2, 3), x250, (0, 1, 4, 5, 3, 6), (4, 5, 6, 2)) - x252 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x252 += einsum(t2, (0, 1, 2, 3), x251, (1, 4, 2, 5), (4, 0, 5, 3)) * -0.5 - x253 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x253 += einsum(x239, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x239 - x253 += einsum(x244, (0, 1, 2, 3), (0, 1, 3, 2)) - del x244 - x253 += einsum(x247, (0, 1, 2, 3), (0, 1, 3, 2)) - del x247 - x253 += einsum(x249, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x249 - x253 += einsum(x252, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x252 - rdm2_f_oovv += einsum(x253, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x253, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x253, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x253, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x253 - x254 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x254 += einsum(l1, (0, 1), t3, (2, 3, 1, 4, 5, 0), (2, 3, 4, 5)) - x255 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x255 += einsum(t2, (0, 1, 2, 3), x24, (1, 0, 4, 5), (5, 4, 2, 3)) - rdm2_f_oovv += einsum(x255, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x255, (0, 1, 2, 3), (0, 1, 2, 3)) - x256 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x256 += einsum(t2, (0, 1, 2, 3), l3, (2, 4, 3, 5, 6, 7), (5, 7, 6, 0, 1, 4)) - x257 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x257 += einsum(t3, (0, 1, 2, 3, 4, 5), x256, (2, 0, 1, 6, 7, 4), (6, 7, 5, 3)) - del x256 - x258 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x258 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 5, 6, 0, 1), (6, 4, 5, 3)) - x259 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x259 += einsum(x258, (0, 1, 2, 3), t3, (4, 0, 5, 2, 6, 1), (4, 5, 3, 6)) - x260 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x260 += einsum(x89, (0, 1, 2, 3), l3, (4, 5, 2, 6, 0, 1), (6, 4, 5, 3)) * 6.0 - del x89 - x261 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x261 += einsum(x258, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x261 += einsum(x258, (0, 1, 2, 3), (0, 2, 1, 3)) * -2.0 - x261 += einsum(x260, (0, 1, 2, 3), (0, 1, 2, 3)) - del x260 - x261 += einsum(x128, (0, 1, 2, 3), (0, 2, 3, 1)) - x262 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x262 += einsum(x261, (0, 1, 2, 3), t3, (4, 0, 5, 2, 1, 6), (4, 5, 3, 6)) * 0.25 - del x261 - x263 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x263 += einsum(t2, (0, 1, 2, 3), l3, (4, 5, 3, 6, 0, 1), (6, 4, 5, 2)) - rdm2_f_vvov = np.zeros((nvir, nvir, nocc, nvir), dtype=types[float]) - rdm2_f_vvov += einsum(x263, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_vvov += einsum(x263, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_vvvo = np.zeros((nvir, nvir, nvir, nocc), dtype=types[float]) - rdm2_f_vvvo += einsum(x263, (0, 1, 2, 3), (2, 1, 3, 0)) - rdm2_f_vvvo += einsum(x263, (0, 1, 2, 3), (2, 1, 3, 0)) - x264 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x264 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 2, 1)) * 1.5 - x264 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.5 - x264 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) - x265 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x265 += einsum(t2, (0, 1, 2, 3), x264, (0, 1, 4, 5, 2, 6), (4, 5, 6, 3)) * 0.6666666666666666 - del x264 - x266 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x266 += einsum(x263, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.6666666666666666 - x266 += einsum(x265, (0, 1, 2, 3), (0, 1, 2, 3)) - del x265 - x267 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x267 += einsum(x266, (0, 1, 2, 3), t3, (4, 0, 5, 1, 2, 6), (4, 5, 3, 6)) * 0.75 - del x266 - x268 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x268 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 2, 1)) * 0.5 - x268 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -0.5 - x268 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) - x269 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x269 += einsum(t2, (0, 1, 2, 3), x268, (0, 1, 4, 5, 2, 6), (4, 5, 6, 3)) * 2.0 - del x268 - x270 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x270 += einsum(x263, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x270 += einsum(x269, (0, 1, 2, 3), (0, 1, 2, 3)) - del x269 - x271 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x271 += einsum(x270, (0, 1, 2, 3), t3, (4, 0, 5, 2, 6, 1), (4, 5, 3, 6)) * 0.25 - x272 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x272 += einsum(t2, (0, 1, 2, 3), x96, (1, 4, 3, 5), (0, 4, 2, 5)) - x273 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x273 += einsum(t2, (0, 1, 2, 3), x272, (4, 1, 5, 3), (4, 0, 5, 2)) * 4.0 - del x272 - x274 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x274 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) - x274 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - x275 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x275 += einsum(t2, (0, 1, 2, 3), x274, (1, 4, 2, 5), (4, 0, 5, 3)) - x276 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x276 += einsum(t2, (0, 1, 2, 3), x275, (1, 4, 2, 5), (4, 0, 5, 3)) * -1.0 - del x275 - x277 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x277 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 4, 7, 2, 1, 0), (5, 3, 6, 7)) - x278 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x278 += einsum(x22, (0, 1, 2, 3), (1, 0, 3, 2)) - x278 += einsum(x277, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.24999999999999 - del x277 - x279 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x279 += einsum(t2, (0, 1, 2, 3), x278, (0, 1, 4, 5), (4, 5, 2, 3)) - del x278 - x280 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x280 += einsum(t2, (0, 1, 2, 3), x98, (1, 4, 0, 5, 6, 2), (4, 6, 5, 3)) - del x98 - x281 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x281 += einsum(x96, (0, 1, 2, 3), t3, (4, 0, 5, 3, 2, 6), (4, 5, 1, 6)) - x282 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x282 += einsum(t1, (0, 1), x25, (0, 2, 3, 4), (2, 3, 4, 1)) * 0.5 - del x25 - x283 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x283 += einsum(x280, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x280 - x283 += einsum(x281, (0, 1, 2, 3), (2, 1, 0, 3)) - del x281 - x283 += einsum(x282, (0, 1, 2, 3), (0, 2, 1, 3)) - del x282 - x284 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x284 += einsum(t1, (0, 1), x283, (0, 2, 3, 4), (2, 3, 4, 1)) * 2.0 - del x283 - x285 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x285 += einsum(x254, (0, 1, 2, 3), (0, 1, 2, 3)) - x285 += einsum(x255, (0, 1, 2, 3), (0, 1, 2, 3)) - del x255 - x285 += einsum(x257, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.24999999999999 - del x257 - x285 += einsum(x259, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x259 - x285 += einsum(x262, (0, 1, 2, 3), (1, 0, 2, 3)) - del x262 - x285 += einsum(x267, (0, 1, 2, 3), (1, 0, 2, 3)) - del x267 - x285 += einsum(x271, (0, 1, 2, 3), (1, 0, 2, 3)) - del x271 - x285 += einsum(x273, (0, 1, 2, 3), (0, 1, 2, 3)) - del x273 - x285 += einsum(x276, (0, 1, 2, 3), (1, 0, 3, 2)) - del x276 - x285 += einsum(x279, (0, 1, 2, 3), (1, 0, 3, 2)) - del x279 - x285 += einsum(x284, (0, 1, 2, 3), (0, 1, 3, 2)) - del x284 - rdm2_f_oovv += einsum(x285, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x285, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_oovv += einsum(x285, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x285, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x285 - x286 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x286 += einsum(t3, (0, 1, 2, 3, 4, 5), x174, (0, 1, 2, 6, 7, 4), (6, 7, 3, 5)) - x287 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x287 += einsum(x42, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x287 += einsum(x42, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - x287 += einsum(x42, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * 2.0 - x288 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x288 += einsum(t2, (0, 1, 2, 3), x287, (0, 1, 4, 5, 6, 3), (4, 5, 6, 2)) * 0.5 - x289 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x289 += einsum(x288, (0, 1, 2, 3), x6, (0, 4, 5, 2), (1, 4, 3, 5)) - del x288 - x290 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x290 += einsum(t1, (0, 1), x10, (2, 3, 4, 1), (0, 3, 2, 4)) - x291 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x291 += einsum(t1, (0, 1), x290, (2, 3, 0, 4), (3, 2, 4, 1)) * 3.0 - del x290 - x292 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x292 += einsum(t1, (0, 1), x291, (0, 2, 3, 4), (2, 3, 4, 1)) * 0.5 - del x291 - x293 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x293 += einsum(x286, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.08333333333333 - del x286 - x293 += einsum(x289, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x289 - x293 += einsum(x292, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x292 - rdm2_f_oovv += einsum(x293, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_oovv += einsum(x293, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - rdm2_f_oovv += einsum(x293, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_oovv += einsum(x293, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x293 - x294 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x294 += einsum(t3, (0, 1, 2, 3, 4, 5), x36, (0, 1, 2, 6, 7, 3), (6, 7, 5, 4)) - x295 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x295 += einsum(x178, (0, 1, 2, 3, 4, 5), x36, (1, 0, 2, 6, 7, 4), (6, 7, 3, 5)) * 0.16666666666667 - x296 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x296 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x296 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * -0.5 - x297 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x297 += einsum(x296, (0, 1, 2, 3, 4, 5), x3, (0, 6, 7, 5, 4, 3), (1, 2, 6, 7)) - del x3, x296 - x298 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x298 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * 0.5 - x298 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 2, 1)) - x299 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x299 += einsum(t3, (0, 1, 2, 3, 4, 5), x298, (6, 7, 2, 4, 5, 3), (6, 7, 0, 1)) - del x298 - x300 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x300 += einsum(x297, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x297 - x300 += einsum(x299, (0, 1, 2, 3), (1, 0, 2, 3)) - del x299 - x301 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x301 += einsum(t2, (0, 1, 2, 3), x300, (0, 1, 4, 5), (4, 5, 2, 3)) * 0.16666666666666 - del x300 - x302 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x302 += einsum(x36, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x302 += einsum(x36, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -0.5 - x302 += einsum(x36, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) * 0.5 - x303 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x303 += einsum(t2, (0, 1, 2, 3), x302, (0, 4, 1, 5, 6, 3), (4, 5, 6, 2)) * 5.99999999999988 - del x302 - x304 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x304 += einsum(t1, (0, 1), x102, (2, 0, 3, 4), (2, 3, 4, 1)) - del x102 - x305 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x305 += einsum(x37, (0, 1, 2, 3), (0, 1, 2, 3)) * -5.99999999999988 - x305 += einsum(x303, (0, 1, 2, 3), (0, 1, 2, 3)) - del x303 - x305 += einsum(x304, (0, 1, 2, 3), (0, 1, 2, 3)) - del x304 - x306 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x306 += einsum(t1, (0, 1), x305, (0, 2, 3, 4), (2, 3, 4, 1)) * 0.16666666666667 - del x305 - x307 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x307 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x307 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * -1.0 - x307 += einsum(x294, (0, 1, 2, 3), (1, 0, 3, 2)) * 0.16666666666667 - del x294 - x307 += einsum(x295, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x295 - x307 += einsum(x301, (0, 1, 2, 3), (1, 0, 3, 2)) - del x301 - x307 += einsum(x306, (0, 1, 2, 3), (1, 0, 2, 3)) - del x306 - rdm2_f_oovv += einsum(x307, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_oovv += einsum(x307, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x307, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_oovv += einsum(x307, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x307 - x308 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x308 += einsum(t2, (0, 1, 2, 3), x251, (1, 4, 3, 5), (4, 0, 5, 2)) * -1.0 - rdm2_f_oovv += einsum(x308, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_oovv += einsum(x308, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - rdm2_f_oovv += einsum(x308, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - rdm2_f_oovv += einsum(x308, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - rdm2_f_oovv += einsum(x308, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_oovv += einsum(x308, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - rdm2_f_oovv += einsum(x308, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - rdm2_f_oovv += einsum(x308, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - del x308 - x309 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x309 += einsum(t2, (0, 1, 2, 3), x42, (1, 4, 0, 5, 6, 2), (4, 5, 6, 3)) - x310 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x310 += einsum(x309, (0, 1, 2, 3), x32, (0, 4, 5, 2), (4, 1, 5, 3)) - rdm2_f_oovv += einsum(x310, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_oovv += einsum(x310, (0, 1, 2, 3), (1, 0, 3, 2)) * -2.0 - rdm2_f_oovv += einsum(x310, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x310, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - rdm2_f_oovv += einsum(x310, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_oovv += einsum(x310, (0, 1, 2, 3), (1, 0, 3, 2)) * -2.0 - rdm2_f_oovv += einsum(x310, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x310, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - del x310 - x311 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x311 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x311 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 0, 2)) * 0.3333333333333333 - x312 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x312 += einsum(t1, (0, 1), x311, (2, 3, 4, 1, 5, 6), (0, 2, 3, 4, 5, 6)) * 3.0 - del x311 - x313 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x313 += einsum(t1, (0, 1), x312, (2, 3, 4, 5, 1, 6), (0, 4, 3, 5, 2, 6)) * 0.3333333333333333 - del x312 - x314 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x314 += einsum(t3, (0, 1, 2, 3, 4, 5), x313, (6, 0, 2, 1, 7, 4), (6, 7, 5, 3)) * 0.50000000000001 - del x313 - rdm2_f_oovv += einsum(x314, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_oovv += einsum(x314, (0, 1, 2, 3), (1, 0, 2, 3)) - del x314 - x315 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x315 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x315 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - x316 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x316 += einsum(l1, (0, 1), x315, (2, 3, 1, 4, 5, 0), (2, 3, 4, 5)) - rdm2_f_oovv += einsum(x316, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - rdm2_f_oovv += einsum(x316, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x316 - x317 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x317 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x317 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - x318 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x318 += einsum(l3, (0, 1, 2, 3, 4, 5), x317, (4, 6, 7, 1, 2, 0), (3, 5, 6, 7)) - x319 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x319 += einsum(x318, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x318 - x319 += einsum(x104, (0, 1, 2, 3), (1, 0, 2, 3)) - del x104 - x320 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x320 += einsum(t1, (0, 1), x319, (0, 2, 3, 4), (2, 3, 4, 1)) - del x319 - x321 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x321 += einsum(t1, (0, 1), x320, (0, 2, 3, 4), (2, 3, 1, 4)) * 0.16666666666667 - del x320 - rdm2_f_oovv += einsum(x321, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x321, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x321 - x322 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x322 += einsum(t2, (0, 1, 2, 3), x42, (4, 0, 1, 5, 2, 6), (4, 5, 6, 3)) - x323 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x323 += einsum(t2, (0, 1, 2, 3), x322, (1, 4, 2, 5), (4, 0, 3, 5)) - del x322 - rdm2_f_oovv += einsum(x323, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x323, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x323 - x324 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x324 += einsum(l2, (0, 1, 2, 3), t2, (4, 3, 1, 5), (2, 4, 0, 5)) - x325 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x325 += einsum(t2, (0, 1, 2, 3), x324, (1, 4, 2, 5), (4, 0, 5, 3)) - del x324 - rdm2_f_oovv += einsum(x325, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x325, (0, 1, 2, 3), (0, 1, 2, 3)) - del x325 - x326 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x326 += einsum(t1, (0, 1), x24, (0, 2, 3, 4), (2, 4, 3, 1)) - del x24 - x327 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x327 += einsum(t1, (0, 1), x326, (0, 2, 3, 4), (2, 3, 1, 4)) - del x326 - rdm2_f_oovv += einsum(x327, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x327, (0, 1, 2, 3), (0, 1, 2, 3)) - del x327 - x328 = np.zeros((nocc, nvir), dtype=types[float]) - x328 += einsum(t1, (0, 1), x1, (0, 2), (2, 1)) - del x1 - rdm2_f_oovv += einsum(t1, (0, 1), x328, (2, 3), (0, 2, 1, 3)) * -1.0 - rdm2_f_oovv += einsum(t1, (0, 1), x328, (2, 3), (0, 2, 1, 3)) * -1.0 - x329 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x329 += einsum(t2, (0, 1, 2, 3), x28, (0, 1, 4, 5), (4, 5, 2, 3)) - x330 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x330 += einsum(x258, (0, 1, 2, 3), t3, (4, 5, 0, 2, 6, 1), (4, 5, 3, 6)) - x331 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x331 += einsum(t2, (0, 1, 2, 3), l3, (4, 2, 3, 1, 5, 6), (6, 5, 0, 4)) - x332 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x332 += einsum(t1, (0, 1), x331, (2, 3, 4, 1), (2, 3, 0, 4)) - x333 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x333 += einsum(t2, (0, 1, 2, 3), x332, (1, 0, 4, 5), (4, 5, 3, 2)) - del x332 - x334 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x334 += einsum(x270, (0, 1, 2, 3), t3, (4, 5, 0, 1, 6, 2), (4, 5, 3, 6)) * 0.25 - x335 = np.zeros((nocc, nocc, nocc, nocc, nocc, nvir), dtype=types[float]) - x335 += einsum(x174, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x174 - x335 += einsum(x36, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 1.0000000000000602 - del x36 - x336 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x336 += einsum(t3, (0, 1, 2, 3, 4, 5), x335, (0, 2, 1, 6, 7, 3), (6, 7, 5, 4)) * 0.49999999999997996 - del x335 - x337 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x337 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x337 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x337 += einsum(x168, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x168 - x337 += einsum(x123, (0, 1, 2, 3), (1, 0, 2, 3)) - del x123 - x338 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x338 += einsum(x337, (0, 1, 2, 3), t3, (0, 4, 1, 3, 5, 6), (2, 4, 6, 5)) * 0.5 - del x337 - x339 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x339 += einsum(x7, (0, 1, 2, 3), t3, (0, 4, 1, 5, 6, 3), (4, 2, 5, 6)) * -0.25 - del x7 - x340 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x340 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 3, 5, 7, 0, 2), (4, 6, 1, 7)) - x341 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x341 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x341 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -0.25 - x341 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.25 - x342 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x342 += einsum(l3, (0, 1, 2, 3, 4, 5), x341, (4, 6, 5, 1, 7, 2), (6, 3, 7, 0)) - del x341 - rdm2_f_ovvo += einsum(x342, (0, 1, 2, 3), (0, 3, 2, 1)) - rdm2_f_ovvo += einsum(x342, (0, 1, 2, 3), (0, 3, 2, 1)) - x343 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x343 += einsum(l3, (0, 1, 2, 3, 4, 5), x188, (3, 6, 5, 0, 2, 7), (4, 6, 1, 7)) * 0.25 - del x188 - x344 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x344 += einsum(x183, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - x344 += einsum(x340, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - del x340 - x344 += einsum(x342, (0, 1, 2, 3), (1, 0, 3, 2)) - del x342 - x344 += einsum(x343, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x343 - x345 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x345 += einsum(t2, (0, 1, 2, 3), x344, (1, 4, 2, 5), (4, 0, 5, 3)) - del x344 - x346 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x346 += einsum(t2, (0, 1, 2, 3), x143, (0, 1, 4, 5, 6, 2), (4, 5, 3, 6)) - x347 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x347 += einsum(t2, (0, 1, 2, 3), x346, (1, 4, 5, 2), (4, 0, 5, 3)) * -0.5 - del x346 - x348 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x348 += einsum(t2, (0, 1, 2, 3), x23, (4, 1, 5, 3), (4, 5, 0, 2)) - x349 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x349 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 4.0 - x349 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -1.0 - x349 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x350 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x350 += einsum(x349, (0, 1, 2, 3, 4, 5), x42, (2, 6, 0, 7, 5, 3), (1, 6, 7, 4)) * 0.5 - x351 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x351 += einsum(x35, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - x351 += einsum(x35, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - x352 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x352 += einsum(t3, (0, 1, 2, 3, 4, 5), x351, (1, 2, 6, 7, 4, 5), (6, 7, 0, 3)) * 0.5 - del x351 - x353 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x353 += einsum(l2, (0, 1, 2, 3), x145, (2, 4, 5, 0, 1, 6), (3, 4, 5, 6)) - del x145 - x354 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x354 += einsum(t2, (0, 1, 2, 3), x133, (1, 4, 5, 6, 3, 2), (0, 4, 5, 6)) * 2.0 - del x133 - x355 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x355 += einsum(x132, (0, 1, 2, 3), (1, 0, 2, 3)) - del x132 - x355 += einsum(x354, (0, 1, 2, 3), (1, 2, 0, 3)) - del x354 - x356 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x356 += einsum(t2, (0, 1, 2, 3), x355, (4, 1, 5, 2), (4, 5, 0, 3)) - del x355 - x357 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x357 += einsum(t2, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x357 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x358 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x358 += einsum(x23, (0, 1, 2, 3), x357, (0, 4, 3, 5), (4, 1, 2, 5)) * 2.0 - x359 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x359 += einsum(x28, (0, 1, 2, 3), (0, 1, 2, 3)) - del x28 - x359 += einsum(x30, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.99999999999996 - del x30 - x360 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x360 += einsum(t1, (0, 1), x359, (2, 0, 3, 4), (2, 3, 4, 1)) * 1.00000000000002 - del x359 - x361 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x361 += einsum(x348, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x348 - x361 += einsum(x140, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x140 - x361 += einsum(x113, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - del x113 - x361 += einsum(x111, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x111 - x361 += einsum(x37, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x37 - x361 += einsum(x350, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x350 - x361 += einsum(x352, (0, 1, 2, 3), (0, 1, 2, 3)) - del x352 - x361 += einsum(x353, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x353 - x361 += einsum(x356, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x356 - x361 += einsum(x358, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x358 - x361 += einsum(x360, (0, 1, 2, 3), (0, 1, 2, 3)) - del x360 - x362 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x362 += einsum(t1, (0, 1), x361, (0, 2, 3, 4), (2, 3, 4, 1)) * 0.5 - del x361 - x363 = np.zeros((nocc, nvir), dtype=types[float]) - x363 += einsum(t1, (0, 1), x21, (0, 2), (2, 1)) - del x21 - x364 = np.zeros((nocc, nvir), dtype=types[float]) - x364 += einsum(x76, (0, 1), (0, 1)) * 0.124999999999995 - del x76 - x364 += einsum(x228, (0, 1), (0, 1)) - del x228 - x364 += einsum(x229, (0, 1), (0, 1)) * -1.0 - del x229 - x364 += einsum(x230, (0, 1), (0, 1)) * -1.0 - del x230 - x364 += einsum(x231, (0, 1), (0, 1)) - del x231 - x364 += einsum(x232, (0, 1), (0, 1)) - del x232 - x364 += einsum(x233, (0, 1), (0, 1)) - del x233 - x364 += einsum(x234, (0, 1), (0, 1)) * -1.0 - del x234 - x364 += einsum(x363, (0, 1), (0, 1)) - del x363 - x365 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x365 += einsum(x254, (0, 1, 2, 3), (0, 1, 2, 3)) - del x254 - x365 += einsum(x329, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.49999999999997996 - del x329 - x365 += einsum(x330, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x330 - x365 += einsum(x333, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x333 - x365 += einsum(x334, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x334 - x365 += einsum(x336, (0, 1, 2, 3), (0, 1, 2, 3)) - del x336 - x365 += einsum(x338, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x338 - x365 += einsum(x195, (0, 1, 2, 3), (0, 1, 2, 3)) - del x195 - x365 += einsum(x339, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x339 - x365 += einsum(x345, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x345 - x365 += einsum(x209, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x209 - x365 += einsum(x347, (0, 1, 2, 3), (0, 1, 3, 2)) - del x347 - x365 += einsum(x362, (0, 1, 2, 3), (0, 1, 3, 2)) - del x362 - x365 += einsum(x221, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x221 - x365 += einsum(t1, (0, 1), x364, (2, 3), (0, 2, 1, 3)) * -2.0 - del x364 - rdm2_f_oovv += einsum(x365, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x365, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_oovv += einsum(x365, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_oovv += einsum(x365, (0, 1, 2, 3), (1, 0, 3, 2)) - del x365 - x366 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x366 += einsum(x29, (0, 1, 2, 3), t3, (4, 1, 0, 5, 6, 3), (2, 4, 5, 6)) - x367 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x367 += einsum(x263, (0, 1, 2, 3), t3, (4, 5, 0, 6, 2, 1), (4, 5, 3, 6)) - x368 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x368 += einsum(x128, (0, 1, 2, 3), t3, (4, 5, 0, 6, 2, 3), (4, 5, 6, 1)) * -0.5 - x369 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x369 += einsum(x23, (0, 1, 2, 3), (1, 0, 2, 3)) - x369 += einsum(x124, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x124 - x370 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x370 += einsum(x369, (0, 1, 2, 3), t3, (4, 0, 1, 5, 6, 3), (2, 4, 5, 6)) - del x369 - x371 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x371 += einsum(t2, (0, 1, 2, 3), x250, (0, 1, 4, 5, 3, 6), (4, 5, 6, 2)) * 0.5 - x372 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x372 += einsum(x176, (0, 1, 2, 3), (0, 1, 2, 3)) - x372 += einsum(x371, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x371 - x373 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x373 += einsum(t2, (0, 1, 2, 3), x372, (1, 4, 2, 5), (4, 0, 5, 3)) - del x372 - x374 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x374 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (5, 6, 3, 2, 1, 7), (4, 6, 0, 7)) - rdm2_f_ovov += einsum(x374, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.5 - rdm2_f_ovov += einsum(x374, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.5 - rdm2_f_vovo += einsum(x374, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.5 - rdm2_f_vovo += einsum(x374, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.5 - x375 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x375 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 4, 5, 0, 7, 2), (3, 6, 1, 7)) - rdm2_f_ovov += einsum(x375, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.5 - rdm2_f_ovov += einsum(x375, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.5 - rdm2_f_vovo += einsum(x375, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.5 - rdm2_f_vovo += einsum(x375, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.5 - x376 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x376 += einsum(x374, (0, 1, 2, 3), (0, 1, 2, 3)) - x376 += einsum(x375, (0, 1, 2, 3), (0, 1, 2, 3)) - x377 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x377 += einsum(t2, (0, 1, 2, 3), x376, (1, 4, 2, 5), (4, 0, 5, 3)) * 0.5 - del x376 - x378 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x378 += einsum(x9, (0, 1, 2, 3), l3, (4, 2, 3, 5, 0, 6), (6, 5, 1, 4)) * 3.0 - del x9 - x379 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x379 += einsum(x29, (0, 1, 2, 3), (0, 1, 2, 3)) - x379 += einsum(x29, (0, 1, 2, 3), (1, 0, 2, 3)) * -3.0 - x379 += einsum(x53, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x379 += einsum(x53, (0, 1, 2, 3), (1, 0, 2, 3)) - del x53 - x379 += einsum(x378, (0, 1, 2, 3), (1, 0, 2, 3)) - x379 += einsum(x59, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x380 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x380 += einsum(t1, (0, 1), x379, (0, 2, 3, 4), (2, 3, 4, 1)) - del x379 - x381 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x381 += einsum(t2, (0, 1, 2, 3), x380, (1, 4, 3, 5), (4, 0, 5, 2)) * 0.5 - del x380 - x382 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x382 += einsum(t2, (0, 1, 2, 3), x23, (4, 1, 5, 2), (4, 5, 0, 3)) - x383 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x383 += einsum(t2, (0, 1, 2, 3), x120, (0, 1, 4, 5, 6, 2), (4, 5, 6, 3)) * 0.5 - del x120 - x384 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x384 += einsum(x29, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x29 - x384 += einsum(x59, (0, 1, 2, 3), (1, 0, 2, 3)) - del x59 - x385 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x385 += einsum(t2, (0, 1, 2, 3), x384, (1, 4, 5, 2), (4, 5, 0, 3)) * 0.5 - del x384 - x386 = np.zeros((nocc, nocc, nocc, nocc), dtype=types[float]) - x386 += einsum(t1, (0, 1), x33, (2, 3, 4, 1), (0, 2, 3, 4)) * -1.0 - x387 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x387 += einsum(t1, (0, 1), x386, (2, 3, 0, 4), (3, 2, 4, 1)) * 0.5 - x388 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x388 += einsum(x38, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x38 - x388 += einsum(x108, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x108 - x388 += einsum(x382, (0, 1, 2, 3), (0, 1, 2, 3)) - del x382 - x388 += einsum(x110, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x110 - x388 += einsum(x109, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x109 - x388 += einsum(x383, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x383 - x388 += einsum(x149, (0, 1, 2, 3), (2, 1, 0, 3)) - del x149 - x388 += einsum(x385, (0, 1, 2, 3), (0, 2, 1, 3)) - del x385 - x388 += einsum(x387, (0, 1, 2, 3), (0, 1, 2, 3)) - del x387 - x389 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x389 += einsum(t1, (0, 1), x388, (0, 2, 3, 4), (2, 3, 4, 1)) - del x388 - x390 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x390 += einsum(t2, (0, 1, 2, 3), x386, (4, 0, 1, 5), (4, 5, 3, 2)) * 0.5 - del x386 - x391 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x391 += einsum(x173, (0, 1, 2, 3), (0, 1, 2, 3)) - del x173 - x391 += einsum(x366, (0, 1, 2, 3), (0, 1, 2, 3)) - del x366 - x391 += einsum(x367, (0, 1, 2, 3), (0, 1, 2, 3)) - del x367 - x391 += einsum(x177, (0, 1, 2, 3), (0, 1, 2, 3)) - del x177 - x391 += einsum(x368, (0, 1, 2, 3), (0, 1, 3, 2)) - del x368 - x391 += einsum(x370, (0, 1, 2, 3), (0, 1, 2, 3)) - del x370 - x391 += einsum(x373, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x373 - x391 += einsum(x377, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x377 - x391 += einsum(x381, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x381 - x391 += einsum(x389, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x389 - x391 += einsum(x390, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x390 - rdm2_f_oovv += einsum(x391, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_oovv += einsum(x391, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x391, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_oovv += einsum(x391, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x391 - x392 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x392 += einsum(t2, (0, 1, 2, 3), x251, (1, 4, 3, 5), (4, 0, 5, 2)) * -0.5 - del x251 - rdm2_f_oovv += einsum(x392, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x392, (0, 1, 2, 3), (1, 0, 3, 2)) * -2.0 - rdm2_f_oovv += einsum(x392, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x392, (0, 1, 2, 3), (1, 0, 3, 2)) * -2.0 - del x392 - x393 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x393 += einsum(t2, (0, 1, 2, 3), x309, (1, 4, 3, 5), (4, 0, 2, 5)) - del x309 - rdm2_f_oovv += einsum(x393, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - rdm2_f_oovv += einsum(x393, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_oovv += einsum(x393, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - rdm2_f_oovv += einsum(x393, (0, 1, 2, 3), (1, 0, 2, 3)) - del x393 - x394 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x394 += einsum(t2, (0, 1, 2, 3), x287, (0, 1, 4, 5, 6, 3), (4, 5, 6, 2)) * 0.25 - del x287 - x395 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x395 += einsum(t2, (0, 1, 2, 3), x192, (1, 4, 3, 5), (0, 4, 2, 5)) - del x192 - x396 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x396 += einsum(x394, (0, 1, 2, 3), (0, 1, 2, 3)) - del x394 - x396 += einsum(x395, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x395 - x397 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x397 += einsum(t2, (0, 1, 2, 3), x396, (1, 4, 3, 5), (4, 0, 5, 2)) * 2.0 - del x396 - rdm2_f_oovv += einsum(x397, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_oovv += einsum(x397, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x397 - x398 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x398 += einsum(t2, (0, 1, 2, 3), x248, (1, 4, 3, 5), (4, 0, 5, 2)) * -1.0 - del x248 - rdm2_f_oovv += einsum(x398, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - rdm2_f_oovv += einsum(x398, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x398 - x399 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x399 += einsum(l2, (0, 1, 2, 3), t2, (4, 2, 1, 5), (3, 4, 0, 5)) - rdm2_f_ovov += einsum(x399, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_ovov += einsum(x399, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_vovo += einsum(x399, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - rdm2_f_vovo += einsum(x399, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x400 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x400 += einsum(t2, (0, 1, 2, 3), x42, (0, 4, 1, 5, 2, 6), (4, 5, 6, 3)) - rdm2_f_ovov += einsum(x400, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_ovov += einsum(x400, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_vovo += einsum(x400, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - rdm2_f_vovo += einsum(x400, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x401 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x401 += einsum(x399, (0, 1, 2, 3), (0, 1, 2, 3)) - x401 += einsum(x400, (0, 1, 2, 3), (0, 1, 2, 3)) - x402 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x402 += einsum(t2, (0, 1, 2, 3), x401, (1, 4, 2, 5), (4, 0, 5, 3)) - del x401 - rdm2_f_oovv += einsum(x402, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_oovv += einsum(x402, (0, 1, 2, 3), (1, 0, 2, 3)) - del x402 - x403 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x403 += einsum(t2, (0, 1, 2, 3), (0, 1, 2, 3)) - x403 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - x404 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x404 += einsum(x22, (0, 1, 2, 3), x403, (0, 1, 4, 5), (2, 3, 4, 5)) - del x22, x403 - rdm2_f_oovv += einsum(x404, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_oovv += einsum(x404, (0, 1, 2, 3), (1, 0, 3, 2)) - del x404 - x405 = np.zeros((nocc, nvir), dtype=types[float]) - x405 += einsum(t1, (0, 1), (0, 1)) - x405 += einsum(x328, (0, 1), (0, 1)) * -1.0 - del x328 - rdm2_f_oovv += einsum(t1, (0, 1), x405, (2, 3), (2, 0, 3, 1)) - rdm2_f_oovv += einsum(t1, (0, 1), x405, (2, 3), (2, 0, 3, 1)) - del x405 - x406 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x406 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 5, 4, 1, 7, 2), (3, 6, 0, 7)) - rdm2_f_ovov += einsum(x406, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.25 - rdm2_f_ovov += einsum(x406, (0, 1, 2, 3), (1, 2, 0, 3)) * -0.25 - rdm2_f_voov += einsum(x406, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.25 - rdm2_f_voov += einsum(x406, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.25 - del x406 - x407 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x407 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * 0.2 - x407 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -0.2 - x407 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -0.2 - x407 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - x408 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x408 += einsum(l3, (0, 1, 2, 3, 4, 5), x407, (4, 6, 5, 1, 7, 2), (6, 3, 7, 0)) * 1.25 - del x407 - rdm2_f_ovov += einsum(x408, (0, 1, 2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_ovov += einsum(x408, (0, 1, 2, 3), (0, 3, 1, 2)) * -1.0 - del x408 - x409 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x409 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - x409 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) - x410 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x410 += einsum(t3, (0, 1, 2, 3, 4, 5), x409, (2, 1, 6, 5, 7, 3), (6, 0, 7, 4)) * 0.25 - del x409 - rdm2_f_ovov += einsum(x410, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_ovov += einsum(x410, (0, 1, 2, 3), (1, 2, 0, 3)) - del x410 - x411 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x411 += einsum(l3, (0, 1, 2, 3, 4, 5), x317, (5, 6, 3, 1, 7, 2), (4, 6, 0, 7)) * 0.25 - rdm2_f_ovov += einsum(x411, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_ovov += einsum(x411, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_ovvo += einsum(x411, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_ovvo += einsum(x411, (0, 1, 2, 3), (1, 2, 3, 0)) - del x411 - x412 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x412 += einsum(t2, (0, 1, 2, 3), x250, (0, 1, 4, 5, 6, 2), (4, 5, 6, 3)) * 0.5 - rdm2_f_ovov += einsum(x412, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_ovov += einsum(x412, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_vovo += einsum(x412, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - rdm2_f_vovo += einsum(x412, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - del x412 - x413 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x413 += einsum(x42, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 2.0 - x413 += einsum(x42, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - x414 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x414 += einsum(t2, (0, 1, 2, 3), x413, (4, 0, 1, 5, 6, 3), (4, 5, 6, 2)) - del x413 - rdm2_f_ovov += einsum(x414, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_ovov += einsum(x414, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_ovvo += einsum(x414, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_ovvo += einsum(x414, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - del x414 - x415 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x415 += einsum(l2, (0, 1, 2, 3), x32, (2, 4, 5, 1), (3, 4, 0, 5)) - rdm2_f_ovov += einsum(x415, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_ovov += einsum(x415, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x415 - x416 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x416 += einsum(l2, (0, 1, 2, 3), x19, (3, 4, 5, 1), (2, 4, 0, 5)) * 2.0 - del x19 - rdm2_f_ovov += einsum(x416, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_ovov += einsum(x416, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_voov += einsum(x416, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_voov += einsum(x416, (0, 1, 2, 3), (2, 1, 0, 3)) - del x416 - x417 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x417 += einsum(x32, (0, 1, 2, 3), l3, (4, 2, 3, 5, 6, 0), (5, 6, 1, 4)) - x418 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x418 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x418 += einsum(x417, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x417 - x419 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x419 += einsum(x418, (0, 1, 2, 3), (0, 1, 2, 3)) - x419 += einsum(x418, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x419 += einsum(x378, (0, 1, 2, 3), (1, 0, 2, 3)) - x420 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x420 += einsum(t1, (0, 1), x419, (2, 0, 3, 4), (2, 3, 4, 1)) * 0.5 - del x419 - rdm2_f_ovov += einsum(x420, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_ovov += einsum(x420, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_ovvo += einsum(x420, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_ovvo += einsum(x420, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_voov += einsum(x420, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_voov += einsum(x420, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_vovo += einsum(x420, (0, 1, 2, 3), (2, 1, 3, 0)) - rdm2_f_vovo += einsum(x420, (0, 1, 2, 3), (2, 1, 3, 0)) - del x420 - x421 = np.zeros((nvir, nvir), dtype=types[float]) - x421 += einsum(l1, (0, 1), t1, (1, 2), (0, 2)) - x422 = np.zeros((nvir, nvir), dtype=types[float]) - x422 += einsum(x421, (0, 1), (0, 1)) - x422 += einsum(x203, (0, 1), (0, 1)) * 0.24999999999999 - x422 += einsum(x205, (0, 1), (0, 1)) - del x205 - x422 += einsum(x206, (0, 1), (0, 1)) * -1.0 - del x206 - x422 += einsum(x207, (0, 1), (1, 0)) - del x207 - rdm2_f_ovov += einsum(delta.oo, (0, 1), x422, (2, 3), (0, 2, 1, 3)) - rdm2_f_ovov += einsum(delta.oo, (0, 1), x422, (2, 3), (0, 2, 1, 3)) - rdm2_f_ovov += einsum(delta.oo, (0, 1), x422, (2, 3), (0, 2, 1, 3)) - rdm2_f_ovov += einsum(delta.oo, (0, 1), x422, (2, 3), (0, 2, 1, 3)) - rdm2_f_ovvo += einsum(delta.oo, (0, 1), x422, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_ovvo += einsum(delta.oo, (0, 1), x422, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_voov += einsum(delta.oo, (0, 1), x422, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_voov += einsum(delta.oo, (0, 1), x422, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_vovo += einsum(delta.oo, (0, 1), x422, (2, 3), (2, 0, 3, 1)) - rdm2_f_vovo += einsum(delta.oo, (0, 1), x422, (2, 3), (2, 0, 3, 1)) - rdm2_f_vovo += einsum(delta.oo, (0, 1), x422, (2, 3), (2, 0, 3, 1)) - rdm2_f_vovo += einsum(delta.oo, (0, 1), x422, (2, 3), (2, 0, 3, 1)) - x423 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x423 += einsum(t2, (0, 1, 2, 3), x143, (0, 1, 4, 5, 2, 6), (4, 5, 3, 6)) * 0.5 - rdm2_f_ovov += einsum(x423, (0, 1, 2, 3), (1, 3, 0, 2)) * -1.0 - rdm2_f_ovov += einsum(x423, (0, 1, 2, 3), (1, 3, 0, 2)) * -1.0 - rdm2_f_vovo += einsum(x423, (0, 1, 2, 3), (3, 1, 2, 0)) * -1.0 - rdm2_f_vovo += einsum(x423, (0, 1, 2, 3), (3, 1, 2, 0)) * -1.0 - del x423 - x424 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x424 += einsum(t1, (0, 1), x151, (0, 2, 3, 4), (2, 3, 1, 4)) - rdm2_f_ovov += einsum(x424, (0, 1, 2, 3), (1, 3, 0, 2)) * -1.0 - rdm2_f_ovov += einsum(x424, (0, 1, 2, 3), (1, 3, 0, 2)) * -1.0 - del x424 - x425 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x425 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 3, 5, 1, 7, 2), (4, 6, 0, 7)) - rdm2_f_ovvo += einsum(x425, (0, 1, 2, 3), (1, 2, 3, 0)) * 0.25 - rdm2_f_ovvo += einsum(x425, (0, 1, 2, 3), (1, 2, 3, 0)) * 0.25 - rdm2_f_vovo += einsum(x425, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.25 - rdm2_f_vovo += einsum(x425, (0, 1, 2, 3), (2, 1, 3, 0)) * -0.25 - del x425 - x426 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x426 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x426 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - x426 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -1.0 - x426 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * 5.0 - x427 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x427 += einsum(l3, (0, 1, 2, 3, 4, 5), x426, (4, 6, 5, 1, 7, 2), (6, 3, 7, 0)) * 0.25 - del x426 - rdm2_f_ovvo += einsum(x427, (0, 1, 2, 3), (0, 3, 2, 1)) - rdm2_f_ovvo += einsum(x427, (0, 1, 2, 3), (0, 3, 2, 1)) - rdm2_f_voov += einsum(x427, (0, 1, 2, 3), (3, 0, 1, 2)) - rdm2_f_voov += einsum(x427, (0, 1, 2, 3), (3, 0, 1, 2)) - del x427 - x428 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x428 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x428 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) * -1.0 - x429 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x429 += einsum(l3, (0, 1, 2, 3, 4, 5), x428, (5, 6, 4, 2, 1, 7), (6, 3, 7, 0)) * 0.25 - del x428 - rdm2_f_ovvo += einsum(x429, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - rdm2_f_ovvo += einsum(x429, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - del x429 - x430 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x430 += einsum(x42, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - x430 += einsum(x42, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - x431 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x431 += einsum(t2, (0, 1, 2, 3), x430, (0, 1, 4, 5, 6, 2), (4, 5, 6, 3)) * 0.5 - del x430 - rdm2_f_ovvo += einsum(x431, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_ovvo += einsum(x431, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_voov += einsum(x431, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_voov += einsum(x431, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x431 - x432 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x432 += einsum(t2, (0, 1, 2, 3), x274, (1, 4, 5, 2), (4, 0, 5, 3)) - rdm2_f_ovvo += einsum(x432, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_ovvo += einsum(x432, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_vovo += einsum(x432, (0, 1, 2, 3), (2, 1, 3, 0)) - rdm2_f_vovo += einsum(x432, (0, 1, 2, 3), (2, 1, 3, 0)) - del x432 - x433 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x433 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) * 2.0 - x433 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - x434 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x434 += einsum(t2, (0, 1, 2, 3), x433, (1, 4, 5, 3), (4, 0, 5, 2)) - del x433 - rdm2_f_ovvo += einsum(x434, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_ovvo += einsum(x434, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_vovo += einsum(x434, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - rdm2_f_vovo += einsum(x434, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - del x434 - x435 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x435 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (6, 3, 5, 0, 7, 2), (4, 6, 1, 7)) - rdm2_f_ovvo += einsum(x435, (0, 1, 2, 3), (1, 2, 3, 0)) * -0.25 - rdm2_f_ovvo += einsum(x435, (0, 1, 2, 3), (1, 2, 3, 0)) * -0.25 - rdm2_f_voov += einsum(x435, (0, 1, 2, 3), (2, 1, 0, 3)) * -0.25 - rdm2_f_voov += einsum(x435, (0, 1, 2, 3), (2, 1, 0, 3)) * -0.25 - x436 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x436 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 6, 5, 1, 7, 2), (4, 6, 0, 7)) - rdm2_f_ovvo += einsum(x436, (0, 1, 2, 3), (1, 2, 3, 0)) * -0.25 - rdm2_f_ovvo += einsum(x436, (0, 1, 2, 3), (1, 2, 3, 0)) * -0.25 - rdm2_f_voov += einsum(x436, (0, 1, 2, 3), (2, 1, 0, 3)) * -0.25 - rdm2_f_voov += einsum(x436, (0, 1, 2, 3), (2, 1, 0, 3)) * -0.25 - del x436 - x437 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x437 += einsum(l2, (0, 1, 2, 3), t2, (4, 2, 5, 1), (3, 4, 0, 5)) - rdm2_f_ovvo += einsum(x437, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_ovvo += einsum(x437, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_voov += einsum(x437, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_voov += einsum(x437, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - x438 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x438 += einsum(t3, (0, 1, 2, 3, 4, 5), x127, (1, 2, 6, 5, 4, 7), (0, 6, 3, 7)) * 0.25 - rdm2_f_ovvo += einsum(x438, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - rdm2_f_ovvo += einsum(x438, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - rdm2_f_voov += einsum(x438, (0, 1, 2, 3), (3, 0, 1, 2)) * -1.0 - rdm2_f_voov += einsum(x438, (0, 1, 2, 3), (3, 0, 1, 2)) * -1.0 - del x438 - x439 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x439 += einsum(t2, (0, 1, 2, 3), x250, (0, 1, 4, 5, 2, 6), (4, 5, 6, 3)) * 0.5 - rdm2_f_ovvo += einsum(x439, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_ovvo += einsum(x439, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_voov += einsum(x439, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_voov += einsum(x439, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x439 - x440 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x440 += einsum(l2, (0, 1, 2, 3), x92, (3, 4, 5, 1), (2, 4, 0, 5)) - del x92 - rdm2_f_ovvo += einsum(x440, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_ovvo += einsum(x440, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_voov += einsum(x440, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_voov += einsum(x440, (0, 1, 2, 3), (2, 1, 0, 3)) - del x440 - x441 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x441 += einsum(t1, (0, 1), x130, (2, 0, 3, 4), (2, 3, 1, 4)) * 0.5 - rdm2_f_ovvo += einsum(x441, (0, 1, 2, 3), (1, 3, 2, 0)) * -1.0 - rdm2_f_ovvo += einsum(x441, (0, 1, 2, 3), (1, 3, 2, 0)) * -1.0 - del x441 - x442 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x442 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x442 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * -1.0 - x443 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x443 += einsum(t3, (0, 1, 2, 3, 4, 5), x442, (2, 1, 6, 5, 7, 3), (6, 0, 7, 4)) * 0.25 - del x442 - rdm2_f_voov += einsum(x443, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_voov += einsum(x443, (0, 1, 2, 3), (2, 1, 0, 3)) - del x443 - x444 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x444 += einsum(l3, (0, 1, 2, 3, 4, 5), x317, (5, 6, 3, 2, 7, 1), (4, 6, 0, 7)) * 0.25 - del x317 - rdm2_f_voov += einsum(x444, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_voov += einsum(x444, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x444 - x445 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x445 += einsum(x42, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -0.5 - x445 += einsum(x42, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - x446 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x446 += einsum(t2, (0, 1, 2, 3), x445, (4, 0, 1, 5, 6, 2), (4, 5, 6, 3)) * 2.0 - del x445 - rdm2_f_voov += einsum(x446, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_voov += einsum(x446, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_vovo += einsum(x446, (0, 1, 2, 3), (2, 1, 3, 0)) - rdm2_f_vovo += einsum(x446, (0, 1, 2, 3), (2, 1, 3, 0)) - del x446 - x447 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x447 += einsum(l2, (0, 1, 2, 3), x6, (2, 4, 5, 1), (3, 4, 0, 5)) - rdm2_f_voov += einsum(x447, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_voov += einsum(x447, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x447 - x448 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x448 += einsum(l3, (0, 1, 2, 3, 4, 5), x349, (4, 6, 5, 1, 7, 2), (6, 3, 7, 0)) * 0.25 - rdm2_f_voov += einsum(x448, (0, 1, 2, 3), (3, 0, 1, 2)) - rdm2_f_voov += einsum(x448, (0, 1, 2, 3), (3, 0, 1, 2)) - del x448 - x449 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x449 += einsum(t1, (0, 1), x151, (2, 0, 3, 4), (2, 3, 1, 4)) - del x151 - rdm2_f_voov += einsum(x449, (0, 1, 2, 3), (3, 1, 0, 2)) * -1.0 - rdm2_f_voov += einsum(x449, (0, 1, 2, 3), (3, 1, 0, 2)) * -1.0 - del x449 - x450 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x450 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * 5.0 - x450 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * -1.0 - x451 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x451 += einsum(t3, (0, 1, 2, 3, 4, 5), x450, (2, 6, 1, 5, 7, 4), (6, 0, 7, 3)) * 0.25 - del x450 - rdm2_f_vovo += einsum(x451, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - rdm2_f_vovo += einsum(x451, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - del x451 - x452 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x452 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - x452 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - x452 += einsum(t3, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 3, 4)) - x453 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x453 += einsum(l3, (0, 1, 2, 3, 4, 5), x452, (4, 6, 5, 1, 7, 2), (6, 3, 7, 0)) * 0.25 - del x452 - rdm2_f_vovo += einsum(x453, (0, 1, 2, 3), (3, 0, 2, 1)) - rdm2_f_vovo += einsum(x453, (0, 1, 2, 3), (3, 0, 2, 1)) - del x453 - x454 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x454 += einsum(l3, (0, 1, 2, 3, 4, 5), x315, (5, 6, 4, 2, 1, 7), (3, 6, 0, 7)) * 0.25 - del x315 - rdm2_f_vovo += einsum(x454, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - rdm2_f_vovo += einsum(x454, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - del x454 - x455 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x455 += einsum(t1, (0, 1), x130, (0, 2, 3, 4), (2, 3, 1, 4)) * 0.5 - rdm2_f_vovo += einsum(x455, (0, 1, 2, 3), (3, 1, 2, 0)) * -1.0 - rdm2_f_vovo += einsum(x455, (0, 1, 2, 3), (3, 1, 2, 0)) * -1.0 - del x455 - x456 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x456 += einsum(t3, (0, 1, 2, 3, 4, 5), x42, (2, 0, 1, 6, 7, 4), (6, 7, 5, 3)) - rdm2_f_ovvv = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - rdm2_f_ovvv += einsum(x456, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.50000000000001 - rdm2_f_ovvv += einsum(x456, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.50000000000001 - rdm2_f_vovv = np.zeros((nvir, nocc, nvir, nvir), dtype=types[float]) - rdm2_f_vovv += einsum(x456, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.50000000000001 - rdm2_f_vovv += einsum(x456, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.50000000000001 - del x456 - x457 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x457 += einsum(t3, (0, 1, 2, 3, 4, 5), x35, (0, 1, 2, 6, 4, 7), (6, 7, 3, 5)) - rdm2_f_ovvv += einsum(x457, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.16666666666667 - rdm2_f_ovvv += einsum(x457, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.16666666666667 - rdm2_f_vovv += einsum(x457, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.16666666666667 - rdm2_f_vovv += einsum(x457, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.16666666666667 - del x457 - x458 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x458 += einsum(l1, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) - rdm2_f_ovvv += einsum(x458, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_ovvv += einsum(x458, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_vovv += einsum(x458, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_vovv += einsum(x458, (0, 1, 2, 3), (1, 0, 3, 2)) - x459 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x459 += einsum(t2, (0, 1, 2, 3), x263, (1, 3, 4, 5), (0, 4, 2, 5)) - x460 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x460 += einsum(t3, (0, 1, 2, 3, 4, 5), x35, (0, 1, 2, 6, 3, 7), (6, 7, 5, 4)) - x461 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x461 += einsum(x238, (0, 1, 2, 3, 4, 5), x35, (0, 1, 2, 6, 7, 4), (6, 3, 5, 7)) * 0.16666666666667 - x462 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x462 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - x462 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) - x463 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x463 += einsum(x462, (0, 1, 2, 3), t3, (4, 1, 0, 5, 6, 3), (4, 2, 5, 6)) * 0.5 - del x462 - x464 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x464 += einsum(l3, (0, 1, 2, 3, 4, 5), x198, (5, 6, 4, 2, 7, 1), (3, 6, 0, 7)) * 0.25 - del x198 - x465 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x465 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) - x465 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - x465 += einsum(t3, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - x466 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x466 += einsum(l3, (0, 1, 2, 3, 4, 5), x465, (5, 6, 3, 2, 7, 1), (6, 4, 7, 0)) * 0.25 - del x465 - x467 = np.zeros((nocc, nocc, nocc, nocc, nvir, nvir), dtype=types[float]) - x467 += einsum(x42, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x467 += einsum(x35, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - x467 += einsum(x35, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * 0.5 - x467 += einsum(x35, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -0.5 - x468 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x468 += einsum(t2, (0, 1, 2, 3), x467, (4, 1, 0, 5, 6, 2), (4, 5, 6, 3)) - del x467 - x469 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x469 += einsum(l2, (0, 1, 2, 3), x357, (3, 4, 1, 5), (4, 2, 5, 0)) - x470 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x470 += einsum(l2, (0, 1, 2, 3), x32, (2, 4, 1, 5), (3, 4, 0, 5)) - x471 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x471 += einsum(t1, (0, 1), x418, (2, 0, 3, 4), (2, 3, 4, 1)) * 0.5 - del x418 - x472 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x472 += einsum(x197, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.25 - del x197 - x472 += einsum(x176, (0, 1, 2, 3), (0, 1, 2, 3)) - x472 += einsum(x464, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x464 - x472 += einsum(x466, (0, 1, 2, 3), (1, 0, 3, 2)) - del x466 - x472 += einsum(x468, (0, 1, 2, 3), (0, 1, 2, 3)) - del x468 - x472 += einsum(x469, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x469 - x472 += einsum(x470, (0, 1, 2, 3), (0, 1, 2, 3)) - del x470 - x472 += einsum(x471, (0, 1, 2, 3), (0, 1, 2, 3)) - del x471 - x473 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x473 += einsum(t1, (0, 1), x472, (0, 2, 3, 4), (2, 3, 4, 1)) - del x472 - x474 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x474 += einsum(t2, (0, 1, 2, 3), x222, (1, 4, 5, 6, 2, 3), (4, 5, 0, 6)) * 0.5 - del x222 - x475 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x475 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x475 += einsum(x474, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x474 - x476 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x476 += einsum(t2, (0, 1, 2, 3), x475, (1, 0, 4, 5), (4, 5, 2, 3)) - del x475 - x477 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x477 += einsum(t2, (0, 1, 2, 3), x378, (1, 0, 4, 5), (4, 5, 2, 3)) * 0.25 - del x378 - x478 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x478 += einsum(x458, (0, 1, 2, 3), (0, 1, 2, 3)) - del x458 - x478 += einsum(x459, (0, 1, 2, 3), (0, 1, 2, 3)) - del x459 - x478 += einsum(x460, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.16666666666667 - del x460 - x478 += einsum(x461, (0, 1, 2, 3), (0, 3, 1, 2)) * -1.0 - del x461 - x478 += einsum(x463, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x463 - x478 += einsum(x473, (0, 1, 2, 3), (0, 1, 3, 2)) - del x473 - x478 += einsum(x476, (0, 1, 2, 3), (0, 1, 3, 2)) - del x476 - x478 += einsum(x477, (0, 1, 2, 3), (0, 1, 2, 3)) - del x477 - x478 += einsum(t1, (0, 1), x422, (2, 3), (0, 2, 1, 3)) - del x422 - rdm2_f_ovvv += einsum(x478, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_ovvv += einsum(x478, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_ovvv += einsum(x478, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_ovvv += einsum(x478, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_vovv += einsum(x478, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_vovv += einsum(x478, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_vovv += einsum(x478, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_vovv += einsum(x478, (0, 1, 2, 3), (1, 0, 3, 2)) - del x478 - x479 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x479 += einsum(t2, (0, 1, 2, 3), x128, (1, 4, 5, 3), (0, 2, 5, 4)) * -1.0 - rdm2_f_ovvv += einsum(x479, (0, 1, 2, 3), (0, 2, 1, 3)) - rdm2_f_ovvv += einsum(x479, (0, 1, 2, 3), (0, 2, 3, 1)) * -0.5 - rdm2_f_ovvv += einsum(x479, (0, 1, 2, 3), (0, 2, 1, 3)) - rdm2_f_ovvv += einsum(x479, (0, 1, 2, 3), (0, 2, 3, 1)) * -0.5 - rdm2_f_vovv += einsum(x479, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_vovv += einsum(x479, (0, 1, 2, 3), (2, 0, 3, 1)) * 0.5 - rdm2_f_vovv += einsum(x479, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_vovv += einsum(x479, (0, 1, 2, 3), (2, 0, 3, 1)) * 0.5 - del x479 - x480 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x480 += einsum(x258, (0, 1, 2, 3), x6, (0, 4, 2, 5), (4, 1, 3, 5)) - rdm2_f_ovvv += einsum(x480, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_ovvv += einsum(x480, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - rdm2_f_ovvv += einsum(x480, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_ovvv += einsum(x480, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - rdm2_f_vovv += einsum(x480, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - rdm2_f_vovv += einsum(x480, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - rdm2_f_vovv += einsum(x480, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - rdm2_f_vovv += einsum(x480, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - del x480 - x481 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x481 += einsum(x238, (0, 1, 2, 3, 4, 5), x35, (0, 2, 1, 6, 7, 5), (6, 3, 4, 7)) * 0.16666666666667 - rdm2_f_ovvv += einsum(x481, (0, 1, 2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_ovvv += einsum(x481, (0, 1, 2, 3), (0, 3, 1, 2)) * -1.0 - del x481 - x482 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x482 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) * -0.3333333333333333 - x482 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) - x483 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x483 += einsum(x482, (0, 1, 2, 3), t3, (4, 1, 0, 5, 3, 6), (4, 2, 6, 5)) * 1.5 - del x482 - rdm2_f_ovvv += einsum(x483, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_ovvv += einsum(x483, (0, 1, 2, 3), (0, 1, 3, 2)) - del x483 - x484 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x484 += einsum(t2, (0, 1, 2, 3), l3, (4, 3, 5, 6, 0, 1), (6, 4, 5, 2)) - x485 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x485 += einsum(t2, (0, 1, 2, 3), l3, (4, 3, 5, 0, 6, 1), (6, 4, 5, 2)) - x486 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x486 += einsum(x484, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x486 += einsum(x485, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x486 += einsum(x485, (0, 1, 2, 3), (0, 2, 1, 3)) - x487 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x487 += einsum(x32, (0, 1, 2, 3), x486, (0, 4, 3, 5), (1, 4, 5, 2)) * 0.5 - del x486 - rdm2_f_ovvv += einsum(x487, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_ovvv += einsum(x487, (0, 1, 2, 3), (0, 1, 2, 3)) - del x487 - x488 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x488 += einsum(t2, (0, 1, 2, 3), x270, (1, 4, 2, 5), (0, 4, 5, 3)) * 0.5 - del x270 - rdm2_f_ovvv += einsum(x488, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_ovvv += einsum(x488, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x488 - x489 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x489 += einsum(x6, (0, 1, 2, 3), l3, (4, 5, 2, 6, 0, 1), (6, 4, 5, 3)) - x490 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x490 += einsum(t2, (0, 1, 2, 3), x489, (1, 4, 3, 5), (0, 4, 5, 2)) * -1.0 - rdm2_f_ovvv += einsum(x490, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_ovvv += einsum(x490, (0, 1, 2, 3), (0, 1, 3, 2)) - del x490 - x491 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x491 += einsum(t1, (0, 1), x10, (2, 0, 3, 4), (2, 3, 1, 4)) * 3.0 - x492 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x492 += einsum(t1, (0, 1), x491, (0, 2, 3, 4), (2, 4, 3, 1)) * 0.5 - del x491 - rdm2_f_ovvv += einsum(x492, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_ovvv += einsum(x492, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x492 - x493 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x493 += einsum(l2, (0, 1, 2, 3), t3, (4, 2, 3, 5, 6, 1), (4, 0, 5, 6)) - rdm2_f_ovvv += einsum(x493, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_ovvv += einsum(x493, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_vovv += einsum(x493, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_vovv += einsum(x493, (0, 1, 2, 3), (1, 0, 3, 2)) - del x493 - x494 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x494 += einsum(t3, (0, 1, 2, 3, 4, 5), x42, (2, 0, 1, 6, 5, 7), (6, 7, 3, 4)) - del x42 - rdm2_f_ovvv += einsum(x494, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.50000000000001 - rdm2_f_ovvv += einsum(x494, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.50000000000001 - rdm2_f_vovv += einsum(x494, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.50000000000001 - rdm2_f_vovv += einsum(x494, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.50000000000001 - del x494 - x495 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x495 += einsum(t3, (0, 1, 2, 3, 4, 5), x35, (0, 2, 1, 6, 7, 5), (6, 7, 3, 4)) - rdm2_f_ovvv += einsum(x495, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.50000000000001 - rdm2_f_ovvv += einsum(x495, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.50000000000001 - rdm2_f_vovv += einsum(x495, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.50000000000001 - rdm2_f_vovv += einsum(x495, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.50000000000001 - del x495 - x496 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x496 += einsum(x274, (0, 1, 2, 3), t3, (0, 4, 1, 5, 6, 3), (4, 2, 5, 6)) * 0.5 - del x274 - rdm2_f_ovvv += einsum(x496, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_ovvv += einsum(x496, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_vovv += einsum(x496, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_vovv += einsum(x496, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x496 - x497 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x497 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 2, 1)) - x497 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - x497 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) - x497 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) * -1.0 - x498 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x498 += einsum(t2, (0, 1, 2, 3), x497, (0, 1, 4, 5, 2, 6), (4, 5, 6, 3)) - del x497 - x499 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x499 += einsum(x263, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x499 += einsum(x263, (0, 1, 2, 3), (0, 2, 1, 3)) - x499 += einsum(x498, (0, 1, 2, 3), (0, 1, 2, 3)) - del x498 - x500 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x500 += einsum(t2, (0, 1, 2, 3), x499, (1, 4, 3, 5), (0, 4, 5, 2)) - del x499 - rdm2_f_ovvv += einsum(x500, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_ovvv += einsum(x500, (0, 1, 2, 3), (0, 1, 3, 2)) - del x500 - x501 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x501 += einsum(t2, (0, 1, 2, 3), x127, (0, 1, 4, 5, 2, 6), (4, 3, 5, 6)) * 0.5 - del x127 - rdm2_f_vvov += einsum(x501, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - rdm2_f_vvov += einsum(x501, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - rdm2_f_vvvo += einsum(x501, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - rdm2_f_vvvo += einsum(x501, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - x502 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x502 += einsum(x263, (0, 1, 2, 3), (0, 1, 2, 3)) - x502 += einsum(x501, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - del x501 - x503 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x503 += einsum(t2, (0, 1, 2, 3), x502, (1, 4, 2, 5), (0, 4, 5, 3)) - rdm2_f_ovvv += einsum(x503, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_ovvv += einsum(x503, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x503 - x504 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x504 += einsum(x263, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x504 += einsum(x128, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - x505 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x505 += einsum(t2, (0, 1, 2, 3), x504, (1, 2, 4, 5), (0, 4, 5, 3)) * 0.5 - del x504 - rdm2_f_ovvv += einsum(x505, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_ovvv += einsum(x505, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x505 - x506 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x506 += einsum(l3, (0, 1, 2, 3, 4, 5), x349, (4, 6, 5, 1, 7, 2), (6, 3, 7, 0)) * 0.125 - del x349 - x507 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x507 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 2, 1)) - x507 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - x508 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x508 += einsum(t3, (0, 1, 2, 3, 4, 5), x507, (1, 2, 6, 4, 5, 7), (6, 0, 7, 3)) * 0.125 - x509 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x509 += einsum(t2, (0, 1, 2, 3), x250, (0, 1, 4, 5, 3, 6), (4, 5, 6, 2)) * 0.25 - del x250 - x510 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x510 += einsum(l2, (0, 1, 2, 3), x357, (3, 4, 1, 5), (4, 2, 5, 0)) * 0.5 - x511 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x511 += einsum(t1, (0, 1), x130, (2, 0, 3, 4), (2, 3, 1, 4)) * 0.25 - del x130 - x512 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x512 += einsum(x437, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x437 - x512 += einsum(x435, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.125 - del x435 - x512 += einsum(x183, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.125 - del x183 - x512 += einsum(x176, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x176 - x512 += einsum(x506, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x506 - x512 += einsum(x508, (0, 1, 2, 3), (0, 1, 2, 3)) - del x508 - x512 += einsum(x509, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x509 - x512 += einsum(x510, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x510 - x512 += einsum(x511, (0, 1, 2, 3), (0, 1, 3, 2)) - del x511 - x513 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x513 += einsum(t1, (0, 1), x512, (0, 2, 3, 4), (2, 3, 4, 1)) * 2.0 - del x512 - rdm2_f_ovvv += einsum(x513, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_ovvv += einsum(x513, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_vovv += einsum(x513, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - rdm2_f_vovv += einsum(x513, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x513 - x514 = np.zeros((nocc, nocc, nocc, nvir), dtype=types[float]) - x514 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - del x23 - x514 += einsum(x331, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x331 - x515 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x515 += einsum(t2, (0, 1, 2, 3), x514, (0, 1, 4, 5), (4, 5, 3, 2)) - del x514 - rdm2_f_ovvv += einsum(x515, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_ovvv += einsum(x515, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_vovv += einsum(x515, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - rdm2_f_vovv += einsum(x515, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x515 - x516 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x516 += einsum(t2, (0, 1, 2, 3), x33, (0, 1, 4, 5), (4, 3, 2, 5)) * -0.5 - del x33 - rdm2_f_ovvv += einsum(x516, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - rdm2_f_ovvv += einsum(x516, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - rdm2_f_vovv += einsum(x516, (0, 1, 2, 3), (3, 0, 1, 2)) * -1.0 - rdm2_f_vovv += einsum(x516, (0, 1, 2, 3), (3, 0, 1, 2)) * -1.0 - del x516 - x517 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x517 += einsum(t2, (0, 1, 2, 3), x143, (0, 1, 4, 5, 6, 2), (4, 5, 3, 6)) * 0.5 - del x143 - x518 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x518 += einsum(x399, (0, 1, 2, 3), (0, 1, 2, 3)) - del x399 - x518 += einsum(x374, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x374 - x518 += einsum(x375, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x375 - x518 += einsum(x400, (0, 1, 2, 3), (0, 1, 2, 3)) - del x400 - x518 += einsum(x517, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x517 - x519 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x519 += einsum(t1, (0, 1), x518, (0, 2, 3, 4), (2, 3, 4, 1)) - del x518 - rdm2_f_ovvv += einsum(x519, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_ovvv += einsum(x519, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_vovv += einsum(x519, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_vovv += einsum(x519, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x519 - x520 = np.zeros((nvir, nvir), dtype=types[float]) - x520 += einsum(l3, (0, 1, 2, 3, 4, 5), x204, (4, 3, 5, 1, 6, 2), (0, 6)) * 0.041666666666665 - del x204 - x521 = np.zeros((nvir, nvir), dtype=types[float]) - x521 += einsum(l3, (0, 1, 2, 3, 4, 5), x45, (4, 5, 3, 6, 1, 2), (0, 6)) * 0.041666666666665 - del x45 - x522 = np.zeros((nvir, nvir), dtype=types[float]) - x522 += einsum(t2, (0, 1, 2, 3), x96, (0, 1, 2, 4), (3, 4)) - del x96 - x523 = np.zeros((nvir, nvir), dtype=types[float]) - x523 += einsum(x421, (0, 1), (0, 1)) * 0.5 - del x421 - x523 += einsum(x203, (0, 1), (0, 1)) * 0.124999999999995 - del x203 - x523 += einsum(x520, (0, 1), (0, 1)) - del x520 - x523 += einsum(x521, (0, 1), (0, 1)) * -1.0 - del x521 - x523 += einsum(x522, (0, 1), (1, 0)) - del x522 - rdm2_f_ovvv += einsum(t1, (0, 1), x523, (2, 3), (0, 2, 1, 3)) * 2.0 - rdm2_f_ovvv += einsum(t1, (0, 1), x523, (2, 3), (0, 2, 1, 3)) * 2.0 - rdm2_f_vovv += einsum(t1, (0, 1), x523, (2, 3), (2, 0, 3, 1)) * 2.0 - rdm2_f_vovv += einsum(t1, (0, 1), x523, (2, 3), (2, 0, 3, 1)) * 2.0 - del x523 - x524 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x524 += einsum(x178, (0, 1, 2, 3, 4, 5), x35, (0, 2, 1, 6, 7, 5), (6, 7, 3, 4)) * 0.16666666666667 - del x35, x178 - rdm2_f_vovv += einsum(x524, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_vovv += einsum(x524, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x524 - x525 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x525 += einsum(l2, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - x525 += einsum(l2, (0, 1, 2, 3), (2, 3, 0, 1)) * 3.0 - x526 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x526 += einsum(x525, (0, 1, 2, 3), t3, (4, 1, 0, 5, 3, 6), (4, 2, 6, 5)) * 0.5 - del x525 - rdm2_f_vovv += einsum(x526, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - rdm2_f_vovv += einsum(x526, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x526 - x527 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x527 += einsum(x484, (0, 1, 2, 3), (0, 1, 2, 3)) - del x484 - x527 += einsum(x485, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x527 += einsum(x485, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.5 - x528 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x528 += einsum(x32, (0, 1, 2, 3), x527, (0, 4, 3, 5), (1, 4, 5, 2)) - del x527 - rdm2_f_vovv += einsum(x528, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_vovv += einsum(x528, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x528 - x529 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x529 += einsum(x489, (0, 1, 2, 3), x6, (0, 4, 2, 5), (4, 1, 3, 5)) * -1.0 - del x6, x489 - rdm2_f_vovv += einsum(x529, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_vovv += einsum(x529, (0, 1, 2, 3), (1, 0, 3, 2)) - del x529 - x530 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x530 += einsum(t2, (0, 1, 2, 3), x128, (1, 4, 5, 2), (0, 3, 5, 4)) * -0.5 - rdm2_f_vovv += einsum(x530, (0, 1, 2, 3), (2, 0, 1, 3)) - rdm2_f_vovv += einsum(x530, (0, 1, 2, 3), (2, 0, 1, 3)) - del x530 - x531 = np.zeros((nocc, nocc, nvir, nvir), dtype=types[float]) - x531 += einsum(t1, (0, 1), x10, (2, 0, 3, 4), (2, 3, 1, 4)) - del x10 - x532 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x532 += einsum(t1, (0, 1), x531, (0, 2, 3, 4), (2, 4, 3, 1)) * 1.5 - del x531 - rdm2_f_vovv += einsum(x532, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_vovv += einsum(x532, (0, 1, 2, 3), (1, 0, 3, 2)) - del x532 - x533 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x533 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 2, 1)) - x533 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) * -1.0 - x533 += einsum(l3, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * 4.0 - x534 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x534 += einsum(t2, (0, 1, 2, 3), x533, (0, 1, 4, 2, 5, 6), (4, 5, 6, 3)) - del x533 - x535 = np.zeros((nocc, nocc, nocc, nvir, nvir, nvir), dtype=types[float]) - x535 += einsum(l3, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 1, 2)) - x535 += einsum(l3, (0, 1, 2, 3, 4, 5), (3, 5, 4, 0, 2, 1)) - x536 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x536 += einsum(t2, (0, 1, 2, 3), x535, (1, 4, 0, 5, 6, 3), (4, 5, 6, 2)) * 2.0 - del x535 - x537 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x537 += einsum(x485, (0, 1, 2, 3), (0, 1, 2, 3)) - x537 += einsum(x485, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x537 += einsum(x534, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x534 - x537 += einsum(x536, (0, 1, 2, 3), (0, 1, 2, 3)) - del x536 - x538 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x538 += einsum(t2, (0, 1, 2, 3), x537, (1, 3, 4, 5), (0, 4, 5, 2)) * 0.5 - del x537 - rdm2_f_vovv += einsum(x538, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_vovv += einsum(x538, (0, 1, 2, 3), (1, 0, 2, 3)) - del x538 - x539 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x539 += einsum(t2, (0, 1, 2, 3), x507, (0, 1, 4, 5, 2, 6), (4, 5, 6, 3)) - x540 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x540 += einsum(x47, (0, 1, 2, 3), (0, 2, 1, 3)) * 2.0 - del x47 - x540 += einsum(x539, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x539 - x541 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x541 += einsum(t2, (0, 1, 2, 3), x540, (1, 2, 4, 5), (0, 4, 5, 3)) * 0.5 - del x540 - rdm2_f_vovv += einsum(x541, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_vovv += einsum(x541, (0, 1, 2, 3), (1, 0, 3, 2)) - del x541 - x542 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x542 += einsum(t2, (0, 1, 2, 3), x502, (1, 2, 4, 5), (0, 4, 5, 3)) - del x502 - rdm2_f_vovv += einsum(x542, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_vovv += einsum(x542, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x542 - x543 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x543 += einsum(t1, (0, 1), l2, (2, 3, 4, 0), (4, 2, 3, 1)) - rdm2_f_vvov += einsum(x543, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_vvov += einsum(x543, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_vvvo += einsum(x543, (0, 1, 2, 3), (2, 1, 3, 0)) - rdm2_f_vvvo += einsum(x543, (0, 1, 2, 3), (2, 1, 3, 0)) - x544 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x544 += einsum(x543, (0, 1, 2, 3), (0, 1, 2, 3)) - x544 += einsum(x485, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x485 - rdm2_f_vvov += einsum(x544, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_vvov += einsum(x544, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_vvov += einsum(x544, (0, 1, 2, 3), (1, 2, 0, 3)) - rdm2_f_vvov += einsum(x544, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_vvvo += einsum(x544, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_vvvo += einsum(x544, (0, 1, 2, 3), (2, 1, 3, 0)) - rdm2_f_vvvo += einsum(x544, (0, 1, 2, 3), (1, 2, 3, 0)) * -1.0 - rdm2_f_vvvo += einsum(x544, (0, 1, 2, 3), (2, 1, 3, 0)) - del x544 - x545 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x545 += einsum(x357, (0, 1, 2, 3), l3, (4, 2, 5, 1, 0, 6), (6, 3, 4, 5)) - del x357 - rdm2_f_vvov += einsum(x545, (0, 1, 2, 3), (3, 2, 0, 1)) - rdm2_f_vvov += einsum(x545, (0, 1, 2, 3), (3, 2, 0, 1)) - rdm2_f_vvvo += einsum(x545, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - rdm2_f_vvvo += einsum(x545, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - del x545 - x546 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x546 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 4, 5, 6, 1, 7), (0, 2, 6, 7)) - rdm2_f_vvvv = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - rdm2_f_vvvv += einsum(x546, (0, 1, 2, 3), (1, 0, 3, 2)) * 0.50000000000001 - rdm2_f_vvvv += einsum(x546, (0, 1, 2, 3), (1, 0, 3, 2)) * 0.50000000000001 - del x546 - x547 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x547 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (5, 3, 4, 6, 2, 7), (0, 1, 6, 7)) - rdm2_f_vvvv += einsum(x547, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.16666666666667 - rdm2_f_vvvv += einsum(x547, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.16666666666667 - del x547 - x548 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x548 += einsum(l2, (0, 1, 2, 3), t2, (2, 3, 4, 5), (0, 1, 4, 5)) - rdm2_f_vvvv += einsum(x548, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_vvvv += einsum(x548, (0, 1, 2, 3), (1, 0, 3, 2)) - x549 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x549 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (5, 3, 4, 2, 6, 7), (0, 1, 7, 6)) - x550 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x550 += einsum(l3, (0, 1, 2, 3, 4, 5), x238, (3, 5, 4, 6, 2, 7), (6, 7, 0, 1)) * 0.16666666666667 - x551 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x551 += einsum(x32, (0, 1, 2, 3), l3, (4, 5, 2, 6, 0, 1), (6, 4, 5, 3)) - del x32 - x552 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x552 += einsum(t2, (0, 1, 2, 3), x507, (0, 1, 4, 5, 2, 6), (4, 5, 6, 3)) * 0.5 - del x507 - x553 = np.zeros((nocc, nvir, nvir, nvir), dtype=types[float]) - x553 += einsum(x543, (0, 1, 2, 3), (0, 1, 2, 3)) - x553 += einsum(x551, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x551 - x553 += einsum(x552, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x552 - x554 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x554 += einsum(t1, (0, 1), x553, (0, 2, 3, 4), (2, 3, 4, 1)) - del x553 - x555 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x555 += einsum(x548, (0, 1, 2, 3), (1, 0, 3, 2)) - del x548 - x555 += einsum(x549, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.16666666666667 - del x549 - x555 += einsum(x550, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - del x550 - x555 += einsum(x554, (0, 1, 2, 3), (1, 0, 2, 3)) - del x554 - rdm2_f_vvvv += einsum(x555, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_vvvv += einsum(x555, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_vvvv += einsum(x555, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_vvvv += einsum(x555, (0, 1, 2, 3), (0, 1, 2, 3)) - del x555 - x556 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x556 += einsum(t1, (0, 1), x258, (0, 2, 3, 4), (2, 3, 1, 4)) - del x258 - rdm2_f_vvvv += einsum(x556, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_vvvv += einsum(x556, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_vvvv += einsum(x556, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_vvvv += einsum(x556, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x556 - x557 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x557 += einsum(l3, (0, 1, 2, 3, 4, 5), x238, (3, 5, 4, 6, 7, 2), (6, 7, 0, 1)) * 0.16666666666667 - del x238 - rdm2_f_vvvv += einsum(x557, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - rdm2_f_vvvv += einsum(x557, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - del x557 - x558 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x558 += einsum(t1, (0, 1), x543, (0, 2, 3, 4), (3, 2, 4, 1)) - del x543 - rdm2_f_vvvv += einsum(x558, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_vvvv += einsum(x558, (0, 1, 2, 3), (1, 0, 3, 2)) - del x558 - x559 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x559 += einsum(l3, (0, 1, 2, 3, 4, 5), t3, (3, 4, 5, 6, 7, 2), (0, 1, 6, 7)) - x560 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x560 += einsum(t1, (0, 1), x263, (0, 2, 3, 4), (2, 3, 1, 4)) - del x263 - x561 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x561 += einsum(x559, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.50000000000001 - del x559 - x561 += einsum(x560, (0, 1, 2, 3), (0, 1, 2, 3)) - del x560 - rdm2_f_vvvv += einsum(x561, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_vvvv += einsum(x561, (0, 1, 2, 3), (1, 0, 3, 2)) - rdm2_f_vvvv += einsum(x561, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_vvvv += einsum(x561, (0, 1, 2, 3), (1, 0, 3, 2)) - del x561 - x562 = np.zeros((nvir, nvir, nvir, nvir), dtype=types[float]) - x562 += einsum(t1, (0, 1), x128, (0, 2, 3, 4), (1, 3, 4, 2)) * -0.5 - del x128 - rdm2_f_vvvv += einsum(x562, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_vvvv += einsum(x562, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_vvvv += einsum(x562, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_vvvv += einsum(x562, (0, 1, 2, 3), (2, 1, 0, 3)) - del x562 - - rdm2_f = pack_2e(rdm2_f_oooo, rdm2_f_ooov, rdm2_f_oovo, rdm2_f_ovoo, rdm2_f_vooo, rdm2_f_oovv, rdm2_f_ovov, rdm2_f_ovvo, rdm2_f_voov, rdm2_f_vovo, rdm2_f_vvoo, rdm2_f_ovvv, rdm2_f_vovv, rdm2_f_vvov, rdm2_f_vvvo, rdm2_f_vvvv) - - rdm2_f = np.transpose(rdm2_f, (0, 2, 1, 3)) - - return rdm2_f - diff --git a/ebcc/codegen/RCCSDwtwp.py b/ebcc/codegen/RCCSDwtwp.py deleted file mode 100644 index ba33f50c..00000000 --- a/ebcc/codegen/RCCSDwtwp.py +++ /dev/null @@ -1,1618 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:16:22.166169 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace -from ebcc.backend import _inflate - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:16:22.869247. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp0 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp1 = np.copy(f.ov) - tmp1 += einsum(t1, (0, 1), tmp0, (0, 2, 3, 1), (2, 3)) - del tmp0 - e_cc = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 2, 1, 3), ()) * 2 - e_cc += einsum(t2, (0, 1, 2, 3), v.ovov, (0, 3, 1, 2), ()) * -1 - e_cc += einsum(tmp1, (0, 1), t1, (0, 1), ()) * 2 - del tmp1 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, t3=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:18:26.069150. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - t3 : array - T3 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - t3new : array - Updated T3 residuals. - """ - - space = kwargs["space"] - t1new = Namespace() - t2new = Namespace() - t3new = Namespace() - so = np.ones((t1.shape[0],), dtype=bool) - sv = np.ones((t1.shape[1],), dtype=bool) - sO = space.active[space.correlated][space.occupied[space.correlated]] - sV = space.active[space.correlated][space.virtual[space.correlated]] - t2_OoVv = np.copy(t2[np.ix_(sO, so, sV, sv)]) - t1_oV = np.copy(t1[np.ix_(so, sV)]) - t1_Ov = np.copy(t1[np.ix_(sO, sv)]) - t2_Oovv = np.copy(t2[np.ix_(sO, so, sv, sv)]) - t2_OOvv = np.copy(t2[np.ix_(sO, sO, sv, sv)]) - t2_OovV = np.copy(t2[np.ix_(sO, so, sv, sV)]) - t2_OoVV = np.copy(t2[np.ix_(sO, so, sV, sV)]) - t2_oovv = np.copy(t2[np.ix_(so, so, sv, sv)]) - t2_ooVV = np.copy(t2[np.ix_(so, so, sV, sV)]) - t2_ooVv = np.copy(t2[np.ix_(so, so, sV, sv)]) - t2_OOvV = np.copy(t2[np.ix_(sO, sO, sv, sV)]) - t1_ov = np.copy(t1[np.ix_(so, sv)]) - - tmp173 = einsum(v.ovov, (0, 1, 2, 3), t1_Ov, (4, 3), (0, 2, 1, 4)) - tmp294 = einsum(v.Vvov, (0, 1, 2, 3), t1_Ov, (4, 1), (2, 3, 4, 0)) - tmp218 = einsum(v.ovov, (0, 1, 2, 3), t1_oV, (2, 4), (0, 1, 3, 4)) - tmp1 = einsum(t1, (0, 1), v.ovov, (2, 3, 0, 1), (2, 3)) - tmp187 = einsum(v.OvVo, (0, 1, 2, 3), t1_Ov, (4, 1), (3, 4, 0, 2)) - tmp148 = einsum(t1, (0, 1), v.Voov, (2, 0, 3, 1), (3, 2)) - tmp14 = einsum(v.ovov, (0, 1, 2, 3), t1, (2, 1), (0, 3)) - tmp154 = einsum(t1_oV, (0, 1), v.VoVo, (2, 3, 4, 0), (3, 1, 2, 4)) - tmp307 = einsum(tmp173, (0, 1, 2, 3), t1_Ov, (4, 2), (0, 1, 4, 3)) - tmp176 = einsum(t1_Ov, (0, 1), v.Ooov, (2, 3, 4, 1), (4, 3, 0, 2)) - tmp134 = einsum(t1_oV, (0, 1), v.Ooov, (2, 0, 3, 4), (3, 4, 2, 1)) - tmp184 = einsum(v.Ovov, (0, 1, 2, 3), t1, (2, 3), (1, 0)) - tmp297 = einsum(v.Vvov, (0, 1, 2, 3), t1_Ov, (4, 3), (2, 1, 4, 0)) - tmp181 = einsum(v.Ovov, (0, 1, 2, 3), t1, (2, 1), (3, 0)) - tmp193 = einsum(tmp173, (0, 1, 2, 3), t1_oV, (0, 4), (1, 2, 3, 4)) - tmp151 = einsum(t1, (0, 1), v.Voov, (2, 3, 0, 1), (3, 2)) - tmp190 = einsum(v.OVov, (0, 1, 2, 3), t1_Ov, (4, 3), (2, 4, 0, 1)) - tmp304 = einsum(v.OvOv, (0, 1, 2, 3), t1_Ov, (4, 3), (1, 4, 0, 2)) - tmp4 = einsum(v.ovov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 2, 1)) - tmp116 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp62 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp75 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp122 = einsum(v.OoOo, (0, 1, 2, 3), t1_oV, (3, 4), (1, 0, 2, 4)) - tmp313 = einsum(tmp294, (0, 1, 2, 3), t1_Ov, (4, 1), (0, 4, 2, 3)) - tmp231 = einsum(tmp218, (0, 1, 2, 3), t2_OovV, (4, 0, 1, 5), (2, 4, 3, 5)) - tmp275 = einsum(t2_OoVv, (0, 1, 2, 3), tmp173, (1, 4, 3, 5), (4, 5, 0, 2)) - tmp216 = einsum(tmp1, (0, 1), t2_OOvV, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp188 = einsum(tmp187, (0, 1, 2, 3), t1_oV, (0, 4), (1, 2, 4, 3)) - del tmp187 - tmp260 = einsum(v.Vvov, (0, 1, 2, 3), t2_OoVv, (4, 2, 5, 1), (3, 4, 5, 0)) - tmp292 = einsum(t1_Ov, (0, 1), v.VvVv, (2, 3, 4, 1), (3, 0, 2, 4)) - tmp300 = einsum(v.OvOv, (0, 1, 2, 3), t2_OOvv, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp167 = einsum(v.OvOO, (0, 1, 2, 3), t1_Ov, (4, 1), (4, 0, 2, 3)) - tmp219 = einsum(tmp218, (0, 1, 2, 3), t2_OovV, (4, 0, 2, 5), (1, 4, 3, 5)) - tmp149 = einsum(t1_oV, (0, 1), tmp148, (0, 2), (1, 2)) - del tmp148 - tmp285 = einsum(t1_Ov, (0, 1), v.OvVV, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp53 = einsum(v.OVVo, (0, 1, 2, 3), t3, (4, 5, 0, 2, 6, 1), (3, 4, 5, 6)) - tmp203 = einsum(v.OvOV, (0, 1, 2, 3), t2_OOvV, (4, 5, 1, 6), (4, 5, 0, 2, 6, 3)) - tmp227 = einsum(t2_OoVv, (0, 1, 2, 3), tmp218, (1, 4, 3, 5), (4, 0, 5, 2)) - tmp161 = einsum(v.VoVv, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp214 = einsum(tmp14, (0, 1), t2_OOvV, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp281 = einsum(v.OoVv, (0, 1, 2, 3), t1_Ov, (4, 3), (1, 4, 0, 2)) - tmp223 = einsum(v.OVVo, (0, 1, 2, 3), t3, (4, 5, 0, 6, 1, 2), (3, 4, 5, 6)) - tmp201 = einsum(t2_OOvV, (0, 1, 2, 3), f.ov, (4, 2), (4, 0, 1, 3)) - tmp265 = einsum(t1_oV, (0, 1), v.VoVV, (2, 0, 3, 4), (1, 2, 3, 4)) - tmp239 = einsum(v.OvVo, (0, 1, 2, 3), t2_OovV, (4, 3, 1, 5), (4, 0, 5, 2)) - tmp142 = einsum(v.Voov, (0, 1, 2, 3), t2_ooVv, (2, 1, 4, 3), (4, 0)) - tmp155 = einsum(tmp154, (0, 1, 2, 3), t1_oV, (0, 4), (1, 4, 3, 2)) - del tmp154 - tmp165 = einsum(f.Ov, (0, 1), t1_Ov, (2, 1), (0, 2)) - tmp308 = einsum(t1_oV, (0, 1), tmp307, (0, 2, 3, 4), (2, 4, 3, 1)) - del tmp307 - tmp171 = einsum(t2_Oovv, (0, 1, 2, 3), v.Ovov, (4, 2, 1, 3), (0, 4)) - tmp252 = einsum(v.OVov, (0, 1, 2, 3), t2_OovV, (4, 2, 3, 5), (4, 0, 5, 1)) - tmp130 = einsum(t1_oV, (0, 1), v.OOVo, (2, 3, 4, 0), (2, 3, 1, 4)) - tmp128 = einsum(t1_oV, (0, 1), v.OoOV, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp179 = einsum(t1_oV, (0, 1), tmp176, (0, 2, 3, 4), (2, 3, 4, 1)) - tmp279 = einsum(t2_OovV, (0, 1, 2, 3), tmp173, (1, 4, 2, 5), (4, 5, 0, 3)) - tmp126 = einsum(v.OOov, (0, 1, 2, 3), t1, (2, 3), (0, 1)) - tmp246 = einsum(t1_oV, (0, 1), v.OoVv, (2, 0, 3, 4), (4, 2, 1, 3)) - tmp254 = einsum(t2_OoVv, (0, 1, 2, 3), v.OVov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp283 = einsum(t2_OovV, (0, 1, 2, 3), tmp173, (4, 1, 2, 5), (4, 5, 0, 3)) - tmp229 = einsum(tmp218, (0, 1, 2, 3), t2_OoVv, (4, 0, 5, 1), (2, 4, 3, 5)) - tmp159 = einsum(v.VVov, (0, 1, 2, 3), t1, (2, 3), (0, 1)) - tmp55 = einsum(v.OVVo, (0, 1, 2, 3), t3, (4, 5, 0, 6, 2, 1), (3, 4, 5, 6)) - tmp144 = einsum(t2_ooVv, (0, 1, 2, 3), v.Voov, (4, 0, 1, 3), (2, 4)) - tmp146 = einsum(t2_ooVV, (0, 1, 2, 3), v.VoVo, (4, 1, 5, 0), (3, 2, 4, 5)) - tmp140 = einsum(f.Vo, (0, 1), t1_oV, (1, 2), (0, 2)) - tmp132 = einsum(t2_ooVV, (0, 1, 2, 3), v.Ooov, (4, 0, 1, 5), (5, 4, 3, 2)) - tmp244 = einsum(v.Vvov, (0, 1, 2, 3), t2_OovV, (4, 2, 1, 5), (3, 4, 5, 0)) - tmp295 = einsum(t1_oV, (0, 1), tmp294, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp294 - tmp135 = einsum(t1_oV, (0, 1), tmp134, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp134 - tmp302 = einsum(tmp218, (0, 1, 2, 3), t2_OOvv, (4, 5, 1, 2), (0, 4, 5, 3)) - del tmp218 - tmp242 = einsum(t1_oV, (0, 1), v.OVov, (2, 3, 0, 4), (4, 2, 1, 3)) - tmp185 = einsum(tmp184, (0, 1), t1_Ov, (2, 0), (2, 1)) - del tmp184 - tmp225 = einsum(v.OVVo, (0, 1, 2, 3), t3, (4, 0, 5, 6, 1, 2), (3, 4, 5, 6)) - tmp258 = einsum(v.Vvov, (0, 1, 2, 3), t2_OoVv, (4, 2, 5, 3), (1, 4, 5, 0)) - tmp298 = einsum(t1_oV, (0, 1), tmp297, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp297 - tmp182 = einsum(tmp181, (0, 1), t1_Ov, (2, 0), (2, 1)) - del tmp181 - tmp124 = einsum(v.OoOv, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp169 = einsum(t2_Oovv, (0, 1, 2, 3), v.Ovov, (4, 3, 1, 2), (0, 4)) - tmp289 = einsum(v.OVVv, (0, 1, 2, 3), t1_Ov, (4, 3), (4, 0, 2, 1)) - tmp177 = einsum(tmp176, (0, 1, 2, 3), t1_oV, (1, 4), (0, 2, 3, 4)) - del tmp176 - tmp174 = einsum(tmp173, (0, 1, 2, 3), t2_ooVV, (0, 1, 4, 5), (2, 3, 4, 5)) - tmp262 = einsum(v.Vvov, (0, 1, 2, 3), t2_OovV, (4, 2, 3, 5), (1, 4, 5, 0)) - tmp250 = einsum(v.OvVo, (0, 1, 2, 3), t2_OoVv, (4, 3, 5, 1), (4, 0, 5, 2)) - tmp277 = einsum(t2_OoVv, (0, 1, 2, 3), tmp173, (4, 1, 3, 5), (4, 5, 0, 2)) - del tmp173 - tmp194 = einsum(t1_oV, (0, 1), tmp193, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp193 - tmp152 = einsum(t1_oV, (0, 1), tmp151, (0, 2), (1, 2)) - del tmp151 - tmp311 = einsum(v.Vvov, (0, 1, 2, 3), t2_OOvv, (4, 5, 3, 1), (2, 4, 5, 0)) - tmp208 = einsum(t2_OoVv, (0, 1, 2, 3), v.Ooov, (4, 1, 5, 3), (5, 0, 4, 2)) - tmp191 = einsum(t1_oV, (0, 1), tmp190, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp305 = einsum(tmp304, (0, 1, 2, 3), t1_Ov, (4, 0), (1, 4, 3, 2)) - del tmp304 - tmp210 = einsum(t2_OoVv, (0, 1, 2, 3), v.Ooov, (4, 5, 1, 3), (5, 0, 4, 2)) - tmp221 = einsum(t2_OovV, (0, 1, 2, 3), v.Ooov, (4, 1, 5, 2), (5, 0, 4, 3)) - tmp212 = einsum(v.Ooov, (0, 1, 2, 3), t2_OovV, (4, 2, 3, 5), (1, 4, 0, 5)) - tmp64 = einsum(v.OvOV, (0, 1, 2, 3), t1, (4, 1), (4, 0, 2, 3)) - tmp38 = einsum(v.OVov, (0, 1, 2, 3), t1, (2, 3), (0, 1)) - tmp36 = einsum(v.OvVo, (0, 1, 2, 3), t1, (3, 1), (0, 2)) - tmp79 = einsum(t2, (0, 1, 2, 3), tmp4, (4, 5, 1, 2), (4, 0, 5, 3)) - tmp94 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp87 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp27 = einsum(v.ooov, (0, 1, 2, 3), t1, (2, 3), (0, 1)) - tmp83 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 2), (0, 4, 5, 3)) - tmp45 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp91 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 2, 3, 5), (4, 0, 1, 5)) - tmp118 = einsum(tmp116, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp89 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp11 = einsum(t1, (0, 1), v.ovvv, (0, 1, 2, 3), (2, 3)) - tmp40 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 3), (4, 1)) - tmp109 = einsum(tmp4, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp13 = einsum(t1, (0, 1), v.ovvv, (0, 2, 3, 1), (2, 3)) - tmp111 = einsum(t2, (0, 1, 2, 3), tmp4, (4, 1, 5, 2), (4, 0, 5, 3)) - tmp9 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 3, 1, 2), (0, 4)) - tmp15 = einsum(tmp14, (0, 1), t1, (2, 1), (2, 0)) - tmp0 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp76 = einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp47 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp48 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp107 = einsum(tmp4, (0, 1, 2, 3), t2, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp57 = einsum(t2, (0, 1, 2, 3), tmp14, (4, 3), (0, 1, 4, 2)) - tmp7 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 3), (0, 4)) - tmp16 = einsum(tmp1, (0, 1), t1, (2, 1), (2, 0)) - tmp26 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 3), (0, 2)) - tmp114 = einsum(t2, (0, 1, 2, 3), v.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp85 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp99 = einsum(t1, (0, 1), tmp4, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp73 = einsum(v.oovv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp71 = einsum(t1, (0, 1), tmp62, (2, 3, 4, 0), (2, 4, 3, 1)) - tmp59 = einsum(t2, (0, 1, 2, 3), tmp1, (4, 3), (0, 1, 4, 2)) - tmp101 = einsum(tmp75, (0, 1, 2, 3), t1, (4, 2), (4, 0, 1, 3)) - tmp42 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 4, 1), (4, 3)) - tmp237 = einsum(t3, (0, 1, 2, 3, 4, 5), v.OOVV, (6, 2, 7, 4), (0, 1, 6, 3, 5, 7)) - tmp123 = einsum(t2_OoVV, (0, 1, 2, 3), tmp122, (1, 4, 5, 6), (0, 5, 4, 6, 3, 2)) - del tmp122 - tmp314 = einsum(t2_OoVV, (0, 1, 2, 3), tmp313, (1, 4, 5, 6), (4, 5, 0, 3, 2, 6)) - del tmp313 - tmp232 = einsum(t2_OOvV, (0, 1, 2, 3), tmp231, (2, 4, 5, 6), (4, 0, 1, 5, 6, 3)) - del tmp231 - tmp276 = einsum(t2_OoVV, (0, 1, 2, 3), tmp275, (1, 4, 5, 6), (4, 5, 0, 6, 3, 2)) - del tmp275 - tmp217 = einsum(t2_OoVV, (0, 1, 2, 3), tmp216, (1, 4, 5, 6), (0, 4, 5, 3, 2, 6)) - del tmp216 - tmp199 = einsum(tmp188, (0, 1, 2, 3), t3, (4, 1, 5, 6, 7, 3), (0, 4, 5, 2, 6, 7)) - tmp261 = einsum(tmp260, (0, 1, 2, 3), t2_OOvV, (4, 5, 0, 6), (1, 4, 5, 2, 6, 3)) - del tmp260 - tmp293 = einsum(t2_OOvV, (0, 1, 2, 3), tmp292, (2, 4, 5, 6), (4, 0, 1, 3, 6, 5)) - del tmp292 - tmp310 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp300, (6, 7, 0, 2), (7, 6, 1, 3, 5, 4)) * -1 - tmp168 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp167, (6, 2, 7, 0), (6, 1, 7, 3, 5, 4)) * -1 - tmp220 = einsum(t2_OOvV, (0, 1, 2, 3), tmp219, (2, 4, 5, 6), (4, 0, 1, 5, 6, 3)) - del tmp219 - tmp120 = einsum(t3, (0, 1, 2, 3, 4, 5), f.OO, (6, 2), (6, 0, 1, 3, 5, 4)) - tmp150 = einsum(tmp149, (0, 1), t3, (2, 3, 4, 5, 6, 1), (2, 4, 3, 0, 5, 6)) - tmp286 = einsum(tmp285, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (0, 4, 5, 6, 7, 2)) - tmp206 = einsum(tmp53, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (4, 1, 2, 6, 5, 3)) - tmp205 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp203, (6, 7, 1, 2, 8, 5), (6, 7, 0, 8, 3, 4)) - tmp228 = einsum(t2_OOvV, (0, 1, 2, 3), tmp227, (2, 4, 5, 6), (4, 0, 1, 5, 6, 3)) - del tmp227 - tmp137 = einsum(v.OOOO, (0, 1, 2, 3), t3, (4, 3, 1, 5, 6, 7), (4, 0, 2, 5, 7, 6)) - tmp233 = einsum(v.OoOV, (0, 1, 2, 3), t2_OoVV, (4, 1, 5, 6), (4, 0, 2, 6, 5, 3)) - tmp162 = einsum(tmp161, (0, 1), t3, (2, 3, 4, 5, 6, 0), (2, 4, 3, 5, 6, 1)) - tmp215 = einsum(tmp214, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (4, 1, 2, 6, 5, 3)) - del tmp214 - tmp157 = einsum(t3, (0, 1, 2, 3, 4, 5), f.VV, (6, 5), (0, 2, 1, 6, 3, 4)) - tmp282 = einsum(tmp281, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (1, 4, 2, 6, 5, 3)) - del tmp281 - tmp158 = einsum(t3, (0, 1, 2, 3, 4, 5), v.OVOV, (6, 7, 2, 5), (0, 1, 6, 3, 4, 7)) - tmp224 = einsum(tmp223, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (4, 1, 2, 6, 5, 3)) - del tmp223 - tmp202 = einsum(tmp201, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (4, 1, 2, 6, 5, 3)) - del tmp201 - tmp266 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp265, (6, 5, 7, 3), (0, 2, 1, 6, 4, 7)) * -1 - tmp240 = einsum(tmp239, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (0, 4, 5, 2, 6, 7)) - tmp163 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp142, (6, 4), (0, 2, 1, 6, 3, 5)) - tmp268 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp155, (6, 7, 3, 5), (0, 2, 1, 6, 7, 4)) - tmp166 = einsum(tmp165, (0, 1), t3, (2, 3, 0, 4, 5, 6), (1, 2, 3, 4, 6, 5)) - tmp309 = einsum(t2_OoVV, (0, 1, 2, 3), tmp308, (1, 4, 5, 6), (5, 4, 0, 6, 3, 2)) - del tmp308 - tmp172 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp171, (6, 2), (6, 0, 1, 3, 5, 4)) - tmp253 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp252, (6, 2, 7, 5), (6, 0, 1, 7, 3, 4)) - tmp196 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp167, (6, 1, 7, 2), (6, 0, 7, 3, 5, 4)) - tmp257 = einsum(tmp239, (0, 1, 2, 3), t3, (4, 1, 5, 6, 7, 3), (0, 4, 5, 2, 6, 7)) - tmp131 = einsum(tmp130, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (4, 5, 0, 2, 6, 7)) - tmp129 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp128, (6, 2, 7, 5), (0, 1, 6, 7, 3, 4)) - tmp180 = einsum(tmp179, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (1, 4, 2, 3, 6, 5)) - del tmp179 - tmp236 = einsum(tmp203, (0, 1, 2, 3, 4, 5), t3, (6, 2, 3, 7, 5, 8), (0, 1, 6, 4, 7, 8)) - tmp280 = einsum(t2_OoVV, (0, 1, 2, 3), tmp279, (1, 4, 5, 6), (4, 5, 0, 6, 3, 2)) - del tmp279 - tmp270 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp265, (6, 5, 7, 4), (0, 2, 1, 6, 3, 7)) - tmp138 = einsum(tmp126, (0, 1), t3, (2, 1, 3, 4, 5, 6), (2, 3, 0, 4, 6, 5)) - tmp247 = einsum(tmp246, (0, 1, 2, 3), t2_OOvV, (4, 5, 0, 6), (4, 5, 1, 2, 6, 3)) - del tmp246 - tmp271 = einsum(tmp254, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (0, 4, 5, 2, 6, 7)) - tmp127 = einsum(tmp126, (0, 1), t3, (2, 3, 1, 4, 5, 6), (2, 3, 0, 4, 6, 5)) - del tmp126 - tmp284 = einsum(t2_OoVV, (0, 1, 2, 3), tmp283, (1, 4, 5, 6), (4, 5, 0, 6, 3, 2)) - del tmp283 - tmp139 = einsum(tmp130, (0, 1, 2, 3), t3, (4, 1, 5, 6, 7, 3), (4, 5, 0, 2, 6, 7)) - tmp230 = einsum(t2_OOvV, (0, 1, 2, 3), tmp229, (2, 4, 5, 6), (4, 0, 1, 5, 6, 3)) - del tmp229 - tmp143 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp142, (6, 5), (0, 2, 1, 6, 3, 4)) - del tmp142 - tmp160 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp159, (6, 5), (0, 2, 1, 3, 4, 6)) - tmp198 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp171, (6, 1), (6, 0, 2, 3, 5, 4)) - del tmp171 - tmp255 = einsum(tmp254, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (0, 4, 5, 2, 6, 7)) - tmp207 = einsum(t2_OoVV, (0, 1, 2, 3), tmp55, (1, 4, 5, 6), (0, 4, 5, 3, 2, 6)) - tmp291 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp285, (6, 1, 7, 5), (6, 0, 2, 3, 4, 7)) - tmp200 = einsum(tmp167, (0, 1, 2, 3), t3, (4, 3, 1, 5, 6, 7), (0, 4, 2, 5, 7, 6)) - del tmp167 - tmp145 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp144, (6, 5), (0, 2, 1, 6, 3, 4)) - tmp267 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp146, (6, 7, 5, 3), (0, 2, 1, 7, 6, 4)) - tmp141 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp140, (5, 6), (0, 2, 1, 6, 3, 4)) - tmp133 = einsum(t2_OOvV, (0, 1, 2, 3), tmp132, (2, 4, 5, 6), (0, 1, 4, 5, 6, 3)) - del tmp132 - tmp164 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp144, (6, 4), (0, 2, 1, 6, 3, 5)) - del tmp144 - tmp301 = einsum(tmp300, (0, 1, 2, 3), t3, (4, 2, 3, 5, 6, 7), (1, 0, 4, 5, 7, 6)) - del tmp300 - tmp245 = einsum(t2_OOvV, (0, 1, 2, 3), tmp244, (2, 4, 5, 6), (4, 0, 1, 5, 3, 6)) - del tmp244 - tmp296 = einsum(t2_OOvV, (0, 1, 2, 3), tmp295, (2, 4, 5, 6), (4, 0, 1, 5, 3, 6)) - del tmp295 - tmp204 = einsum(tmp203, (0, 1, 2, 3, 4, 5), t3, (3, 6, 2, 7, 8, 5), (0, 1, 6, 4, 7, 8)) * -1 - tmp136 = einsum(t2_OOvV, (0, 1, 2, 3), tmp135, (2, 4, 5, 6), (0, 1, 4, 5, 6, 3)) - del tmp135 - tmp287 = einsum(tmp188, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (0, 4, 5, 2, 6, 7)) - tmp147 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp146, (6, 7, 5, 4), (0, 2, 1, 6, 7, 3)) - del tmp146 - tmp303 = einsum(t2_OoVV, (0, 1, 2, 3), tmp302, (1, 4, 5, 6), (5, 4, 0, 6, 3, 2)) - del tmp302 - tmp243 = einsum(tmp242, (0, 1, 2, 3), t2_OOvV, (4, 5, 0, 6), (4, 5, 1, 2, 6, 3)) - del tmp242 - tmp186 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp185, (6, 2), (6, 0, 1, 3, 5, 4)) - tmp226 = einsum(t2_OoVV, (0, 1, 2, 3), tmp225, (1, 4, 5, 6), (0, 5, 4, 3, 2, 6)) * -1 - del tmp225 - tmp259 = einsum(t2_OOvV, (0, 1, 2, 3), tmp258, (2, 4, 5, 6), (4, 0, 1, 5, 3, 6)) - del tmp258 - tmp299 = einsum(t2_OOvV, (0, 1, 2, 3), tmp298, (2, 4, 5, 6), (4, 0, 1, 5, 3, 6)) - del tmp298 - tmp183 = einsum(tmp182, (0, 1), t3, (2, 3, 1, 4, 5, 6), (0, 2, 3, 4, 6, 5)) - tmp121 = einsum(t3, (0, 1, 2, 3, 4, 5), v.OOOO, (6, 0, 7, 2), (1, 6, 7, 3, 5, 4)) - tmp241 = einsum(v.OVVv, (0, 1, 2, 3), t2_OOvV, (4, 5, 3, 6), (4, 5, 0, 6, 2, 1)) - tmp125 = einsum(tmp124, (0, 1), t3, (2, 3, 1, 4, 5, 6), (2, 3, 0, 4, 6, 5)) - tmp156 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp155, (6, 7, 4, 5), (0, 2, 1, 7, 6, 3)) - del tmp155 - tmp235 = einsum(tmp203, (0, 1, 2, 3, 4, 5), t3, (6, 3, 2, 7, 5, 8), (0, 1, 6, 4, 7, 8)) - tmp170 = einsum(tmp169, (0, 1), t3, (2, 3, 1, 4, 5, 6), (0, 2, 3, 4, 6, 5)) - tmp273 = einsum(tmp265, (0, 1, 2, 3), t3, (4, 5, 6, 7, 1, 3), (4, 6, 5, 0, 7, 2)) - del tmp265 - tmp238 = einsum(tmp130, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (4, 5, 0, 2, 6, 7)) - tmp256 = einsum(v.OOVV, (0, 1, 2, 3), t3, (4, 1, 5, 6, 7, 3), (4, 5, 0, 6, 7, 2)) - tmp269 = einsum(t3, (0, 1, 2, 3, 4, 5), v.VVVV, (6, 5, 7, 4), (0, 2, 1, 3, 6, 7)) - tmp274 = einsum(t2_OoVV, (0, 1, 2, 3), tmp190, (1, 4, 5, 6), (4, 0, 5, 3, 2, 6)) - del tmp190 - tmp264 = einsum(t3, (0, 1, 2, 3, 4, 5), v.VVVV, (6, 5, 7, 3), (0, 2, 1, 4, 6, 7)) * -1 - tmp290 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp289, (6, 2, 7, 5), (6, 0, 1, 3, 4, 7)) - tmp178 = einsum(t2_OoVV, (0, 1, 2, 3), tmp177, (1, 4, 5, 6), (4, 0, 5, 6, 3, 2)) - del tmp177 - tmp175 = einsum(tmp174, (0, 1, 2, 3), t2_OOvV, (4, 5, 0, 6), (1, 4, 5, 3, 2, 6)) - del tmp174 - tmp197 = einsum(tmp169, (0, 1), t3, (2, 1, 3, 4, 5, 6), (0, 2, 3, 4, 6, 5)) - del tmp169 - tmp263 = einsum(tmp262, (0, 1, 2, 3), t2_OOvV, (4, 5, 0, 6), (1, 4, 5, 2, 6, 3)) - del tmp262 - tmp251 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp250, (6, 2, 7, 5), (6, 0, 1, 7, 3, 4)) - tmp249 = einsum(tmp239, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (0, 4, 5, 2, 6, 7)) - tmp272 = einsum(tmp254, (0, 1, 2, 3), t3, (4, 1, 5, 6, 3, 7), (0, 4, 5, 2, 6, 7)) - del tmp254 - tmp278 = einsum(t2_OoVV, (0, 1, 2, 3), tmp277, (1, 4, 5, 6), (4, 5, 0, 6, 3, 2)) - del tmp277 - tmp195 = einsum(tmp194, (0, 1, 2, 3), t2_OOvV, (4, 5, 0, 6), (1, 4, 5, 3, 2, 6)) - del tmp194 - tmp153 = einsum(tmp152, (0, 1), t3, (2, 3, 4, 5, 6, 1), (2, 4, 3, 0, 5, 6)) - tmp288 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp285, (6, 2, 7, 5), (6, 0, 1, 3, 4, 7)) - tmp312 = einsum(tmp311, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (1, 2, 4, 6, 5, 3)) - del tmp311 - tmp209 = einsum(t2_OoVV, (0, 1, 2, 3), tmp208, (1, 4, 5, 6), (4, 0, 5, 6, 3, 2)) - del tmp208 - tmp192 = einsum(tmp191, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (0, 4, 5, 2, 6, 7)) - tmp306 = einsum(tmp305, (0, 1, 2, 3), t3, (4, 2, 3, 5, 6, 7), (1, 0, 4, 5, 7, 6)) - tmp211 = einsum(tmp210, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (1, 4, 2, 3, 6, 5)) - del tmp210 - tmp234 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp203, (6, 7, 2, 1, 8, 5), (6, 7, 0, 8, 3, 4)) - del tmp203 - tmp248 = einsum(v.OOVV, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (4, 5, 0, 6, 7, 2)) - tmp222 = einsum(tmp221, (0, 1, 2, 3), t2_OoVV, (4, 0, 5, 6), (1, 4, 2, 3, 6, 5)) - del tmp221 - tmp213 = einsum(t2_OoVV, (0, 1, 2, 3), tmp212, (1, 4, 5, 6), (4, 0, 5, 6, 3, 2)) - del tmp212 - tmp189 = einsum(tmp188, (0, 1, 2, 3), t3, (4, 5, 1, 6, 7, 3), (0, 4, 5, 2, 6, 7)) - tmp315 = einsum(tmp305, (0, 1, 2, 3), t3, (2, 4, 3, 5, 6, 7), (1, 0, 4, 5, 7, 6)) * -1 - del tmp305 - tmp50 = einsum(v.OVVv, (0, 1, 2, 3), t3, (4, 5, 0, 6, 2, 1), (3, 4, 5, 6)) - tmp56 = einsum(tmp55, (0, 1, 2, 3), t1, (0, 4), (4, 1, 2, 3)) - del tmp55 - tmp54 = einsum(tmp53, (0, 1, 2, 3), t1, (0, 4), (4, 1, 2, 3)) - del tmp53 - tmp49 = einsum(v.OVVv, (0, 1, 2, 3), t3, (4, 5, 0, 2, 6, 1), (3, 4, 5, 6)) - tmp31 = einsum(v.OoOV, (0, 1, 2, 3), t3, (4, 0, 2, 5, 6, 3), (1, 4, 5, 6)) - tmp66 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp64, (6, 1, 2, 5), (6, 0, 3, 4)) - tmp30 = einsum(v.OVOo, (0, 1, 2, 3), t3, (0, 4, 2, 5, 6, 1), (3, 4, 5, 6)) * -1 - tmp65 = einsum(tmp64, (0, 1, 2, 3), t3, (2, 4, 1, 5, 6, 3), (0, 4, 5, 6)) * -1 - del tmp64 - tmp35 = einsum(f.OV, (0, 1), t3, (2, 3, 0, 4, 5, 1), (2, 3, 4, 5)) - tmp39 = einsum(t3, (0, 1, 2, 3, 4, 5), tmp38, (2, 5), (0, 1, 3, 4)) - del tmp38 - tmp37 = einsum(tmp36, (0, 1), t3, (2, 3, 0, 4, 5, 1), (2, 3, 4, 5)) - del tmp36 - tmp63 = einsum(t2, (0, 1, 2, 3), tmp62, (4, 5, 1, 0), (4, 5, 3, 2)) - del tmp62 - tmp80 = einsum(tmp79, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp79 - tmp81 = einsum(v.ooov, (0, 1, 2, 3), t1, (1, 4), (0, 2, 4, 3)) - tmp95 = einsum(tmp94, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp94 - tmp88 = einsum(tmp87, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp87 - tmp33 = einsum(t2, (0, 1, 2, 3), tmp27, (4, 1), (0, 4, 2, 3)) - tmp28 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - tmp29 = einsum(v.oooo, (0, 1, 2, 3), t2, (3, 1, 4, 5), (0, 2, 5, 4)) - tmp84 = einsum(tmp83, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp83 - tmp46 = einsum(tmp45, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - del tmp45 - tmp92 = einsum(tmp91, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp91 - tmp119 = einsum(tmp118, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp118 - tmp90 = einsum(tmp89, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp89 - tmp51 = einsum(t2, (0, 1, 2, 3), tmp11, (4, 3), (0, 1, 2, 4)) - tmp41 = einsum(t2, (0, 1, 2, 3), tmp40, (4, 3), (0, 1, 2, 4)) - del tmp40 - tmp110 = einsum(tmp109, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp109 - tmp52 = einsum(t2, (0, 1, 2, 3), tmp13, (3, 4), (0, 1, 2, 4)) - tmp112 = einsum(tmp111, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp111 - tmp105 = einsum(tmp75, (0, 1, 2, 3), t2, (4, 1, 5, 2), (0, 4, 5, 3)) - tmp67 = einsum(t2, (0, 1, 2, 3), tmp9, (4, 1), (0, 4, 2, 3)) - tmp69 = einsum(tmp15, (0, 1), t2, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp61 = einsum(tmp0, (0, 1), t2, (2, 0, 3, 4), (1, 2, 3, 4)) - tmp77 = einsum(t2, (0, 1, 2, 3), tmp76, (4, 1, 5, 2), (4, 0, 3, 5)) - tmp98 = einsum(v.vvvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp97 = einsum(tmp47, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp78 = einsum(tmp4, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - tmp117 = einsum(tmp116, (0, 1, 2, 3), t2, (3, 2, 4, 5), (1, 0, 4, 5)) - del tmp116 - tmp96 = einsum(t2, (0, 1, 2, 3), tmp48, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp34 = einsum(v.oooo, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - tmp113 = einsum(v.vvvv, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp108 = einsum(tmp107, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp107 - tmp58 = einsum(tmp57, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp57 - tmp68 = einsum(t2, (0, 1, 2, 3), tmp7, (4, 1), (0, 4, 2, 3)) - tmp70 = einsum(tmp16, (0, 1), t2, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp32 = einsum(tmp26, (0, 1), t2, (2, 1, 3, 4), (2, 0, 3, 4)) - tmp115 = einsum(tmp114, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp114 - tmp93 = einsum(t2, (0, 1, 2, 3), tmp85, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp100 = einsum(t2, (0, 1, 2, 3), tmp99, (4, 5, 0, 1), (5, 4, 3, 2)) - tmp74 = einsum(tmp73, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp73 - tmp44 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp103 = einsum(t1, (0, 1), tmp99, (2, 3, 0, 4), (3, 2, 4, 1)) - del tmp99 - tmp72 = einsum(tmp71, (0, 1, 2, 3), t1, (1, 4), (0, 2, 4, 3)) - del tmp71 - tmp60 = einsum(tmp59, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp59 - tmp102 = einsum(tmp101, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp101 - tmp106 = einsum(t2, (0, 1, 2, 3), tmp75, (4, 1, 2, 5), (4, 0, 3, 5)) - tmp82 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 2), (0, 4, 3, 5)) - tmp104 = einsum(t2, (0, 1, 2, 3), tmp76, (4, 1, 5, 3), (4, 0, 2, 5)) - del tmp76 - tmp43 = einsum(tmp42, (0, 1), t2, (2, 3, 4, 1), (2, 3, 4, 0)) - del tmp42 - tmp86 = einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp21 = einsum(v.OVOV, (0, 1, 2, 3), t3, (4, 0, 2, 5, 3, 1), (4, 5)) - tmp20 = einsum(v.OVOV, (0, 1, 2, 3), t3, (4, 0, 2, 3, 5, 1), (4, 5)) - tmp22 = einsum(v.OVOV, (0, 1, 2, 3), t3, (4, 0, 2, 5, 1, 3), (4, 5)) - tmp23 = einsum(v.OVOV, (0, 1, 2, 3), t3, (0, 4, 2, 3, 5, 1), (4, 5)) * -1 - tmp2 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 3, 4, 2), (0, 4)) - tmp24 = einsum(t2, (0, 1, 2, 3), tmp1, (1, 2), (0, 3)) - tmp12 = einsum(tmp11, (0, 1), t1, (2, 1), (2, 0)) - del tmp11 - tmp10 = einsum(t1, (0, 1), tmp9, (2, 0), (2, 1)) - del tmp9 - tmp17 = einsum(t1, (0, 1), tmp16, (2, 0), (2, 1)) - del tmp16 - tmp8 = einsum(tmp7, (0, 1), t1, (1, 2), (0, 2)) - del tmp7 - tmp18 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 0, 3), (4, 2)) - tmp6 = einsum(t2, (0, 1, 2, 3), tmp4, (4, 0, 1, 3), (4, 2)) - tmp19 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 0, 1, 3), (4, 2)) - tmp25 = einsum(t2, (0, 1, 2, 3), tmp1, (1, 3), (0, 2)) - tmp3 = einsum(t2, (0, 1, 2, 3), v.ovvv, (1, 2, 4, 3), (0, 4)) - tmp5 = einsum(t2, (0, 1, 2, 3), tmp4, (4, 1, 0, 3), (4, 2)) - del tmp4 - t3new = np.copy(np.transpose(tmp120, (1, 2, 0, 4, 5, 3))) - t3new += np.transpose(tmp121, (1, 0, 2, 4, 5, 3)) * -1 - del tmp121 - t3new += np.transpose(tmp123, (1, 0, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp125, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp127, (0, 1, 2, 4, 5, 3)) * 2 - t3new += np.transpose(tmp129, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp131, (0, 1, 2, 4, 5, 3)) - t3new += np.transpose(tmp129, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp133, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp136, (1, 0, 2, 5, 3, 4)) - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), f.OO, (6, 1), (0, 6, 2, 3, 4, 5)) * -1 - t3new += np.transpose(tmp137, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp123, (1, 2, 0, 5, 4, 3)) * -1 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp124, (6, 1), (0, 6, 2, 3, 4, 5)) - del tmp124 - t3new += np.transpose(tmp138, (0, 2, 1, 4, 5, 3)) * 2 - del tmp138 - t3new += np.transpose(tmp139, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp133, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp133, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp136, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp136, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp120, (0, 2, 1, 4, 5, 3)) * -1 - del tmp120 - t3new += np.transpose(tmp141, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp125, (2, 1, 0, 4, 5, 3)) - del tmp125 - t3new += np.transpose(tmp127, (2, 1, 0, 4, 5, 3)) * -2 - del tmp127 - t3new += np.transpose(tmp129, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp131, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp129, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp143, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp145, (1, 2, 0, 4, 5, 3)) * 2 - t3new += np.transpose(tmp147, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp133, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp136, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp150, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp153, (1, 2, 0, 4, 5, 3)) * 2 - t3new += np.transpose(tmp156, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp123, (2, 0, 1, 4, 5, 3)) - t3new += np.transpose(tmp157, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp141, (0, 2, 1, 3, 5, 4)) - del tmp141 - t3new += np.transpose(tmp158, (2, 1, 0, 5, 4, 3)) - t3new += np.transpose(tmp158, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp160, (0, 2, 1, 5, 4, 3)) * -2 - t3new += np.transpose(tmp162, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp143, (1, 2, 0, 3, 5, 4)) - del tmp143 - t3new += np.transpose(tmp145, (1, 2, 0, 3, 5, 4)) * -2 - del tmp145 - t3new += np.transpose(tmp150, (1, 2, 0, 3, 5, 4)) - del tmp150 - t3new += np.transpose(tmp153, (1, 2, 0, 3, 5, 4)) * -2 - del tmp153 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), f.VV, (6, 4), (0, 1, 2, 3, 6, 5)) - t3new += einsum(tmp140, (0, 1), t3, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) * -1 - del tmp140 - t3new += einsum(tmp159, (0, 1), t3, (2, 3, 4, 5, 1, 6), (2, 3, 4, 5, 0, 6)) * 2 - del tmp159 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp161, (4, 6), (0, 1, 2, 3, 6, 5)) * -1 - del tmp161 - t3new += np.transpose(tmp163, (1, 2, 0, 4, 3, 5)) * -1 - del tmp163 - t3new += np.transpose(tmp164, (1, 2, 0, 4, 3, 5)) * 2 - del tmp164 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp149, (6, 4), (0, 1, 2, 3, 6, 5)) - del tmp149 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp152, (6, 4), (0, 1, 2, 3, 6, 5)) * -2 - del tmp152 - t3new += np.transpose(tmp157, (0, 2, 1, 4, 5, 3)) - del tmp157 - t3new += np.transpose(tmp158, (2, 1, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp158, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp160, (0, 2, 1, 3, 4, 5)) * 2 - del tmp160 - t3new += np.transpose(tmp162, (0, 2, 1, 3, 4, 5)) * -1 - del tmp162 - t3new += np.transpose(tmp166, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp168, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp170, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp172, (1, 2, 0, 3, 5, 4)) * -2 - t3new += np.transpose(tmp175, (2, 1, 0, 5, 4, 3)) - t3new += np.transpose(tmp178, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp180, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp183, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp186, (1, 2, 0, 3, 5, 4)) * -2 - t3new += np.transpose(tmp189, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp192, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp192, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp195, (2, 1, 0, 5, 4, 3)) - t3new += einsum(tmp165, (0, 1), t3, (2, 0, 3, 4, 5, 6), (2, 1, 3, 4, 5, 6)) * -1 - del tmp165 - t3new += np.transpose(tmp196, (2, 0, 1, 4, 5, 3)) - t3new += np.transpose(tmp197, (2, 0, 1, 3, 5, 4)) * -1 - del tmp197 - t3new += np.transpose(tmp198, (2, 0, 1, 3, 5, 4)) * 2 - del tmp198 - t3new += np.transpose(tmp175, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp175, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp178, (2, 0, 1, 5, 4, 3)) * -1 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp182, (6, 1), (0, 6, 2, 3, 4, 5)) - del tmp182 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp185, (6, 1), (0, 6, 2, 3, 4, 5)) * -2 - del tmp185 - t3new += np.transpose(tmp199, (2, 0, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp195, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp195, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp166, (0, 2, 1, 4, 5, 3)) * -1 - del tmp166 - t3new += np.transpose(tmp200, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp170, (0, 2, 1, 3, 5, 4)) * -1 - del tmp170 - t3new += np.transpose(tmp172, (0, 2, 1, 3, 5, 4)) * 2 - del tmp172 - t3new += np.transpose(tmp175, (0, 1, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp180, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp183, (0, 2, 1, 3, 5, 4)) * -1 - del tmp183 - t3new += np.transpose(tmp186, (0, 2, 1, 3, 5, 4)) * 2 - del tmp186 - t3new += np.transpose(tmp189, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp192, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp192, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp195, (0, 1, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp168, (0, 1, 2, 4, 5, 3)) * -1 - del tmp168 - t3new += np.transpose(tmp178, (0, 1, 2, 4, 5, 3)) - t3new += np.transpose(tmp180, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp202, (0, 1, 2, 5, 3, 4)) - t3new += np.transpose(tmp123, (0, 2, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp204, (2, 0, 1, 3, 4, 5)) - t3new += np.transpose(tmp205, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp206, (0, 1, 2, 5, 3, 4)) - t3new += np.transpose(tmp207, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp209, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp211, (1, 2, 0, 3, 4, 5)) * 2 - t3new += np.transpose(tmp213, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp215, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp217, (0, 1, 2, 5, 3, 4)) * 2 - t3new += np.transpose(tmp220, (0, 1, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp222, (1, 0, 2, 3, 4, 5)) * -1 - t3new += np.transpose(tmp202, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp202, (2, 0, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp123, (2, 0, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp204, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp204, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp205, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp205, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp206, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp224, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp207, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp226, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp222, (2, 1, 0, 3, 5, 4)) - t3new += np.transpose(tmp209, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp213, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp211, (2, 1, 0, 3, 5, 4)) * 2 - t3new += np.transpose(tmp215, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp215, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp217, (1, 0, 2, 5, 4, 3)) * 2 - t3new += np.transpose(tmp217, (2, 0, 1, 5, 4, 3)) * -2 - t3new += np.transpose(tmp228, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp228, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp230, (1, 0, 2, 5, 4, 3)) * 2 - t3new += np.transpose(tmp230, (2, 0, 1, 5, 4, 3)) * -2 - t3new += np.transpose(tmp232, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp232, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp233, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp123, (1, 0, 2, 3, 5, 4)) - t3new += np.transpose(tmp222, (0, 1, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp209, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp213, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp211, (0, 1, 2, 3, 5, 4)) * -2 - t3new += np.transpose(tmp202, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp202, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp234, (2, 1, 0, 5, 3, 4)) * -0.5 - t3new += np.transpose(tmp234, (2, 1, 0, 4, 3, 5)) * 0.5 - t3new += np.transpose(tmp235, (2, 1, 0, 5, 3, 4)) * 1.5 - t3new += np.transpose(tmp205, (2, 1, 0, 5, 3, 4)) * 0.5 - t3new += np.transpose(tmp205, (2, 1, 0, 4, 3, 5)) * -0.5 - t3new += np.transpose(tmp236, (2, 1, 0, 5, 3, 4)) * -0.5 - t3new += np.transpose(tmp222, (1, 2, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp222, (1, 2, 0, 5, 3, 4)) - t3new += np.transpose(tmp215, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp215, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp217, (0, 2, 1, 3, 5, 4)) * 2 - t3new += np.transpose(tmp217, (0, 2, 1, 4, 5, 3)) * -2 - t3new += np.transpose(tmp233, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp233, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp123, (0, 1, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp123, (0, 1, 2, 5, 3, 4)) - t3new += np.transpose(tmp209, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp209, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp211, (1, 0, 2, 4, 3, 5)) * 2 - t3new += np.transpose(tmp211, (1, 0, 2, 5, 3, 4)) * -2 - t3new += np.transpose(tmp213, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp213, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp202, (2, 1, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp204, (1, 0, 2, 3, 4, 5)) * -1 - t3new += np.transpose(tmp205, (1, 0, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp206, (2, 1, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp207, (1, 2, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp222, (2, 0, 1, 3, 4, 5)) - t3new += np.transpose(tmp215, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp217, (2, 1, 0, 5, 3, 4)) * -2 - t3new += np.transpose(tmp220, (2, 1, 0, 5, 4, 3)) - t3new += np.transpose(tmp123, (1, 2, 0, 3, 4, 5)) - t3new += np.transpose(tmp209, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp211, (0, 2, 1, 3, 4, 5)) * -2 - t3new += np.transpose(tmp213, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp202, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp202, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp123, (2, 1, 0, 4, 3, 5)) - t3new += np.transpose(tmp123, (2, 1, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp234, (0, 1, 2, 5, 3, 4)) * 0.5 - t3new += np.transpose(tmp234, (0, 1, 2, 4, 3, 5)) * -0.5 - del tmp234 - t3new += np.transpose(tmp235, (0, 1, 2, 5, 3, 4)) * -1.5 - del tmp235 - t3new += np.transpose(tmp205, (0, 1, 2, 5, 3, 4)) * -0.5 - t3new += np.transpose(tmp205, (0, 1, 2, 4, 3, 5)) * 0.5 - t3new += np.transpose(tmp236, (0, 1, 2, 5, 3, 4)) * 0.5 - del tmp236 - t3new += np.transpose(tmp209, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp209, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp211, (2, 0, 1, 4, 3, 5)) * -2 - t3new += np.transpose(tmp211, (2, 0, 1, 5, 3, 4)) * 2 - t3new += np.transpose(tmp213, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp213, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp215, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp215, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp217, (1, 2, 0, 3, 5, 4)) * -2 - t3new += np.transpose(tmp217, (1, 2, 0, 4, 5, 3)) * 2 - t3new += np.transpose(tmp233, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp233, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp237, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp238, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp240, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp202, (0, 1, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp204, (2, 0, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp205, (2, 0, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp206, (0, 1, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp207, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp133, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp215, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp217, (0, 1, 2, 4, 3, 5)) * -2 - t3new += np.transpose(tmp136, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp241, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp243, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp245, (0, 1, 2, 5, 3, 4)) * -1 - t3new += tmp220 - t3new += np.transpose(tmp202, (1, 0, 2, 3, 4, 5)) * -1 - t3new += np.transpose(tmp202, (2, 0, 1, 3, 4, 5)) - t3new += np.transpose(tmp247, (0, 2, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp247, (1, 2, 0, 5, 3, 4)) - t3new += np.transpose(tmp204, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp204, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp205, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp205, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp206, (1, 0, 2, 3, 4, 5)) * -1 - t3new += np.transpose(tmp224, (1, 0, 2, 3, 4, 5)) * -1 - del tmp224 - t3new += np.transpose(tmp207, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp226, (2, 0, 1, 3, 4, 5)) * -1 - del tmp226 - t3new += np.transpose(tmp133, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp133, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp215, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp215, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp217, (1, 0, 2, 3, 4, 5)) * -2 - t3new += np.transpose(tmp217, (2, 0, 1, 3, 4, 5)) * 2 - t3new += np.transpose(tmp136, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp136, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp202, (2, 1, 0, 4, 3, 5)) - del tmp202 - t3new += np.transpose(tmp204, (1, 0, 2, 5, 4, 3)) - del tmp204 - t3new += np.transpose(tmp205, (1, 0, 2, 4, 5, 3)) - del tmp205 - t3new += np.transpose(tmp206, (2, 1, 0, 4, 3, 5)) - t3new += np.transpose(tmp207, (1, 2, 0, 4, 3, 5)) - t3new += np.transpose(tmp133, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp215, (2, 1, 0, 4, 3, 5)) * -1 - del tmp215 - t3new += np.transpose(tmp217, (2, 1, 0, 4, 3, 5)) * 2 - del tmp217 - t3new += np.transpose(tmp136, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp241, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp243, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp245, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp220, (2, 1, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp233, (0, 1, 2, 5, 3, 4)) - t3new += np.transpose(tmp233, (2, 0, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp248, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp129, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp131, (0, 1, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp129, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp249, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp251, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp253, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp255, (1, 2, 0, 3, 5, 4)) * -2 - t3new += np.transpose(tmp251, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp255, (2, 1, 0, 3, 4, 5)) * -2 - t3new += np.transpose(tmp253, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp232, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp230, (1, 2, 0, 4, 5, 3)) * 2 - t3new += np.transpose(tmp220, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp228, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp248, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp129, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp131, (2, 1, 0, 3, 5, 4)) - del tmp131 - t3new += np.transpose(tmp129, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp249, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp251, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp253, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp255, (0, 2, 1, 3, 5, 4)) * 2 - t3new += tmp251 * -1 - t3new += tmp255 * 2 - t3new += tmp253 * -1 - t3new += np.transpose(tmp232, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp230, (0, 2, 1, 4, 5, 3)) * -2 - t3new += np.transpose(tmp220, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp228, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp233, (2, 1, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp256, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp139, (0, 2, 1, 3, 5, 4)) * -1 - del tmp139 - t3new += np.transpose(tmp257, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp233, (0, 1, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp233, (1, 0, 2, 3, 4, 5)) * -1 - t3new += np.transpose(tmp233, (2, 0, 1, 3, 4, 5)) - t3new += tmp248 * -1 - t3new += np.transpose(tmp248, (2, 1, 0, 3, 4, 5)) - del tmp248 - t3new += np.transpose(tmp233, (2, 1, 0, 4, 3, 5)) - del tmp233 - t3new += np.transpose(tmp256, (0, 2, 1, 3, 4, 5)) * -1 - del tmp256 - t3new += np.transpose(tmp241, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp241, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp259, (1, 0, 2, 5, 3, 4)) * 2 - t3new += np.transpose(tmp259, (2, 0, 1, 5, 3, 4)) * -2 - t3new += np.transpose(tmp261, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp261, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp263, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp263, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp230, (1, 0, 2, 3, 4, 5)) * -2 - t3new += np.transpose(tmp230, (2, 0, 1, 3, 4, 5)) * 2 - t3new += np.transpose(tmp228, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp228, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp232, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp232, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp241, (0, 1, 2, 4, 3, 5)) - t3new += tmp243 * -1 - t3new += np.transpose(tmp263, (1, 2, 0, 3, 4, 5)) - t3new += np.transpose(tmp259, (1, 2, 0, 3, 4, 5)) * -2 - t3new += np.transpose(tmp245, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp261, (1, 2, 0, 3, 4, 5)) - t3new += tmp247 - t3new += np.transpose(tmp241, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp243, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp247, (0, 1, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp206, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp206, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp207, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp207, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp136, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp136, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp241, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp264, (0, 2, 1, 5, 3, 4)) * -1 - del tmp264 - t3new += np.transpose(tmp266, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp267, (1, 2, 0, 3, 5, 4)) * -1 - del tmp267 - t3new += np.transpose(tmp268, (1, 2, 0, 3, 5, 4)) * -1 - del tmp268 - t3new += np.transpose(tmp243, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp263, (0, 2, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp259, (0, 2, 1, 3, 4, 5)) * 2 - t3new += np.transpose(tmp245, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp261, (0, 2, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp247, (2, 1, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp241, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp243, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp247, (2, 1, 0, 5, 4, 3)) - t3new += np.transpose(tmp206, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp206, (0, 2, 1, 4, 5, 3)) * -1 - del tmp206 - t3new += np.transpose(tmp207, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp207, (0, 1, 2, 4, 5, 3)) * -1 - del tmp207 - t3new += np.transpose(tmp136, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp136, (2, 1, 0, 3, 5, 4)) * -1 - del tmp136 - t3new += np.transpose(tmp241, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp243, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp241, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp241, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp243, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp243, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp247, (0, 2, 1, 4, 3, 5)) - t3new += np.transpose(tmp247, (1, 2, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp241, (2, 0, 1, 3, 4, 5)) * -1 - del tmp241 - t3new += np.transpose(tmp269, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp270, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp243, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp137, (0, 2, 1, 4, 5, 3)) * -1 - del tmp137 - t3new += np.transpose(tmp123, (0, 2, 1, 5, 4, 3)) - del tmp123 - t3new += np.transpose(tmp158, (0, 1, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp158, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp237, (0, 1, 2, 4, 5, 3)) - del tmp237 - t3new += np.transpose(tmp238, (0, 1, 2, 5, 3, 4)) * -1 - del tmp238 - t3new += np.transpose(tmp240, (1, 2, 0, 4, 3, 5)) - del tmp240 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), v.OVOV, (6, 7, 1, 4), (0, 6, 2, 3, 7, 5)) - t3new += np.transpose(tmp158, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp158, (0, 2, 1, 3, 5, 4)) - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), v.OVOV, (6, 7, 2, 4), (0, 6, 1, 3, 7, 5)) * -1 - t3new += einsum(v.OOVV, (0, 1, 2, 3), t3, (4, 1, 5, 6, 3, 7), (4, 0, 5, 6, 2, 7)) * -1 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp128, (6, 1, 7, 4), (0, 6, 2, 3, 7, 5)) * -1 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp130, (6, 1, 7, 4), (0, 6, 2, 3, 7, 5)) - del tmp130 - t3new += np.transpose(tmp129, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp129, (0, 2, 1, 4, 3, 5)) * -1 - del tmp129 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp128, (6, 2, 7, 4), (0, 6, 1, 3, 7, 5)) - del tmp128 - t3new += np.transpose(tmp251, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp251, (1, 0, 2, 4, 3, 5)) * -1 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp250, (6, 2, 7, 4), (0, 6, 1, 3, 7, 5)) - t3new += np.transpose(tmp255, (1, 0, 2, 5, 3, 4)) * -2 - t3new += np.transpose(tmp255, (1, 0, 2, 4, 3, 5)) * 2 - t3new += np.transpose(tmp271, (1, 0, 2, 4, 3, 5)) * -2 - del tmp271 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp239, (6, 1, 7, 4), (0, 6, 2, 3, 7, 5)) - del tmp239 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp250, (6, 1, 7, 4), (0, 6, 2, 3, 7, 5)) * -1 - del tmp250 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp252, (6, 1, 7, 4), (0, 6, 2, 3, 7, 5)) * -1 - t3new += np.transpose(tmp272, (2, 0, 1, 4, 3, 5)) * -2 - del tmp272 - t3new += np.transpose(tmp253, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp253, (1, 0, 2, 4, 3, 5)) * -1 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp252, (6, 2, 7, 4), (0, 6, 1, 3, 7, 5)) - del tmp252 - t3new += tmp158 - t3new += np.transpose(tmp158, (1, 0, 2, 4, 3, 5)) - del tmp158 - t3new += np.transpose(tmp269, (0, 2, 1, 4, 5, 3)) * -1 - del tmp269 - t3new += np.transpose(tmp273, (0, 2, 1, 5, 3, 4)) - t3new += np.transpose(tmp147, (1, 2, 0, 3, 4, 5)) - del tmp147 - t3new += np.transpose(tmp156, (1, 2, 0, 3, 4, 5)) - del tmp156 - t3new += np.transpose(tmp274, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp276, (2, 0, 1, 3, 4, 5)) * 2 - t3new += np.transpose(tmp278, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp280, (2, 0, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp178, (1, 0, 2, 3, 4, 5)) * -1 - t3new += np.transpose(tmp274, (0, 1, 2, 5, 4, 3)) - t3new += np.transpose(tmp282, (0, 1, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp280, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp276, (0, 2, 1, 3, 5, 4)) * 2 - t3new += np.transpose(tmp284, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp278, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp178, (0, 1, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp180, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp282, (1, 0, 2, 3, 5, 4)) - t3new += np.transpose(tmp282, (1, 0, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp284, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp284, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp180, (1, 0, 2, 4, 3, 5)) * -1 - t3new += np.transpose(tmp180, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp282, (1, 2, 0, 5, 3, 4)) - t3new += np.transpose(tmp284, (2, 1, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp180, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp282, (0, 2, 1, 5, 3, 4)) * -1 - t3new += tmp284 - t3new += np.transpose(tmp180, (0, 2, 1, 3, 4, 5)) - t3new += np.transpose(tmp274, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp274, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp276, (2, 1, 0, 4, 3, 5)) * 2 - t3new += np.transpose(tmp276, (2, 1, 0, 5, 3, 4)) * -2 - t3new += np.transpose(tmp278, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp278, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp280, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp280, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp178, (1, 2, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp178, (1, 2, 0, 5, 3, 4)) - t3new += np.transpose(tmp274, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp274, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp286, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp287, (0, 2, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp276, (0, 1, 2, 4, 3, 5)) * -2 - t3new += np.transpose(tmp276, (0, 1, 2, 5, 3, 4)) * 2 - t3new += np.transpose(tmp278, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp278, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp280, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp280, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp178, (0, 2, 1, 4, 3, 5)) - t3new += np.transpose(tmp178, (0, 2, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp274, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp288, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp290, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp290, (2, 1, 0, 5, 3, 4)) * -1 - t3new += np.transpose(tmp189, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp192, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp192, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp282, (2, 1, 0, 5, 4, 3)) - t3new += np.transpose(tmp280, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp276, (1, 2, 0, 3, 5, 4)) * -2 - t3new += np.transpose(tmp284, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp278, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp178, (2, 1, 0, 3, 5, 4)) - t3new += np.transpose(tmp180, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp274, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp291, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp199, (2, 0, 1, 3, 5, 4)) - del tmp199 - t3new += np.transpose(tmp276, (1, 0, 2, 3, 4, 5)) * -2 - t3new += np.transpose(tmp278, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp280, (1, 0, 2, 3, 4, 5)) - t3new += np.transpose(tmp178, (2, 0, 1, 3, 4, 5)) - t3new += np.transpose(tmp282, (2, 0, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp282, (2, 0, 1, 4, 5, 3)) - t3new += np.transpose(tmp284, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp284, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp180, (2, 0, 1, 4, 3, 5)) - t3new += np.transpose(tmp180, (2, 0, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp247, (1, 0, 2, 3, 5, 4)) - t3new += np.transpose(tmp243, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp243, (1, 2, 0, 3, 5, 4)) - del tmp243 - t3new += np.transpose(tmp245, (1, 0, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp245, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp220, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp220, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp247, (1, 0, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp247, (2, 0, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp247, (2, 0, 1, 4, 5, 3)) - del tmp247 - t3new += np.transpose(tmp274, (1, 0, 2, 4, 3, 5)) * -1 - t3new += tmp274 * -1 - t3new += tmp282 - t3new += np.transpose(tmp282, (1, 2, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp282, (0, 2, 1, 4, 3, 5)) - t3new += np.transpose(tmp274, (2, 1, 0, 3, 4, 5)) - t3new += np.transpose(tmp288, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp290, (1, 2, 0, 3, 4, 5)) - t3new += np.transpose(tmp290, (2, 1, 0, 4, 3, 5)) - t3new += np.transpose(tmp282, (2, 1, 0, 3, 4, 5)) * -1 - del tmp282 - t3new += np.transpose(tmp274, (2, 0, 1, 4, 3, 5)) - del tmp274 - t3new += np.transpose(tmp291, (1, 0, 2, 3, 4, 5)) * -1 - del tmp291 - t3new += np.transpose(tmp293, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp175, (2, 1, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp296, (2, 1, 0, 5, 3, 4)) - t3new += np.transpose(tmp195, (2, 1, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp293, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp293, (2, 0, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp175, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp175, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp299, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp299, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp195, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp195, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp293, (1, 2, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp293, (1, 2, 0, 5, 3, 4)) - t3new += np.transpose(tmp299, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp296, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp195, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp195, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp293, (0, 1, 2, 4, 5, 3)) - t3new += tmp175 - t3new += np.transpose(tmp296, (0, 1, 2, 5, 3, 4)) * -1 - t3new += tmp195 - t3new += np.transpose(tmp293, (0, 2, 1, 4, 3, 5)) - t3new += np.transpose(tmp293, (0, 2, 1, 5, 3, 4)) * -1 - t3new += np.transpose(tmp299, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp296, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp195, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp195, (0, 2, 1, 3, 5, 4)) - del tmp195 - t3new += np.transpose(tmp293, (2, 1, 0, 3, 5, 4)) - t3new += np.transpose(tmp299, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp296, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp293, (1, 0, 2, 3, 4, 5)) * -1 - t3new += np.transpose(tmp293, (2, 0, 1, 3, 4, 5)) - t3new += np.transpose(tmp296, (1, 0, 2, 4, 5, 3)) - t3new += np.transpose(tmp296, (2, 0, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp299, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp299, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp293, (0, 1, 2, 3, 5, 4)) * -1 - del tmp293 - t3new += np.transpose(tmp299, (0, 1, 2, 4, 5, 3)) - t3new += np.transpose(tmp296, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp196, (1, 0, 2, 4, 5, 3)) * -1 - del tmp196 - t3new += np.transpose(tmp178, (1, 0, 2, 5, 4, 3)) - del tmp178 - t3new += np.transpose(tmp200, (1, 2, 0, 4, 5, 3)) * -1 - del tmp200 - t3new += np.transpose(tmp180, (1, 2, 0, 5, 4, 3)) - del tmp180 - t3new += np.transpose(tmp286, (1, 2, 0, 4, 5, 3)) - del tmp286 - t3new += np.transpose(tmp287, (1, 2, 0, 4, 3, 5)) - del tmp287 - t3new += einsum(tmp285, (0, 1, 2, 3), t3, (4, 1, 5, 6, 3, 7), (4, 0, 5, 6, 2, 7)) * -1 - del tmp285 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp289, (6, 1, 7, 4), (0, 6, 2, 3, 7, 5)) - t3new += np.transpose(tmp290, (1, 0, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp290, (1, 0, 2, 3, 5, 4)) - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp289, (6, 2, 7, 4), (0, 6, 1, 3, 7, 5)) * -1 - del tmp289 - t3new += einsum(t3, (0, 1, 2, 3, 4, 5), tmp188, (6, 1, 7, 4), (0, 6, 2, 3, 7, 5)) - del tmp188 - t3new += einsum(tmp191, (0, 1, 2, 3), t3, (4, 1, 5, 6, 3, 7), (4, 0, 5, 6, 2, 7)) * -1 - t3new += np.transpose(tmp192, (1, 0, 2, 5, 3, 4)) - t3new += np.transpose(tmp192, (1, 0, 2, 4, 3, 5)) * -1 - t3new += einsum(tmp191, (0, 1, 2, 3), t3, (4, 5, 1, 6, 3, 7), (4, 0, 5, 6, 2, 7)) - del tmp191 - t3new += np.transpose(tmp288, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp290, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp290, (0, 1, 2, 5, 3, 4)) - t3new += np.transpose(tmp189, (0, 2, 1, 3, 5, 4)) - del tmp189 - t3new += np.transpose(tmp192, (0, 2, 1, 3, 5, 4)) * -1 - t3new += tmp192 * -1 - del tmp192 - t3new += np.transpose(tmp270, (0, 2, 1, 3, 5, 4)) - del tmp270 - t3new += np.transpose(tmp288, (0, 2, 1, 3, 4, 5)) - del tmp288 - t3new += np.transpose(tmp290, (0, 2, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp290, (0, 1, 2, 4, 3, 5)) * -1 - del tmp290 - t3new += np.transpose(tmp266, (0, 2, 1, 3, 4, 5)) * -1 - del tmp266 - t3new += np.transpose(tmp273, (0, 2, 1, 4, 3, 5)) * -1 - del tmp273 - t3new += np.transpose(tmp301, (2, 1, 0, 3, 5, 4)) - t3new += np.transpose(tmp303, (2, 1, 0, 5, 4, 3)) - t3new += np.transpose(tmp306, (2, 1, 0, 3, 5, 4)) - t3new += np.transpose(tmp309, (2, 1, 0, 5, 4, 3)) - t3new += np.transpose(tmp310, (0, 2, 1, 3, 5, 4)) - del tmp310 - t3new += np.transpose(tmp303, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp303, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp301, (0, 1, 2, 3, 5, 4)) * -1 - del tmp301 - t3new += np.transpose(tmp303, (0, 1, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp249, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp251, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp253, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp255, (1, 2, 0, 4, 5, 3)) * 2 - t3new += np.transpose(tmp251, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp255, (2, 1, 0, 5, 4, 3)) * 2 - t3new += np.transpose(tmp253, (2, 1, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp222, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp209, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp213, (2, 1, 0, 4, 5, 3)) - t3new += np.transpose(tmp211, (2, 1, 0, 4, 5, 3)) * -2 - t3new += np.transpose(tmp257, (2, 0, 1, 4, 5, 3)) * -1 - del tmp257 - t3new += np.transpose(tmp222, (2, 0, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp249, (0, 2, 1, 4, 5, 3)) * -1 - del tmp249 - t3new += np.transpose(tmp251, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp253, (0, 2, 1, 4, 5, 3)) - t3new += np.transpose(tmp255, (0, 2, 1, 4, 5, 3)) * -2 - t3new += np.transpose(tmp251, (0, 1, 2, 5, 4, 3)) - del tmp251 - t3new += np.transpose(tmp255, (0, 1, 2, 5, 4, 3)) * -2 - del tmp255 - t3new += np.transpose(tmp253, (0, 1, 2, 5, 4, 3)) - del tmp253 - t3new += np.transpose(tmp209, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp211, (0, 2, 1, 5, 4, 3)) * 2 - t3new += np.transpose(tmp213, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp222, (0, 1, 2, 4, 5, 3)) - t3new += np.transpose(tmp209, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp213, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp211, (0, 1, 2, 4, 5, 3)) * 2 - t3new += np.transpose(tmp133, (0, 1, 2, 3, 5, 4)) - t3new += np.transpose(tmp133, (0, 1, 2, 4, 5, 3)) * -1 - t3new += np.transpose(tmp222, (1, 0, 2, 5, 4, 3)) - t3new += np.transpose(tmp222, (0, 2, 1, 4, 3, 5)) - t3new += np.transpose(tmp222, (0, 2, 1, 5, 3, 4)) * -1 - del tmp222 - t3new += np.transpose(tmp209, (1, 2, 0, 5, 4, 3)) - del tmp209 - t3new += np.transpose(tmp211, (1, 2, 0, 5, 4, 3)) * -2 - del tmp211 - t3new += np.transpose(tmp213, (1, 2, 0, 5, 4, 3)) - del tmp213 - t3new += np.transpose(tmp133, (2, 1, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp133, (2, 1, 0, 4, 5, 3)) - del tmp133 - t3new += np.transpose(tmp312, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp303, (2, 1, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp314, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp309, (2, 1, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp312, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp312, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp303, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp303, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp312, (2, 1, 0, 3, 5, 4)) - t3new += np.transpose(tmp312, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp303, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp303, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp314, (2, 1, 0, 3, 5, 4)) - t3new += np.transpose(tmp314, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp309, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp309, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp312, (1, 0, 2, 5, 3, 4)) * -1 - t3new += tmp303 - t3new += np.transpose(tmp312, (0, 1, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp312, (0, 1, 2, 4, 5, 3)) - t3new += np.transpose(tmp303, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp303, (1, 0, 2, 5, 3, 4)) * -1 - del tmp303 - t3new += np.transpose(tmp259, (2, 1, 0, 3, 5, 4)) * -2 - t3new += np.transpose(tmp261, (2, 1, 0, 3, 5, 4)) - t3new += np.transpose(tmp263, (2, 1, 0, 3, 5, 4)) - t3new += np.transpose(tmp230, (2, 1, 0, 4, 3, 5)) * 2 - t3new += np.transpose(tmp228, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp232, (2, 1, 0, 4, 3, 5)) * -1 - t3new += np.transpose(tmp259, (0, 1, 2, 3, 5, 4)) * 2 - t3new += np.transpose(tmp261, (0, 1, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp263, (0, 1, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp230, (0, 1, 2, 4, 3, 5)) * -2 - t3new += np.transpose(tmp228, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp232, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp245, (0, 2, 1, 5, 4, 3)) * -1 - t3new += np.transpose(tmp261, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp263, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp259, (0, 2, 1, 5, 4, 3)) * -2 - t3new += np.transpose(tmp220, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp228, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp232, (0, 2, 1, 3, 5, 4)) * -1 - t3new += np.transpose(tmp230, (0, 2, 1, 3, 5, 4)) * 2 - t3new += np.transpose(tmp261, (0, 1, 2, 4, 5, 3)) - t3new += np.transpose(tmp259, (0, 1, 2, 4, 5, 3)) * -2 - t3new += np.transpose(tmp263, (0, 1, 2, 4, 5, 3)) - t3new += np.transpose(tmp228, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp230, (0, 1, 2, 5, 3, 4)) * 2 - t3new += np.transpose(tmp232, (0, 1, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp245, (1, 0, 2, 4, 5, 3)) - t3new += np.transpose(tmp245, (2, 0, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp220, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp220, (2, 0, 1, 5, 3, 4)) - t3new += np.transpose(tmp245, (1, 2, 0, 5, 4, 3)) - t3new += np.transpose(tmp261, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp263, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp259, (1, 2, 0, 5, 4, 3)) * 2 - t3new += np.transpose(tmp220, (1, 2, 0, 3, 5, 4)) * -1 - del tmp220 - t3new += np.transpose(tmp228, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp232, (1, 2, 0, 3, 5, 4)) - t3new += np.transpose(tmp230, (1, 2, 0, 3, 5, 4)) * -2 - t3new += np.transpose(tmp261, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp259, (2, 1, 0, 4, 5, 3)) * 2 - t3new += np.transpose(tmp263, (2, 1, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp228, (2, 1, 0, 5, 3, 4)) - del tmp228 - t3new += np.transpose(tmp230, (2, 1, 0, 5, 3, 4)) * -2 - del tmp230 - t3new += np.transpose(tmp232, (2, 1, 0, 5, 3, 4)) - del tmp232 - t3new += np.transpose(tmp312, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp314, (2, 0, 1, 4, 3, 5)) * -1 - t3new += np.transpose(tmp312, (1, 2, 0, 3, 4, 5)) - t3new += np.transpose(tmp312, (0, 2, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp312, (1, 0, 2, 4, 3, 5)) - del tmp312 - t3new += np.transpose(tmp245, (0, 1, 2, 4, 3, 5)) - t3new += np.transpose(tmp261, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp261, (2, 0, 1, 4, 3, 5)) * -1 - del tmp261 - t3new += np.transpose(tmp259, (1, 0, 2, 4, 3, 5)) * -2 - t3new += np.transpose(tmp259, (2, 0, 1, 4, 3, 5)) * 2 - del tmp259 - t3new += np.transpose(tmp263, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp263, (2, 0, 1, 4, 3, 5)) * -1 - del tmp263 - t3new += np.transpose(tmp245, (2, 1, 0, 4, 3, 5)) * -1 - del tmp245 - t3new += np.transpose(tmp175, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp175, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp284, (2, 1, 0, 5, 4, 3)) - t3new += np.transpose(tmp280, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp276, (1, 2, 0, 4, 5, 3)) * 2 - t3new += np.transpose(tmp284, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp278, (1, 2, 0, 4, 5, 3)) * -1 - t3new += np.transpose(tmp276, (2, 0, 1, 5, 4, 3)) * -2 - t3new += np.transpose(tmp278, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp280, (2, 0, 1, 5, 4, 3)) - t3new += np.transpose(tmp276, (1, 0, 2, 5, 4, 3)) * 2 - t3new += np.transpose(tmp278, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp280, (1, 0, 2, 5, 4, 3)) * -1 - t3new += np.transpose(tmp175, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp175, (0, 2, 1, 4, 5, 3)) * -1 - del tmp175 - t3new += np.transpose(tmp280, (0, 2, 1, 4, 5, 3)) - del tmp280 - t3new += np.transpose(tmp276, (0, 2, 1, 4, 5, 3)) * -2 - del tmp276 - t3new += np.transpose(tmp284, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp278, (0, 2, 1, 4, 5, 3)) - del tmp278 - t3new += np.transpose(tmp284, (0, 1, 2, 5, 4, 3)) * -1 - del tmp284 - t3new += np.transpose(tmp314, (1, 2, 0, 5, 4, 3)) * -1 - t3new += np.transpose(tmp314, (0, 2, 1, 5, 4, 3)) - t3new += np.transpose(tmp309, (0, 2, 1, 3, 5, 4)) - t3new += np.transpose(tmp309, (1, 2, 0, 3, 5, 4)) * -1 - t3new += np.transpose(tmp314, (1, 0, 2, 5, 3, 4)) * -1 - t3new += tmp309 - t3new += np.transpose(tmp314, (0, 1, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp314, (0, 1, 2, 4, 5, 3)) - t3new += np.transpose(tmp309, (1, 0, 2, 4, 3, 5)) - t3new += np.transpose(tmp309, (1, 0, 2, 5, 3, 4)) * -1 - t3new += np.transpose(tmp299, (2, 1, 0, 3, 5, 4)) - t3new += np.transpose(tmp296, (1, 0, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp296, (2, 0, 1, 3, 5, 4)) - t3new += np.transpose(tmp299, (0, 1, 2, 3, 5, 4)) * -1 - t3new += np.transpose(tmp314, (1, 2, 0, 3, 4, 5)) - t3new += np.transpose(tmp314, (0, 2, 1, 3, 4, 5)) * -1 - t3new += np.transpose(tmp299, (1, 2, 0, 3, 4, 5)) - t3new += np.transpose(tmp296, (1, 2, 0, 3, 4, 5)) * -1 - t3new += np.transpose(tmp314, (1, 0, 2, 4, 3, 5)) - del tmp314 - t3new += np.transpose(tmp299, (0, 2, 1, 3, 4, 5)) * -1 - del tmp299 - t3new += np.transpose(tmp296, (0, 2, 1, 3, 4, 5)) - del tmp296 - t3new += np.transpose(tmp315, (0, 2, 1, 3, 5, 4)) - del tmp315 - t3new += np.transpose(tmp309, (0, 2, 1, 4, 5, 3)) * -1 - t3new += np.transpose(tmp309, (1, 2, 0, 4, 5, 3)) - t3new += np.transpose(tmp306, (0, 1, 2, 3, 5, 4)) * -1 - del tmp306 - t3new += np.transpose(tmp309, (0, 1, 2, 5, 4, 3)) * -1 - del tmp309 - t2new_OOVv = np.copy(np.transpose(tmp49, (2, 1, 3, 0))) - t2new_OOVv += np.transpose(tmp50, (1, 2, 3, 0)) - t2new_OOVv += np.transpose(tmp54, (2, 1, 3, 0)) * -1 - t2new_OOVv += np.transpose(tmp56, (1, 2, 3, 0)) * -1 - t2new_OOvV = np.copy(np.transpose(tmp49, (1, 2, 0, 3))) - del tmp49 - t2new_OOvV += np.transpose(tmp50, (2, 1, 0, 3)) - del tmp50 - t2new_OOvV += np.transpose(tmp54, (1, 2, 0, 3)) * -1 - del tmp54 - t2new_OOvV += np.transpose(tmp56, (2, 1, 0, 3)) * -1 - del tmp56 - t2new_oOVV = np.copy(tmp30) * -1 - t2new_oOVV += np.transpose(tmp31, (0, 1, 3, 2)) * -1 - t2new_oOVV += tmp65 * -1 - t2new_oOVV += np.transpose(tmp66, (0, 1, 3, 2)) * -1 - t2new_OOVV = np.copy(tmp35) - t2new_OOVV += np.transpose(tmp35, (1, 0, 3, 2)) - del tmp35 - t2new_OOVV += tmp37 * -1 - t2new_OOVV += tmp39 * 2 - t2new_OOVV += np.transpose(tmp37, (1, 0, 3, 2)) * -1 - del tmp37 - t2new_OOVV += np.transpose(tmp39, (1, 0, 3, 2)) * 2 - del tmp39 - t2new_OoVV = np.copy(np.transpose(tmp30, (1, 0, 3, 2))) * -1 - del tmp30 - t2new_OoVV += np.transpose(tmp31, (1, 0, 2, 3)) * -1 - del tmp31 - t2new_OoVV += np.transpose(tmp65, (1, 0, 3, 2)) * -1 - del tmp65 - t2new_OoVV += np.transpose(tmp66, (1, 0, 2, 3)) * -1 - del tmp66 - t2new = np.copy(np.transpose(tmp28, (1, 0, 2, 3))) * -1 - t2new += np.transpose(tmp29, (1, 0, 3, 2)) - del tmp29 - t2new += tmp32 - t2new += tmp33 * -2 - t2new += einsum(tmp34, (0, 1, 2, 3), t1, (1, 4), (0, 2, 4, 3)) - del tmp34 - t2new += np.transpose(tmp28, (0, 1, 3, 2)) * -1 - del tmp28 - t2new += np.transpose(tmp32, (1, 0, 3, 2)) - del tmp32 - t2new += np.transpose(tmp33, (1, 0, 3, 2)) * -2 - del tmp33 - t2new += tmp41 * -2 - t2new += tmp43 - t2new += np.transpose(tmp44, (1, 0, 2, 3)) - t2new += np.transpose(tmp46, (1, 0, 2, 3)) * -1 - t2new += np.transpose(tmp47, (1, 0, 3, 2)) * 2 - t2new += np.transpose(tmp48, (1, 0, 3, 2)) * -1 - t2new += np.transpose(tmp51, (1, 0, 3, 2)) * 2 - t2new += np.transpose(tmp52, (1, 0, 3, 2)) * -1 - t2new += np.transpose(tmp43, (1, 0, 3, 2)) - del tmp43 - t2new += np.transpose(tmp41, (1, 0, 3, 2)) * -2 - del tmp41 - t2new += np.transpose(tmp58, (1, 0, 2, 3)) - t2new += np.transpose(tmp60, (1, 0, 2, 3)) * -2 - t2new += np.transpose(tmp44, (0, 1, 3, 2)) - del tmp44 - t2new += np.transpose(tmp46, (0, 1, 3, 2)) * -1 - del tmp46 - t2new += tmp51 * 2 - del tmp51 - t2new += tmp52 * -1 - del tmp52 - t2new += np.transpose(tmp58, (0, 1, 3, 2)) - del tmp58 - t2new += np.transpose(tmp60, (0, 1, 3, 2)) * -2 - del tmp60 - t2new += np.transpose(tmp61, (1, 0, 2, 3)) * -1 - t2new += np.transpose(tmp63, (1, 0, 2, 3)) - t2new += tmp67 - t2new += tmp68 * -2 - t2new += np.transpose(tmp69, (1, 0, 2, 3)) - t2new += np.transpose(tmp70, (1, 0, 2, 3)) * -2 - t2new += np.transpose(tmp72, (1, 0, 2, 3)) - t2new += np.transpose(tmp61, (0, 1, 3, 2)) * -1 - del tmp61 - t2new += np.transpose(tmp63, (0, 1, 3, 2)) - del tmp63 - t2new += np.transpose(tmp74, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp67, (1, 0, 3, 2)) - del tmp67 - t2new += np.transpose(tmp68, (1, 0, 3, 2)) * -2 - del tmp68 - t2new += np.transpose(tmp69, (0, 1, 3, 2)) - del tmp69 - t2new += np.transpose(tmp70, (0, 1, 3, 2)) * -2 - del tmp70 - t2new += np.transpose(tmp72, (0, 1, 3, 2)) - del tmp72 - t2new += np.transpose(v.ovov, (0, 2, 1, 3)) - t2new += np.transpose(tmp75, (1, 0, 2, 3)) - t2new += np.transpose(tmp77, (1, 0, 3, 2)) * -1 - t2new += np.transpose(tmp78, (1, 0, 3, 2)) * -1 - t2new += np.transpose(tmp80, (1, 0, 2, 3)) - t2new += np.transpose(tmp81, (1, 0, 3, 2)) * -1 - t2new += np.transpose(tmp82, (0, 1, 3, 2)) * -1 - t2new += tmp84 - t2new += einsum(t2, (0, 1, 2, 3), tmp85, (4, 1, 5, 2), (4, 0, 3, 5)) - del tmp85 - t2new += np.transpose(tmp86, (1, 0, 3, 2)) * -1 - t2new += np.transpose(tmp88, (1, 0, 2, 3)) * -2 - t2new += np.transpose(tmp90, (1, 0, 2, 3)) - t2new += np.transpose(tmp92, (1, 0, 2, 3)) - t2new += np.transpose(tmp93, (1, 0, 3, 2)) - t2new += tmp95 * -2 - del tmp95 - t2new += np.transpose(tmp96, (1, 0, 3, 2)) * -2 - t2new += tmp97 * 4 - del tmp97 - t2new += tmp93 - del tmp93 - t2new += tmp96 * -2 - del tmp96 - t2new += einsum(t2, (0, 1, 2, 3), tmp48, (4, 1, 5, 2), (4, 0, 5, 3)) - t2new += tmp81 * -1 - del tmp81 - t2new += np.transpose(tmp82, (1, 0, 2, 3)) * -1 - del tmp82 - t2new += np.transpose(tmp84, (1, 0, 3, 2)) - del tmp84 - t2new += np.transpose(tmp75, (0, 1, 3, 2)) - del tmp75 - t2new += einsum(t1, (0, 1), tmp98, (2, 3, 1, 4), (0, 2, 3, 4)) - del tmp98 - t2new += tmp100 - del tmp100 - t2new += np.transpose(tmp102, (1, 0, 3, 2)) * -1 - t2new += einsum(tmp103, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp103 - t2new += np.transpose(tmp104, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp105, (0, 1, 3, 2)) * 2 - t2new += np.transpose(tmp106, (0, 1, 3, 2)) * -1 - t2new += tmp108 - t2new += tmp110 * -2 - t2new += tmp112 - t2new += tmp47 * 2 - del tmp47 - t2new += tmp48 * -1 - del tmp48 - t2new += tmp86 * -1 - del tmp86 - t2new += np.transpose(tmp88, (0, 1, 3, 2)) * -2 - del tmp88 - t2new += np.transpose(tmp90, (0, 1, 3, 2)) - del tmp90 - t2new += np.transpose(tmp92, (0, 1, 3, 2)) - del tmp92 - t2new += np.transpose(tmp113, (1, 0, 3, 2)) - del tmp113 - t2new += np.transpose(tmp115, (1, 0, 3, 2)) * -1 - t2new += tmp117 - del tmp117 - t2new += tmp119 - del tmp119 - t2new += np.transpose(tmp104, (1, 0, 2, 3)) * -1 - del tmp104 - t2new += np.transpose(tmp105, (1, 0, 2, 3)) * 2 - del tmp105 - t2new += np.transpose(tmp106, (1, 0, 2, 3)) * -1 - del tmp106 - t2new += np.transpose(tmp108, (1, 0, 3, 2)) - del tmp108 - t2new += np.transpose(tmp110, (1, 0, 3, 2)) * -2 - del tmp110 - t2new += np.transpose(tmp112, (1, 0, 3, 2)) - del tmp112 - t2new += tmp77 * -1 - del tmp77 - t2new += tmp78 * -1 - del tmp78 - t2new += np.transpose(tmp80, (0, 1, 3, 2)) - del tmp80 - t2new += tmp115 * -1 - del tmp115 - t2new += np.transpose(tmp74, (1, 0, 2, 3)) * -1 - del tmp74 - t2new += tmp102 * -1 - del tmp102 - t1new_OV = np.copy(tmp20) * 0.5 - del tmp20 - t1new_OV += tmp21 * -0.5 - del tmp21 - t1new_OV += tmp22 * 1.5 - del tmp22 - t1new_OV += tmp23 * 0.5 - del tmp23 - t1new = np.copy(f.ov) - t1new += einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - t1new += einsum(t1, (0, 1), tmp0, (0, 2), (2, 1)) * -1 - del tmp0 - t1new += tmp1 * 2 - del tmp1 - t1new += tmp2 * 2 - del tmp2 - t1new += tmp3 * -1 - del tmp3 - t1new += tmp5 * -2 - del tmp5 - t1new += tmp6 - del tmp6 - t1new += tmp8 * -2 - del tmp8 - t1new += tmp10 - del tmp10 - t1new += tmp12 * 2 - del tmp12 - t1new += einsum(tmp13, (0, 1), t1, (2, 0), (2, 1)) * -1 - del tmp13 - t1new += einsum(t1, (0, 1), tmp15, (2, 0), (2, 1)) - del tmp15 - t1new += tmp17 * -2 - del tmp17 - t1new += einsum(t1, (0, 1), f.oo, (2, 0), (2, 1)) * -1 - t1new += einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) * -1 - t1new += einsum(t2, (0, 1, 2, 3), f.ov, (1, 3), (0, 2)) * 2 - t1new += einsum(t1, (0, 1), v.oovv, (2, 0, 3, 1), (2, 3)) * -1 - t1new += tmp18 - del tmp18 - t1new += tmp19 * -2 - del tmp19 - t1new += einsum(tmp14, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - t1new += einsum(t2, (0, 1, 2, 3), tmp14, (1, 3), (0, 2)) * -2 - del tmp14 - t1new += tmp24 * -2 - del tmp24 - t1new += tmp25 * 4 - del tmp25 - t1new += einsum(t1, (0, 1), tmp26, (2, 0), (2, 1)) - del tmp26 - t1new += einsum(tmp27, (0, 1), t1, (1, 2), (0, 2)) * -2 - del tmp27 - - t2new += _inflate(t2new.shape, np.ix_(sO, sO, sV, sV), t2new_OOVV) - t1new += _inflate(t1new.shape, np.ix_(sO, sV), t1new_OV) - t2new += _inflate(t2new.shape, np.ix_(sO, sO, sV, sv), t2new_OOVv) - t2new += _inflate(t2new.shape, np.ix_(sO, so, sV, sV), t2new_OoVV) - t2new += _inflate(t2new.shape, np.ix_(sO, sO, sv, sV), t2new_OOvV) - t2new += _inflate(t2new.shape, np.ix_(so, sO, sV, sV), t2new_oOVV) - - return {f"t1new": t1new, f"t2new": t2new, f"t3new": t3new} - diff --git a/ebcc/codegen/RDCD.py b/ebcc/codegen/RDCD.py deleted file mode 100644 index 00804f20..00000000 --- a/ebcc/codegen/RDCD.py +++ /dev/null @@ -1,113 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:06:59.222790 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:06:59.485668. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - e_cc = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 2, 1, 3), ()) * 2 - e_cc += einsum(t2, (0, 1, 2, 3), v.ovov, (0, 3, 1, 2), ()) * -1 - - return e_cc - -def update_amps(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:07:02.649958. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t2new : array - Updated T2 residuals. - """ - - tmp6 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp6 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp7 = einsum(t2, (0, 1, 2, 3), tmp6, (0, 1, 3, 4), (2, 4)) - tmp0 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 5), (4, 0, 5, 1)) - tmp9 = einsum(t2, (0, 1, 2, 3), tmp6, (1, 4, 2, 3), (0, 4)) * 2 - del tmp6 - tmp1 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp8 = einsum(t2, (0, 1, 2, 3), tmp7, (4, 2), (0, 1, 3, 4)) - del tmp7 - tmp5 = einsum(t2, (0, 1, 2, 3), tmp0, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp10 = einsum(t2, (0, 1, 2, 3), tmp9, (4, 1), (0, 4, 3, 2)) * 0.5 - del tmp9 - tmp2 = einsum(t2, (0, 1, 2, 3), f.vv, (4, 3), (0, 1, 4, 2)) - tmp3 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 5, 2)) - tmp14 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp14 += v.oovv * -1 - tmp14 += tmp1 * 4 - tmp11 = np.copy(tmp5) * 2 - del tmp5 - tmp11 += np.transpose(tmp8, (1, 0, 2, 3)) - del tmp8 - tmp11 += np.transpose(tmp10, (0, 1, 3, 2)) - del tmp10 - tmp13 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * -1 - tmp13 += tmp0 - tmp4 = np.copy(tmp2) - del tmp2 - tmp4 += tmp3 * -1 - del tmp3 - tmp12 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - t2new = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - t2new += np.transpose(tmp0, (1, 0, 3, 2)) * -1 - del tmp0 - t2new += np.transpose(tmp1, (1, 0, 3, 2)) * 2 - del tmp1 - t2new += einsum(v.vvvv, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - t2new += np.transpose(v.ovov, (0, 2, 1, 3)) - t2new += einsum(t2, (0, 1, 2, 3), v.oooo, (4, 1, 5, 0), (4, 5, 3, 2)) - t2new += np.transpose(tmp4, (0, 1, 3, 2)) - t2new += np.transpose(tmp4, (1, 0, 2, 3)) - del tmp4 - t2new += tmp11 * -1 - t2new += np.transpose(tmp11, (1, 0, 3, 2)) * -1 - del tmp11 - t2new += np.transpose(tmp12, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp12, (1, 0, 2, 3)) * -1 - del tmp12 - t2new += einsum(tmp13, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 5, 2)) - del tmp13 - t2new += einsum(tmp14, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp14 - - return {f"t2new": t2new} - diff --git a/ebcc/codegen/RDCSD.py b/ebcc/codegen/RDCSD.py deleted file mode 100644 index 72c2cc15..00000000 --- a/ebcc/codegen/RDCSD.py +++ /dev/null @@ -1,303 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:07:48.913612 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:07:49.622767. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp0 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp1 = np.copy(f.ov) - tmp1 += einsum(t1, (0, 1), tmp0, (0, 2, 3, 1), (2, 3)) - del tmp0 - e_cc = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 2, 1, 3), ()) * 2 - e_cc += einsum(t2, (0, 1, 2, 3), v.ovov, (0, 3, 1, 2), ()) * -1 - e_cc += einsum(t1, (0, 1), tmp1, (0, 1), ()) * 2 - del tmp1 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:08:05.693585. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - """ - - tmp1 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp3 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * 2 - tmp3 += np.transpose(v.ovov, (0, 2, 1, 3)) * -1 - tmp44 = np.copy(tmp1) * 2 - tmp44 += np.transpose(tmp1, (0, 2, 1, 3)) * -1 - tmp31 = einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp31 += np.transpose(t2, (0, 1, 3, 2)) * -2 - tmp31 += t2 - tmp4 = einsum(t1, (0, 1), tmp3, (0, 2, 3, 1), (2, 3)) - del tmp3 - tmp39 = np.copy(v.ovvv) * 2 - tmp39 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -1 - tmp43 = einsum(t2, (0, 1, 2, 3), tmp1, (4, 1, 5, 2), (4, 0, 5, 3)) - tmp45 = einsum(t2, (0, 1, 2, 3), tmp44, (4, 1, 5, 3), (4, 5, 0, 2)) - del tmp44 - tmp42 = einsum(t2, (0, 1, 2, 3), v.ooov, (4, 1, 5, 2), (0, 4, 5, 3)) - tmp48 = np.copy(v.ooov) * 2 - tmp48 += np.transpose(v.ooov, (0, 2, 1, 3)) * -1 - tmp65 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp55 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -0.5 - tmp55 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp32 = einsum(tmp31, (0, 1, 2, 3), v.ooov, (4, 5, 0, 3), (4, 5, 1, 2)) - del tmp31 - tmp30 = einsum(t2, (0, 1, 2, 3), tmp1, (4, 5, 1, 2), (4, 0, 5, 3)) - tmp33 = einsum(t2, (0, 1, 2, 3), tmp4, (4, 2), (4, 0, 1, 3)) - tmp28 = einsum(t1, (0, 1), v.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp29 = einsum(v.ooov, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp16 = einsum(t1, (0, 1), tmp1, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp40 = einsum(t1, (0, 1), tmp39, (0, 1, 2, 3), (2, 3)) - del tmp39 - tmp46 = np.copy(tmp1) * -1 - tmp46 += tmp42 - del tmp42 - tmp46 += tmp43 - del tmp43 - tmp46 += np.transpose(tmp45, (0, 2, 1, 3)) * -1 - del tmp45 - tmp49 = einsum(tmp48, (0, 1, 2, 3), t1, (2, 3), (0, 1)) - del tmp48 - tmp63 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp66 = np.copy(f.oo) - tmp66 += tmp65 - del tmp65 - tmp17 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp56 = einsum(tmp55, (0, 1, 2, 3), t2, (0, 1, 4, 3), (2, 4)) - tmp58 = einsum(t2, (0, 1, 2, 3), tmp55, (1, 4, 3, 2), (4, 0)) * 2 - del tmp55 - tmp52 = einsum(v.ovvv, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp36 = einsum(tmp4, (0, 1), t1, (2, 1), (0, 2)) - tmp34 = np.copy(np.transpose(tmp28, (0, 2, 1, 3))) * -1 - del tmp28 - tmp34 += np.transpose(tmp29, (0, 2, 1, 3)) - del tmp29 - tmp34 += np.transpose(tmp30, (0, 2, 1, 3)) - del tmp30 - tmp34 += np.transpose(tmp32, (2, 1, 0, 3)) - del tmp32 - tmp34 += np.transpose(tmp33, (2, 0, 1, 3)) * -1 - del tmp33 - tmp26 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp26 += t2 * 2 - tmp23 = einsum(t1, (0, 1), v.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp19 = einsum(t1, (0, 1), v.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp12 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp12 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp69 = np.copy(v.oooo) - tmp69 += einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp69 += np.transpose(tmp16, (3, 1, 0, 2)) - tmp41 = einsum(tmp40, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) - del tmp40 - tmp47 = einsum(tmp46, (0, 1, 2, 3), t1, (2, 4), (0, 1, 3, 4)) - del tmp46 - tmp50 = einsum(tmp49, (0, 1), t2, (2, 1, 3, 4), (0, 2, 4, 3)) - del tmp49 - tmp64 = einsum(t1, (0, 1), tmp63, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp63 - tmp67 = einsum(t2, (0, 1, 2, 3), tmp66, (1, 4), (4, 0, 3, 2)) - del tmp66 - tmp54 = einsum(tmp17, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp57 = einsum(tmp56, (0, 1), t2, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp56 - tmp59 = einsum(t2, (0, 1, 2, 3), tmp58, (1, 4), (4, 0, 3, 2)) * 0.5 - del tmp58 - tmp53 = einsum(t1, (0, 1), tmp52, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp52 - tmp18 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp61 = einsum(v.ooov, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp37 = einsum(tmp36, (0, 1), t2, (2, 0, 3, 4), (1, 2, 4, 3)) - del tmp36 - tmp35 = einsum(tmp34, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - del tmp34 - tmp27 = einsum(tmp23, (0, 1, 2, 3), tmp26, (1, 4, 2, 5), (4, 0, 5, 3)) - del tmp26 - tmp22 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp25 = einsum(t2, (0, 1, 2, 3), tmp19, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp24 = einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 5, 2)) - tmp20 = np.copy(t2) - tmp20 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp8 = np.copy(v.ovvv) - tmp8 += np.transpose(v.ovvv, (0, 2, 3, 1)) * -0.5 - tmp10 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * 2 - tmp10 += np.transpose(v.ovov, (0, 2, 1, 3)) * -1 - tmp13 = np.copy(f.ov) * 0.5 - tmp13 += einsum(t1, (0, 1), tmp12, (0, 2, 3, 1), (2, 3)) - del tmp12 - tmp11 = np.copy(v.ooov) - tmp11 += np.transpose(v.ooov, (0, 2, 1, 3)) * -0.5 - tmp15 = einsum(t1, (0, 1), v.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp70 = np.copy(np.transpose(v.ooov, (0, 2, 1, 3))) * -1 - tmp70 += einsum(tmp69, (0, 1, 2, 3), t1, (0, 4), (2, 1, 3, 4)) - del tmp69 - tmp51 = np.copy(np.transpose(tmp41, (1, 0, 3, 2))) - del tmp41 - tmp51 += np.transpose(tmp47, (0, 1, 3, 2)) - del tmp47 - tmp51 += np.transpose(tmp50, (1, 0, 3, 2)) * -1 - del tmp50 - tmp71 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * -1 - tmp71 += tmp17 - tmp68 = np.copy(tmp64) - del tmp64 - tmp68 += np.transpose(tmp67, (0, 1, 3, 2)) - del tmp67 - tmp60 = np.copy(tmp53) - del tmp53 - tmp60 += tmp54 * 2 - del tmp54 - tmp60 += np.transpose(tmp57, (1, 0, 3, 2)) - del tmp57 - tmp60 += np.transpose(tmp59, (1, 0, 3, 2)) - del tmp59 - tmp72 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 0.5 - tmp72 += v.oovv * -0.25 - tmp72 += tmp18 - tmp62 = einsum(t2, (0, 1, 2, 3), tmp61, (4, 5, 0, 1), (4, 5, 2, 3)) - del tmp61 - tmp38 = np.copy(tmp22) - del tmp22 - tmp38 += tmp23 - del tmp23 - tmp38 += tmp24 * -1 - del tmp24 - tmp38 += tmp25 * -1 - del tmp25 - tmp38 += np.transpose(tmp27, (1, 0, 2, 3)) - del tmp27 - tmp38 += np.transpose(tmp35, (0, 1, 3, 2)) - del tmp35 - tmp38 += np.transpose(tmp37, (0, 1, 3, 2)) * -1 - del tmp37 - tmp21 = einsum(tmp20, (0, 1, 2, 3), tmp19, (4, 0, 3, 5), (4, 1, 5, 2)) - del tmp19, tmp20 - tmp9 = np.copy(f.vv) - tmp9 += einsum(t1, (0, 1), tmp8, (0, 1, 2, 3), (3, 2)) * 2 - del tmp8 - tmp0 = np.copy(v.ovvv) * -0.5 - tmp0 += np.transpose(v.ovvv, (0, 2, 1, 3)) - tmp6 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp6 += t2 * -1 - tmp7 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp7 += v.oovv * -1 - tmp5 = np.copy(f.ov) - tmp5 += tmp4 - del tmp4 - tmp14 = np.copy(f.oo) - tmp14 += einsum(tmp10, (0, 1, 2, 3), t2, (4, 0, 2, 3), (1, 4)) - del tmp10 - tmp14 += einsum(t1, (0, 1), tmp11, (2, 3, 0, 1), (3, 2)) * 2 - del tmp11 - tmp14 += einsum(tmp13, (0, 1), t1, (2, 1), (0, 2)) * 2 - del tmp13 - tmp2 = np.copy(v.ooov) - tmp2 += np.transpose(v.ooov, (0, 2, 1, 3)) * -0.5 - tmp2 += tmp1 * -0.5 - tmp2 += np.transpose(tmp1, (0, 2, 1, 3)) - del tmp1 - t2new = einsum(t2, (0, 1, 2, 3), v.vvvv, (4, 2, 5, 3), (0, 1, 4, 5)) - t2new += einsum(t1, (0, 1), tmp15, (2, 3, 1, 4), (0, 2, 3, 4)) - del tmp15 - t2new += np.transpose(v.ovov, (0, 2, 1, 3)) - t2new += einsum(t2, (0, 1, 2, 3), v.oooo, (4, 1, 5, 0), (4, 5, 3, 2)) - t2new += einsum(t2, (0, 1, 2, 3), tmp16, (4, 5, 1, 0), (5, 4, 2, 3)) - del tmp16 - t2new += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 3), (4, 0, 5, 2)) * -1 - t2new += tmp17 * -1 - del tmp17 - t2new += np.transpose(tmp18, (1, 0, 3, 2)) * 2 - del tmp18 - t2new += einsum(v.ovoo, (0, 1, 2, 3), t1, (3, 4), (0, 2, 1, 4)) * -1 - t2new += np.transpose(tmp21, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp21, (1, 0, 2, 3)) * -1 - del tmp21 - t2new += np.transpose(tmp38, (0, 1, 3, 2)) - t2new += np.transpose(tmp38, (1, 0, 2, 3)) - del tmp38 - t2new += tmp51 - t2new += np.transpose(tmp51, (1, 0, 3, 2)) - del tmp51 - t2new += tmp60 * -1 - t2new += np.transpose(tmp60, (1, 0, 3, 2)) * -1 - del tmp60 - t2new += np.transpose(tmp62, (0, 1, 3, 2)) - t2new += np.transpose(tmp62, (1, 0, 2, 3)) - del tmp62 - t2new += np.transpose(tmp68, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp68, (1, 0, 2, 3)) * -1 - del tmp68 - t2new += einsum(t1, (0, 1), tmp70, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp70 - t2new += einsum(t2, (0, 1, 2, 3), tmp71, (4, 1, 5, 2), (4, 0, 5, 3)) - del tmp71 - t2new += einsum(tmp72, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) * 4 - del tmp72 - t1new = np.copy(f.ov) - t1new += einsum(tmp0, (0, 1, 2, 3), t2, (4, 0, 1, 2), (4, 3)) * 2 - del tmp0 - t1new += einsum(tmp2, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) * -2 - del tmp2 - t1new += einsum(tmp5, (0, 1), tmp6, (0, 2, 3, 1), (2, 3)) - del tmp5, tmp6 - t1new += einsum(t1, (0, 1), tmp7, (0, 2, 1, 3), (2, 3)) - del tmp7 - t1new += einsum(t1, (0, 1), tmp9, (1, 2), (0, 2)) - del tmp9 - t1new += einsum(t1, (0, 1), tmp14, (0, 2), (2, 1)) * -1 - del tmp14 - - return {f"t1new": t1new, f"t2new": t2new} - diff --git a/ebcc/codegen/RDFCC2.py b/ebcc/codegen/RDFCC2.py deleted file mode 100644 index a7487c17..00000000 --- a/ebcc/codegen/RDFCC2.py +++ /dev/null @@ -1,2308 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T16:47:36.491983 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:47:37.630643. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp3 = einsum(t1, (0, 1), v.xov, (2, 3, 1), (0, 3, 2)) - tmp1 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp1 += t2 * -1 - tmp0 = einsum(v.xov, (0, 1, 2), t1, (1, 2), (0,)) - tmp4 = np.copy(f.ov) * 2 - tmp4 += einsum(tmp3, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) * -1 - del tmp3 - tmp2 = einsum(t1, (0, 1), tmp0, (2,), (0, 1, 2)) - del tmp0 - tmp2 += einsum(v.xov, (0, 1, 2), tmp1, (1, 3, 4, 2), (3, 4, 0)) * 0.5 - del tmp1 - e_cc = einsum(v.xov, (0, 1, 2), tmp2, (1, 2, 0), ()) * 2 - del tmp2 - e_cc += einsum(tmp4, (0, 1), t1, (0, 1), ()) - del tmp4 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:47:46.694180. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - """ - - tmp2 = einsum(t1, (0, 1), v.xov, (2, 3, 1), (0, 3, 2)) - tmp18 = einsum(v.xoo, (0, 1, 2), tmp2, (3, 4, 0), (3, 1, 2, 4)) - tmp6 = einsum(v.xoo, (0, 1, 2), t1, (2, 3), (1, 3, 0)) - tmp15 = einsum(v.xvv, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp28 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp26 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp31 = np.copy(np.transpose(v.xoo, (1, 2, 0))) - tmp31 += np.transpose(tmp2, (1, 0, 2)) - tmp19 = einsum(tmp18, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - del tmp18 - tmp21 = np.copy(np.transpose(v.xov, (1, 2, 0))) * -1 - tmp21 += tmp6 - tmp9 = einsum(tmp2, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp0 = einsum(v.xov, (0, 1, 2), t1, (1, 2), (0,)) - tmp5 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp5 += t2 * -1 - tmp24 = einsum(tmp2, (0, 1, 2), tmp15, (3, 4, 2), (0, 3, 1, 4)) - tmp29 = einsum(t1, (0, 1), tmp28, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp28 - tmp27 = einsum(t2, (0, 1, 2, 3), tmp26, (1, 4), (4, 0, 2, 3)) - del tmp26 - tmp34 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp34 += einsum(tmp2, (0, 1, 2), tmp2, (3, 4, 2), (4, 0, 1, 3)) - tmp32 = einsum(tmp31, (0, 1, 2), v.xov, (2, 3, 4), (0, 1, 3, 4)) - del tmp31 - tmp20 = einsum(t1, (0, 1), tmp19, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp19 - tmp22 = einsum(tmp21, (0, 1, 2), tmp15, (3, 4, 2), (0, 3, 1, 4)) - del tmp21 - tmp17 = einsum(t2, (0, 1, 2, 3), f.vv, (4, 3), (0, 1, 4, 2)) - tmp7 = einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 0.5 - tmp7 += np.transpose(t2, (0, 1, 3, 2)) * -1 - tmp7 += t2 * 0.5 - tmp3 = np.copy(np.transpose(v.xoo, (1, 2, 0))) - tmp3 += np.transpose(tmp2, (1, 0, 2)) - del tmp2 - tmp13 = np.copy(f.ov) - tmp13 += tmp9 * -1 - tmp12 = np.copy(tmp6) * -1 - tmp12 += einsum(t1, (0, 1), tmp0, (2,), (0, 1, 2)) * 2 - tmp12 += einsum(v.xov, (0, 1, 2), tmp5, (1, 3, 4, 2), (3, 4, 0)) - tmp1 = einsum(v.xov, (0, 1, 2), tmp0, (0,), (1, 2)) - tmp25 = einsum(t1, (0, 1), tmp24, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp24 - tmp30 = np.copy(tmp27) - del tmp27 - tmp30 += tmp29 - del tmp29 - tmp16 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - tmp35 = einsum(t1, (0, 1), tmp34, (0, 2, 3, 4), (2, 4, 3, 1)) - del tmp34 - tmp33 = einsum(tmp32, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp32 - tmp23 = np.copy(tmp17) - del tmp17 - tmp23 += tmp20 - del tmp20 - tmp23 += np.transpose(tmp22, (1, 0, 2, 3)) * -1 - del tmp22 - tmp8 = np.copy(tmp6) * 0.5 - del tmp6 - tmp8 += einsum(t1, (0, 1), tmp0, (2,), (0, 1, 2)) * -1 - tmp8 += einsum(v.xov, (0, 1, 2), tmp7, (1, 3, 4, 2), (3, 4, 0)) - del tmp7 - tmp4 = einsum(tmp3, (0, 1, 2), v.xov, (2, 3, 4), (1, 3, 0, 4)) - del tmp3 - tmp11 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp11 += t2 * -1 - tmp14 = np.copy(f.oo) * 0.5 - tmp14 += einsum(v.xoo, (0, 1, 2), tmp0, (0,), (1, 2)) - del tmp0 - tmp14 += einsum(v.xov, (0, 1, 2), tmp12, (3, 2, 0), (1, 3)) * 0.5 - del tmp12 - tmp14 += einsum(tmp13, (0, 1), t1, (2, 1), (0, 2)) * 0.5 - del tmp13 - tmp10 = np.copy(f.ov) - tmp10 += tmp1 * 2 - tmp10 += tmp9 * -1 - del tmp9 - t2new = einsum(tmp15, (0, 1, 2), tmp15, (3, 4, 2), (3, 0, 4, 1)) - del tmp15 - t2new += einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (1, 3, 2, 4)) - t2new += np.transpose(tmp16, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp16, (1, 0, 2, 3)) * -1 - del tmp16 - t2new += np.transpose(tmp23, (0, 1, 3, 2)) - t2new += np.transpose(tmp23, (1, 0, 2, 3)) - del tmp23 - t2new += tmp25 * -1 - t2new += np.transpose(tmp25, (1, 0, 3, 2)) * -1 - del tmp25 - t2new += np.transpose(tmp30, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp30, (1, 0, 2, 3)) * -1 - del tmp30 - t2new += np.transpose(tmp33, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp33, (1, 0, 2, 3)) * -1 - del tmp33 - t2new += einsum(t1, (0, 1), tmp35, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp35 - t1new = np.copy(f.ov) - t1new += tmp1 * 2 - del tmp1 - t1new += einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - t1new += einsum(tmp5, (0, 1, 2, 3), tmp4, (4, 0, 1, 3), (4, 2)) * -1 - del tmp5, tmp4 - t1new += einsum(tmp8, (0, 1, 2), v.xvv, (2, 3, 1), (0, 3)) * -2 - del tmp8 - t1new += einsum(tmp10, (0, 1), tmp11, (0, 2, 3, 1), (2, 3)) - del tmp10, tmp11 - t1new += einsum(tmp14, (0, 1), t1, (0, 2), (1, 2)) * -2 - del tmp14 - - return {f"t1new": t1new, f"t2new": t2new} - -def update_lams(f=None, l1=None, l2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:48:58.221724. - - Parameters - ---------- - f : array - Fock matrix. - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - l1new : array - Updated L1 residuals. - l2new : array - Updated L2 residuals. - """ - - tmp13 = einsum(v.xov, (0, 1, 2), t1, (1, 2), (0,)) - tmp5 = einsum(t1, (0, 1), v.xov, (2, 3, 1), (0, 3, 2)) - tmp14 = einsum(tmp13, (0,), v.xov, (0, 1, 2), (1, 2)) - tmp15 = einsum(tmp5, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp33 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - tmp0 = einsum(t1, (0, 1), v.xvv, (2, 3, 1), (0, 3, 2)) - tmp7 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp97 = np.copy(tmp14) * 2 - tmp97 += tmp15 * -1 - tmp92 = np.copy(tmp33) * -1 - tmp92 += np.transpose(tmp33, (1, 0, 2, 3)) * 2 - tmp89 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp89 += tmp0 - tmp90 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * 2 - tmp90 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp8 = einsum(tmp7, (0, 1, 2, 3), t2, (4, 5, 3, 2), (4, 5, 1, 0)) - tmp9 = einsum(tmp5, (0, 1, 2), tmp5, (3, 4, 2), (3, 0, 4, 1)) - tmp28 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp28 += t2 - tmp63 = einsum(v.xoo, (0, 1, 2), tmp5, (2, 3, 0), (1, 3)) - tmp98 = einsum(tmp97, (0, 1), t1, (2, 1), (2, 0)) - tmp93 = einsum(v.xoo, (0, 1, 2), tmp92, (1, 3, 2, 4), (3, 4, 0)) - tmp94 = einsum(tmp92, (0, 1, 2, 3), tmp5, (0, 2, 4), (1, 3, 4)) - del tmp92 - tmp91 = einsum(tmp90, (0, 1, 2, 3), tmp89, (0, 3, 4), (1, 2, 4)) - del tmp90, tmp89 - tmp80 = np.copy(np.transpose(v.xoo, (1, 2, 0))) - tmp80 += np.transpose(tmp5, (1, 0, 2)) - tmp49 = einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - tmp21 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp21 += t2 * -1 - tmp3 = einsum(v.xvv, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp10 = np.copy(tmp8) - del tmp8 - tmp10 += tmp9 - tmp50 = einsum(tmp28, (0, 1, 2, 3), l2, (2, 3, 0, 4), (4, 1)) - tmp55 = einsum(tmp28, (0, 1, 2, 3), l2, (2, 3, 0, 4), (4, 1)) * 2 - tmp78 = einsum(tmp5, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 1, 4)) - tmp76 = einsum(v.xov, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp99 = np.copy(tmp63) - tmp99 += tmp98 * -1 - del tmp98 - tmp65 = einsum(tmp13, (0,), v.xvv, (0, 1, 2), (1, 2)) - tmp95 = np.copy(tmp91) - del tmp91 - tmp95 += tmp93 * -1 - del tmp93 - tmp95 += tmp94 * -1 - del tmp94 - tmp81 = einsum(v.xvv, (0, 1, 2), tmp80, (3, 4, 0), (3, 4, 1, 2)) - del tmp80 - tmp109 = einsum(v.xov, (0, 1, 2), tmp49, (3, 1), (3, 2, 0)) - tmp73 = einsum(v.xvv, (0, 1, 2), l1, (2, 3), (3, 1, 0)) - tmp25 = einsum(v.xoo, (0, 1, 2), tmp5, (3, 4, 0), (3, 1, 2, 4)) - tmp70 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp104 = einsum(v.xov, (0, 1, 2), tmp0, (1, 3, 0), (2, 3)) - tmp18 = np.copy(np.transpose(v.xoo, (1, 2, 0))) - tmp18 += np.transpose(tmp5, (1, 0, 2)) - tmp16 = np.copy(tmp14) * 2 - tmp16 += tmp15 * -1 - tmp24 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp22 = einsum(v.xov, (0, 1, 2), tmp21, (1, 3, 4, 2), (3, 4, 0)) - tmp6 = einsum(tmp0, (0, 1, 2), tmp5, (3, 4, 2), (3, 0, 4, 1)) - tmp4 = einsum(t2, (0, 1, 2, 3), tmp3, (4, 3, 5, 2), (0, 1, 4, 5)) - tmp11 = einsum(tmp10, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) * 2 - del tmp10 - tmp20 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp20 += t2 * -0.5 - tmp46 = einsum(tmp33, (0, 1, 2, 3), t1, (4, 3), (1, 0, 2, 4)) - tmp35 = np.copy(tmp33) * -0.5 - tmp35 += np.transpose(tmp33, (1, 0, 2, 3)) - tmp41 = einsum(t2, (0, 1, 2, 3), l1, (3, 4), (4, 0, 1, 2)) - tmp42 = np.copy(tmp33) * 2 - tmp42 += np.transpose(tmp33, (1, 0, 2, 3)) * -1 - tmp51 = np.copy(tmp49) * 0.5 - tmp51 += tmp50 - del tmp50 - tmp44 = einsum(t2, (0, 1, 2, 3), l2, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp58 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp58 += t2 * 2 - tmp56 = np.copy(tmp49) - tmp56 += tmp55 - del tmp55 - tmp87 = einsum(tmp33, (0, 1, 2, 3), tmp78, (1, 2, 4, 5), (0, 4, 3, 5)) - tmp84 = einsum(tmp33, (0, 1, 2, 3), tmp76, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp100 = einsum(tmp99, (0, 1), l2, (2, 3, 0, 4), (4, 1, 2, 3)) - del tmp99 - tmp101 = einsum(tmp33, (0, 1, 2, 3), tmp97, (2, 4), (0, 1, 3, 4)) - tmp85 = einsum(l2, (0, 1, 2, 3), tmp65, (4, 1), (2, 3, 0, 4)) - tmp96 = einsum(v.xov, (0, 1, 2), tmp95, (3, 4, 0), (1, 3, 2, 4)) - del tmp95 - tmp88 = einsum(tmp81, (0, 1, 2, 3), l2, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp86 = einsum(tmp33, (0, 1, 2, 3), tmp3, (2, 4, 3, 5), (1, 0, 5, 4)) - del tmp3 - tmp110 = einsum(tmp109, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 4, 1)) - del tmp109 - tmp108 = einsum(l1, (0, 1), tmp78, (1, 2, 3, 4), (2, 3, 0, 4)) - tmp62 = einsum(tmp13, (0,), v.xoo, (0, 1, 2), (1, 2)) - del tmp13 - tmp79 = einsum(tmp78, (0, 1, 2, 3), tmp33, (0, 4, 1, 5), (4, 2, 5, 3)) - del tmp78 - tmp77 = einsum(tmp76, (0, 1, 2, 3), tmp33, (1, 4, 2, 5), (4, 0, 5, 3)) - tmp74 = einsum(v.xov, (0, 1, 2), tmp73, (3, 4, 0), (3, 1, 2, 4)) - del tmp73 - tmp75 = einsum(l2, (0, 1, 2, 3), tmp25, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp69 = einsum(l2, (0, 1, 2, 3), f.vv, (4, 1), (2, 3, 4, 0)) - tmp72 = einsum(tmp33, (0, 1, 2, 3), f.ov, (2, 4), (0, 1, 4, 3)) - tmp82 = einsum(l2, (0, 1, 2, 3), tmp81, (4, 2, 5, 1), (3, 4, 0, 5)) - del tmp81 - tmp71 = einsum(tmp70, (0, 1), l2, (2, 3, 4, 1), (0, 4, 2, 3)) - del tmp70 - tmp105 = einsum(tmp104, (0, 1), l2, (2, 1, 3, 4), (3, 4, 2, 0)) - del tmp104 - tmp103 = einsum(l1, (0, 1), tmp76, (2, 1, 3, 4), (2, 3, 0, 4)) - del tmp76 - tmp19 = einsum(v.xov, (0, 1, 2), tmp18, (3, 4, 0), (1, 3, 4, 2)) - tmp17 = einsum(tmp16, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) - del tmp16 - tmp2 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp1 = einsum(v.xoo, (0, 1, 2), tmp0, (3, 4, 0), (3, 1, 2, 4)) - tmp26 = np.copy(np.transpose(tmp24, (3, 2, 1, 0))) - tmp26 += np.transpose(tmp25, (1, 0, 3, 2)) - tmp26 += np.transpose(tmp25, (3, 0, 2, 1)) * -0.5 - tmp23 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp23 += tmp22 - tmp12 = np.copy(tmp4) * 2 - del tmp4 - tmp12 += tmp6 * 2 - del tmp6 - tmp12 += tmp11 * -1 - del tmp11 - tmp29 = np.copy(np.transpose(tmp24, (3, 2, 1, 0))) * 0.5 - tmp29 += np.transpose(tmp25, (1, 0, 3, 2)) * 0.5 - tmp29 += np.transpose(tmp25, (3, 0, 2, 1)) * -1 - del tmp25 - tmp61 = np.copy(f.ov) - tmp61 += tmp14 * 2 - del tmp14 - tmp61 += tmp15 * -1 - del tmp15 - tmp34 = np.copy(tmp33) * -1 - tmp34 += np.transpose(tmp33, (1, 0, 2, 3)) * 2 - tmp37 = np.copy(np.transpose(v.xoo, (1, 2, 0))) - tmp37 += tmp5 - tmp32 = np.copy(np.transpose(l2, (3, 2, 0, 1))) - tmp32 += np.transpose(l2, (2, 3, 0, 1)) * -0.5 - tmp36 = einsum(l2, (0, 1, 2, 3), tmp20, (2, 3, 1, 4), (0, 4)) * 2 - tmp31 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp31 += tmp0 - tmp31 += tmp22 - tmp48 = np.copy(tmp46) * -0.5 - tmp48 += np.transpose(tmp46, (0, 1, 3, 2)) - tmp43 = np.copy(tmp41) * -1 - tmp43 += np.transpose(tmp41, (0, 2, 1, 3)) * 0.5 - del tmp41 - tmp43 += einsum(t2, (0, 1, 2, 3), tmp42, (1, 4, 5, 3), (4, 5, 0, 2)) * 0.5 - del tmp42 - tmp43 += einsum(tmp35, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 2, 4, 5)) - tmp39 = einsum(l2, (0, 1, 2, 3), tmp21, (2, 4, 1, 5), (3, 4, 0, 5)) - tmp39 += einsum(tmp28, (0, 1, 2, 3), l2, (4, 2, 5, 0), (5, 1, 4, 3)) * 2 - tmp52 = np.copy(t1) * -0.5 - tmp52 += einsum(tmp33, (0, 1, 2, 3), tmp20, (0, 1, 4, 3), (2, 4)) - tmp52 += einsum(l1, (0, 1), tmp21, (1, 2, 3, 0), (2, 3)) * -0.5 - tmp52 += einsum(tmp51, (0, 1), t1, (0, 2), (1, 2)) - tmp47 = np.copy(tmp46) * 2 - tmp47 += np.transpose(tmp46, (0, 1, 3, 2)) * -1 - tmp45 = np.copy(np.transpose(tmp44, (1, 0, 2, 3))) * -0.5 - tmp45 += np.transpose(tmp44, (1, 0, 3, 2)) - del tmp44 - tmp40 = np.copy(tmp33) - tmp40 += np.transpose(tmp33, (1, 0, 2, 3)) * -0.5 - tmp54 = einsum(l1, (0, 1), t1, (1, 2), (0, 2)) * 0.5 - tmp54 += einsum(l2, (0, 1, 2, 3), tmp20, (2, 3, 1, 4), (0, 4)) - tmp59 = np.copy(tmp49) - del tmp49 - tmp59 += einsum(l2, (0, 1, 2, 3), tmp58, (2, 4, 0, 1), (4, 3)) - del tmp58 - tmp57 = np.copy(np.transpose(l1, (1, 0))) - tmp57 += t1 - tmp57 += einsum(tmp33, (0, 1, 2, 3), tmp21, (0, 1, 4, 3), (2, 4)) * -1 - del tmp33, tmp21 - tmp57 += einsum(l1, (0, 1), tmp20, (1, 2, 3, 0), (2, 3)) * 2 - tmp57 += einsum(tmp56, (0, 1), t1, (0, 2), (1, 2)) * -1 - tmp68 = einsum(l2, (0, 1, 2, 3), f.oo, (4, 3), (4, 2, 0, 1)) - tmp112 = np.copy(np.transpose(tmp24, (3, 2, 1, 0))) - del tmp24 - tmp112 += np.transpose(tmp9, (0, 3, 1, 2)) - del tmp9 - tmp102 = einsum(l1, (0, 1), f.ov, (2, 3), (2, 1, 3, 0)) - tmp102 += tmp84 - del tmp84 - tmp102 += tmp85 * 2 - del tmp85 - tmp102 += tmp86 * -1 - del tmp86 - tmp102 += tmp87 - del tmp87 - tmp102 += tmp88 * -1 - del tmp88 - tmp102 += np.transpose(tmp96, (1, 0, 3, 2)) - del tmp96 - tmp102 += np.transpose(tmp100, (0, 1, 3, 2)) - del tmp100 - tmp102 += tmp101 * -1 - del tmp101 - tmp102 += einsum(l1, (0, 1), tmp97, (2, 3), (1, 2, 0, 3)) - del tmp97 - tmp67 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp111 = np.copy(tmp108) - del tmp108 - tmp111 += tmp110 - del tmp110 - tmp107 = einsum(l2, (0, 1, 2, 3), tmp62, (4, 3), (2, 4, 0, 1)) - tmp83 = np.copy(tmp69) - del tmp69 - tmp83 += tmp71 * -1 - del tmp71 - tmp83 += tmp72 * -1 - del tmp72 - tmp83 += tmp74 - del tmp74 - tmp83 += tmp75 - del tmp75 - tmp83 += tmp77 - del tmp77 - tmp83 += tmp79 - del tmp79 - tmp83 += tmp82 * -1 - del tmp82 - tmp106 = np.copy(tmp103) - del tmp103 - tmp106 += tmp105 - del tmp105 - tmp66 = np.copy(f.vv) - tmp66 += np.transpose(tmp65, (1, 0)) * 2 - del tmp65 - tmp27 = np.copy(np.transpose(tmp1, (0, 2, 1, 3))) - tmp27 += np.transpose(tmp2, (1, 0, 2, 3)) - tmp27 += np.transpose(tmp2, (2, 0, 1, 3)) * -2 - del tmp2 - tmp27 += np.transpose(tmp12, (0, 2, 1, 3)) * -1 - tmp27 += np.transpose(tmp12, (1, 2, 0, 3)) * 0.5 - del tmp12 - tmp27 += np.transpose(tmp17, (1, 2, 0, 3)) - tmp27 += np.transpose(tmp17, (0, 2, 1, 3)) * -2 - del tmp17 - tmp27 += einsum(tmp19, (0, 1, 2, 3), tmp20, (1, 4, 5, 3), (2, 0, 4, 5)) * 2 - del tmp20 - tmp27 += einsum(tmp18, (0, 1, 2), tmp23, (3, 4, 2), (1, 0, 3, 4)) * -2 - tmp27 += einsum(tmp26, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) * 2 - del tmp26 - tmp30 = np.copy(np.transpose(tmp1, (0, 2, 1, 3))) * -1 - del tmp1 - tmp30 += einsum(tmp19, (0, 1, 2, 3), tmp28, (1, 4, 5, 3), (2, 0, 4, 5)) - del tmp28, tmp19 - tmp30 += einsum(tmp18, (0, 1, 2), tmp23, (3, 4, 2), (1, 0, 3, 4)) * 0.5 - del tmp23 - tmp30 += einsum(t1, (0, 1), tmp29, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - del tmp29 - tmp64 = np.copy(f.oo) - tmp64 += np.transpose(tmp62, (1, 0)) * 2 - del tmp62 - tmp64 += tmp63 * -1 - del tmp63 - tmp64 += einsum(tmp22, (0, 1, 2), v.xov, (2, 3, 1), (0, 3)) - del tmp22 - tmp64 += einsum(t1, (0, 1), tmp61, (2, 1), (0, 2)) - tmp38 = einsum(tmp32, (0, 1, 2, 3), tmp31, (0, 3, 4), (1, 2, 4)) * -1 - del tmp32 - tmp38 += einsum(tmp34, (0, 1, 2, 3), v.xoo, (4, 0, 2), (1, 3, 4)) * 0.5 - del tmp34 - tmp38 += einsum(tmp5, (0, 1, 2), tmp35, (0, 3, 1, 4), (3, 4, 2)) - del tmp35 - tmp38 += einsum(v.xov, (0, 1, 2), tmp36, (3, 2), (1, 3, 0)) * 0.5 - del tmp36 - tmp38 += einsum(l1, (0, 1), tmp37, (1, 2, 3), (2, 0, 3)) * 0.5 - del tmp37 - tmp53 = einsum(l1, (0, 1), tmp0, (2, 0, 3), (2, 1, 3)) * -0.5 - del tmp0 - tmp53 += einsum(v.xvv, (0, 1, 2), tmp39, (3, 4, 2, 1), (4, 3, 0)) * -0.5 - del tmp39 - tmp53 += einsum(tmp31, (0, 1, 2), tmp40, (0, 3, 4, 1), (4, 3, 2)) * -1 - del tmp31, tmp40 - tmp53 += einsum(v.xov, (0, 1, 2), tmp43, (3, 1, 4, 2), (4, 3, 0)) - del tmp43 - tmp53 += einsum(tmp18, (0, 1, 2), tmp45, (1, 3, 0, 4), (4, 3, 2)) - del tmp18, tmp45 - tmp53 += einsum(tmp47, (0, 1, 2, 3), tmp5, (0, 2, 4), (3, 1, 4)) * 0.5 - del tmp5, tmp47 - tmp53 += einsum(tmp48, (0, 1, 2, 3), v.xoo, (4, 0, 3), (2, 1, 4)) - del tmp48 - tmp53 += einsum(tmp52, (0, 1), v.xov, (2, 3, 1), (0, 3, 2)) - del tmp52 - tmp53 += einsum(tmp51, (0, 1), v.xoo, (2, 3, 0), (1, 3, 2)) - del tmp51 - tmp60 = einsum(tmp54, (0, 1), v.xvv, (2, 1, 0), (2,)) * 2 - del tmp54 - tmp60 += einsum(v.xov, (0, 1, 2), tmp57, (1, 2), (0,)) - del tmp57 - tmp60 += einsum(tmp59, (0, 1), v.xoo, (2, 1, 0), (2,)) * -1 - del tmp59 - l2new = einsum(tmp67, (0, 1, 2, 3), l2, (3, 2, 4, 5), (0, 1, 4, 5)) - del tmp67 - l2new += einsum(tmp46, (0, 1, 2, 3), tmp7, (2, 3, 4, 5), (5, 4, 1, 0)) - del tmp46 - l2new += np.transpose(tmp7, (3, 2, 1, 0)) - del tmp7 - l2new += np.transpose(tmp68, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp68, (2, 3, 1, 0)) * -1 - del tmp68 - l2new += np.transpose(tmp83, (3, 2, 0, 1)) - l2new += np.transpose(tmp83, (2, 3, 1, 0)) - del tmp83 - l2new += np.transpose(tmp102, (2, 3, 0, 1)) - l2new += np.transpose(tmp102, (3, 2, 1, 0)) - del tmp102 - l2new += np.transpose(tmp106, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp106, (3, 2, 1, 0)) * -1 - del tmp106 - l2new += np.transpose(tmp107, (2, 3, 0, 1)) * -2 - l2new += np.transpose(tmp107, (3, 2, 1, 0)) * -2 - del tmp107 - l2new += np.transpose(tmp111, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp111, (2, 3, 1, 0)) * -1 - del tmp111 - l2new += einsum(tmp112, (0, 1, 2, 3), l2, (4, 5, 2, 0), (4, 5, 1, 3)) - del tmp112 - l1new = np.copy(np.transpose(f.ov, (1, 0))) - l1new += einsum(tmp27, (0, 1, 2, 3), l2, (4, 3, 0, 2), (4, 1)) - del tmp27 - l1new += einsum(l2, (0, 1, 2, 3), tmp30, (3, 4, 2, 1), (0, 4)) * 2 - del tmp30 - l1new += einsum(tmp38, (0, 1, 2), v.xvv, (2, 3, 1), (3, 0)) * -2 - del tmp38 - l1new += einsum(tmp53, (0, 1, 2), v.xov, (2, 0, 3), (3, 1)) * 2 - del tmp53 - l1new += einsum(v.xov, (0, 1, 2), tmp60, (0,), (2, 1)) * 2 - del tmp60 - l1new += einsum(tmp56, (0, 1), tmp61, (1, 2), (2, 0)) * -1 - del tmp56, tmp61 - l1new += einsum(tmp64, (0, 1), l1, (2, 0), (2, 1)) * -1 - del tmp64 - l1new += einsum(l1, (0, 1), tmp66, (0, 2), (2, 1)) - del tmp66 - - return {f"l1new": l1new, f"l2new": l2new} - -def make_rdm1_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:48:59.806842. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm1 : array - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp2 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - tmp1 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp1 += t2 - tmp0 = einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - tmp6 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp6 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp4 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp4 += t2 * -1 - tmp3 = np.copy(tmp2) * -0.5 - tmp3 += np.transpose(tmp2, (1, 0, 2, 3)) - del tmp2 - tmp5 = np.copy(tmp0) - tmp5 += einsum(l2, (0, 1, 2, 3), tmp1, (2, 4, 0, 1), (3, 4)) * 2 - rdm1.vv = einsum(l1, (0, 1), t1, (1, 2), (0, 2)) * 2 - rdm1.vv += einsum(tmp6, (0, 1, 2, 3), t2, (0, 1, 2, 4), (3, 4)) * 2 - del tmp6 - rdm1.vo = np.copy(l1) * 2 - rdm1.ov = np.copy(t1) * 2 - rdm1.ov += einsum(tmp3, (0, 1, 2, 3), t2, (1, 0, 3, 4), (2, 4)) * -4 - del tmp3 - rdm1.ov += einsum(l1, (0, 1), tmp4, (1, 2, 3, 0), (2, 3)) * 2 - del tmp4 - rdm1.ov += einsum(tmp5, (0, 1), t1, (0, 2), (1, 2)) * -2 - del tmp5 - rdm1.oo = np.copy(np.transpose(tmp0, (1, 0))) * -2 - del tmp0 - rdm1.oo += delta.oo * 2 - del delta - rdm1.oo += einsum(l2, (0, 1, 2, 3), tmp1, (2, 4, 0, 1), (4, 3)) * -4 - del tmp1 - rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]]) - - return rdm1 - -def make_rdm2_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:50:15.681589. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm2 : array - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp4 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - tmp80 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp80 += t2 * 2 - tmp78 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp78 += t2 - tmp14 = np.copy(tmp4) - tmp14 += np.transpose(tmp4, (1, 0, 2, 3)) * -1 - tmp16 = np.copy(tmp4) * 2 - tmp16 += np.transpose(tmp4, (1, 0, 2, 3)) * -1 - tmp0 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp0 += t2 - tmp45 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * 2 - tmp45 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp81 = einsum(l2, (0, 1, 2, 3), tmp80, (3, 4, 1, 5), (4, 2, 5, 0)) - del tmp80 - tmp87 = einsum(tmp4, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - tmp79 = einsum(l2, (0, 1, 2, 3), tmp78, (2, 4, 1, 5), (4, 3, 5, 0)) - del tmp78 - tmp61 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp61 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp101 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * 2 - tmp101 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp15 = einsum(tmp14, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 2, 4, 5)) - tmp17 = einsum(tmp16, (0, 1, 2, 3), t2, (4, 0, 5, 3), (1, 2, 4, 5)) - del tmp16 - tmp12 = einsum(t2, (0, 1, 2, 3), l1, (3, 4), (4, 0, 1, 2)) - tmp2 = einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - tmp22 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp22 += t2 * -1 - tmp26 = einsum(tmp4, (0, 1, 2, 3), t2, (4, 1, 3, 5), (0, 2, 4, 5)) - tmp3 = einsum(l2, (0, 1, 2, 3), t2, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp5 = einsum(t1, (0, 1), tmp4, (2, 3, 4, 1), (3, 2, 4, 0)) - tmp8 = np.copy(tmp4) * -1 - tmp8 += np.transpose(tmp4, (1, 0, 2, 3)) * 2 - tmp1 = einsum(l2, (0, 1, 2, 3), tmp0, (2, 4, 0, 1), (3, 4)) * 2 - tmp54 = np.copy(np.transpose(l2, (3, 2, 0, 1))) - tmp54 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp25 = einsum(tmp4, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 2, 4, 5)) - tmp33 = einsum(l2, (0, 1, 2, 3), tmp0, (2, 4, 0, 1), (3, 4)) - del tmp0 - tmp111 = einsum(l2, (0, 1, 2, 3), t1, (3, 4), (2, 0, 1, 4)) - tmp66 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 1, 5), (2, 4, 0, 5)) - tmp52 = einsum(tmp45, (0, 1, 2, 3), t2, (4, 0, 5, 3), (1, 4, 2, 5)) - tmp105 = np.copy(tmp87) - tmp105 += np.transpose(tmp79, (1, 0, 3, 2)) - tmp105 += np.transpose(tmp81, (1, 0, 3, 2)) * -1 - tmp89 = einsum(tmp61, (0, 1, 2, 3), t2, (0, 1, 2, 4), (3, 4)) - tmp84 = einsum(l1, (0, 1), t1, (1, 2), (0, 2)) - tmp94 = np.copy(np.transpose(tmp81, (1, 0, 3, 2))) - tmp94 += np.transpose(tmp79, (1, 0, 3, 2)) * -1 - tmp102 = einsum(tmp101, (0, 1, 2, 3), t2, (4, 0, 5, 3), (1, 4, 2, 5)) - del tmp101 - tmp48 = np.copy(tmp12) - tmp48 += tmp15 - tmp48 += tmp17 * -1 - tmp21 = einsum(tmp2, (0, 1), t1, (0, 2), (1, 2)) - tmp23 = einsum(l1, (0, 1), tmp22, (1, 2, 3, 0), (2, 3)) - del tmp22 - tmp46 = einsum(tmp45, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 4, 2, 5)) - del tmp45 - tmp73 = np.copy(tmp12) - tmp73 += tmp26 * -1 - tmp6 = np.copy(np.transpose(tmp3, (1, 0, 3, 2))) - tmp6 += tmp5 - tmp9 = einsum(tmp8, (0, 1, 2, 3), t2, (0, 1, 4, 3), (2, 4)) * 0.5 - tmp10 = einsum(tmp1, (0, 1), t1, (0, 2), (1, 2)) * 0.5 - tmp62 = einsum(tmp61, (0, 1, 2, 3), t2, (0, 1, 2, 4), (3, 4)) * 0.5 - del tmp61 - tmp19 = einsum(t1, (0, 1), tmp3, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp13 = einsum(t1, (0, 1), tmp5, (0, 2, 3, 4), (2, 4, 3, 1)) - tmp55 = einsum(tmp54, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 4, 2, 5)) - del tmp54 - tmp70 = np.copy(tmp25) - tmp70 += tmp17 * -1 - tmp34 = np.copy(tmp2) * 0.5 - tmp34 += tmp33 - del tmp33 - tmp31 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp31 += t2 * -1 - tmp112 = einsum(l2, (0, 1, 2, 3), t2, (3, 2, 4, 5), (0, 1, 5, 4)) - tmp113 = einsum(t1, (0, 1), tmp111, (0, 2, 3, 4), (3, 2, 4, 1)) - tmp109 = np.copy(tmp66) - tmp109 += tmp87 - tmp109 += tmp52 * -1 - tmp68 = einsum(l2, (0, 1, 2, 3), t2, (4, 2, 1, 5), (3, 4, 0, 5)) - tmp93 = einsum(t2, (0, 1, 2, 3), l1, (4, 1), (0, 4, 2, 3)) - tmp106 = einsum(tmp105, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp105 - tmp90 = np.copy(tmp84) - tmp90 += tmp89 - del tmp89 - tmp97 = einsum(tmp4, (0, 1, 2, 3), t2, (0, 1, 4, 5), (2, 3, 4, 5)) - tmp95 = einsum(tmp94, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp94 - tmp103 = np.copy(tmp66) - tmp103 += tmp87 - tmp103 += tmp102 * -1 - del tmp102 - tmp91 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp91 += np.transpose(l2, (2, 3, 0, 1)) - tmp82 = np.copy(tmp4) * -1 - tmp82 += np.transpose(tmp4, (1, 0, 2, 3)) - tmp49 = einsum(tmp48, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp48 - tmp24 = np.copy(tmp21) - tmp24 += tmp23 * -1 - tmp44 = einsum(t2, (0, 1, 2, 3), tmp2, (1, 4), (4, 0, 2, 3)) - tmp47 = einsum(tmp46, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - del tmp46 - tmp74 = einsum(tmp73, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp73 - tmp29 = einsum(t1, (0, 1), tmp6, (0, 2, 3, 4), (2, 3, 4, 1)) - tmp11 = np.copy(tmp9) - tmp11 += tmp10 - del tmp10 - tmp63 = einsum(tmp62, (0, 1), t2, (2, 3, 0, 4), (2, 3, 1, 4)) * 2 - tmp64 = einsum(t2, (0, 1, 2, 3), tmp1, (1, 4), (0, 4, 3, 2)) - tmp58 = einsum(t1, (0, 1), tmp19, (0, 2, 3, 4), (3, 2, 4, 1)) - tmp59 = einsum(t2, (0, 1, 2, 3), tmp6, (0, 1, 4, 5), (4, 5, 2, 3)) - tmp53 = einsum(tmp52, (0, 1, 2, 3), t2, (4, 0, 5, 2), (1, 4, 3, 5)) - tmp51 = einsum(t1, (0, 1), tmp13, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp56 = einsum(tmp55, (0, 1, 2, 3), t2, (4, 0, 2, 5), (1, 4, 3, 5)) - tmp71 = einsum(t1, (0, 1), tmp70, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp70 - tmp35 = einsum(tmp34, (0, 1), t1, (0, 2), (1, 2)) * 2 - tmp30 = einsum(tmp8, (0, 1, 2, 3), t2, (0, 1, 4, 3), (2, 4)) - del tmp8 - tmp41 = einsum(tmp34, (0, 1), t1, (0, 2), (1, 2)) - tmp40 = einsum(l1, (0, 1), tmp31, (1, 2, 3, 0), (2, 3)) * 0.5 - tmp32 = einsum(l1, (0, 1), tmp31, (1, 2, 3, 0), (2, 3)) - del tmp31 - tmp27 = np.copy(tmp4) * -1 - tmp27 += np.transpose(tmp4, (1, 0, 2, 3)) * 2 - tmp114 = np.copy(np.transpose(tmp112, (1, 0, 3, 2))) - tmp114 += np.transpose(tmp113, (1, 0, 3, 2)) - tmp110 = einsum(tmp109, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp109 - tmp100 = einsum(t1, (0, 1), tmp68, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp107 = np.copy(tmp93) - tmp107 += np.transpose(tmp106, (0, 1, 3, 2)) - del tmp106 - tmp108 = np.copy(tmp97) - tmp108 += einsum(tmp90, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp98 = np.copy(tmp97) - tmp98 += einsum(tmp62, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - tmp85 = np.copy(tmp84) * 0.5 - tmp85 += tmp62 - del tmp62 - tmp99 = einsum(t1, (0, 1), tmp87, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp96 = np.copy(tmp93) - tmp96 += einsum(t1, (0, 1), tmp84, (2, 3), (0, 2, 1, 3)) - del tmp84 - tmp96 += np.transpose(tmp95, (0, 1, 3, 2)) * -1 - del tmp95 - tmp104 = einsum(tmp103, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp103 - tmp92 = einsum(tmp91, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 4, 2, 5)) - del tmp91 - tmp88 = einsum(tmp14, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp14 - tmp86 = einsum(tmp4, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - tmp83 = einsum(t1, (0, 1), tmp82, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp82 - tmp50 = np.copy(tmp44) - tmp50 += np.transpose(tmp47, (1, 0, 3, 2)) * -1 - tmp50 += np.transpose(tmp49, (0, 1, 3, 2)) - del tmp49 - tmp50 += einsum(tmp24, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -1 - tmp77 = np.copy(t1) - tmp77 += tmp21 * -1 - tmp67 = einsum(tmp66, (0, 1, 2, 3), t2, (4, 0, 2, 5), (1, 4, 3, 5)) - tmp75 = np.copy(tmp44) - del tmp44 - tmp75 += np.transpose(tmp74, (0, 1, 3, 2)) - del tmp74 - tmp76 = einsum(tmp29, (0, 1, 2, 3), t1, (0, 4), (2, 1, 3, 4)) - tmp65 = np.copy(np.transpose(tmp63, (1, 0, 3, 2))) - del tmp63 - tmp65 += np.transpose(tmp64, (0, 1, 3, 2)) - del tmp64 - tmp65 += einsum(t1, (0, 1), tmp11, (2, 3), (0, 2, 1, 3)) * 2 - tmp69 = einsum(tmp68, (0, 1, 2, 3), t2, (4, 0, 2, 5), (1, 4, 3, 5)) - tmp60 = np.copy(tmp58) - del tmp58 - tmp60 += tmp59 - tmp57 = np.copy(tmp51) - del tmp51 - tmp57 += tmp53 * 2 - tmp57 += np.transpose(tmp56, (1, 0, 3, 2)) - del tmp56 - tmp72 = np.copy(np.transpose(tmp47, (1, 0, 3, 2))) * -1 - del tmp47 - tmp72 += np.transpose(tmp71, (0, 1, 3, 2)) - del tmp71 - tmp72 += einsum(tmp23, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp43 = np.copy(tmp2) - tmp43 += tmp1 - tmp37 = np.copy(tmp30) - tmp37 += tmp35 - tmp39 = np.copy(tmp12) - tmp39 += np.transpose(tmp29, (0, 2, 1, 3)) - tmp39 += einsum(tmp1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp38 = einsum(tmp2, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp38 += tmp15 - tmp38 += tmp17 * -1 - tmp42 = np.copy(t1) * -0.5 - tmp42 += tmp9 - del tmp9 - tmp42 += tmp40 * -1 - del tmp40 - tmp42 += tmp41 - del tmp41 - tmp18 = np.copy(tmp12) - tmp18 += tmp13 - del tmp13 - tmp18 += tmp15 - del tmp15 - tmp18 += tmp17 * -1 - tmp20 = np.copy(tmp19) - del tmp19 - tmp20 += einsum(tmp1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp36 = np.copy(t1) * -1 - tmp36 += tmp30 - del tmp30 - tmp36 += tmp32 * -1 - del tmp32 - tmp36 += tmp35 - del tmp35 - tmp28 = einsum(tmp27, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 2, 4, 5)) - del tmp27 - tmp7 = np.copy(delta.oo) - tmp7 += tmp2 * -1 - rdm2.vvvv = np.copy(np.transpose(tmp114, (0, 1, 3, 2))) * -2 - rdm2.vvvv += tmp114 * 2 - del tmp114 - rdm2.vvvv += np.transpose(tmp112, (1, 0, 3, 2)) * 2 - del tmp112 - rdm2.vvvv += np.transpose(tmp113, (1, 0, 3, 2)) * 2 - del tmp113 - rdm2.vvvo = np.copy(np.transpose(tmp111, (1, 2, 3, 0))) * -2 - rdm2.vvvo += np.transpose(tmp111, (2, 1, 3, 0)) * 4 - rdm2.vvov = np.copy(np.transpose(tmp111, (1, 2, 0, 3))) * 4 - rdm2.vvov += np.transpose(tmp111, (2, 1, 0, 3)) * -2 - del tmp111 - rdm2.vovv = np.copy(np.transpose(tmp107, (1, 0, 2, 3))) * -2 - rdm2.vovv += np.transpose(tmp107, (1, 0, 3, 2)) * 2 - del tmp107 - rdm2.vovv += np.transpose(tmp108, (1, 0, 2, 3)) * -2 - rdm2.vovv += np.transpose(tmp108, (1, 0, 3, 2)) * 2 - del tmp108 - rdm2.vovv += np.transpose(tmp100, (1, 0, 3, 2)) * -2 - rdm2.vovv += np.transpose(tmp97, (1, 0, 2, 3)) * -2 - rdm2.vovv += np.transpose(tmp93, (1, 0, 3, 2)) * 2 - rdm2.vovv += np.transpose(tmp110, (1, 0, 3, 2)) * -2 - del tmp110 - rdm2.vovv += einsum(t1, (0, 1), tmp90, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.ovvv = np.copy(tmp96) * 2 - rdm2.ovvv += np.transpose(tmp96, (0, 1, 3, 2)) * -2 - del tmp96 - rdm2.ovvv += tmp98 * 2 - rdm2.ovvv += np.transpose(tmp98, (0, 1, 3, 2)) * -2 - del tmp98 - rdm2.ovvv += tmp99 * 2 - rdm2.ovvv += np.transpose(tmp99, (0, 1, 3, 2)) * -2 - del tmp99 - rdm2.ovvv += np.transpose(tmp97, (0, 1, 3, 2)) * -2 - del tmp97 - rdm2.ovvv += tmp100 * -2 - del tmp100 - rdm2.ovvv += tmp93 * 2 - del tmp93 - rdm2.ovvv += tmp104 * -2 - del tmp104 - rdm2.ovvv += einsum(tmp85, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.vvoo = np.copy(np.transpose(l2, (0, 1, 3, 2))) * -2 - rdm2.vvoo += l2 * 4 - rdm2.vovo = einsum(l1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.vovo += np.transpose(tmp52, (2, 1, 3, 0)) * -2 - rdm2.vovo += np.transpose(tmp92, (2, 1, 3, 0)) * -2 - del tmp92 - rdm2.vovo += np.transpose(tmp88, (2, 1, 3, 0)) * -2 - rdm2.vovo += einsum(tmp90, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 4 - rdm2.vovo += np.transpose(tmp68, (2, 1, 3, 0)) * -2 - rdm2.vovo += np.transpose(tmp86, (2, 1, 3, 0)) * -2 - rdm2.voov = einsum(l1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 4 - rdm2.voov += np.transpose(tmp81, (3, 0, 1, 2)) * 2 - rdm2.voov += np.transpose(tmp79, (3, 0, 1, 2)) * -2 - rdm2.voov += np.transpose(tmp88, (2, 1, 0, 3)) * 2 - del tmp88 - rdm2.voov += einsum(tmp90, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -2 - del tmp90 - rdm2.voov += np.transpose(tmp66, (2, 1, 0, 3)) * -2 - rdm2.voov += np.transpose(tmp87, (2, 1, 0, 3)) * -2 - rdm2.voov += np.transpose(tmp52, (2, 1, 0, 3)) * 2 - rdm2.ovvo = einsum(l1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.ovvo += np.transpose(tmp52, (1, 2, 3, 0)) * 4 - del tmp52 - rdm2.ovvo += np.transpose(tmp55, (1, 2, 3, 0)) * -2 - del tmp55 - rdm2.ovvo += np.transpose(tmp83, (1, 2, 3, 0)) * -2 - rdm2.ovvo += einsum(delta.oo, (0, 1), tmp85, (2, 3), (0, 2, 3, 1)) * -4 - rdm2.ovvo += np.transpose(tmp66, (1, 2, 3, 0)) * -2 - del tmp66 - rdm2.ovvo += np.transpose(tmp87, (1, 2, 3, 0)) * -2 - del tmp87 - rdm2.ovov = einsum(l1, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.ovov += np.transpose(tmp79, (0, 3, 1, 2)) * 2 - del tmp79 - rdm2.ovov += np.transpose(tmp81, (0, 3, 1, 2)) * -2 - del tmp81 - rdm2.ovov += np.transpose(tmp83, (1, 2, 0, 3)) * 2 - del tmp83 - rdm2.ovov += einsum(delta.oo, (0, 1), tmp85, (2, 3), (0, 2, 1, 3)) * 8 - del tmp85 - rdm2.ovov += np.transpose(tmp68, (1, 2, 0, 3)) * -2 - del tmp68 - rdm2.ovov += np.transpose(tmp86, (1, 2, 0, 3)) * -2 - del tmp86 - rdm2.oovv = np.copy(tmp50) * 2 - rdm2.oovv += np.transpose(tmp50, (0, 1, 3, 2)) * -2 - rdm2.oovv += np.transpose(tmp50, (1, 0, 2, 3)) * -2 - rdm2.oovv += np.transpose(tmp50, (1, 0, 3, 2)) * 2 - del tmp50 - rdm2.oovv += np.transpose(t2, (0, 1, 3, 2)) * -2 - rdm2.oovv += t2 * 4 - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.oovv += tmp57 * 2 - rdm2.oovv += np.transpose(tmp57, (0, 1, 3, 2)) * -2 - del tmp57 - rdm2.oovv += tmp60 * 2 - rdm2.oovv += np.transpose(tmp60, (0, 1, 3, 2)) * -2 - del tmp60 - rdm2.oovv += tmp65 * -4 - rdm2.oovv += np.transpose(tmp65, (0, 1, 3, 2)) * 2 - rdm2.oovv += np.transpose(tmp65, (1, 0, 2, 3)) * 2 - rdm2.oovv += np.transpose(tmp65, (1, 0, 3, 2)) * -4 - del tmp65 - rdm2.oovv += einsum(tmp21, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -2 - del tmp21 - rdm2.oovv += tmp67 * 2 - del tmp67 - rdm2.oovv += np.transpose(tmp69, (0, 1, 3, 2)) * 2 - del tmp69 - rdm2.oovv += tmp72 * 2 - rdm2.oovv += np.transpose(tmp72, (1, 0, 3, 2)) * 2 - del tmp72 - rdm2.oovv += np.transpose(tmp75, (0, 1, 3, 2)) * -2 - rdm2.oovv += np.transpose(tmp75, (1, 0, 2, 3)) * -2 - del tmp75 - rdm2.oovv += tmp53 * 4 - del tmp53 - rdm2.oovv += tmp59 * 2 - del tmp59 - rdm2.oovv += np.transpose(tmp76, (0, 1, 3, 2)) * 2 - del tmp76 - rdm2.oovv += einsum(t1, (0, 1), tmp77, (2, 3), (2, 0, 3, 1)) * 2 - del tmp77 - rdm2.vooo = np.copy(np.transpose(tmp4, (3, 2, 0, 1))) * -4 - rdm2.vooo += np.transpose(tmp4, (3, 2, 1, 0)) * 2 - rdm2.vooo += einsum(l1, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 4 - rdm2.vooo += einsum(l1, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.ovoo = np.copy(np.transpose(tmp4, (2, 3, 0, 1))) * 2 - rdm2.ovoo += np.transpose(tmp4, (2, 3, 1, 0)) * -4 - del tmp4 - rdm2.ovoo += einsum(l1, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.ovoo += einsum(l1, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.oovo = einsum(tmp37, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * -2 - rdm2.oovo += einsum(delta.oo, (0, 1), tmp37, (2, 3), (0, 2, 3, 1)) * 2 - del tmp37 - rdm2.oovo += np.transpose(tmp38, (1, 2, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp38, (2, 1, 3, 0)) * 2 - del tmp38 - rdm2.oovo += np.transpose(tmp39, (1, 2, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp39, (2, 1, 3, 0)) * 2 - del tmp39 - rdm2.oovo += einsum(tmp23, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.oovo += einsum(delta.oo, (0, 1), tmp23, (2, 3), (0, 2, 3, 1)) * -2 - del tmp23 - rdm2.oovo += einsum(t1, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.oovo += einsum(delta.oo, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.oovo += np.transpose(tmp26, (1, 2, 3, 0)) * 2 - rdm2.oovo += np.transpose(tmp25, (2, 1, 3, 0)) * 2 - rdm2.oovo += np.transpose(tmp12, (1, 2, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp17, (2, 1, 3, 0)) * -2 - del tmp17 - rdm2.oovo += np.transpose(tmp29, (1, 2, 3, 0)) * 2 - rdm2.oovo += einsum(delta.oo, (0, 1), tmp42, (2, 3), (2, 0, 3, 1)) * -4 - del tmp42 - rdm2.oovo += einsum(tmp43, (0, 1), t1, (2, 3), (2, 1, 3, 0)) * -2 - del tmp43 - rdm2.ooov = einsum(tmp11, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * 4 - rdm2.ooov += einsum(delta.oo, (0, 1), tmp11, (2, 3), (0, 2, 1, 3)) * -4 - del tmp11 - rdm2.ooov += np.transpose(tmp18, (1, 2, 0, 3)) * 2 - rdm2.ooov += np.transpose(tmp18, (2, 1, 0, 3)) * -2 - del tmp18 - rdm2.ooov += np.transpose(tmp20, (1, 2, 0, 3)) * 2 - rdm2.ooov += np.transpose(tmp20, (2, 1, 0, 3)) * -2 - del tmp20 - rdm2.ooov += einsum(tmp24, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * 2 - rdm2.ooov += einsum(tmp24, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * -2 - del tmp24 - rdm2.ooov += einsum(t1, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.ooov += einsum(delta.oo, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.ooov += einsum(t1, (0, 1), tmp2, (2, 3), (0, 3, 2, 1)) * 2 - rdm2.ooov += einsum(tmp2, (0, 1), t1, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.ooov += np.transpose(tmp25, (1, 2, 0, 3)) * 2 - del tmp25 - rdm2.ooov += np.transpose(tmp26, (2, 1, 0, 3)) * 2 - del tmp26 - rdm2.ooov += np.transpose(tmp12, (2, 1, 0, 3)) * -2 - del tmp12 - rdm2.ooov += np.transpose(tmp28, (1, 2, 0, 3)) * -2 - del tmp28 - rdm2.ooov += np.transpose(tmp29, (2, 1, 0, 3)) * 2 - del tmp29 - rdm2.ooov += einsum(tmp36, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * -2 - del tmp36 - rdm2.ooov += einsum(tmp34, (0, 1), t1, (2, 3), (1, 2, 0, 3)) * -4 - del tmp34 - rdm2.oooo = einsum(tmp1, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * -4 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp1, (2, 3), (0, 3, 2, 1)) * 2 - rdm2.oooo += einsum(tmp1, (0, 1), delta.oo, (2, 3), (1, 2, 3, 0)) * 2 - rdm2.oooo += einsum(tmp1, (0, 1), delta.oo, (2, 3), (2, 1, 3, 0)) * -4 - del tmp1 - rdm2.oooo += einsum(tmp2, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp2, (2, 3), (0, 3, 2, 1)) * 2 - rdm2.oooo += einsum(tmp2, (0, 1), delta.oo, (2, 3), (1, 2, 3, 0)) * 2 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp2, (2, 3), (0, 3, 1, 2)) * -4 - del tmp2 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.oooo += np.transpose(tmp6, (3, 2, 0, 1)) * -2 - rdm2.oooo += np.transpose(tmp6, (2, 3, 0, 1)) * 2 - del tmp6 - rdm2.oooo += np.transpose(tmp3, (3, 2, 1, 0)) * 2 - del tmp3 - rdm2.oooo += np.transpose(tmp5, (3, 2, 1, 0)) * 2 - del tmp5 - rdm2.oooo += einsum(tmp7, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * 2 - del delta, tmp7 - rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv) - rdm2 = np.transpose(rdm2, (0, 2, 1, 3)) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:50:33.631023. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp11 : array - tmp14 : array - tmp17 : array - tmp18 : array - tmp20 : array - tmp21 : array - tmp23 : array - tmp24 : array - tmp30 : array - tmp32 : array - tmp33 : array - tmp35 : array - tmp38 : array - tmp39 : array - tmp40 : array - tmp42 : array - tmp43 : array - tmp45 : array - tmp46 : array - tmp47 : array - tmp5 : array - tmp52 : array - tmp54 : array - tmp55 : array - tmp56 : array - tmp57 : array - tmp58 : array - tmp60 : array - tmp66 : array - tmp67 : array - tmp68 : array - tmp69 : array - tmp7 : array - tmp9 : array - """ - - tmp6 = einsum(v.xov, (0, 1, 2), t1, (1, 2), (0,)) - tmp4 = einsum(t1, (0, 1), v.xov, (2, 3, 1), (0, 3, 2)) - tmp0 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp17 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 2, 4), (3, 4, 0)) - tmp20 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 4, 2), (3, 4, 0)) - tmp1 = einsum(v.xov, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp32 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp29 = einsum(v.xvv, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp11 = einsum(tmp6, (0,), v.xov, (0, 1, 2), (1, 2)) - tmp9 = einsum(tmp4, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp69 = einsum(tmp0, (0, 1), t1, (0, 2), (1, 2)) - tmp68 = einsum(v.xvv, (0, 1, 2), tmp17, (3, 2, 0), (3, 1)) - tmp67 = einsum(tmp20, (0, 1, 2), v.xvv, (2, 3, 1), (0, 3)) - tmp66 = einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - tmp60 = einsum(v.xov, (0, 1, 2), tmp20, (1, 3, 0), (3, 2)) - tmp58 = einsum(v.xov, (0, 1, 2), tmp17, (1, 3, 0), (3, 2)) - tmp57 = einsum(tmp1, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) - tmp56 = einsum(tmp1, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) - tmp55 = einsum(t2, (0, 1, 2, 3), tmp1, (4, 0, 1, 2), (4, 3)) - tmp54 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp52 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - tmp47 = einsum(tmp32, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp46 = einsum(t2, (0, 1, 2, 3), tmp32, (1, 4, 5, 2), (0, 4, 3, 5)) - tmp45 = einsum(tmp17, (0, 1, 2), v.xoo, (2, 3, 4), (0, 3, 4, 1)) - tmp43 = einsum(v.xoo, (0, 1, 2), tmp20, (3, 4, 0), (3, 1, 2, 4)) - tmp42 = einsum(tmp1, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp40 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp39 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp38 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp35 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp33 = einsum(tmp32, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp30 = einsum(tmp29, (0, 1, 2, 3), t2, (4, 5, 3, 2), (4, 5, 0, 1)) - del tmp29 - tmp24 = einsum(t1, (0, 1), tmp11, (2, 1), (0, 2)) - tmp23 = einsum(t1, (0, 1), tmp9, (2, 1), (0, 2)) - tmp21 = einsum(v.xov, (0, 1, 2), tmp20, (3, 2, 0), (3, 1)) - tmp18 = einsum(tmp17, (0, 1, 2), v.xov, (2, 3, 1), (0, 3)) - tmp14 = einsum(v.xov, (0, 1, 2), tmp4, (3, 4, 0), (3, 1, 4, 2)) - tmp7 = einsum(tmp6, (0,), v.xoo, (0, 1, 2), (1, 2)) - del tmp6 - tmp5 = einsum(tmp4, (0, 1, 2), v.xoo, (2, 3, 0), (3, 1)) - del tmp4 - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp11": tmp11, f"tmp14": tmp14, f"tmp17": tmp17, f"tmp18": tmp18, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp23": tmp23, f"tmp24": tmp24, f"tmp30": tmp30, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp35": tmp35, f"tmp38": tmp38, f"tmp39": tmp39, f"tmp40": tmp40, f"tmp42": tmp42, f"tmp43": tmp43, f"tmp45": tmp45, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp5": tmp5, f"tmp52": tmp52, f"tmp54": tmp54, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp57": tmp57, f"tmp58": tmp58, f"tmp60": tmp60, f"tmp66": tmp66, f"tmp67": tmp67, f"tmp68": tmp68, f"tmp69": tmp69, f"tmp7": tmp7, f"tmp9": tmp9} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:50:33.663660. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp3 = np.copy(r2) * 2 - tmp3 += np.transpose(r2, (1, 0, 2)) * -1 - tmp9 = np.copy(np.transpose(ints.tmp60, (1, 0))) * 2 - del ints.tmp60 - tmp9 += f.vv * -1 - tmp9 += np.transpose(ints.tmp58, (1, 0)) * -1 - del ints.tmp58 - tmp9 += einsum(f.ov, (0, 1), t1, (0, 2), (1, 2)) - tmp13 = np.copy(f.ov) - tmp13 += ints.tmp39 * 2 - del ints.tmp39 - tmp13 += ints.tmp55 - del ints.tmp55 - tmp13 += ints.tmp66 - del ints.tmp66 - tmp13 += ints.tmp67 * 2 - del ints.tmp67 - tmp13 += ints.tmp38 * -1 - del ints.tmp38 - tmp13 += ints.tmp52 * -1 - del ints.tmp52 - tmp13 += ints.tmp56 * -2 - del ints.tmp56 - tmp13 += ints.tmp68 * -1 - del ints.tmp68 - tmp13 += ints.tmp69 * -1 - del ints.tmp69 - tmp6 = np.copy(ints.tmp35) - tmp6 += ints.tmp46 * -1 - tmp8 = np.copy(ints.tmp20) * 2 - del ints.tmp20 - tmp8 += np.transpose(v.xov, (1, 2, 0)) - tmp8 += ints.tmp17 * -1 - del ints.tmp17 - tmp11 = np.copy(ints.tmp1) - tmp11 += np.transpose(ints.tmp30, (0, 2, 1, 3)) - del ints.tmp30 - tmp11 += np.transpose(ints.tmp43, (2, 1, 0, 3)) * 2 - del ints.tmp43 - tmp11 += np.transpose(ints.tmp54, (2, 0, 1, 3)) - del ints.tmp54 - tmp11 += np.transpose(ints.tmp42, (1, 2, 0, 3)) * -1 - del ints.tmp42 - tmp11 += np.transpose(ints.tmp45, (2, 1, 0, 3)) * -1 - del ints.tmp45 - tmp11 += np.transpose(ints.tmp57, (0, 2, 1, 3)) * -1 - del ints.tmp57 - tmp7 = einsum(tmp3, (0, 1, 2), v.xov, (3, 0, 2), (1, 3)) * 0.5 - tmp5 = np.copy(ints.tmp35) * 0.5 - del ints.tmp35 - tmp5 += ints.tmp47 - tmp5 += ints.tmp46 * -0.5 - del ints.tmp46 - tmp12 = np.copy(f.oo) - tmp12 += ints.tmp0 - tmp12 += np.transpose(ints.tmp21, (1, 0)) * 2 - tmp12 += np.transpose(ints.tmp18, (1, 0)) * -1 - tmp10 = einsum(ints.tmp32, (0, 1, 2, 3), tmp3, (0, 1, 2), (3,)) * 0.5 - del ints.tmp32 - tmp4 = np.copy(f.oo) - tmp4 += ints.tmp0 - del ints.tmp0 - tmp4 += np.transpose(ints.tmp21, (1, 0)) * 2 - del ints.tmp21 - tmp4 += np.transpose(ints.tmp24, (1, 0)) * 2 - del ints.tmp24 - tmp4 += np.transpose(ints.tmp7, (1, 0)) * 2 - del ints.tmp7 - tmp4 += np.transpose(ints.tmp18, (1, 0)) * -1 - del ints.tmp18 - tmp4 += np.transpose(ints.tmp23, (1, 0)) * -1 - del ints.tmp23 - tmp4 += np.transpose(ints.tmp5, (1, 0)) * -1 - del ints.tmp5 - tmp2 = np.copy(f.ov) * 0.5 - tmp2 += ints.tmp11 - del ints.tmp11 - tmp2 += ints.tmp9 * -0.5 - del ints.tmp9 - tmp0 = np.copy(r2) * -1 - tmp0 += np.transpose(r2, (1, 0, 2)) * 2 - tmp1 = np.copy(r2) - tmp1 += np.transpose(r2, (1, 0, 2)) * -0.5 - r2new = einsum(ints.tmp40, (0, 1, 2, 3), r2, (1, 3, 4), (2, 0, 4)) - del ints.tmp40 - r2new += einsum(ints.tmp33, (0, 1, 2, 3), r2, (3, 2, 4), (1, 0, 4)) - del ints.tmp33 - r2new += einsum(r2, (0, 1, 2), ints.tmp47, (3, 1, 4, 2), (3, 0, 4)) - del ints.tmp47 - r2new += einsum(r2, (0, 1, 2), tmp5, (3, 0, 4, 2), (3, 1, 4)) * -2 - del tmp5 - r2new += einsum(r2, (0, 1, 2), tmp6, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp6 - r2new += einsum(tmp8, (0, 1, 2), tmp7, (3, 2), (0, 3, 1)) * 2 - del tmp8, tmp7 - r2new += einsum(tmp9, (0, 1), r2, (2, 3, 0), (2, 3, 1)) * -1 - del tmp9 - r2new += einsum(tmp10, (0,), t2, (1, 2, 3, 0), (1, 2, 3)) * -2 - del tmp10 - r2new += einsum(r1, (0,), tmp11, (1, 0, 2, 3), (2, 1, 3)) - del tmp11 - r2new += einsum(r2, (0, 1, 2), tmp12, (0, 3), (3, 1, 2)) * -1 - r2new += einsum(tmp12, (0, 1), r2, (2, 0, 3), (2, 1, 3)) * -1 - del tmp12 - r2new += einsum(r1, (0,), tmp13, (1, 2), (1, 0, 2)) * -1 - del tmp13 - r1new = einsum(ints.tmp14, (0, 1, 2, 3), tmp0, (2, 1, 3), (0,)) - del ints.tmp14, tmp0 - r1new += einsum(tmp1, (0, 1, 2), ints.tmp1, (3, 1, 0, 2), (3,)) * 2 - del ints.tmp1, tmp1 - r1new += einsum(tmp3, (0, 1, 2), tmp2, (0, 2), (1,)) * -2 - del tmp3, tmp2 - r1new += einsum(r1, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:50:51.681681. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp12 : array - tmp15 : array - tmp20 : array - tmp21 : array - tmp23 : array - tmp24 : array - tmp33 : array - tmp36 : array - tmp37 : array - tmp39 : array - tmp45 : array - tmp46 : array - tmp47 : array - tmp49 : array - tmp5 : array - tmp50 : array - tmp51 : array - tmp53 : array - tmp55 : array - tmp56 : array - tmp57 : array - tmp58 : array - tmp60 : array - tmp61 : array - tmp62 : array - tmp64 : array - tmp65 : array - tmp68 : array - tmp8 : array - """ - - tmp15 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp20 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 2, 4), (3, 4, 0)) - tmp1 = einsum(v.xvv, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp23 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 4, 2), (3, 4, 0)) - tmp38 = einsum(v.xov, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp46 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp4 = einsum(v.xov, (0, 1, 2), t1, (1, 2), (0,)) - tmp9 = einsum(t1, (0, 1), v.xov, (2, 3, 1), (0, 3, 2)) - tmp7 = einsum(v.xvv, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp68 = einsum(tmp15, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp65 = einsum(v.xvv, (0, 1, 2), tmp20, (3, 4, 0), (3, 4, 1, 2)) - tmp64 = einsum(t2, (0, 1, 2, 3), tmp1, (1, 4, 3, 5), (0, 2, 5, 4)) - tmp62 = einsum(tmp23, (0, 1, 2), v.xvv, (2, 3, 4), (0, 1, 3, 4)) - tmp61 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp60 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp58 = einsum(tmp38, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) - tmp57 = einsum(t2, (0, 1, 2, 3), tmp38, (4, 0, 1, 2), (4, 3)) - tmp56 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - tmp55 = einsum(tmp46, (0, 1), t1, (0, 2), (1, 2)) - tmp53 = einsum(tmp23, (0, 1, 2), v.xov, (2, 3, 1), (0, 3)) - tmp51 = einsum(v.xov, (0, 1, 2), tmp20, (3, 2, 0), (3, 1)) - tmp50 = einsum(tmp20, (0, 1, 2), v.xvv, (2, 3, 1), (0, 3)) - tmp49 = einsum(v.xvv, (0, 1, 2), tmp23, (3, 2, 0), (3, 1)) - tmp47 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp45 = einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - tmp39 = einsum(t2, (0, 1, 2, 3), tmp38, (4, 0, 1, 5), (4, 2, 3, 5)) - del tmp38 - tmp37 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp36 = einsum(tmp15, (0, 1, 2, 3), t2, (4, 0, 3, 5), (4, 1, 5, 2)) - tmp33 = einsum(t2, (0, 1, 2, 3), tmp1, (1, 4, 2, 5), (0, 3, 5, 4)) - tmp24 = einsum(v.xov, (0, 1, 2), tmp23, (1, 3, 0), (3, 2)) - tmp21 = einsum(v.xov, (0, 1, 2), tmp20, (1, 3, 0), (3, 2)) - tmp12 = einsum(v.xov, (0, 1, 2), tmp4, (0,), (1, 2)) - tmp10 = einsum(tmp9, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - del tmp9 - tmp8 = einsum(v.xov, (0, 1, 2), tmp7, (1, 3, 0), (2, 3)) - del tmp7 - tmp5 = einsum(v.xvv, (0, 1, 2), tmp4, (0,), (1, 2)) - del tmp4 - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp12": tmp12, f"tmp15": tmp15, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp23": tmp23, f"tmp24": tmp24, f"tmp33": tmp33, f"tmp36": tmp36, f"tmp37": tmp37, f"tmp39": tmp39, f"tmp45": tmp45, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp50": tmp50, f"tmp51": tmp51, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp57": tmp57, f"tmp58": tmp58, f"tmp60": tmp60, f"tmp61": tmp61, f"tmp62": tmp62, f"tmp64": tmp64, f"tmp65": tmp65, f"tmp68": tmp68, f"tmp8": tmp8} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:50:51.711912. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp0 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp0 += np.transpose(r2, (2, 1, 0)) * -0.5 - tmp2 = np.copy(np.transpose(r2, (2, 0, 1))) * -1 - tmp2 += np.transpose(r2, (2, 1, 0)) * 2 - tmp12 = einsum(f.ov, (0, 1), t1, (0, 2), (1, 2)) - tmp4 = einsum(tmp0, (0, 1, 2), ints.tmp15, (0, 3, 1, 2), (3,)) * 2 - tmp1 = np.copy(f.ov) - tmp1 += ints.tmp12 * 2 - del ints.tmp12 - tmp1 += ints.tmp10 * -1 - del ints.tmp10 - tmp9 = einsum(v.xov, (0, 1, 2), tmp2, (1, 3, 2), (3, 0)) * 0.5 - tmp13 = np.copy(np.transpose(ints.tmp24, (1, 0))) * 2 - tmp13 += f.vv * -1 - tmp13 += np.transpose(ints.tmp21, (1, 0)) * -1 - tmp13 += tmp12 - del tmp12 - tmp15 = einsum(f.ov, (0, 1), r1, (1,), (0,)) - tmp15 += tmp4 * -1 - tmp6 = einsum(r2, (0, 1, 2), ints.tmp15, (3, 4, 1, 0), (3, 4, 2)) - del ints.tmp15 - tmp8 = np.copy(ints.tmp36) - tmp8 += ints.tmp37 * -1 - tmp16 = np.copy(f.ov) - tmp16 += ints.tmp45 - del ints.tmp45 - tmp16 += ints.tmp49 * 2 - del ints.tmp49 - tmp16 += ints.tmp57 - del ints.tmp57 - tmp16 += ints.tmp61 * 2 - del ints.tmp61 - tmp16 += ints.tmp50 * -1 - del ints.tmp50 - tmp16 += ints.tmp55 * -1 - del ints.tmp55 - tmp16 += ints.tmp56 * -1 - del ints.tmp56 - tmp16 += ints.tmp58 * -2 - del ints.tmp58 - tmp16 += ints.tmp60 * -1 - del ints.tmp60 - tmp11 = np.copy(ints.tmp1) - tmp11 += np.transpose(ints.tmp39, (0, 2, 3, 1)) - del ints.tmp39 - tmp11 += np.transpose(ints.tmp62, (0, 3, 2, 1)) * 2 - del ints.tmp62 - tmp11 += ints.tmp33 * -1 - del ints.tmp33 - tmp11 += np.transpose(ints.tmp64, (0, 3, 2, 1)) * -1 - del ints.tmp64 - tmp11 += np.transpose(ints.tmp65, (0, 3, 2, 1)) * -1 - del ints.tmp65 - tmp7 = np.copy(ints.tmp37) * 0.5 - del ints.tmp37 - tmp7 += ints.tmp68 - tmp7 += ints.tmp36 * -0.5 - del ints.tmp36 - tmp14 = np.copy(f.oo) - tmp14 += ints.tmp46 - del ints.tmp46 - tmp14 += np.transpose(ints.tmp53, (1, 0)) * 2 - del ints.tmp53 - tmp14 += np.transpose(ints.tmp51, (1, 0)) * -1 - del ints.tmp51 - tmp10 = np.copy(ints.tmp23) * 2 - del ints.tmp23 - tmp10 += np.transpose(v.xov, (1, 2, 0)) - tmp10 += ints.tmp20 * -1 - del ints.tmp20 - tmp3 = np.copy(f.vv) - tmp3 += np.transpose(ints.tmp21, (1, 0)) - del ints.tmp21 - tmp3 += np.transpose(ints.tmp5, (1, 0)) * 2 - del ints.tmp5 - tmp3 += np.transpose(ints.tmp24, (1, 0)) * -2 - del ints.tmp24 - tmp3 += ints.tmp8 * -1 - del ints.tmp8 - tmp5 = np.copy(tmp4) * -1 - del tmp4 - tmp5 += einsum(tmp1, (0, 1), r1, (1,), (0,)) - r2new = einsum(ints.tmp68, (0, 1, 2, 3), r2, (4, 3, 1), (2, 4, 0)) - del ints.tmp68 - r2new += einsum(r2, (0, 1, 2), ints.tmp47, (3, 0, 4, 1), (4, 3, 2)) - del ints.tmp47 - r2new += einsum(t2, (0, 1, 2, 3), tmp6, (0, 1, 4), (3, 2, 4)) - del tmp6 - r2new += einsum(tmp7, (0, 1, 2, 3), r2, (3, 4, 1), (2, 4, 0)) * -2 - del tmp7 - r2new += einsum(r2, (0, 1, 2), tmp8, (3, 2, 4, 1), (0, 4, 3)) - del tmp8 - r2new += einsum(tmp10, (0, 1, 2), tmp9, (3, 2), (1, 3, 0)) * 2 - del tmp10, tmp9 - r2new += einsum(r1, (0,), tmp11, (1, 2, 0, 3), (3, 2, 1)) * -1 - del tmp11 - r2new += einsum(r2, (0, 1, 2), tmp13, (0, 3), (3, 1, 2)) * -1 - r2new += einsum(r2, (0, 1, 2), tmp13, (1, 3), (0, 3, 2)) * -1 - del tmp13 - r2new += einsum(r2, (0, 1, 2), tmp14, (2, 3), (0, 1, 3)) * -1 - del tmp14 - r2new += einsum(t2, (0, 1, 2, 3), tmp15, (1,), (2, 3, 0)) - del tmp15 - r2new += einsum(r1, (0,), tmp16, (1, 2), (2, 0, 1)) * -1 - del tmp16 - r1new = einsum(ints.tmp1, (0, 1, 2, 3), tmp0, (0, 3, 2), (1,)) * -2 - del tmp0, ints.tmp1 - r1new += einsum(tmp2, (0, 1, 2), tmp1, (0, 2), (1,)) * -1 - del tmp2, tmp1 - r1new += einsum(r1, (0,), tmp3, (0, 1), (1,)) - del tmp3 - r1new += einsum(tmp5, (0,), t1, (0, 1), (1,)) * -1 - del tmp5 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:52:04.166676. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp10 : array - tmp101 : array - tmp102 : array - tmp103 : array - tmp106 : array - tmp107 : array - tmp109 : array - tmp111 : array - tmp115 : array - tmp117 : array - tmp120 : array - tmp123 : array - tmp125 : array - tmp128 : array - tmp130 : array - tmp134 : array - tmp139 : array - tmp14 : array - tmp141 : array - tmp142 : array - tmp16 : array - tmp161 : array - tmp163 : array - tmp18 : array - tmp19 : array - tmp2 : array - tmp22 : array - tmp26 : array - tmp28 : array - tmp3 : array - tmp30 : array - tmp32 : array - tmp33 : array - tmp35 : array - tmp36 : array - tmp38 : array - tmp4 : array - tmp41 : array - tmp44 : array - tmp46 : array - tmp48 : array - tmp50 : array - tmp52 : array - tmp55 : array - tmp59 : array - tmp6 : array - tmp63 : array - tmp65 : array - tmp68 : array - tmp71 : array - tmp74 : array - tmp77 : array - tmp80 : array - tmp83 : array - tmp86 : array - tmp88 : array - tmp9 : array - tmp91 : array - tmp93 : array - tmp95 : array - tmp98 : array - """ - - tmp15 = einsum(v.xov, (0, 1, 2), t1, (1, 2), (0,)) - tmp13 = einsum(t1, (0, 1), v.xov, (2, 3, 1), (0, 3, 2)) - tmp22 = einsum(v.xov, (0, 1, 2), tmp15, (0,), (1, 2)) - tmp62 = einsum(v.xov, (0, 1, 2), tmp13, (1, 3, 0), (3, 2)) - tmp101 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp32 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 2, 4), (3, 4, 0)) - tmp35 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 4, 2), (3, 4, 0)) - tmp133 = einsum(tmp13, (0, 1, 2), tmp13, (3, 4, 2), (0, 3, 1, 4)) - tmp107 = einsum(t1, (0, 1), tmp22, (2, 1), (0, 2)) - tmp106 = einsum(tmp62, (0, 1), t1, (2, 1), (2, 0)) - tmp25 = einsum(v.xvv, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp119 = einsum(v.xvv, (0, 1, 2), tmp15, (0,), (1, 2)) - tmp114 = einsum(v.xoo, (0, 1, 2), tmp13, (3, 4, 0), (3, 1, 2, 4)) - tmp16 = einsum(v.xoo, (0, 1, 2), tmp15, (0,), (1, 2)) - del tmp15 - tmp14 = einsum(v.xoo, (0, 1, 2), tmp13, (2, 3, 0), (1, 3)) - tmp102 = einsum(t2, (0, 1, 2, 3), tmp101, (4, 5, 3, 2), (0, 1, 5, 4)) - tmp33 = einsum(tmp32, (0, 1, 2), v.xov, (2, 3, 1), (0, 3)) - tmp36 = einsum(tmp35, (0, 1, 2), v.xov, (2, 3, 1), (0, 3)) - tmp28 = einsum(tmp13, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 1, 4)) - tmp58 = einsum(v.xvv, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp10 = einsum(v.xov, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp18 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp0 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp163 = einsum(tmp35, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp161 = einsum(v.xov, (0, 1, 2), tmp32, (1, 3, 0), (3, 2)) - tmp142 = einsum(tmp101, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp141 = einsum(tmp101, (0, 1, 2, 3), t2, (4, 0, 3, 5), (4, 1, 5, 2)) - tmp139 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp134 = einsum(tmp133, (0, 1, 2, 3), t1, (3, 4), (0, 1, 2, 4)) - del tmp133 - tmp130 = einsum(tmp107, (0, 1), t1, (1, 2), (0, 2)) - tmp128 = einsum(tmp106, (0, 1), t1, (1, 2), (0, 2)) - tmp125 = einsum(tmp25, (0, 1, 2), tmp13, (3, 4, 2), (3, 0, 4, 1)) - tmp123 = einsum(tmp13, (0, 1, 2), tmp25, (1, 3, 2), (0, 3)) - tmp120 = einsum(tmp119, (0, 1), t1, (2, 1), (2, 0)) - del tmp119 - tmp117 = einsum(t1, (0, 1), tmp114, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp115 = einsum(t1, (0, 1), tmp114, (2, 3, 0, 4), (2, 3, 4, 1)) - del tmp114 - tmp111 = einsum(tmp16, (0, 1), t1, (1, 2), (0, 2)) - tmp109 = einsum(tmp14, (0, 1), t1, (1, 2), (0, 2)) - tmp103 = einsum(tmp102, (0, 1, 2, 3), t1, (2, 4), (1, 0, 3, 4)) - tmp98 = einsum(tmp33, (0, 1), t1, (1, 2), (0, 2)) - tmp95 = einsum(tmp36, (0, 1), t1, (1, 2), (0, 2)) - tmp93 = einsum(tmp28, (0, 1, 2, 3), t2, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp91 = einsum(tmp28, (0, 1, 2, 3), t2, (4, 2, 3, 5), (0, 4, 1, 5)) - tmp88 = einsum(tmp35, (0, 1, 2), tmp13, (3, 4, 2), (3, 0, 4, 1)) - tmp86 = einsum(tmp13, (0, 1, 2), tmp32, (3, 4, 2), (0, 3, 1, 4)) - del tmp13 - tmp83 = einsum(t2, (0, 1, 2, 3), tmp28, (4, 1, 0, 2), (4, 3)) - tmp80 = einsum(t2, (0, 1, 2, 3), tmp28, (4, 1, 0, 3), (4, 2)) - tmp77 = einsum(tmp22, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp74 = einsum(t2, (0, 1, 2, 3), tmp62, (4, 3), (0, 1, 4, 2)) - tmp71 = einsum(t2, (0, 1, 2, 3), tmp22, (1, 3), (0, 2)) - tmp68 = einsum(t2, (0, 1, 2, 3), tmp22, (1, 2), (0, 3)) - tmp65 = einsum(tmp62, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp63 = einsum(t2, (0, 1, 2, 3), tmp62, (1, 2), (0, 3)) - del tmp62 - tmp59 = einsum(t2, (0, 1, 2, 3), tmp58, (4, 5, 3, 2), (0, 1, 4, 5)) - del tmp58 - tmp55 = einsum(v.xvv, (0, 1, 2), tmp32, (3, 2, 0), (3, 1)) - tmp52 = einsum(tmp35, (0, 1, 2), v.xvv, (2, 3, 1), (0, 3)) - tmp50 = einsum(tmp35, (0, 1, 2), v.xoo, (2, 3, 4), (0, 3, 4, 1)) - tmp48 = einsum(tmp32, (0, 1, 2), v.xoo, (2, 3, 4), (0, 3, 4, 1)) - tmp46 = einsum(tmp10, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 1, 2, 5)) - tmp44 = einsum(tmp10, (0, 1, 2, 3), t2, (4, 0, 3, 5), (4, 1, 2, 5)) - tmp41 = einsum(t2, (0, 1, 2, 3), tmp10, (0, 4, 1, 3), (4, 2)) - tmp38 = einsum(t2, (0, 1, 2, 3), tmp10, (0, 4, 1, 2), (4, 3)) - tmp30 = einsum(tmp25, (0, 1, 2), v.xoo, (2, 3, 4), (0, 3, 4, 1)) - tmp26 = einsum(tmp25, (0, 1, 2), v.xoo, (2, 3, 0), (3, 1)) - del tmp25 - tmp19 = einsum(t1, (0, 1), tmp18, (2, 0, 3, 4), (4, 2, 3, 1)) - tmp9 = einsum(tmp0, (0, 1), t1, (0, 2), (1, 2)) - tmp6 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp4 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp3 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp2 = einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - tmp1 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp10": tmp10, f"tmp101": tmp101, f"tmp102": tmp102, f"tmp103": tmp103, f"tmp106": tmp106, f"tmp107": tmp107, f"tmp109": tmp109, f"tmp111": tmp111, f"tmp115": tmp115, f"tmp117": tmp117, f"tmp120": tmp120, f"tmp123": tmp123, f"tmp125": tmp125, f"tmp128": tmp128, f"tmp130": tmp130, f"tmp134": tmp134, f"tmp139": tmp139, f"tmp14": tmp14, f"tmp141": tmp141, f"tmp142": tmp142, f"tmp16": tmp16, f"tmp161": tmp161, f"tmp163": tmp163, f"tmp18": tmp18, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp22": tmp22, f"tmp26": tmp26, f"tmp28": tmp28, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp35": tmp35, f"tmp36": tmp36, f"tmp38": tmp38, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp44": tmp44, f"tmp46": tmp46, f"tmp48": tmp48, f"tmp50": tmp50, f"tmp52": tmp52, f"tmp55": tmp55, f"tmp59": tmp59, f"tmp6": tmp6, f"tmp63": tmp63, f"tmp65": tmp65, f"tmp68": tmp68, f"tmp71": tmp71, f"tmp74": tmp74, f"tmp77": tmp77, f"tmp80": tmp80, f"tmp83": tmp83, f"tmp86": tmp86, f"tmp88": tmp88, f"tmp9": tmp9, f"tmp91": tmp91, f"tmp93": tmp93, f"tmp95": tmp95, f"tmp98": tmp98} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:52:04.221775. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp12 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp12 += t2 * -0.5 - tmp9 = np.copy(ints.tmp35) * 2 - del ints.tmp35 - tmp9 += np.transpose(v.xov, (1, 2, 0)) - tmp9 += ints.tmp32 * -1 - del ints.tmp32 - tmp0 = np.copy(r2) - tmp0 += np.transpose(r2, (1, 0, 2)) * -0.5 - tmp13 = einsum(r2, (0, 1, 2), tmp12, (0, 1, 3, 2), (3,)) - del tmp12 - tmp8 = np.copy(ints.tmp139) - tmp8 += ints.tmp141 * -1 - tmp11 = np.copy(ints.tmp163) * 2 - del ints.tmp163 - tmp11 += f.vv * -1 - tmp11 += ints.tmp161 * -1 - del ints.tmp161 - tmp11 += einsum(t1, (0, 1), f.ov, (0, 2), (1, 2)) - tmp7 = np.copy(ints.tmp139) * 0.5 - del ints.tmp139 - tmp7 += ints.tmp142 - tmp7 += ints.tmp141 * -0.5 - del ints.tmp141 - tmp14 = np.copy(f.oo) - tmp14 += np.transpose(ints.tmp0, (1, 0)) - tmp14 += ints.tmp36 * 2 - tmp14 += ints.tmp33 * -1 - tmp10 = einsum(tmp9, (0, 1, 2), tmp0, (0, 3, 1), (3, 2)) * 2 - del tmp9 - tmp6 = np.copy(f.oo) - tmp6 += np.transpose(ints.tmp0, (1, 0)) - del ints.tmp0 - tmp6 += ints.tmp107 * 2 - del ints.tmp107 - tmp6 += np.transpose(ints.tmp16, (1, 0)) * 2 - del ints.tmp16 - tmp6 += ints.tmp36 * 2 - del ints.tmp36 - tmp6 += ints.tmp106 * -1 - del ints.tmp106 - tmp6 += ints.tmp14 * -1 - del ints.tmp14 - tmp6 += ints.tmp33 * -1 - del ints.tmp33 - tmp4 = np.copy(ints.tmp111) * 2 - del ints.tmp111 - tmp4 += ints.tmp123 - del ints.tmp123 - tmp4 += ints.tmp130 * 2 - del ints.tmp130 - tmp4 += ints.tmp1 - del ints.tmp1 - tmp4 += ints.tmp26 - del ints.tmp26 - tmp4 += ints.tmp3 - del ints.tmp3 - tmp4 += ints.tmp41 * 2 - del ints.tmp41 - tmp4 += ints.tmp55 - del ints.tmp55 - tmp4 += ints.tmp65 * 2 - del ints.tmp65 - tmp4 += ints.tmp68 * 2 - del ints.tmp68 - tmp4 += ints.tmp80 * 2 - del ints.tmp80 - tmp4 += ints.tmp95 * 2 - del ints.tmp95 - tmp4 += ints.tmp9 - del ints.tmp9 - tmp4 += f.ov * -1 - tmp4 += ints.tmp109 * -1 - del ints.tmp109 - tmp4 += ints.tmp120 * -2 - del ints.tmp120 - tmp4 += ints.tmp128 * -1 - del ints.tmp128 - tmp4 += ints.tmp22 * -2 - del ints.tmp22 - tmp4 += ints.tmp2 * -1 - del ints.tmp2 - tmp4 += ints.tmp38 * -1 - del ints.tmp38 - tmp4 += ints.tmp4 * -2 - del ints.tmp4 - tmp4 += ints.tmp52 * -2 - del ints.tmp52 - tmp4 += ints.tmp63 * -1 - del ints.tmp63 - tmp4 += ints.tmp71 * -4 - del ints.tmp71 - tmp4 += ints.tmp83 * -1 - del ints.tmp83 - tmp4 += ints.tmp98 * -1 - del ints.tmp98 - tmp2 = np.copy(r2) * -1 - tmp2 += np.transpose(r2, (1, 0, 2)) * 2 - tmp1 = np.copy(ints.tmp103) - del ints.tmp103 - tmp1 += ints.tmp115 - del ints.tmp115 - tmp1 += ints.tmp134 - del ints.tmp134 - tmp1 += np.transpose(ints.tmp19, (0, 2, 1, 3)) - del ints.tmp19 - tmp1 += ints.tmp44 - del ints.tmp44 - tmp1 += ints.tmp86 - del ints.tmp86 - tmp1 += ints.tmp93 - del ints.tmp93 - tmp1 += np.transpose(ints.tmp10, (1, 2, 0, 3)) * -1 - tmp1 += ints.tmp125 * -1 - del ints.tmp125 - tmp1 += ints.tmp28 * -1 - del ints.tmp28 - tmp1 += ints.tmp59 * -1 - del ints.tmp59 - tmp1 += ints.tmp88 * -2 - del ints.tmp88 - tmp3 = np.copy(ints.tmp117) - del ints.tmp117 - tmp3 += np.transpose(ints.tmp46, (0, 2, 1, 3)) - del ints.tmp46 - tmp3 += np.transpose(ints.tmp48, (0, 2, 1, 3)) - del ints.tmp48 - tmp3 += np.transpose(ints.tmp74, (0, 2, 1, 3)) - del ints.tmp74 - tmp3 += np.transpose(ints.tmp91, (0, 2, 1, 3)) - del ints.tmp91 - tmp3 += ints.tmp30 * -1 - del ints.tmp30 - tmp3 += np.transpose(ints.tmp50, (0, 2, 1, 3)) * -2 - del ints.tmp50 - tmp3 += np.transpose(ints.tmp6, (1, 0, 2, 3)) * -1 - del ints.tmp6 - tmp3 += np.transpose(ints.tmp77, (0, 2, 1, 3)) * -2 - del ints.tmp77 - tmp5 = np.copy(r2) * 2 - tmp5 += np.transpose(r2, (1, 0, 2)) * -1 - r2new = einsum(r1, (0,), ints.tmp10, (1, 0, 2, 3), (2, 1, 3)) - del ints.tmp10 - r2new += einsum(ints.tmp18, (0, 1, 2, 3), r2, (2, 3, 4), (1, 0, 4)) - del ints.tmp18 - r2new += einsum(ints.tmp102, (0, 1, 2, 3), r2, (1, 0, 4), (3, 2, 4)) - del ints.tmp102 - r2new += einsum(f.ov, (0, 1), r1, (2,), (0, 2, 1)) * -1 - r2new += einsum(r2, (0, 1, 2), ints.tmp142, (1, 3, 2, 4), (3, 0, 4)) - del ints.tmp142 - r2new += einsum(r2, (0, 1, 2), tmp7, (0, 3, 2, 4), (3, 1, 4)) * -2 - del tmp7 - r2new += einsum(tmp8, (0, 1, 2, 3), r2, (4, 0, 2), (4, 1, 3)) * -1 - del tmp8 - r2new += einsum(v.xov, (0, 1, 2), tmp10, (3, 0), (1, 3, 2)) - del tmp10 - r2new += einsum(r2, (0, 1, 2), tmp11, (2, 3), (0, 1, 3)) * -1 - del tmp11 - r2new += einsum(ints.tmp101, (0, 1, 2, 3), tmp13, (3,), (0, 1, 2)) * -2 - del ints.tmp101, tmp13 - r2new += einsum(r2, (0, 1, 2), tmp14, (0, 3), (3, 1, 2)) * -1 - r2new += einsum(r2, (0, 1, 2), tmp14, (1, 3), (0, 3, 2)) * -1 - del tmp14 - r1new = einsum(tmp0, (0, 1, 2), tmp1, (1, 0, 3, 2), (3,)) * -2 - del tmp0, tmp1 - r1new += einsum(tmp3, (0, 1, 2, 3), tmp2, (2, 0, 3), (1,)) * -1 - del tmp3, tmp2 - r1new += einsum(tmp5, (0, 1, 2), tmp4, (0, 2), (1,)) - del tmp5, tmp4 - r1new += einsum(tmp6, (0, 1), r1, (0,), (1,)) * -1 - del tmp6 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:53:19.551877. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp100 : array - tmp102 : array - tmp105 : array - tmp107 : array - tmp11 : array - tmp111 : array - tmp114 : array - tmp12 : array - tmp120 : array - tmp123 : array - tmp125 : array - tmp127 : array - tmp130 : array - tmp133 : array - tmp152 : array - tmp16 : array - tmp19 : array - tmp2 : array - tmp20 : array - tmp23 : array - tmp25 : array - tmp29 : array - tmp3 : array - tmp31 : array - tmp34 : array - tmp35 : array - tmp37 : array - tmp38 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp44 : array - tmp47 : array - tmp50 : array - tmp53 : array - tmp56 : array - tmp58 : array - tmp61 : array - tmp63 : array - tmp66 : array - tmp67 : array - tmp69 : array - tmp72 : array - tmp75 : array - tmp82 : array - tmp83 : array - tmp86 : array - tmp89 : array - tmp92 : array - tmp93 : array - tmp96 : array - tmp97 : array - """ - - tmp15 = einsum(v.xov, (0, 1, 2), t1, (1, 2), (0,)) - tmp65 = einsum(t1, (0, 1), v.xov, (2, 3, 1), (0, 3, 2)) - tmp20 = einsum(v.xov, (0, 1, 2), tmp15, (0,), (1, 2)) - tmp66 = einsum(tmp65, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp34 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 2, 4), (3, 4, 0)) - tmp37 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 4, 2), (3, 4, 0)) - tmp132 = einsum(tmp20, (0, 1), t1, (2, 1), (2, 0)) - tmp129 = einsum(tmp66, (0, 1), t1, (2, 1), (2, 0)) - tmp18 = einsum(t1, (0, 1), v.xvv, (2, 3, 1), (0, 3, 2)) - tmp16 = einsum(v.xvv, (0, 1, 2), tmp15, (0,), (1, 2)) - tmp113 = einsum(v.xoo, (0, 1, 2), tmp15, (0,), (1, 2)) - del tmp15 - tmp110 = einsum(tmp65, (0, 1, 2), v.xoo, (2, 3, 0), (3, 1)) - tmp25 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp96 = einsum(tmp34, (0, 1, 2), v.xov, (2, 3, 1), (0, 3)) - tmp92 = einsum(tmp37, (0, 1, 2), v.xov, (2, 3, 1), (0, 3)) - tmp82 = einsum(tmp65, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 1, 4)) - tmp12 = einsum(v.xvv, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp40 = einsum(v.xov, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp10 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp152 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp133 = einsum(tmp132, (0, 1), t1, (1, 2), (0, 2)) - del tmp132 - tmp130 = einsum(tmp129, (0, 1), t1, (1, 2), (0, 2)) - del tmp129 - tmp127 = einsum(tmp18, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 4, 1)) - tmp125 = einsum(v.xvv, (0, 1, 2), tmp65, (3, 4, 0), (3, 4, 1, 2)) - tmp123 = einsum(tmp18, (0, 1, 2), tmp65, (3, 0, 2), (3, 1)) - del tmp65 - tmp120 = einsum(tmp16, (0, 1), t1, (2, 1), (2, 0)) - tmp114 = einsum(tmp113, (0, 1), t1, (1, 2), (0, 2)) - del tmp113 - tmp111 = einsum(tmp110, (0, 1), t1, (1, 2), (0, 2)) - del tmp110 - tmp107 = einsum(t2, (0, 1, 2, 3), tmp25, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp105 = einsum(t2, (0, 1, 2, 3), tmp25, (1, 4, 5, 2), (0, 4, 3, 5)) - tmp102 = einsum(v.xov, (0, 1, 2), tmp37, (3, 4, 0), (3, 1, 4, 2)) - tmp100 = einsum(v.xov, (0, 1, 2), tmp34, (3, 4, 0), (3, 1, 4, 2)) - tmp97 = einsum(tmp96, (0, 1), t1, (1, 2), (0, 2)) - tmp93 = einsum(tmp92, (0, 1), t1, (1, 2), (0, 2)) - tmp89 = einsum(tmp82, (0, 1, 2, 3), t2, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp86 = einsum(t2, (0, 1, 2, 3), tmp82, (4, 1, 0, 2), (4, 3)) - tmp83 = einsum(tmp82, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp75 = einsum(tmp20, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp72 = einsum(t2, (0, 1, 2, 3), tmp20, (1, 2), (0, 3)) - tmp69 = einsum(tmp66, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp67 = einsum(tmp66, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp63 = einsum(t2, (0, 1, 2, 3), tmp12, (1, 3, 4, 5), (0, 2, 5, 4)) - tmp61 = einsum(t2, (0, 1, 2, 3), tmp12, (1, 2, 4, 5), (0, 3, 5, 4)) - tmp58 = einsum(tmp37, (0, 1, 2), v.xvv, (2, 3, 4), (0, 1, 3, 4)) - tmp56 = einsum(tmp34, (0, 1, 2), v.xvv, (2, 3, 4), (0, 1, 3, 4)) - tmp53 = einsum(tmp34, (0, 1, 2), v.xvv, (2, 3, 1), (0, 3)) - tmp50 = einsum(tmp37, (0, 1, 2), v.xvv, (2, 3, 1), (0, 3)) - tmp47 = einsum(tmp40, (0, 1, 2, 3), t2, (0, 2, 4, 5), (1, 4, 5, 3)) - tmp44 = einsum(tmp40, (0, 1, 2, 3), t2, (0, 2, 4, 3), (1, 4)) - tmp41 = einsum(t2, (0, 1, 2, 3), tmp40, (0, 4, 1, 2), (4, 3)) - tmp38 = einsum(v.xov, (0, 1, 2), tmp37, (1, 3, 0), (3, 2)) - tmp35 = einsum(v.xov, (0, 1, 2), tmp34, (1, 3, 0), (3, 2)) - tmp31 = einsum(tmp18, (0, 1, 2), v.xvv, (2, 3, 4), (0, 3, 4, 1)) - tmp29 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp23 = einsum(tmp18, (0, 1, 2), v.xoo, (2, 3, 0), (3, 1)) - tmp19 = einsum(v.xov, (0, 1, 2), tmp18, (1, 3, 0), (2, 3)) - del tmp18 - tmp11 = einsum(tmp10, (0, 1), t1, (0, 2), (1, 2)) - tmp4 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp3 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp2 = einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - tmp1 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp100": tmp100, f"tmp102": tmp102, f"tmp105": tmp105, f"tmp107": tmp107, f"tmp11": tmp11, f"tmp111": tmp111, f"tmp114": tmp114, f"tmp12": tmp12, f"tmp120": tmp120, f"tmp123": tmp123, f"tmp125": tmp125, f"tmp127": tmp127, f"tmp130": tmp130, f"tmp133": tmp133, f"tmp152": tmp152, f"tmp16": tmp16, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp23": tmp23, f"tmp25": tmp25, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp31": tmp31, f"tmp34": tmp34, f"tmp35": tmp35, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp44": tmp44, f"tmp47": tmp47, f"tmp50": tmp50, f"tmp53": tmp53, f"tmp56": tmp56, f"tmp58": tmp58, f"tmp61": tmp61, f"tmp63": tmp63, f"tmp66": tmp66, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp72": tmp72, f"tmp75": tmp75, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp86": tmp86, f"tmp89": tmp89, f"tmp92": tmp92, f"tmp93": tmp93, f"tmp96": tmp96, f"tmp97": tmp97} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:53:19.603416. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp10 = einsum(t1, (0, 1), r2, (2, 1, 3), (3, 0, 2)) - tmp4 = np.copy(np.transpose(r2, (2, 0, 1))) * -0.5 - tmp4 += np.transpose(r2, (2, 1, 0)) - tmp21 = np.copy(ints.tmp37) * 2 - del ints.tmp37 - tmp21 += np.transpose(v.xov, (1, 2, 0)) - tmp21 += ints.tmp34 * -1 - del ints.tmp34 - tmp26 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp26 += t2 - tmp23 = einsum(f.ov, (0, 1), t1, (0, 2), (1, 2)) - tmp11 = einsum(tmp10, (0, 1, 2), t1, (3, 2), (0, 3, 1)) - del tmp10 - tmp15 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp15 += t2 * 2 - tmp0 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp0 += np.transpose(r2, (2, 1, 0)) * -0.5 - tmp22 = einsum(tmp4, (0, 1, 2), tmp21, (0, 2, 3), (1, 3)) * 2 - del tmp21 - tmp19 = np.copy(ints.tmp107) - tmp19 += ints.tmp29 * 0.5 - tmp19 += ints.tmp105 * -0.5 - tmp27 = einsum(r2, (0, 1, 2), tmp26, (2, 3, 0, 1), (3,)) - del tmp26 - tmp24 = np.copy(ints.tmp38) * 2 - tmp24 += f.vv * -1 - tmp24 += ints.tmp35 * -1 - tmp24 += np.transpose(tmp23, (1, 0)) - del tmp23 - tmp18 = einsum(t2, (0, 1, 2, 3), r2, (2, 3, 4), (4, 0, 1)) - tmp20 = np.copy(ints.tmp105) - tmp20 += ints.tmp29 * -1 - tmp25 = np.copy(f.oo) - tmp25 += np.transpose(ints.tmp10, (1, 0)) - del ints.tmp10 - tmp25 += ints.tmp92 * 2 - del ints.tmp92 - tmp25 += ints.tmp96 * -1 - del ints.tmp96 - tmp9 = np.copy(ints.tmp114) * 2 - del ints.tmp114 - tmp9 += ints.tmp11 - del ints.tmp11 - tmp9 += ints.tmp123 - del ints.tmp123 - tmp9 += ints.tmp133 * 2 - del ints.tmp133 - tmp9 += ints.tmp1 - del ints.tmp1 - tmp9 += ints.tmp23 - del ints.tmp23 - tmp9 += ints.tmp3 - del ints.tmp3 - tmp9 += ints.tmp44 * 2 - del ints.tmp44 - tmp9 += ints.tmp53 - del ints.tmp53 - tmp9 += ints.tmp69 * 2 - del ints.tmp69 - tmp9 += ints.tmp72 * 2 - del ints.tmp72 - tmp9 += ints.tmp83 * 2 - del ints.tmp83 - tmp9 += ints.tmp93 * 2 - del ints.tmp93 - tmp9 += f.ov * -1 - tmp9 += ints.tmp111 * -1 - del ints.tmp111 - tmp9 += ints.tmp120 * -2 - del ints.tmp120 - tmp9 += ints.tmp130 * -1 - del ints.tmp130 - tmp9 += ints.tmp20 * -2 - tmp9 += ints.tmp2 * -1 - del ints.tmp2 - tmp9 += ints.tmp41 * -1 - del ints.tmp41 - tmp9 += ints.tmp4 * -2 - del ints.tmp4 - tmp9 += ints.tmp50 * -2 - del ints.tmp50 - tmp9 += ints.tmp67 * -1 - del ints.tmp67 - tmp9 += ints.tmp75 * -4 - del ints.tmp75 - tmp9 += ints.tmp86 * -1 - del ints.tmp86 - tmp9 += ints.tmp97 * -1 - del ints.tmp97 - tmp13 = np.copy(tmp11) * -1 - tmp13 += np.transpose(tmp11, (0, 2, 1)) * 2 - tmp17 = np.copy(f.ov) - tmp17 += ints.tmp20 * 2 - del ints.tmp20 - tmp17 += ints.tmp66 * -1 - del ints.tmp66 - tmp6 = np.copy(np.transpose(ints.tmp125, (0, 1, 3, 2))) - del ints.tmp125 - tmp6 += np.transpose(ints.tmp29, (0, 1, 3, 2)) - del ints.tmp29 - tmp6 += ints.tmp105 * -1 - del ints.tmp105 - tmp8 = np.copy(ints.tmp102) * 2 - del ints.tmp102 - tmp8 += np.transpose(ints.tmp127, (0, 1, 3, 2)) - del ints.tmp127 - tmp8 += ints.tmp25 - tmp8 += ints.tmp100 * -1 - del ints.tmp100 - tmp8 += ints.tmp107 * -1 - tmp16 = einsum(r1, (0,), t1, (1, 0), (1,)) - tmp16 += einsum(tmp15, (0, 1, 2, 3), r2, (2, 3, 0), (1,)) * -1 - del tmp15 - tmp2 = np.copy(np.transpose(r2, (2, 0, 1))) * -1 - tmp2 += np.transpose(r2, (2, 1, 0)) * 2 - tmp1 = np.copy(ints.tmp12) - tmp1 += ints.tmp31 - del ints.tmp31 - tmp1 += np.transpose(ints.tmp89, (0, 3, 1, 2)) - del ints.tmp89 - tmp1 += np.transpose(ints.tmp61, (0, 2, 1, 3)) * -1 - del ints.tmp61 - tmp7 = einsum(t1, (0, 1), tmp0, (2, 3, 1), (2, 0, 3)) * 2 - tmp3 = np.copy(ints.tmp47) - del ints.tmp47 - tmp3 += ints.tmp58 * 2 - del ints.tmp58 - tmp3 += ints.tmp56 * -1 - del ints.tmp56 - tmp3 += np.transpose(ints.tmp63, (0, 1, 3, 2)) * -1 - del ints.tmp63 - tmp5 = einsum(t1, (0, 1), tmp4, (2, 3, 1), (2, 0, 3)) - del tmp4 - tmp14 = np.copy(f.vv) - tmp14 += np.transpose(ints.tmp16, (1, 0)) * 2 - del ints.tmp16 - tmp14 += ints.tmp35 - del ints.tmp35 - tmp14 += np.transpose(ints.tmp19, (1, 0)) * -1 - del ints.tmp19 - tmp14 += ints.tmp38 * -2 - del ints.tmp38 - tmp12 = np.copy(tmp11) - tmp12 += np.transpose(tmp11, (0, 2, 1)) * -0.5 - del tmp11 - r2new = einsum(ints.tmp107, (0, 1, 2, 3), r2, (4, 2, 0), (3, 4, 1)) - del ints.tmp107 - r2new += einsum(f.ov, (0, 1), r1, (2,), (1, 2, 0)) * -1 - r2new += einsum(ints.tmp12, (0, 1, 2, 3), r1, (2,), (3, 1, 0)) * -1 - del ints.tmp12 - r2new += einsum(r2, (0, 1, 2), ints.tmp152, (3, 4, 0, 1), (4, 3, 2)) - del ints.tmp152 - r2new += einsum(ints.tmp25, (0, 1, 2, 3), tmp18, (4, 1, 0), (3, 2, 4)) - del tmp18 - r2new += einsum(tmp19, (0, 1, 2, 3), r2, (2, 4, 0), (3, 4, 1)) * -2 - del tmp19 - r2new += einsum(r2, (0, 1, 2), tmp20, (2, 3, 1, 4), (0, 4, 3)) - del tmp20 - r2new += einsum(v.xov, (0, 1, 2), tmp22, (3, 0), (2, 3, 1)) - del tmp22 - r2new += einsum(r2, (0, 1, 2), tmp24, (0, 3), (3, 1, 2)) * -1 - r2new += einsum(tmp24, (0, 1), r2, (2, 0, 3), (2, 1, 3)) * -1 - del tmp24 - r2new += einsum(r2, (0, 1, 2), tmp25, (2, 3), (0, 1, 3)) * -1 - del tmp25 - r2new += einsum(tmp27, (0,), ints.tmp25, (0, 1, 2, 3), (3, 2, 1)) * -2 - del ints.tmp25, tmp27 - r1new = einsum(tmp0, (0, 1, 2), tmp1, (0, 3, 2, 1), (3,)) * -2 - del tmp0, tmp1 - r1new += einsum(tmp2, (0, 1, 2), tmp3, (0, 2, 1, 3), (3,)) * -1 - del tmp3 - r1new += einsum(tmp6, (0, 1, 2, 3), tmp5, (0, 1, 2), (3,)) * 2 - del tmp6, tmp5 - r1new += einsum(tmp7, (0, 1, 2), tmp8, (0, 1, 2, 3), (3,)) - del tmp7, tmp8 - r1new += einsum(tmp2, (0, 1, 2), tmp9, (0, 2), (1,)) - del tmp2, tmp9 - r1new += einsum(ints.tmp82, (0, 1, 2, 3), tmp12, (0, 2, 1), (3,)) * -2 - del ints.tmp82, tmp12 - r1new += einsum(ints.tmp40, (0, 1, 2, 3), tmp13, (0, 2, 1), (3,)) * -1 - del ints.tmp40, tmp13 - r1new += einsum(tmp14, (0, 1), r1, (0,), (1,)) - del tmp14 - r1new += einsum(tmp16, (0,), tmp17, (0, 1), (1,)) * -1 - del tmp16, tmp17 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/RDFCCD.py b/ebcc/codegen/RDFCCD.py deleted file mode 100644 index d3cab54c..00000000 --- a/ebcc/codegen/RDFCCD.py +++ /dev/null @@ -1,1208 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:23:45.319274 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:45.871482. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp0 += t2 * -1 - tmp1 = einsum(v.xov, (0, 1, 2), tmp0, (1, 3, 4, 2), (3, 4, 0)) * 0.5 - del tmp0 - e_cc = einsum(v.xov, (0, 1, 2), tmp1, (1, 2, 0), ()) * 2 - del tmp1 - - return e_cc - -def update_amps(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:51.489539. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t2new : array - Updated T2 residuals. - """ - - tmp0 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 2, 4), (3, 4, 0)) - tmp6 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp6 += tmp0 * -1 - tmp1 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp11 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp11 += t2 * -1 - tmp5 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp7 = einsum(v.xov, (0, 1, 2), tmp6, (3, 4, 0), (1, 3, 2, 4)) - del tmp6 - tmp2 = einsum(t2, (0, 1, 2, 3), tmp1, (1, 4, 5, 2), (0, 4, 3, 5)) - tmp12 = einsum(v.xov, (0, 1, 2), tmp11, (1, 3, 4, 2), (3, 4, 0)) - del tmp11 - tmp8 = np.copy(np.transpose(tmp5, (1, 0, 3, 2))) - tmp8 += tmp2 * -1 - tmp8 += np.transpose(tmp7, (1, 0, 3, 2)) * -2 - del tmp7 - tmp15 = einsum(tmp12, (0, 1, 2), v.xov, (2, 3, 1), (3, 0)) - tmp13 = einsum(v.xov, (0, 1, 2), tmp12, (1, 3, 0), (2, 3)) * 0.5 - del tmp12 - tmp23 = np.copy(np.transpose(tmp1, (1, 0, 2, 3))) * 2 - tmp23 += np.transpose(tmp1, (1, 0, 3, 2)) * -1 - tmp9 = einsum(tmp8, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp8 - tmp4 = einsum(v.xov, (0, 1, 2), tmp0, (3, 4, 0), (3, 1, 4, 2)) - tmp19 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp20 = einsum(t2, (0, 1, 2, 3), tmp5, (4, 1, 5, 2), (0, 4, 3, 5)) - del tmp5 - tmp16 = einsum(t2, (0, 1, 2, 3), tmp15, (1, 4), (0, 4, 3, 2)) - del tmp15 - tmp14 = einsum(t2, (0, 1, 2, 3), tmp13, (2, 4), (0, 1, 3, 4)) * 2 - del tmp13 - tmp3 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp24 = einsum(t2, (0, 1, 2, 3), tmp23, (1, 4, 5, 3), (0, 4, 2, 5)) - del tmp23 - tmp10 = np.copy(tmp4) - del tmp4 - tmp10 += tmp9 - del tmp9 - tmp22 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp22 += einsum(tmp1, (0, 1, 2, 3), t2, (4, 5, 3, 2), (0, 4, 1, 5)) - tmp21 = np.copy(tmp19) - del tmp19 - tmp21 += tmp20 * -1 - del tmp20 - tmp17 = np.copy(np.transpose(tmp14, (1, 0, 2, 3))) - del tmp14 - tmp17 += np.transpose(tmp16, (0, 1, 3, 2)) - del tmp16 - tmp18 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - t2new = einsum(tmp0, (0, 1, 2), tmp0, (3, 4, 2), (3, 0, 4, 1)) - del tmp0 - t2new += einsum(tmp2, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) - del tmp2 - t2new += np.transpose(tmp1, (1, 0, 3, 2)) - del tmp1 - t2new += einsum(t2, (0, 1, 2, 3), tmp3, (4, 3, 5, 2), (0, 1, 4, 5)) - del tmp3 - t2new += tmp10 * -1 - t2new += np.transpose(tmp10, (1, 0, 3, 2)) * -1 - del tmp10 - t2new += tmp17 * -1 - t2new += np.transpose(tmp17, (1, 0, 3, 2)) * -1 - del tmp17 - t2new += np.transpose(tmp18, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp18, (1, 0, 2, 3)) * -1 - del tmp18 - t2new += np.transpose(tmp21, (0, 1, 3, 2)) - t2new += np.transpose(tmp21, (1, 0, 2, 3)) - del tmp21 - t2new += einsum(t2, (0, 1, 2, 3), tmp22, (0, 4, 1, 5), (4, 5, 3, 2)) - del tmp22 - t2new += einsum(tmp24, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp24 - - return {f"t2new": t2new} - -def update_lams(f=None, l2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:59.270914. - - Parameters - ---------- - f : array - Fock matrix. - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - l2new : array - Updated L2 residuals. - """ - - tmp10 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp10 += t2 * -1 - tmp22 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp22 += t2 * -0.5 - tmp6 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp6 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp11 = einsum(v.xov, (0, 1, 2), tmp10, (1, 3, 4, 2), (3, 4, 0)) - del tmp10 - tmp0 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp30 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp30 += t2 * -1 - tmp26 = einsum(tmp22, (0, 1, 2, 3), l2, (4, 3, 1, 0), (4, 2)) * 2 - tmp23 = einsum(l2, (0, 1, 2, 3), tmp22, (2, 4, 1, 0), (3, 4)) * 2 - del tmp22 - tmp5 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 1, 5), (2, 4, 0, 5)) - tmp7 = einsum(tmp6, (0, 1, 2, 3), t2, (4, 0, 5, 2), (4, 1, 5, 3)) - del tmp6 - tmp12 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp12 += tmp11 - del tmp11 - tmp13 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * 2 - tmp13 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp18 = einsum(t2, (0, 1, 2, 3), tmp0, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp3 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp31 = einsum(v.xov, (0, 1, 2), tmp30, (1, 3, 4, 2), (3, 4, 0)) - del tmp30 - tmp27 = einsum(tmp26, (0, 1), v.xov, (2, 3, 1), (3, 0, 2)) - del tmp26 - tmp24 = einsum(tmp23, (0, 1), v.xov, (2, 1, 3), (0, 3, 2)) * 0.5 - del tmp23 - tmp8 = np.copy(tmp5) - del tmp5 - tmp8 += np.transpose(tmp7, (1, 0, 3, 2)) * -1 - del tmp7 - tmp14 = einsum(tmp12, (0, 1, 2), tmp13, (0, 3, 4, 1), (3, 4, 2)) - del tmp12, tmp13 - tmp19 = np.copy(np.transpose(tmp3, (1, 0, 3, 2))) * -1 - tmp19 += tmp18 - del tmp18 - tmp34 = einsum(tmp31, (0, 1, 2), v.xov, (2, 3, 1), (3, 0)) - tmp32 = einsum(tmp31, (0, 1, 2), v.xov, (2, 0, 3), (3, 1)) * 0.5 - del tmp31 - tmp28 = einsum(v.xov, (0, 1, 2), tmp27, (3, 4, 0), (1, 3, 2, 4)) - del tmp27 - tmp25 = einsum(v.xov, (0, 1, 2), tmp24, (3, 4, 0), (1, 3, 2, 4)) * 2 - del tmp24 - tmp9 = einsum(tmp8, (0, 1, 2, 3), tmp0, (1, 4, 5, 3), (4, 0, 5, 2)) - del tmp8 - tmp15 = einsum(tmp14, (0, 1, 2), v.xov, (2, 3, 4), (3, 0, 4, 1)) - del tmp14 - tmp4 = einsum(l2, (0, 1, 2, 3), tmp3, (4, 3, 5, 1), (2, 4, 0, 5)) - del tmp3 - tmp17 = einsum(l2, (0, 1, 2, 3), f.vv, (4, 1), (2, 3, 4, 0)) - tmp20 = einsum(tmp19, (0, 1, 2, 3), l2, (4, 2, 0, 5), (5, 1, 4, 3)) - del tmp19 - tmp35 = einsum(l2, (0, 1, 2, 3), tmp34, (4, 2), (4, 3, 0, 1)) - del tmp34 - tmp33 = einsum(l2, (0, 1, 2, 3), tmp32, (4, 1), (3, 2, 0, 4)) * 2 - del tmp32 - tmp29 = np.copy(np.transpose(tmp25, (1, 0, 2, 3))) - del tmp25 - tmp29 += np.transpose(tmp28, (0, 1, 3, 2)) - del tmp28 - tmp16 = np.copy(tmp4) - del tmp4 - tmp16 += np.transpose(tmp9, (1, 0, 3, 2)) * -1 - del tmp9 - tmp16 += np.transpose(tmp15, (1, 0, 3, 2)) * -1 - del tmp15 - tmp38 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp38 += einsum(t2, (0, 1, 2, 3), tmp0, (4, 5, 3, 2), (0, 1, 4, 5)) - tmp21 = np.copy(tmp17) - del tmp17 - tmp21 += tmp20 - del tmp20 - tmp36 = np.copy(np.transpose(tmp33, (1, 0, 2, 3))) - del tmp33 - tmp36 += np.transpose(tmp35, (1, 0, 3, 2)) - del tmp35 - tmp1 = einsum(t2, (0, 1, 2, 3), l2, (3, 2, 4, 5), (5, 4, 0, 1)) - tmp2 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp37 = einsum(l2, (0, 1, 2, 3), f.oo, (4, 3), (4, 2, 0, 1)) - l2new = einsum(tmp0, (0, 1, 2, 3), tmp1, (4, 5, 0, 1), (3, 2, 5, 4)) - del tmp1 - l2new += np.transpose(tmp0, (3, 2, 1, 0)) - del tmp0 - l2new += einsum(tmp2, (0, 1, 2, 3), l2, (1, 3, 4, 5), (2, 0, 4, 5)) - del tmp2 - l2new += np.transpose(tmp16, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp16, (3, 2, 1, 0)) * -1 - del tmp16 - l2new += np.transpose(tmp21, (3, 2, 0, 1)) - l2new += np.transpose(tmp21, (2, 3, 1, 0)) - del tmp21 - l2new += np.transpose(tmp29, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp29, (2, 3, 1, 0)) * -1 - del tmp29 - l2new += np.transpose(tmp36, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp36, (3, 2, 1, 0)) * -1 - del tmp36 - l2new += np.transpose(tmp37, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp37, (2, 3, 1, 0)) * -1 - del tmp37 - l2new += einsum(tmp38, (0, 1, 2, 3), l2, (4, 5, 0, 1), (4, 5, 3, 2)) - del tmp38 - - return {f"l2new": l2new} - -def make_rdm1_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:59.850080. - - Parameters - ---------- - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm1 : array - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp1 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp1 += t2 * -0.5 - tmp0 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp0 += t2 - rdm1.vv = einsum(tmp1, (0, 1, 2, 3), l2, (4, 3, 1, 0), (4, 2)) * 4 - del tmp1 - rdm1.oo = np.copy(delta.oo) * 2 - del delta - rdm1.oo += einsum(l2, (0, 1, 2, 3), tmp0, (2, 4, 0, 1), (4, 3)) * -4 - del tmp0 - rdm1.ov = np.zeros((t2.shape[0], t2.shape[-1])) - rdm1.vo = np.zeros((t2.shape[-1], t2.shape[0])) - rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]]) - - return rdm1 - -def make_rdm2_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:24:18.091182. - - Parameters - ---------- - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm2 : array - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp3 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp3 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp6 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp6 += np.transpose(l2, (2, 3, 0, 1)) - tmp12 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp12 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp1 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp1 += t2 - tmp4 = einsum(tmp3, (0, 1, 2, 3), t2, (4, 0, 5, 2), (4, 1, 5, 3)) - del tmp3 - tmp7 = einsum(t2, (0, 1, 2, 3), tmp6, (1, 4, 2, 5), (0, 4, 3, 5)) - del tmp6 - tmp13 = einsum(tmp12, (0, 1, 2, 3), t2, (0, 1, 2, 4), (4, 3)) * 0.5 - tmp2 = einsum(l2, (0, 1, 2, 3), tmp1, (2, 4, 0, 1), (3, 4)) * 2 - del tmp1 - tmp26 = np.copy(np.transpose(l2, (3, 2, 0, 1))) - tmp26 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp23 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp23 += t2 * 2 - tmp21 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp21 += t2 - tmp5 = einsum(tmp4, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp8 = einsum(t2, (0, 1, 2, 3), tmp7, (4, 1, 5, 2), (0, 4, 3, 5)) - tmp0 = einsum(l2, (0, 1, 2, 3), t2, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp14 = einsum(tmp13, (0, 1), t2, (2, 3, 1, 4), (2, 3, 4, 0)) * 2 - tmp15 = einsum(tmp2, (0, 1), t2, (2, 0, 3, 4), (2, 1, 4, 3)) - tmp19 = einsum(l2, (0, 1, 2, 3), t2, (4, 2, 1, 5), (3, 4, 0, 5)) - tmp17 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 1, 5), (2, 4, 0, 5)) - tmp28 = einsum(l2, (0, 1, 2, 3), t2, (3, 2, 4, 5), (0, 1, 5, 4)) - tmp27 = einsum(t2, (0, 1, 2, 3), tmp26, (1, 4, 2, 5), (0, 4, 3, 5)) - del tmp26 - tmp25 = einsum(tmp12, (0, 1, 2, 3), t2, (0, 1, 2, 4), (4, 3)) - del tmp12 - tmp24 = einsum(l2, (0, 1, 2, 3), tmp23, (3, 4, 1, 5), (2, 4, 0, 5)) - del tmp23 - tmp22 = einsum(l2, (0, 1, 2, 3), tmp21, (2, 4, 1, 5), (3, 4, 0, 5)) - del tmp21 - tmp9 = np.copy(np.transpose(tmp5, (1, 0, 3, 2))) * 2 - tmp9 += tmp8 - del tmp8 - tmp11 = einsum(tmp0, (0, 1, 2, 3), t2, (1, 0, 4, 5), (3, 2, 4, 5)) - tmp16 = np.copy(np.transpose(tmp14, (1, 0, 2, 3))) - del tmp14 - tmp16 += np.transpose(tmp15, (0, 1, 3, 2)) - del tmp15 - tmp10 = einsum(t2, (0, 1, 2, 3), tmp4, (4, 1, 5, 2), (0, 4, 3, 5)) - tmp20 = einsum(t2, (0, 1, 2, 3), tmp19, (1, 4, 2, 5), (4, 0, 5, 3)) - tmp18 = einsum(t2, (0, 1, 2, 3), tmp17, (1, 4, 2, 5), (4, 0, 5, 3)) - rdm2.vvvv = np.copy(np.transpose(tmp28, (1, 0, 2, 3))) * -2 - rdm2.vvvv += np.transpose(tmp28, (1, 0, 3, 2)) * 4 - del tmp28 - rdm2.vvoo = np.copy(np.transpose(l2, (0, 1, 3, 2))) * -2 - rdm2.vvoo += l2 * 4 - rdm2.vovo = np.copy(np.transpose(tmp4, (3, 0, 2, 1))) * -2 - rdm2.vovo += np.transpose(tmp27, (3, 0, 2, 1)) * -2 - del tmp27 - rdm2.vovo += einsum(delta.oo, (0, 1), tmp25, (2, 3), (3, 0, 2, 1)) * 4 - rdm2.vovo += np.transpose(tmp19, (2, 1, 3, 0)) * -2 - rdm2.voov = np.copy(np.transpose(tmp24, (2, 1, 0, 3))) * 2 - rdm2.voov += np.transpose(tmp22, (2, 1, 0, 3)) * -2 - rdm2.voov += einsum(delta.oo, (0, 1), tmp25, (2, 3), (3, 0, 1, 2)) * -2 - del tmp25 - rdm2.voov += np.transpose(tmp17, (2, 1, 0, 3)) * -2 - rdm2.voov += np.transpose(tmp4, (3, 0, 1, 2)) * 2 - rdm2.ovvo = np.copy(np.transpose(tmp4, (0, 3, 2, 1))) * 4 - del tmp4 - rdm2.ovvo += np.transpose(tmp7, (0, 3, 2, 1)) * -2 - del tmp7 - rdm2.ovvo += einsum(delta.oo, (0, 1), tmp13, (2, 3), (0, 3, 2, 1)) * -4 - rdm2.ovvo += np.transpose(tmp17, (1, 2, 3, 0)) * -2 - del tmp17 - rdm2.ovov = np.copy(np.transpose(tmp22, (1, 2, 0, 3))) * 2 - del tmp22 - rdm2.ovov += np.transpose(tmp24, (1, 2, 0, 3)) * -2 - del tmp24 - rdm2.ovov += einsum(delta.oo, (0, 1), tmp13, (2, 3), (0, 3, 1, 2)) * 8 - del tmp13 - rdm2.ovov += np.transpose(tmp19, (1, 2, 0, 3)) * -2 - del tmp19 - rdm2.oovv = np.copy(tmp9) * 2 - rdm2.oovv += np.transpose(tmp9, (0, 1, 3, 2)) * -2 - del tmp9 - rdm2.oovv += np.transpose(tmp10, (1, 0, 3, 2)) * -4 - rdm2.oovv += np.transpose(tmp10, (1, 0, 2, 3)) * 2 - rdm2.oovv += np.transpose(tmp10, (0, 1, 3, 2)) * 2 - rdm2.oovv += tmp10 * -4 - del tmp10 - rdm2.oovv += tmp11 * 4 - rdm2.oovv += np.transpose(tmp11, (0, 1, 3, 2)) * -2 - del tmp11 - rdm2.oovv += tmp16 * -4 - rdm2.oovv += np.transpose(tmp16, (0, 1, 3, 2)) * 2 - rdm2.oovv += np.transpose(tmp16, (1, 0, 2, 3)) * 2 - rdm2.oovv += np.transpose(tmp16, (1, 0, 3, 2)) * -4 - del tmp16 - rdm2.oovv += np.transpose(t2, (0, 1, 3, 2)) * -2 - rdm2.oovv += t2 * 4 - rdm2.oovv += tmp18 * 2 - del tmp18 - rdm2.oovv += np.transpose(tmp20, (0, 1, 3, 2)) * 2 - del tmp20 - rdm2.oovv += tmp5 * 4 - del tmp5 - rdm2.oooo = np.copy(np.transpose(tmp0, (2, 3, 1, 0))) * -2 - rdm2.oooo += np.transpose(tmp0, (3, 2, 1, 0)) * 4 - del tmp0 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp2, (2, 3), (3, 0, 2, 1)) * -4 - rdm2.oooo += einsum(tmp2, (0, 1), delta.oo, (2, 3), (2, 1, 0, 3)) * 2 - rdm2.oooo += einsum(tmp2, (0, 1), delta.oo, (2, 3), (1, 2, 3, 0)) * 2 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp2, (2, 3), (0, 3, 1, 2)) * -4 - del tmp2 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -2 - del delta - rdm2.ooov = np.zeros((t2.shape[0], t2.shape[0], t2.shape[0], t2.shape[-1])) - rdm2.oovo = np.zeros((t2.shape[0], t2.shape[0], t2.shape[-1], t2.shape[0])) - rdm2.ovoo = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[0], t2.shape[0])) - rdm2.vooo = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[0], t2.shape[0])) - rdm2.ovvv = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[-1], t2.shape[-1])) - rdm2.vovv = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[-1], t2.shape[-1])) - rdm2.vvov = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[0], t2.shape[-1])) - rdm2.vvvo = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[-1], t2.shape[0])) - rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv) - rdm2 = np.transpose(rdm2, (0, 2, 1, 3)) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:24:30.721998. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp13 : array - tmp15 : array - tmp16 : array - tmp18 : array - tmp23 : array - tmp24 : array - tmp25 : array - tmp27 : array - tmp28 : array - tmp3 : array - tmp30 : array - tmp31 : array - tmp32 : array - tmp37 : array - tmp38 : array - tmp39 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp43 : array - tmp49 : array - tmp50 : array - tmp6 : array - tmp7 : array - """ - - tmp3 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 2, 4), (3, 4, 0)) - tmp6 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 4, 2), (3, 4, 0)) - tmp0 = einsum(v.xoo, (0, 1, 2), v.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp15 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp12 = einsum(v.xvv, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp50 = einsum(v.xvv, (0, 1, 2), tmp3, (3, 2, 0), (3, 1)) - tmp49 = einsum(v.xvv, (0, 1, 2), tmp6, (3, 2, 0), (3, 1)) - tmp43 = einsum(tmp6, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp41 = einsum(tmp3, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp40 = einsum(tmp0, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) - tmp39 = einsum(t2, (0, 1, 2, 3), tmp0, (4, 0, 1, 3), (4, 2)) - tmp38 = einsum(tmp0, (0, 1, 2, 3), t2, (1, 2, 3, 4), (0, 4)) - tmp37 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp32 = einsum(t2, (0, 1, 2, 3), tmp15, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp31 = einsum(t2, (0, 1, 2, 3), tmp15, (1, 4, 5, 2), (0, 4, 3, 5)) - tmp30 = einsum(v.xoo, (0, 1, 2), tmp3, (3, 4, 0), (3, 1, 2, 4)) - tmp28 = einsum(v.xoo, (0, 1, 2), tmp6, (3, 4, 0), (3, 1, 2, 4)) - tmp27 = einsum(tmp0, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp25 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp24 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp23 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp18 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp16 = einsum(t2, (0, 1, 2, 3), tmp15, (4, 5, 2, 3), (0, 1, 4, 5)) - tmp13 = einsum(tmp12, (0, 1, 2, 3), t2, (4, 5, 3, 2), (4, 5, 0, 1)) - del tmp12 - tmp7 = einsum(v.xov, (0, 1, 2), tmp6, (3, 2, 0), (3, 1)) - tmp4 = einsum(v.xov, (0, 1, 2), tmp3, (3, 2, 0), (3, 1)) - - return {f"tmp0": tmp0, f"tmp13": tmp13, f"tmp15": tmp15, f"tmp16": tmp16, f"tmp18": tmp18, f"tmp23": tmp23, f"tmp24": tmp24, f"tmp25": tmp25, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp31": tmp31, f"tmp32": tmp32, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp43": tmp43, f"tmp49": tmp49, f"tmp50": tmp50, f"tmp6": tmp6, f"tmp7": tmp7} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:24:30.746086. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp9 = np.copy(ints.tmp15) - tmp9 += np.transpose(ints.tmp15, (1, 0, 2, 3)) * -0.5 - del ints.tmp15 - tmp1 = np.copy(r2) * -1 - tmp1 += np.transpose(r2, (1, 0, 2)) * 2 - tmp11 = np.copy(ints.tmp0) - tmp11 += np.transpose(ints.tmp13, (0, 2, 1, 3)) - del ints.tmp13 - tmp11 += np.transpose(ints.tmp28, (2, 1, 0, 3)) * 2 - del ints.tmp28 - tmp11 += np.transpose(ints.tmp37, (2, 0, 1, 3)) - del ints.tmp37 - tmp11 += np.transpose(ints.tmp27, (1, 2, 0, 3)) * -1 - del ints.tmp27 - tmp11 += np.transpose(ints.tmp30, (2, 1, 0, 3)) * -1 - del ints.tmp30 - tmp11 += np.transpose(ints.tmp40, (0, 2, 1, 3)) * -1 - del ints.tmp40 - tmp8 = np.copy(f.vv) - tmp8 += np.transpose(ints.tmp41, (1, 0)) - del ints.tmp41 - tmp8 += np.transpose(ints.tmp43, (1, 0)) * -2 - del ints.tmp43 - tmp3 = np.copy(ints.tmp18) * 0.5 - tmp3 += ints.tmp32 - tmp3 += ints.tmp31 * -0.5 - tmp7 = np.copy(ints.tmp6) * 2 - del ints.tmp6 - tmp7 += np.transpose(v.xov, (1, 2, 0)) - tmp7 += ints.tmp3 * -1 - del ints.tmp3 - tmp10 = einsum(tmp9, (0, 1, 2, 3), r2, (0, 1, 2), (3,)) - del tmp9 - tmp6 = einsum(tmp1, (0, 1, 2), v.xov, (3, 1, 2), (0, 3)) * 0.5 - tmp5 = np.copy(ints.tmp16) - del ints.tmp16 - tmp5 += np.transpose(ints.tmp25, (0, 2, 3, 1)) - del ints.tmp25 - tmp12 = np.copy(f.ov) - tmp12 += ints.tmp24 * 2 - del ints.tmp24 - tmp12 += ints.tmp38 - del ints.tmp38 - tmp12 += ints.tmp49 * 2 - del ints.tmp49 - tmp12 += ints.tmp23 * -1 - del ints.tmp23 - tmp12 += ints.tmp39 * -2 - del ints.tmp39 - tmp12 += ints.tmp50 * -1 - del ints.tmp50 - tmp2 = np.copy(f.oo) - tmp2 += np.transpose(ints.tmp7, (1, 0)) * 2 - del ints.tmp7 - tmp2 += np.transpose(ints.tmp4, (1, 0)) * -1 - del ints.tmp4 - tmp4 = np.copy(ints.tmp18) - del ints.tmp18 - tmp4 += ints.tmp31 * -1 - del ints.tmp31 - tmp0 = np.copy(r2) * 2 - tmp0 += np.transpose(r2, (1, 0, 2)) * -1 - r2new = einsum(ints.tmp32, (0, 1, 2, 3), r2, (4, 1, 3), (0, 4, 2)) - del ints.tmp32 - r2new += einsum(r2, (0, 1, 2), tmp3, (3, 0, 4, 2), (3, 1, 4)) * -2 - del tmp3 - r2new += einsum(r2, (0, 1, 2), tmp4, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp4 - r2new += einsum(r2, (0, 1, 2), tmp5, (3, 4, 1, 0), (4, 3, 2)) - del tmp5 - r2new += einsum(tmp6, (0, 1), tmp7, (2, 3, 1), (2, 0, 3)) * 2 - del tmp6, tmp7 - r2new += einsum(r2, (0, 1, 2), tmp8, (2, 3), (0, 1, 3)) - del tmp8 - r2new += einsum(t2, (0, 1, 2, 3), tmp10, (3,), (0, 1, 2)) * -2 - del tmp10 - r2new += einsum(r1, (0,), tmp11, (1, 0, 2, 3), (2, 1, 3)) - del tmp11 - r2new += einsum(r2, (0, 1, 2), tmp2, (0, 3), (3, 1, 2)) * -1 - r2new += einsum(tmp2, (0, 1), r2, (2, 0, 3), (2, 1, 3)) * -1 - r2new += einsum(tmp12, (0, 1), r1, (2,), (0, 2, 1)) * -1 - del tmp12 - r1new = einsum(tmp0, (0, 1, 2), ints.tmp0, (3, 1, 0, 2), (3,)) - del ints.tmp0, tmp0 - r1new += einsum(tmp1, (0, 1, 2), f.ov, (1, 2), (0,)) * -1 - del tmp1 - r1new += einsum(tmp2, (0, 1), r1, (0,), (1,)) * -1 - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:24:43.329472. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp12 : array - tmp15 : array - tmp16 : array - tmp18 : array - tmp20 : array - tmp28 : array - tmp3 : array - tmp30 : array - tmp31 : array - tmp32 : array - tmp34 : array - tmp36 : array - tmp37 : array - tmp38 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp44 : array - tmp49 : array - tmp50 : array - tmp6 : array - tmp7 : array - """ - - tmp19 = einsum(v.xoo, (0, 1, 2), v.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp15 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp3 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 2, 4), (3, 4, 0)) - tmp0 = einsum(v.xvv, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp6 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 4, 2), (3, 4, 0)) - tmp50 = einsum(t2, (0, 1, 2, 3), tmp19, (4, 0, 1, 3), (4, 2)) - tmp49 = einsum(tmp19, (0, 1, 2, 3), t2, (1, 2, 3, 4), (0, 4)) - tmp44 = einsum(t2, (0, 1, 2, 3), tmp15, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp41 = einsum(v.xvv, (0, 1, 2), tmp3, (3, 4, 0), (3, 4, 1, 2)) - tmp40 = einsum(tmp0, (0, 1, 2, 3), t2, (4, 0, 5, 2), (4, 5, 3, 1)) - tmp38 = einsum(v.xvv, (0, 1, 2), tmp6, (3, 4, 0), (3, 4, 1, 2)) - tmp37 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp36 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp34 = einsum(v.xov, (0, 1, 2), tmp6, (3, 2, 0), (3, 1)) - tmp32 = einsum(v.xov, (0, 1, 2), tmp3, (3, 2, 0), (3, 1)) - tmp31 = einsum(v.xvv, (0, 1, 2), tmp3, (3, 2, 0), (3, 1)) - tmp30 = einsum(v.xvv, (0, 1, 2), tmp6, (3, 2, 0), (3, 1)) - tmp28 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp20 = einsum(tmp19, (0, 1, 2, 3), t2, (1, 2, 4, 5), (0, 4, 5, 3)) - del tmp19 - tmp18 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp16 = einsum(t2, (0, 1, 2, 3), tmp15, (1, 4, 5, 2), (0, 4, 3, 5)) - tmp12 = einsum(t2, (0, 1, 2, 3), tmp0, (1, 4, 2, 5), (0, 3, 5, 4)) - tmp7 = einsum(tmp6, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp4 = einsum(tmp3, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - - return {f"tmp0": tmp0, f"tmp12": tmp12, f"tmp15": tmp15, f"tmp16": tmp16, f"tmp18": tmp18, f"tmp20": tmp20, f"tmp28": tmp28, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp31": tmp31, f"tmp32": tmp32, f"tmp34": tmp34, f"tmp36": tmp36, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp44": tmp44, f"tmp49": tmp49, f"tmp50": tmp50, f"tmp6": tmp6, f"tmp7": tmp7} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:24:43.351707. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp9 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp9 += np.transpose(r2, (2, 1, 0)) * -0.5 - tmp1 = np.copy(np.transpose(r2, (2, 0, 1))) * -1 - tmp1 += np.transpose(r2, (2, 1, 0)) * 2 - tmp11 = np.copy(f.oo) - tmp11 += np.transpose(ints.tmp34, (1, 0)) * 2 - del ints.tmp34 - tmp11 += np.transpose(ints.tmp32, (1, 0)) * -1 - del ints.tmp32 - tmp8 = np.copy(ints.tmp0) - tmp8 += np.transpose(ints.tmp20, (0, 2, 3, 1)) - del ints.tmp20 - tmp8 += np.transpose(ints.tmp38, (0, 3, 2, 1)) * 2 - del ints.tmp38 - tmp8 += ints.tmp12 * -1 - del ints.tmp12 - tmp8 += np.transpose(ints.tmp40, (0, 3, 2, 1)) * -1 - del ints.tmp40 - tmp8 += np.transpose(ints.tmp41, (0, 3, 2, 1)) * -1 - del ints.tmp41 - tmp3 = einsum(r2, (0, 1, 2), ints.tmp15, (3, 4, 1, 0), (3, 4, 2)) - tmp7 = np.copy(ints.tmp6) * 2 - del ints.tmp6 - tmp7 += np.transpose(v.xov, (1, 2, 0)) - tmp7 += ints.tmp3 * -1 - del ints.tmp3 - tmp10 = einsum(f.ov, (0, 1), r1, (1,), (0,)) - tmp10 += einsum(ints.tmp15, (0, 1, 2, 3), tmp9, (0, 2, 3), (1,)) * -2 - del ints.tmp15, tmp9 - tmp6 = einsum(tmp1, (0, 1, 2), v.xov, (3, 0, 2), (1, 3)) * 0.5 - tmp5 = np.copy(ints.tmp16) - tmp5 += ints.tmp18 * -1 - tmp12 = np.copy(f.ov) - tmp12 += ints.tmp30 * 2 - del ints.tmp30 - tmp12 += ints.tmp37 * 2 - del ints.tmp37 - tmp12 += ints.tmp49 - del ints.tmp49 - tmp12 += ints.tmp31 * -1 - del ints.tmp31 - tmp12 += ints.tmp36 * -1 - del ints.tmp36 - tmp12 += ints.tmp50 * -2 - del ints.tmp50 - tmp2 = np.copy(f.vv) - tmp2 += np.transpose(ints.tmp4, (1, 0)) - del ints.tmp4 - tmp2 += np.transpose(ints.tmp7, (1, 0)) * -2 - del ints.tmp7 - tmp4 = np.copy(ints.tmp18) * 0.5 - del ints.tmp18 - tmp4 += ints.tmp44 - tmp4 += ints.tmp16 * -0.5 - del ints.tmp16 - tmp0 = np.copy(np.transpose(r2, (2, 0, 1))) * -0.5 - tmp0 += np.transpose(r2, (2, 1, 0)) - r2new = einsum(ints.tmp28, (0, 1, 2, 3), r2, (1, 3, 4), (2, 0, 4)) - del ints.tmp28 - r2new += einsum(ints.tmp44, (0, 1, 2, 3), r2, (4, 3, 1), (2, 4, 0)) - del ints.tmp44 - r2new += einsum(t2, (0, 1, 2, 3), tmp3, (1, 0, 4), (2, 3, 4)) - del tmp3 - r2new += einsum(tmp4, (0, 1, 2, 3), r2, (3, 4, 1), (2, 4, 0)) * -2 - del tmp4 - r2new += einsum(tmp5, (0, 1, 2, 3), r2, (4, 3, 1), (4, 2, 0)) - del tmp5 - r2new += einsum(tmp6, (0, 1), tmp7, (2, 3, 1), (3, 0, 2)) * 2 - del tmp6, tmp7 - r2new += einsum(tmp8, (0, 1, 2, 3), r1, (2,), (3, 1, 0)) * -1 - del tmp8 - r2new += einsum(r2, (0, 1, 2), tmp2, (0, 3), (3, 1, 2)) - r2new += einsum(tmp2, (0, 1), r2, (2, 0, 3), (2, 1, 3)) - r2new += einsum(t2, (0, 1, 2, 3), tmp10, (1,), (2, 3, 0)) - del tmp10 - r2new += einsum(r2, (0, 1, 2), tmp11, (2, 3), (0, 1, 3)) * -1 - del tmp11 - r2new += einsum(tmp12, (0, 1), r1, (2,), (1, 2, 0)) * -1 - del tmp12 - r1new = einsum(tmp0, (0, 1, 2), ints.tmp0, (0, 3, 1, 2), (3,)) * -2 - del ints.tmp0, tmp0 - r1new += einsum(f.ov, (0, 1), tmp1, (0, 2, 1), (2,)) * -1 - del tmp1 - r1new += einsum(r1, (0,), tmp2, (0, 1), (1,)) - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:25:02.496159. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp10 : array - tmp12 : array - tmp13 : array - tmp15 : array - tmp18 : array - tmp21 : array - tmp23 : array - tmp25 : array - tmp27 : array - tmp29 : array - tmp3 : array - tmp32 : array - tmp36 : array - tmp41 : array - tmp43 : array - tmp44 : array - tmp45 : array - tmp59 : array - tmp6 : array - tmp63 : array - tmp65 : array - tmp67 : array - tmp9 : array - """ - - tmp12 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 4, 2), (3, 4, 0)) - tmp9 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 2, 4), (3, 4, 0)) - tmp43 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp35 = einsum(v.xvv, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp6 = einsum(v.xoo, (0, 1, 2), v.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp67 = einsum(tmp12, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp65 = einsum(tmp9, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp63 = einsum(t2, (0, 1, 2, 3), tmp43, (4, 5, 3, 2), (0, 1, 5, 4)) - tmp59 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp45 = einsum(t2, (0, 1, 2, 3), tmp43, (4, 1, 3, 5), (0, 4, 2, 5)) - tmp44 = einsum(t2, (0, 1, 2, 3), tmp43, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp41 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp36 = einsum(tmp35, (0, 1, 2, 3), t2, (4, 5, 3, 2), (4, 5, 0, 1)) - del tmp35 - tmp32 = einsum(v.xvv, (0, 1, 2), tmp9, (3, 2, 0), (3, 1)) - tmp29 = einsum(v.xvv, (0, 1, 2), tmp12, (3, 2, 0), (3, 1)) - tmp27 = einsum(v.xoo, (0, 1, 2), tmp12, (3, 4, 0), (3, 1, 2, 4)) - tmp25 = einsum(v.xoo, (0, 1, 2), tmp9, (3, 4, 0), (3, 1, 2, 4)) - tmp23 = einsum(tmp6, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 1, 2, 5)) - tmp21 = einsum(tmp6, (0, 1, 2, 3), t2, (4, 0, 3, 5), (4, 1, 2, 5)) - tmp18 = einsum(t2, (0, 1, 2, 3), tmp6, (0, 4, 1, 3), (4, 2)) - tmp15 = einsum(tmp6, (0, 1, 2, 3), t2, (0, 2, 3, 4), (1, 4)) - tmp13 = einsum(v.xov, (0, 1, 2), tmp12, (3, 2, 0), (3, 1)) - tmp10 = einsum(v.xov, (0, 1, 2), tmp9, (3, 2, 0), (3, 1)) - tmp3 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp1 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp0 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp10": tmp10, f"tmp12": tmp12, f"tmp13": tmp13, f"tmp15": tmp15, f"tmp18": tmp18, f"tmp21": tmp21, f"tmp23": tmp23, f"tmp25": tmp25, f"tmp27": tmp27, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp32": tmp32, f"tmp36": tmp36, f"tmp41": tmp41, f"tmp43": tmp43, f"tmp44": tmp44, f"tmp45": tmp45, f"tmp59": tmp59, f"tmp6": tmp6, f"tmp63": tmp63, f"tmp65": tmp65, f"tmp67": tmp67, f"tmp9": tmp9} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:25:02.519888. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp12 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp12 += t2 * -0.5 - tmp9 = np.copy(ints.tmp12) - del ints.tmp12 - tmp9 += np.transpose(v.xov, (1, 2, 0)) * 0.5 - tmp9 += ints.tmp9 * -0.5 - del ints.tmp9 - tmp2 = np.copy(r2) * -1 - tmp2 += np.transpose(r2, (1, 0, 2)) * 2 - tmp11 = np.copy(f.vv) - tmp11 += ints.tmp65 - del ints.tmp65 - tmp11 += ints.tmp67 * -2 - del ints.tmp67 - tmp8 = np.copy(ints.tmp59) - del ints.tmp59 - tmp8 += np.transpose(ints.tmp63, (3, 0, 2, 1)) - del ints.tmp63 - tmp7 = np.copy(ints.tmp41) - tmp7 += np.transpose(ints.tmp44, (1, 0, 3, 2)) * -1 - tmp13 = einsum(r2, (0, 1, 2), tmp12, (0, 1, 3, 2), (3,)) - del tmp12 - tmp10 = einsum(tmp2, (0, 1, 2), tmp9, (1, 2, 3), (0, 3)) * 2 - del tmp9 - tmp5 = np.copy(f.oo) - tmp5 += ints.tmp13 * 2 - del ints.tmp13 - tmp5 += ints.tmp10 * -1 - del ints.tmp10 - tmp6 = np.copy(ints.tmp41) * 0.5 - del ints.tmp41 - tmp6 += np.transpose(ints.tmp45, (1, 0, 3, 2)) - tmp6 += np.transpose(ints.tmp44, (1, 0, 3, 2)) * -0.5 - del ints.tmp44 - tmp3 = np.copy(ints.tmp27) * 2 - del ints.tmp27 - tmp3 += np.transpose(ints.tmp3, (1, 2, 0, 3)) - del ints.tmp3 - tmp3 += ints.tmp23 * -1 - del ints.tmp23 - tmp3 += ints.tmp25 * -1 - del ints.tmp25 - tmp0 = np.copy(r2) - tmp0 += np.transpose(r2, (1, 0, 2)) * -0.5 - tmp1 = np.copy(ints.tmp36) - del ints.tmp36 - tmp1 += np.transpose(ints.tmp6, (1, 2, 0, 3)) - tmp1 += ints.tmp21 * -1 - del ints.tmp21 - tmp4 = np.copy(f.ov) - tmp4 += ints.tmp15 - del ints.tmp15 - tmp4 += ints.tmp1 * 2 - del ints.tmp1 - tmp4 += ints.tmp29 * 2 - del ints.tmp29 - tmp4 += ints.tmp0 * -1 - del ints.tmp0 - tmp4 += ints.tmp18 * -2 - del ints.tmp18 - tmp4 += ints.tmp32 * -1 - del ints.tmp32 - r2new = einsum(ints.tmp45, (0, 1, 2, 3), r2, (4, 0, 2), (1, 4, 3)) - del ints.tmp45 - r2new += einsum(f.ov, (0, 1), r1, (2,), (0, 2, 1)) * -1 - r2new += einsum(r1, (0,), ints.tmp6, (1, 0, 2, 3), (2, 1, 3)) - del ints.tmp6 - r2new += einsum(r2, (0, 1, 2), tmp6, (3, 0, 4, 2), (3, 1, 4)) * -2 - del tmp6 - r2new += einsum(r2, (0, 1, 2), tmp7, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp7 - r2new += einsum(tmp8, (0, 1, 2, 3), r2, (1, 3, 4), (2, 0, 4)) - del tmp8 - r2new += einsum(tmp10, (0, 1), v.xov, (1, 2, 3), (2, 0, 3)) - del tmp10 - r2new += einsum(r2, (0, 1, 2), tmp11, (2, 3), (0, 1, 3)) - del tmp11 - r2new += einsum(tmp13, (0,), ints.tmp43, (1, 2, 3, 0), (1, 2, 3)) * -2 - del tmp13, ints.tmp43 - r2new += einsum(r2, (0, 1, 2), tmp5, (0, 3), (3, 1, 2)) * -1 - r2new += einsum(tmp5, (0, 1), r2, (2, 0, 3), (2, 1, 3)) * -1 - r1new = einsum(tmp1, (0, 1, 2, 3), tmp0, (1, 0, 3), (2,)) * 2 - del tmp1, tmp0 - r1new += einsum(tmp3, (0, 1, 2, 3), tmp2, (1, 0, 3), (2,)) - del tmp3 - r1new += einsum(tmp4, (0, 1), tmp2, (2, 0, 1), (2,)) * -1 - del tmp2, tmp4 - r1new += einsum(r1, (0,), tmp5, (0, 1), (1,)) * -1 - del tmp5 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:25:21.828908. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp10 : array - tmp11 : array - tmp13 : array - tmp14 : array - tmp17 : array - tmp20 : array - tmp23 : array - tmp26 : array - tmp29 : array - tmp32 : array - tmp34 : array - tmp37 : array - tmp39 : array - tmp43 : array - tmp45 : array - tmp47 : array - tmp49 : array - tmp50 : array - tmp51 : array - tmp61 : array - tmp7 : array - """ - - tmp49 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp13 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 4, 2), (3, 4, 0)) - tmp10 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 2, 4), (3, 4, 0)) - tmp7 = einsum(v.xvv, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp16 = einsum(v.xoo, (0, 1, 2), v.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp61 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp51 = einsum(tmp49, (0, 1, 2, 3), t2, (4, 1, 5, 2), (4, 0, 5, 3)) - tmp50 = einsum(t2, (0, 1, 2, 3), tmp49, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp47 = einsum(v.xov, (0, 1, 2), tmp13, (3, 2, 0), (3, 1)) - tmp45 = einsum(v.xov, (0, 1, 2), tmp10, (3, 2, 0), (3, 1)) - tmp43 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp39 = einsum(tmp7, (0, 1, 2, 3), t2, (4, 0, 5, 2), (4, 5, 3, 1)) - tmp37 = einsum(tmp7, (0, 1, 2, 3), t2, (4, 0, 2, 5), (4, 5, 3, 1)) - tmp34 = einsum(v.xvv, (0, 1, 2), tmp13, (3, 4, 0), (3, 4, 1, 2)) - tmp32 = einsum(v.xvv, (0, 1, 2), tmp10, (3, 4, 0), (3, 4, 1, 2)) - tmp29 = einsum(v.xvv, (0, 1, 2), tmp10, (3, 2, 0), (3, 1)) - tmp26 = einsum(tmp13, (0, 1, 2), v.xvv, (2, 3, 1), (0, 3)) - tmp23 = einsum(t2, (0, 1, 2, 3), tmp16, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp20 = einsum(t2, (0, 1, 2, 3), tmp16, (4, 0, 1, 3), (4, 2)) - tmp17 = einsum(t2, (0, 1, 2, 3), tmp16, (4, 0, 1, 2), (4, 3)) - del tmp16 - tmp14 = einsum(tmp13, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp11 = einsum(tmp10, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp1 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp0 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp10": tmp10, f"tmp11": tmp11, f"tmp13": tmp13, f"tmp14": tmp14, f"tmp17": tmp17, f"tmp20": tmp20, f"tmp23": tmp23, f"tmp26": tmp26, f"tmp29": tmp29, f"tmp32": tmp32, f"tmp34": tmp34, f"tmp37": tmp37, f"tmp39": tmp39, f"tmp43": tmp43, f"tmp45": tmp45, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp50": tmp50, f"tmp51": tmp51, f"tmp61": tmp61, f"tmp7": tmp7} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:25:21.852175. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp11 = np.copy(ints.tmp13) * 2 - del ints.tmp13 - tmp11 += np.transpose(v.xov, (1, 2, 0)) - tmp11 += ints.tmp10 * -1 - del ints.tmp10 - tmp10 = np.copy(np.transpose(r2, (2, 0, 1))) * -0.5 - tmp10 += np.transpose(r2, (2, 1, 0)) - tmp5 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp5 += t2 * -0.5 - tmp9 = np.copy(ints.tmp43) - tmp9 += np.transpose(ints.tmp50, (1, 0, 3, 2)) * -1 - tmp12 = einsum(tmp11, (0, 1, 2), tmp10, (0, 3, 1), (3, 2)) * 2 - del tmp11, tmp10 - tmp8 = np.copy(ints.tmp43) * 0.5 - del ints.tmp43 - tmp8 += np.transpose(ints.tmp51, (1, 0, 3, 2)) - tmp8 += np.transpose(ints.tmp50, (1, 0, 3, 2)) * -0.5 - del ints.tmp50 - tmp7 = einsum(r2, (0, 1, 2), t2, (3, 4, 0, 1), (2, 3, 4)) - tmp13 = np.copy(f.oo) - tmp13 += ints.tmp47 * 2 - del ints.tmp47 - tmp13 += ints.tmp45 * -1 - del ints.tmp45 - tmp14 = einsum(r2, (0, 1, 2), tmp5, (2, 3, 1, 0), (3,)) - tmp4 = np.copy(f.vv) - tmp4 += ints.tmp11 - del ints.tmp11 - tmp4 += ints.tmp14 * -2 - del ints.tmp14 - tmp3 = np.copy(np.transpose(r2, (2, 0, 1))) * -1 - tmp3 += np.transpose(r2, (2, 1, 0)) * 2 - tmp0 = np.copy(ints.tmp23) * 0.5 - tmp0 += ints.tmp34 - tmp0 += np.transpose(ints.tmp37, (0, 1, 3, 2)) - tmp0 += ints.tmp32 * -0.5 - tmp0 += np.transpose(ints.tmp39, (0, 1, 3, 2)) * -0.5 - tmp0 += np.transpose(ints.tmp7, (0, 2, 3, 1)) * -1 - tmp6 = einsum(r2, (0, 1, 2), tmp5, (2, 3, 1, 0), (3,)) * 2 - del tmp5 - tmp1 = np.copy(ints.tmp23) * 2 - del ints.tmp23 - tmp1 += ints.tmp34 * 4 - del ints.tmp34 - tmp1 += np.transpose(ints.tmp37, (0, 1, 3, 2)) - del ints.tmp37 - tmp1 += ints.tmp32 * -2 - del ints.tmp32 - tmp1 += np.transpose(ints.tmp39, (0, 1, 3, 2)) * -2 - del ints.tmp39 - tmp1 += np.transpose(ints.tmp7, (0, 2, 3, 1)) * -1 - tmp2 = np.copy(f.ov) - tmp2 += ints.tmp17 - del ints.tmp17 - tmp2 += ints.tmp1 * 2 - del ints.tmp1 - tmp2 += ints.tmp26 * 2 - del ints.tmp26 - tmp2 += ints.tmp0 * -1 - del ints.tmp0 - tmp2 += ints.tmp20 * -2 - del ints.tmp20 - tmp2 += ints.tmp29 * -1 - del ints.tmp29 - r2new = einsum(ints.tmp61, (0, 1, 2, 3), r2, (1, 3, 4), (2, 0, 4)) - del ints.tmp61 - r2new += einsum(f.ov, (0, 1), r1, (2,), (1, 2, 0)) * -1 - r2new += einsum(ints.tmp51, (0, 1, 2, 3), r2, (4, 2, 0), (3, 4, 1)) - del ints.tmp51 - r2new += einsum(ints.tmp49, (0, 1, 2, 3), tmp7, (4, 1, 0), (3, 2, 4)) - del tmp7 - r2new += einsum(ints.tmp7, (0, 1, 2, 3), r1, (2,), (3, 1, 0)) * -1 - del ints.tmp7 - r2new += einsum(tmp8, (0, 1, 2, 3), r2, (3, 4, 1), (2, 4, 0)) * -2 - del tmp8 - r2new += einsum(tmp9, (0, 1, 2, 3), r2, (4, 3, 1), (4, 2, 0)) * -1 - del tmp9 - r2new += einsum(v.xov, (0, 1, 2), tmp12, (3, 0), (2, 3, 1)) - del tmp12 - r2new += einsum(tmp4, (0, 1), r2, (0, 2, 3), (1, 2, 3)) - r2new += einsum(r2, (0, 1, 2), tmp4, (1, 3), (0, 3, 2)) - r2new += einsum(r2, (0, 1, 2), tmp13, (2, 3), (0, 1, 3)) * -1 - del tmp13 - r2new += einsum(ints.tmp49, (0, 1, 2, 3), tmp14, (1,), (2, 3, 0)) * -2 - del ints.tmp49, tmp14 - r1new = einsum(r2, (0, 1, 2), tmp0, (2, 1, 0, 3), (3,)) * 2 - del tmp0 - r1new += einsum(r2, (0, 1, 2), tmp1, (2, 0, 1, 3), (3,)) * -1 - del tmp1 - r1new += einsum(tmp3, (0, 1, 2), tmp2, (0, 2), (1,)) * -1 - del tmp3, tmp2 - r1new += einsum(r1, (0,), tmp4, (0, 1), (1,)) - del tmp4 - r1new += einsum(f.ov, (0, 1), tmp6, (0,), (1,)) - del tmp6 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/RDFCCSD.py b/ebcc/codegen/RDFCCSD.py deleted file mode 100644 index 3facde95..00000000 --- a/ebcc/codegen/RDFCCSD.py +++ /dev/null @@ -1,2851 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:58:14.102514 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:58:15.239579. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp3 = einsum(v.xov, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp0 = einsum(t1, (0, 1), v.xov, (2, 0, 1), (2,)) - tmp1 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp1 += t2 * -1 - tmp4 = np.copy(f.ov) * 2 - tmp4 += einsum(v.xov, (0, 1, 2), tmp3, (1, 3, 0), (3, 2)) * -1 - del tmp3 - tmp2 = einsum(tmp0, (0,), t1, (1, 2), (1, 2, 0)) - del tmp0 - tmp2 += einsum(tmp1, (0, 1, 2, 3), v.xov, (4, 0, 3), (1, 2, 4)) * 0.5 - del tmp1 - e_cc = einsum(tmp2, (0, 1, 2), v.xov, (2, 0, 1), ()) * 2 - del tmp2 - e_cc += einsum(tmp4, (0, 1), t1, (0, 1), ()) - del tmp4 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:58:52.991307. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - """ - - tmp2 = einsum(v.xov, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp0 = einsum(t1, (0, 1), v.xov, (2, 0, 1), (2,)) - tmp17 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 2), (0, 3, 4)) - tmp37 = einsum(v.xov, (0, 1, 2), tmp2, (3, 4, 0), (3, 1, 4, 2)) - tmp44 = np.copy(t2) - tmp44 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp9 = einsum(v.xov, (0, 1, 2), tmp2, (1, 3, 0), (3, 2)) - tmp1 = einsum(tmp0, (0,), v.xov, (0, 1, 2), (1, 2)) - tmp39 = einsum(v.xov, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp18 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp52 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp52 += tmp17 * -1 - tmp21 = einsum(t1, (0, 1), v.xvv, (2, 3, 1), (0, 3, 2)) - tmp64 = np.copy(tmp37) * 2 - tmp64 += np.transpose(tmp37, (0, 2, 1, 3)) * -1 - tmp5 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp5 += t2 * -1 - tmp45 = einsum(tmp44, (0, 1, 2, 3), v.xov, (4, 0, 3), (1, 2, 4)) - del tmp44 - tmp42 = np.copy(tmp1) * 2 - tmp42 += tmp9 * -1 - tmp40 = np.copy(np.transpose(tmp39, (1, 0, 2, 3))) * 2 - tmp40 += np.transpose(tmp39, (1, 2, 0, 3)) * -1 - tmp11 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp11 += t2 * -1 - tmp30 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp19 = einsum(tmp18, (0, 1, 2, 3), t2, (4, 0, 3, 5), (4, 1, 5, 2)) - tmp53 = einsum(tmp52, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 1, 4)) - del tmp52 - tmp58 = einsum(tmp0, (0,), v.xvv, (0, 1, 2), (1, 2)) - tmp59 = einsum(tmp21, (0, 1, 2), v.xov, (2, 0, 3), (3, 1)) - tmp68 = einsum(v.xoo, (0, 1, 2), tmp2, (2, 3, 0), (1, 3)) - tmp12 = einsum(tmp0, (0,), v.xoo, (0, 1, 2), (1, 2)) - tmp63 = einsum(tmp17, (0, 1, 2), tmp2, (3, 4, 2), (3, 0, 4, 1)) - tmp65 = einsum(t2, (0, 1, 2, 3), tmp64, (4, 1, 5, 3), (4, 5, 0, 2)) - del tmp64 - tmp62 = einsum(tmp39, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) - del tmp39 - tmp6 = einsum(v.xoo, (0, 1, 2), t1, (2, 3), (1, 3, 0)) - tmp72 = einsum(v.xov, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp13 = einsum(tmp5, (0, 1, 2, 3), v.xov, (4, 0, 3), (1, 2, 4)) - tmp38 = einsum(tmp37, (0, 1, 2, 3), t2, (4, 2, 3, 5), (0, 4, 1, 5)) - del tmp37 - tmp46 = einsum(tmp45, (0, 1, 2), v.xoo, (2, 3, 4), (0, 3, 4, 1)) - tmp43 = einsum(t2, (0, 1, 2, 3), tmp42, (4, 2), (4, 0, 1, 3)) - tmp41 = einsum(tmp40, (0, 1, 2, 3), t2, (4, 2, 5, 3), (0, 1, 4, 5)) - del tmp40 - tmp34 = einsum(v.xov, (0, 1, 2), tmp11, (1, 3, 4, 2), (3, 4, 0)) - tmp54 = np.copy(np.transpose(tmp30, (1, 0, 3, 2))) - tmp54 += tmp19 * -1 - tmp54 += tmp53 * -2 - del tmp53 - tmp60 = np.copy(np.transpose(tmp58, (1, 0))) * 2 - del tmp58 - tmp60 += tmp59 * -1 - del tmp59 - tmp69 = np.copy(np.transpose(tmp68, (1, 0))) * -1 - del tmp68 - tmp69 += np.transpose(tmp12, (1, 0)) * 2 - tmp66 = np.copy(tmp62) - del tmp62 - tmp66 += tmp63 - del tmp63 - tmp66 += np.transpose(tmp65, (0, 2, 1, 3)) * -1 - del tmp65 - tmp56 = np.copy(tmp6) - tmp56 += tmp45 - del tmp45 - tmp73 = einsum(tmp72, (0, 1, 2, 3), t2, (4, 5, 3, 2), (4, 5, 0, 1)) - del tmp72 - tmp77 = einsum(v.xov, (0, 1, 2), tmp13, (3, 2, 0), (3, 1)) - tmp75 = einsum(v.xov, (0, 1, 2), tmp13, (1, 3, 0), (3, 2)) * 0.5 - tmp47 = np.copy(np.transpose(tmp38, (0, 2, 1, 3))) - del tmp38 - tmp47 += np.transpose(tmp41, (2, 1, 0, 3)) * -1 - del tmp41 - tmp47 += np.transpose(tmp43, (2, 0, 1, 3)) * -1 - del tmp43 - tmp47 += np.transpose(tmp46, (0, 2, 1, 3)) - del tmp46 - tmp35 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp35 += tmp6 * -1 - tmp35 += tmp34 - del tmp34 - tmp32 = einsum(v.xvv, (0, 1, 2), tmp2, (3, 4, 0), (3, 4, 1, 2)) - tmp49 = einsum(tmp42, (0, 1), t1, (2, 1), (0, 2)) - del tmp42 - tmp82 = einsum(tmp21, (0, 1, 2), tmp2, (3, 4, 2), (3, 0, 4, 1)) - tmp26 = einsum(v.xoo, (0, 1, 2), tmp2, (3, 4, 0), (3, 1, 2, 4)) - tmp22 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp24 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp55 = einsum(tmp54, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp54 - tmp61 = einsum(t2, (0, 1, 2, 3), tmp60, (2, 4), (0, 1, 4, 3)) - del tmp60 - tmp70 = einsum(t2, (0, 1, 2, 3), tmp69, (1, 4), (4, 0, 3, 2)) - del tmp69 - tmp67 = einsum(tmp66, (0, 1, 2, 3), t1, (2, 4), (0, 1, 3, 4)) - del tmp66 - tmp57 = einsum(tmp56, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 1, 4)) - del tmp56 - tmp74 = einsum(t1, (0, 1), tmp73, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp73 - tmp78 = einsum(tmp77, (0, 1), t2, (2, 1, 3, 4), (0, 2, 4, 3)) - del tmp77 - tmp76 = einsum(tmp75, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) * 2 - del tmp75 - tmp48 = einsum(tmp47, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - del tmp47 - tmp36 = einsum(tmp21, (0, 1, 2), tmp35, (3, 4, 2), (0, 3, 1, 4)) - del tmp35 - tmp33 = einsum(t2, (0, 1, 2, 3), tmp32, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp29 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp50 = einsum(t2, (0, 1, 2, 3), tmp49, (1, 4), (4, 0, 3, 2)) - del tmp49 - tmp31 = einsum(tmp30, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 5, 2)) - del tmp30 - tmp81 = einsum(tmp32, (0, 1, 2, 3), t2, (4, 1, 3, 5), (0, 4, 5, 2)) - del tmp32 - tmp83 = einsum(t1, (0, 1), tmp82, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp82 - tmp27 = einsum(tmp26, (0, 1, 2, 3), t2, (1, 3, 4, 5), (0, 2, 4, 5)) - del tmp26 - tmp23 = einsum(t2, (0, 1, 2, 3), tmp22, (1, 4), (4, 0, 2, 3)) - del tmp22 - tmp25 = einsum(t1, (0, 1), tmp24, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp24 - tmp87 = einsum(tmp18, (0, 1, 2, 3), t1, (1, 4), (0, 4, 2, 3)) - tmp89 = np.copy(np.transpose(tmp18, (1, 0, 2, 3))) * -1 - tmp89 += np.transpose(tmp18, (1, 0, 3, 2)) * 2 - tmp3 = np.copy(np.transpose(v.xoo, (1, 2, 0))) - tmp3 += np.transpose(tmp2, (1, 0, 2)) - tmp7 = einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 0.5 - tmp7 += np.transpose(t2, (0, 1, 3, 2)) * -1 - tmp7 += t2 * 0.5 - tmp15 = np.copy(f.ov) - tmp15 += tmp9 * -1 - tmp14 = np.copy(tmp6) * -1 - tmp14 += einsum(tmp0, (0,), t1, (1, 2), (1, 2, 0)) * 2 - tmp14 += tmp13 - del tmp13 - tmp71 = np.copy(np.transpose(tmp55, (1, 0, 3, 2))) - del tmp55 - tmp71 += tmp57 - del tmp57 - tmp71 += np.transpose(tmp61, (1, 0, 3, 2)) * -1 - del tmp61 - tmp71 += np.transpose(tmp67, (0, 1, 3, 2)) * -1 - del tmp67 - tmp71 += np.transpose(tmp70, (1, 0, 3, 2)) - del tmp70 - tmp79 = np.copy(tmp74) - del tmp74 - tmp79 += np.transpose(tmp76, (1, 0, 3, 2)) - del tmp76 - tmp79 += np.transpose(tmp78, (1, 0, 3, 2)) - del tmp78 - tmp51 = np.copy(tmp29) - del tmp29 - tmp51 += tmp31 * -1 - del tmp31 - tmp51 += tmp33 * -1 - del tmp33 - tmp51 += np.transpose(tmp36, (0, 1, 3, 2)) - del tmp36 - tmp51 += np.transpose(tmp48, (0, 1, 3, 2)) - del tmp48 - tmp51 += np.transpose(tmp50, (0, 1, 3, 2)) * -1 - del tmp50 - tmp84 = np.copy(tmp81) - del tmp81 - tmp84 += tmp83 - del tmp83 - tmp28 = np.copy(tmp23) - del tmp23 - tmp28 += tmp25 - del tmp25 - tmp28 += tmp27 * -1 - del tmp27 - tmp88 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp88 += einsum(t1, (0, 1), tmp87, (0, 2, 3, 4), (4, 1, 3, 2)) - del tmp87 - tmp90 = einsum(t2, (0, 1, 2, 3), tmp89, (1, 4, 3, 5), (0, 4, 2, 5)) - del tmp89 - tmp80 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - tmp20 = einsum(t2, (0, 1, 2, 3), tmp18, (4, 5, 3, 2), (0, 1, 5, 4)) - tmp86 = np.copy(t2) - tmp86 += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp85 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp85 += einsum(tmp2, (0, 1, 2), tmp2, (3, 4, 2), (4, 0, 1, 3)) - del tmp2 - tmp4 = einsum(v.xov, (0, 1, 2), tmp3, (3, 4, 0), (4, 1, 3, 2)) - del tmp3 - tmp10 = np.copy(f.ov) - tmp10 += tmp1 * 2 - tmp10 += tmp9 * -1 - del tmp9 - tmp8 = np.copy(tmp6) - del tmp6 - tmp8 += einsum(tmp0, (0,), t1, (1, 2), (1, 2, 0)) * -2 - del tmp0 - tmp8 += einsum(v.xov, (0, 1, 2), tmp7, (1, 3, 4, 2), (3, 4, 0)) * 2 - del tmp7 - tmp16 = np.copy(f.oo) - tmp16 += np.transpose(tmp12, (1, 0)) * 2 - del tmp12 - tmp16 += einsum(tmp14, (0, 1, 2), v.xov, (2, 3, 1), (3, 0)) - del tmp14 - tmp16 += einsum(tmp15, (0, 1), t1, (2, 1), (0, 2)) - del tmp15 - t2new = einsum(tmp17, (0, 1, 2), tmp17, (3, 4, 2), (0, 3, 1, 4)) - del tmp17 - t2new += einsum(tmp19, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) - del tmp19 - t2new += einsum(t2, (0, 1, 2, 3), tmp20, (4, 5, 0, 1), (5, 4, 3, 2)) - del tmp20 - t2new += np.transpose(tmp18, (1, 0, 3, 2)) - del tmp18 - t2new += einsum(tmp21, (0, 1, 2), tmp21, (3, 4, 2), (0, 3, 1, 4)) - del tmp21 - t2new += np.transpose(tmp28, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp28, (1, 0, 2, 3)) * -1 - del tmp28 - t2new += np.transpose(tmp51, (0, 1, 3, 2)) - t2new += np.transpose(tmp51, (1, 0, 2, 3)) - del tmp51 - t2new += tmp71 * -1 - t2new += np.transpose(tmp71, (1, 0, 3, 2)) * -1 - del tmp71 - t2new += tmp79 * -1 - t2new += np.transpose(tmp79, (1, 0, 3, 2)) * -1 - del tmp79 - t2new += np.transpose(tmp80, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp80, (1, 0, 2, 3)) * -1 - del tmp80 - t2new += tmp84 * -1 - t2new += np.transpose(tmp84, (1, 0, 3, 2)) * -1 - del tmp84 - t2new += einsum(tmp85, (0, 1, 2, 3), tmp86, (0, 2, 4, 5), (1, 3, 5, 4)) - del tmp85, tmp86 - t2new += einsum(tmp88, (0, 1, 2, 3), t2, (4, 5, 2, 0), (4, 5, 1, 3)) - del tmp88 - t2new += einsum(tmp90, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp90 - t1new = np.copy(f.ov) - t1new += tmp1 * 2 - del tmp1 - t1new += einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - t1new += einsum(tmp4, (0, 1, 2, 3), tmp5, (1, 2, 4, 3), (0, 4)) * -1 - del tmp5, tmp4 - t1new += einsum(v.xvv, (0, 1, 2), tmp8, (3, 2, 0), (3, 1)) * -1 - del tmp8 - t1new += einsum(tmp10, (0, 1), tmp11, (0, 2, 3, 1), (2, 3)) - del tmp11, tmp10 - t1new += einsum(tmp16, (0, 1), t1, (0, 2), (1, 2)) * -1 - del tmp16 - - return {f"t1new": t1new, f"t2new": t2new} - -def update_lams(f=None, l1=None, l2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:00:11.425062. - - Parameters - ---------- - f : array - Fock matrix. - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - l1new : array - Updated L1 residuals. - l2new : array - Updated L2 residuals. - """ - - tmp9 = einsum(t1, (0, 1), v.xov, (2, 0, 1), (2,)) - tmp11 = einsum(v.xov, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp89 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp89 += t2 * -1 - tmp17 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp17 += t2 - tmp10 = einsum(tmp9, (0,), v.xov, (0, 1, 2), (1, 2)) - tmp12 = einsum(tmp11, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp34 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - tmp93 = einsum(tmp89, (0, 1, 2, 3), v.xov, (4, 0, 3), (1, 2, 4)) - tmp0 = einsum(t1, (0, 1), v.xvv, (2, 3, 1), (0, 3, 2)) - tmp18 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp18 += t2 * -1 - tmp5 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp78 = np.copy(np.transpose(v.xoo, (1, 2, 0))) - tmp78 += np.transpose(tmp11, (1, 0, 2)) - tmp48 = einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - tmp49 = einsum(tmp17, (0, 1, 2, 3), l2, (2, 3, 0, 4), (4, 1)) - tmp103 = np.copy(tmp10) * 2 - tmp103 += tmp12 * -1 - tmp97 = np.copy(tmp34) * -1 - tmp97 += np.transpose(tmp34, (1, 0, 2, 3)) * 2 - tmp99 = np.copy(tmp34) * 2 - tmp99 += np.transpose(tmp34, (1, 0, 2, 3)) * -1 - tmp95 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * 2 - tmp95 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp94 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp94 += tmp0 - tmp94 += tmp93 - del tmp93 - tmp19 = einsum(v.xov, (0, 1, 2), tmp18, (1, 3, 4, 2), (3, 4, 0)) - tmp77 = einsum(tmp5, (0, 1, 2, 3), t2, (4, 1, 2, 5), (4, 0, 5, 3)) - tmp79 = einsum(tmp78, (0, 1, 2), v.xvv, (2, 3, 4), (0, 1, 3, 4)) - del tmp78 - tmp37 = einsum(tmp17, (0, 1, 2, 3), l2, (4, 2, 1, 0), (4, 3)) * 2 - tmp50 = np.copy(tmp48) * 0.5 - tmp50 += tmp49 - del tmp49 - tmp90 = einsum(tmp5, (0, 1, 2, 3), tmp89, (0, 4, 5, 3), (1, 4, 2, 5)) - del tmp89 - tmp61 = einsum(v.xoo, (0, 1, 2), tmp11, (2, 3, 0), (1, 3)) - tmp104 = einsum(t1, (0, 1), tmp103, (2, 1), (0, 2)) - tmp98 = einsum(v.xoo, (0, 1, 2), tmp97, (1, 3, 2, 4), (3, 4, 0)) - del tmp97 - tmp100 = einsum(tmp99, (0, 1, 2, 3), tmp11, (1, 2, 4), (0, 3, 4)) - del tmp99 - tmp96 = einsum(tmp94, (0, 1, 2), tmp95, (0, 3, 4, 1), (3, 4, 2)) - del tmp94, tmp95 - tmp60 = einsum(tmp9, (0,), v.xoo, (0, 1, 2), (1, 2)) - tmp117 = einsum(tmp19, (0, 1, 2), v.xov, (2, 3, 1), (3, 0)) * 0.5 - tmp6 = einsum(tmp5, (0, 1, 2, 3), t2, (4, 5, 2, 3), (4, 5, 0, 1)) - tmp3 = einsum(v.xov, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp26 = einsum(tmp11, (0, 1, 2), tmp11, (3, 4, 2), (0, 3, 1, 4)) - tmp73 = einsum(v.xov, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp123 = einsum(tmp0, (0, 1, 2), v.xov, (2, 0, 3), (3, 1)) - tmp70 = einsum(v.xvv, (0, 1, 2), l1, (2, 3), (3, 1, 0)) - tmp75 = einsum(v.xov, (0, 1, 2), tmp11, (3, 4, 0), (3, 1, 4, 2)) - tmp67 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp80 = np.copy(tmp77) * -1 - del tmp77 - tmp80 += np.transpose(tmp79, (1, 0, 3, 2)) - tmp22 = einsum(v.xoo, (0, 1, 2), tmp11, (3, 4, 0), (3, 1, 2, 4)) - tmp112 = einsum(v.xov, (0, 1, 2), tmp37, (3, 2), (1, 3, 0)) * 0.5 - tmp110 = einsum(tmp50, (0, 1), v.xov, (2, 1, 3), (0, 3, 2)) * 2 - tmp91 = np.copy(np.transpose(tmp90, (1, 0, 3, 2))) - del tmp90 - tmp91 += np.transpose(tmp79, (1, 0, 3, 2)) - del tmp79 - tmp105 = np.copy(tmp61) - tmp105 += tmp104 * -1 - del tmp104 - tmp63 = einsum(tmp9, (0,), v.xvv, (0, 1, 2), (1, 2)) - del tmp9 - tmp86 = einsum(t2, (0, 1, 2, 3), l2, (4, 3, 1, 5), (5, 0, 4, 2)) - tmp101 = np.copy(tmp96) * -1 - del tmp96 - tmp101 += tmp98 - del tmp98 - tmp101 += tmp100 - del tmp100 - tmp118 = np.copy(np.transpose(tmp60, (1, 0))) - tmp118 += np.transpose(tmp117, (1, 0)) - del tmp117 - tmp115 = einsum(tmp19, (0, 1, 2), v.xov, (2, 0, 3), (3, 1)) * 0.5 - tmp7 = einsum(t1, (0, 1), tmp6, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp4 = einsum(t2, (0, 1, 2, 3), tmp3, (4, 3, 5, 2), (0, 1, 4, 5)) - tmp13 = np.copy(tmp10) * 2 - tmp13 += tmp12 * -1 - tmp21 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp15 = np.copy(np.transpose(v.xoo, (1, 2, 0))) - tmp15 += np.transpose(tmp11, (1, 0, 2)) - tmp55 = np.copy(tmp48) - tmp55 += einsum(tmp17, (0, 1, 2, 3), l2, (2, 3, 0, 4), (4, 1)) * 2 - tmp54 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp54 += t2 * 2 - tmp29 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp29 += t2 * -0.5 - tmp45 = einsum(l2, (0, 1, 2, 3), t2, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp46 = einsum(tmp34, (0, 1, 2, 3), t1, (4, 3), (1, 0, 2, 4)) - tmp43 = np.copy(tmp34) * 2 - tmp43 += np.transpose(tmp34, (1, 0, 2, 3)) * -1 - tmp41 = np.copy(tmp34) * -0.5 - tmp41 += np.transpose(tmp34, (1, 0, 2, 3)) - tmp42 = einsum(t2, (0, 1, 2, 3), l1, (3, 4), (4, 0, 1, 2)) - tmp27 = einsum(t1, (0, 1), tmp26, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp25 = einsum(tmp0, (0, 1, 2), tmp11, (3, 4, 2), (3, 0, 4, 1)) - tmp122 = einsum(tmp73, (0, 1, 2, 3), l1, (4, 1), (0, 2, 4, 3)) - tmp124 = einsum(tmp123, (0, 1), l2, (2, 1, 3, 4), (3, 4, 2, 0)) - del tmp123 - tmp74 = einsum(tmp34, (0, 1, 2, 3), tmp73, (4, 0, 2, 5), (1, 4, 3, 5)) - tmp71 = einsum(v.xov, (0, 1, 2), tmp70, (3, 4, 0), (3, 1, 2, 4)) - del tmp70 - tmp66 = einsum(f.vv, (0, 1), l2, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp76 = einsum(tmp75, (0, 1, 2, 3), tmp34, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp68 = einsum(l2, (0, 1, 2, 3), tmp67, (4, 3), (4, 2, 0, 1)) - del tmp67 - tmp81 = einsum(tmp80, (0, 1, 2, 3), l2, (4, 2, 0, 5), (5, 1, 4, 3)) - del tmp80 - tmp72 = einsum(l2, (0, 1, 2, 3), tmp22, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp69 = einsum(tmp34, (0, 1, 2, 3), f.ov, (2, 4), (0, 1, 4, 3)) - tmp113 = einsum(v.xov, (0, 1, 2), tmp112, (3, 4, 0), (1, 3, 2, 4)) * 2 - del tmp112 - tmp109 = einsum(l1, (0, 1), tmp75, (1, 2, 3, 4), (2, 3, 0, 4)) - tmp111 = einsum(tmp110, (0, 1, 2), v.xov, (2, 3, 4), (3, 0, 4, 1)) - del tmp110 - tmp107 = einsum(tmp34, (0, 1, 2, 3), tmp103, (2, 4), (0, 1, 3, 4)) - tmp85 = einsum(tmp34, (0, 1, 2, 3), tmp3, (2, 4, 3, 5), (1, 0, 5, 4)) - del tmp3 - tmp92 = einsum(l2, (0, 1, 2, 3), tmp91, (3, 4, 1, 5), (2, 4, 0, 5)) - del tmp91 - tmp106 = einsum(l2, (0, 1, 2, 3), tmp105, (2, 4), (3, 4, 0, 1)) - del tmp105 - tmp88 = einsum(tmp34, (0, 1, 2, 3), tmp75, (1, 2, 4, 5), (0, 4, 3, 5)) - del tmp75 - tmp84 = einsum(l2, (0, 1, 2, 3), tmp63, (4, 1), (2, 3, 0, 4)) - tmp87 = einsum(tmp5, (0, 1, 2, 3), tmp86, (4, 0, 5, 3), (4, 1, 5, 2)) - del tmp86 - tmp102 = einsum(tmp101, (0, 1, 2), v.xov, (2, 3, 4), (3, 0, 4, 1)) - del tmp101 - tmp83 = einsum(tmp34, (0, 1, 2, 3), tmp73, (4, 1, 2, 5), (0, 4, 3, 5)) - del tmp73 - tmp119 = einsum(l2, (0, 1, 2, 3), tmp118, (2, 4), (3, 4, 0, 1)) * 2 - del tmp118 - tmp116 = einsum(l2, (0, 1, 2, 3), tmp115, (4, 1), (3, 2, 0, 4)) * 2 - del tmp115 - tmp59 = np.copy(f.ov) - tmp59 += tmp10 * 2 - del tmp10 - tmp59 += tmp12 * -1 - del tmp12 - tmp35 = np.copy(tmp34) * -1 - tmp35 += np.transpose(tmp34, (1, 0, 2, 3)) * 2 - tmp32 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp32 += tmp0 - tmp32 += tmp19 - tmp36 = np.copy(tmp34) - tmp36 += np.transpose(tmp34, (1, 0, 2, 3)) * -0.5 - tmp33 = np.copy(np.transpose(l2, (3, 2, 0, 1))) - tmp33 += np.transpose(l2, (2, 3, 0, 1)) * -0.5 - tmp38 = np.copy(np.transpose(v.xoo, (1, 2, 0))) - tmp38 += tmp11 - tmp8 = np.copy(tmp4) - del tmp4 - tmp8 += tmp7 * -1 - del tmp7 - tmp2 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp1 = einsum(v.xoo, (0, 1, 2), tmp0, (3, 4, 0), (3, 1, 2, 4)) - tmp14 = einsum(t2, (0, 1, 2, 3), tmp13, (4, 2), (0, 1, 4, 3)) * 2 - del tmp13 - tmp23 = np.copy(np.transpose(tmp21, (3, 2, 1, 0))) - tmp23 += np.transpose(tmp22, (1, 0, 3, 2)) - tmp23 += np.transpose(tmp22, (3, 0, 2, 1)) * -2 - tmp20 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp20 += tmp19 - tmp16 = einsum(tmp15, (0, 1, 2), v.xov, (2, 3, 4), (3, 0, 1, 4)) - tmp56 = np.copy(np.transpose(l1, (1, 0))) - tmp56 += t1 - tmp56 += einsum(tmp54, (0, 1, 2, 3), tmp34, (1, 0, 4, 3), (4, 2)) * -1 - tmp56 += einsum(l1, (0, 1), tmp29, (1, 2, 3, 0), (2, 3)) * 2 - tmp56 += einsum(tmp55, (0, 1), t1, (0, 2), (1, 2)) * -1 - del tmp55 - tmp57 = np.copy(tmp48) - del tmp48 - tmp57 += einsum(l2, (0, 1, 2, 3), tmp54, (2, 4, 0, 1), (4, 3)) - del tmp54 - tmp53 = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) * 0.5 - tmp53 += einsum(tmp17, (0, 1, 2, 3), l2, (4, 2, 1, 0), (4, 3)) - tmp47 = np.copy(np.transpose(tmp45, (1, 0, 2, 3))) * 2 - tmp47 += np.transpose(tmp45, (1, 0, 3, 2)) * -1 - tmp47 += tmp46 * -1 - tmp47 += np.transpose(tmp46, (0, 1, 3, 2)) * 2 - tmp51 = np.copy(t1) * -0.5 - tmp51 += einsum(tmp17, (0, 1, 2, 3), tmp34, (1, 0, 4, 3), (4, 2)) - del tmp34 - tmp51 += einsum(l1, (0, 1), tmp18, (1, 2, 3, 0), (2, 3)) * -0.5 - tmp51 += einsum(t1, (0, 1), tmp50, (0, 2), (2, 1)) - tmp44 = np.copy(tmp42) * -1 - tmp44 += np.transpose(tmp42, (0, 2, 1, 3)) * 0.5 - del tmp42 - tmp44 += einsum(t2, (0, 1, 2, 3), tmp43, (1, 4, 5, 3), (4, 5, 0, 2)) * 0.5 - del tmp43 - tmp44 += einsum(t2, (0, 1, 2, 3), tmp41, (1, 4, 5, 2), (4, 5, 0, 3)) - tmp40 = einsum(tmp18, (0, 1, 2, 3), l2, (4, 2, 0, 5), (5, 1, 4, 3)) - del tmp18 - tmp40 += einsum(l2, (0, 1, 2, 3), tmp17, (3, 4, 1, 5), (2, 4, 0, 5)) * 2 - tmp30 = np.copy(np.transpose(tmp21, (3, 2, 1, 0))) - tmp30 += np.transpose(tmp22, (1, 0, 3, 2)) - tmp30 += np.transpose(tmp22, (3, 0, 2, 1)) * -0.5 - del tmp22 - tmp28 = np.copy(tmp25) * 2 - del tmp25 - tmp28 += tmp27 * -2 - del tmp27 - tmp126 = np.copy(np.transpose(tmp21, (3, 2, 1, 0))) - del tmp21 - tmp126 += np.transpose(tmp6, (0, 3, 1, 2)) - del tmp6 - tmp126 += np.transpose(tmp26, (0, 3, 1, 2)) - del tmp26 - tmp125 = np.copy(tmp122) - del tmp122 - tmp125 += tmp124 - del tmp124 - tmp127 = np.copy(np.transpose(tmp45, (1, 0, 3, 2))) - del tmp45 - tmp127 += tmp46 - del tmp46 - tmp82 = np.copy(tmp66) - del tmp66 - tmp82 += tmp68 * -1 - del tmp68 - tmp82 += tmp69 * -1 - del tmp69 - tmp82 += tmp71 - del tmp71 - tmp82 += tmp72 - del tmp72 - tmp82 += tmp74 - del tmp74 - tmp82 += tmp76 - del tmp76 - tmp82 += tmp81 * -1 - del tmp81 - tmp114 = np.copy(tmp109) - del tmp109 - tmp114 += np.transpose(tmp111, (1, 0, 2, 3)) - del tmp111 - tmp114 += np.transpose(tmp113, (0, 1, 3, 2)) - del tmp113 - tmp108 = einsum(l1, (0, 1), f.ov, (2, 3), (2, 1, 3, 0)) - tmp108 += tmp83 - del tmp83 - tmp108 += tmp84 * 2 - del tmp84 - tmp108 += tmp85 * -1 - del tmp85 - tmp108 += tmp87 - del tmp87 - tmp108 += tmp88 - del tmp88 - tmp108 += tmp92 * -1 - del tmp92 - tmp108 += np.transpose(tmp102, (1, 0, 3, 2)) * -1 - del tmp102 - tmp108 += np.transpose(tmp106, (0, 1, 3, 2)) - del tmp106 - tmp108 += tmp107 * -1 - del tmp107 - tmp108 += einsum(l1, (0, 1), tmp103, (2, 3), (1, 2, 0, 3)) - del tmp103 - tmp65 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp121 = einsum(l2, (0, 1, 2, 3), f.oo, (4, 3), (4, 2, 0, 1)) - tmp120 = np.copy(np.transpose(tmp116, (1, 0, 2, 3))) - del tmp116 - tmp120 += np.transpose(tmp119, (0, 1, 3, 2)) - del tmp119 - tmp62 = np.copy(f.oo) - tmp62 += np.transpose(tmp60, (1, 0)) * 2 - del tmp60 - tmp62 += tmp61 * -1 - del tmp61 - tmp62 += einsum(v.xov, (0, 1, 2), tmp19, (3, 2, 0), (3, 1)) - del tmp19 - tmp62 += einsum(tmp59, (0, 1), t1, (2, 1), (2, 0)) - tmp39 = einsum(tmp32, (0, 1, 2), tmp33, (0, 3, 4, 1), (3, 4, 2)) * -2 - del tmp33 - tmp39 += einsum(tmp35, (0, 1, 2, 3), v.xoo, (4, 0, 2), (1, 3, 4)) - del tmp35 - tmp39 += einsum(tmp36, (0, 1, 2, 3), tmp11, (1, 2, 4), (0, 3, 4)) * 2 - del tmp36 - tmp39 += einsum(v.xov, (0, 1, 2), tmp37, (3, 2), (1, 3, 0)) - del tmp37 - tmp39 += einsum(tmp38, (0, 1, 2), l1, (3, 0), (1, 3, 2)) - del tmp38 - tmp24 = np.copy(np.transpose(tmp1, (0, 2, 1, 3))) * -2 - tmp24 += np.transpose(tmp2, (1, 0, 2, 3)) * -2 - tmp24 += np.transpose(tmp2, (2, 0, 1, 3)) - del tmp2 - tmp24 += np.transpose(tmp8, (0, 2, 1, 3)) - tmp24 += np.transpose(tmp8, (1, 2, 0, 3)) * -2 - del tmp8 - tmp24 += np.transpose(tmp14, (1, 2, 0, 3)) * -1 - tmp24 += np.transpose(tmp14, (0, 2, 1, 3)) * 0.5 - del tmp14 - tmp24 += einsum(tmp17, (0, 1, 2, 3), tmp16, (4, 0, 5, 3), (5, 4, 1, 2)) * 2 - del tmp17 - tmp24 += einsum(tmp15, (0, 1, 2), tmp20, (3, 4, 2), (1, 0, 3, 4)) - tmp24 += einsum(t1, (0, 1), tmp23, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - del tmp23 - tmp64 = np.copy(f.vv) - tmp64 += np.transpose(tmp63, (1, 0)) * 2 - del tmp63 - tmp58 = einsum(tmp53, (0, 1), v.xvv, (2, 1, 0), (2,)) * 2 - del tmp53 - tmp58 += einsum(tmp56, (0, 1), v.xov, (2, 0, 1), (2,)) - del tmp56 - tmp58 += einsum(tmp57, (0, 1), v.xoo, (2, 1, 0), (2,)) * -1 - del tmp57 - tmp52 = einsum(tmp0, (0, 1, 2), l1, (1, 3), (0, 3, 2)) * -1 - del tmp0 - tmp52 += einsum(v.xvv, (0, 1, 2), tmp40, (3, 4, 2, 1), (4, 3, 0)) * -1 - del tmp40 - tmp52 += einsum(tmp32, (0, 1, 2), tmp41, (3, 0, 4, 1), (4, 3, 2)) * -2 - del tmp41, tmp32 - tmp52 += einsum(tmp44, (0, 1, 2, 3), v.xov, (4, 1, 3), (2, 0, 4)) * 2 - del tmp44 - tmp52 += einsum(tmp47, (0, 1, 2, 3), tmp11, (0, 3, 4), (2, 1, 4)) - del tmp11 - tmp52 += einsum(tmp47, (0, 1, 2, 3), v.xoo, (4, 0, 3), (2, 1, 4)) - del tmp47 - tmp52 += einsum(v.xov, (0, 1, 2), tmp51, (3, 2), (3, 1, 0)) * 2 - del tmp51 - tmp52 += einsum(tmp50, (0, 1), v.xoo, (2, 3, 0), (1, 3, 2)) * 2 - tmp31 = np.copy(np.transpose(tmp1, (0, 2, 1, 3))) - del tmp1 - tmp31 += np.transpose(tmp28, (0, 2, 1, 3)) * -1 - tmp31 += np.transpose(tmp28, (1, 2, 0, 3)) * 0.5 - del tmp28 - tmp31 += einsum(tmp16, (0, 1, 2, 3), tmp29, (1, 4, 5, 3), (2, 0, 4, 5)) * 2 - del tmp29, tmp16 - tmp31 += einsum(tmp15, (0, 1, 2), tmp20, (3, 4, 2), (1, 0, 3, 4)) * -2 - del tmp15, tmp20 - tmp31 += einsum(t1, (0, 1), tmp30, (0, 2, 3, 4), (2, 3, 4, 1)) * 2 - del tmp30 - l2new = np.copy(np.transpose(tmp5, (3, 2, 1, 0))) - l2new += einsum(tmp65, (0, 1, 2, 3), l2, (3, 2, 4, 5), (0, 1, 4, 5)) - del tmp65 - l2new += np.transpose(tmp82, (3, 2, 0, 1)) - l2new += np.transpose(tmp82, (2, 3, 1, 0)) - del tmp82 - l2new += np.transpose(tmp108, (2, 3, 0, 1)) - l2new += np.transpose(tmp108, (3, 2, 1, 0)) - del tmp108 - l2new += np.transpose(tmp114, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp114, (2, 3, 1, 0)) * -1 - del tmp114 - l2new += np.transpose(tmp120, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp120, (3, 2, 1, 0)) * -1 - del tmp120 - l2new += np.transpose(tmp121, (3, 2, 0, 1)) * -1 - l2new += np.transpose(tmp121, (2, 3, 1, 0)) * -1 - del tmp121 - l2new += np.transpose(tmp125, (2, 3, 0, 1)) * -1 - l2new += np.transpose(tmp125, (3, 2, 1, 0)) * -1 - del tmp125 - l2new += einsum(tmp126, (0, 1, 2, 3), l2, (4, 5, 2, 0), (4, 5, 1, 3)) - del tmp126 - l2new += einsum(tmp5, (0, 1, 2, 3), tmp127, (4, 5, 0, 1), (3, 2, 5, 4)) - del tmp5, tmp127 - l1new = np.copy(np.transpose(f.ov, (1, 0))) - l1new += einsum(l2, (0, 1, 2, 3), tmp24, (3, 4, 2, 1), (0, 4)) - del tmp24 - l1new += einsum(l2, (0, 1, 2, 3), tmp31, (2, 4, 3, 1), (0, 4)) - del tmp31 - l1new += einsum(v.xvv, (0, 1, 2), tmp39, (3, 2, 0), (1, 3)) * -1 - del tmp39 - l1new += einsum(tmp52, (0, 1, 2), v.xov, (2, 0, 3), (3, 1)) - del tmp52 - l1new += einsum(tmp58, (0,), v.xov, (0, 1, 2), (2, 1)) * 2 - del tmp58 - l1new += einsum(tmp59, (0, 1), tmp50, (2, 0), (1, 2)) * -2 - del tmp50, tmp59 - l1new += einsum(tmp62, (0, 1), l1, (2, 0), (2, 1)) * -1 - del tmp62 - l1new += einsum(tmp64, (0, 1), l1, (0, 2), (1, 2)) - del tmp64 - - return {f"l1new": l1new, f"l2new": l2new} - -def make_rdm1_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:00:13.203824. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm1 : array - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp2 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - tmp0 = einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - tmp1 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp1 += t2 - tmp6 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp6 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp4 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp4 += t2 * -1 - tmp3 = np.copy(tmp2) - tmp3 += np.transpose(tmp2, (1, 0, 2, 3)) * -0.5 - del tmp2 - tmp5 = np.copy(tmp0) - tmp5 += einsum(l2, (0, 1, 2, 3), tmp1, (2, 4, 0, 1), (3, 4)) * 2 - rdm1.vv = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) * 2 - rdm1.vv += einsum(tmp6, (0, 1, 2, 3), t2, (0, 1, 4, 3), (2, 4)) * 2 - del tmp6 - rdm1.vo = np.copy(l1) * 2 - rdm1.ov = np.copy(t1) * 2 - rdm1.ov += einsum(t2, (0, 1, 2, 3), tmp3, (1, 0, 4, 3), (4, 2)) * -4 - del tmp3 - rdm1.ov += einsum(tmp4, (0, 1, 2, 3), l1, (3, 0), (1, 2)) * 2 - del tmp4 - rdm1.ov += einsum(tmp5, (0, 1), t1, (0, 2), (1, 2)) * -2 - del tmp5 - rdm1.oo = np.copy(delta.oo) * 2 - del delta - rdm1.oo += np.transpose(tmp0, (1, 0)) * -2 - del tmp0 - rdm1.oo += einsum(l2, (0, 1, 2, 3), tmp1, (2, 4, 0, 1), (4, 3)) * -4 - del tmp1 - rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]]) - - return rdm1 - -def make_rdm2_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:01:27.859431. - - Parameters - ---------- - l1 : array - L1 amplitudes. - l2 : array - L2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm2 : array - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp1 = einsum(l2, (0, 1, 2, 3), t1, (4, 1), (2, 3, 4, 0)) - tmp13 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp13 += t2 * -1 - tmp75 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp75 += t2 * -1 - tmp4 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -0.5 - tmp4 += t2 - tmp20 = np.copy(tmp1) * 2 - tmp20 += np.transpose(tmp1, (1, 0, 2, 3)) * -1 - tmp18 = np.copy(tmp1) - tmp18 += np.transpose(tmp1, (1, 0, 2, 3)) * -1 - tmp42 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * 2 - tmp42 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp58 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp58 += np.transpose(l2, (2, 3, 0, 1)) * 2 - tmp77 = einsum(l2, (0, 1, 2, 3), tmp13, (3, 4, 5, 1), (4, 2, 5, 0)) - tmp83 = einsum(tmp1, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - tmp76 = einsum(tmp75, (0, 1, 2, 3), l2, (4, 3, 0, 5), (1, 5, 2, 4)) - del tmp75 - tmp96 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * 2 - tmp96 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp0 = einsum(t2, (0, 1, 2, 3), l2, (3, 2, 4, 5), (5, 4, 0, 1)) - tmp2 = einsum(t1, (0, 1), tmp1, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp45 = np.copy(np.transpose(l2, (3, 2, 0, 1))) - tmp45 += np.transpose(l2, (2, 3, 0, 1)) * -1 - tmp5 = einsum(tmp4, (0, 1, 2, 3), l2, (2, 3, 0, 4), (4, 1)) * 2 - tmp8 = np.copy(tmp1) * 2 - tmp8 += np.transpose(tmp1, (1, 0, 2, 3)) * -1 - tmp26 = einsum(tmp1, (0, 1, 2, 3), t2, (4, 1, 3, 5), (0, 2, 4, 5)) - tmp16 = einsum(t2, (0, 1, 2, 3), l1, (3, 4), (4, 0, 1, 2)) - tmp21 = einsum(t2, (0, 1, 2, 3), tmp20, (1, 4, 5, 3), (4, 5, 0, 2)) - del tmp20 - tmp25 = einsum(tmp1, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 2, 4, 5)) - tmp6 = einsum(l1, (0, 1), t1, (2, 0), (1, 2)) - tmp19 = einsum(tmp18, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 2, 4, 5)) - tmp33 = einsum(tmp4, (0, 1, 2, 3), l2, (2, 3, 0, 4), (4, 1)) - del tmp4 - tmp106 = einsum(t1, (0, 1), l2, (2, 3, 4, 0), (4, 2, 3, 1)) - tmp43 = einsum(t2, (0, 1, 2, 3), tmp42, (1, 4, 5, 3), (4, 0, 5, 2)) - del tmp42 - tmp63 = einsum(l2, (0, 1, 2, 3), t2, (4, 3, 1, 5), (2, 4, 0, 5)) - tmp80 = einsum(tmp58, (0, 1, 2, 3), t2, (0, 1, 4, 3), (2, 4)) - tmp79 = einsum(t1, (0, 1), l1, (2, 0), (2, 1)) - tmp100 = np.copy(tmp83) - tmp100 += np.transpose(tmp76, (1, 0, 3, 2)) - tmp100 += np.transpose(tmp77, (1, 0, 3, 2)) * -1 - tmp97 = einsum(tmp96, (0, 1, 2, 3), t2, (4, 0, 5, 3), (1, 4, 2, 5)) - del tmp96 - tmp89 = np.copy(np.transpose(tmp77, (1, 0, 3, 2))) - tmp89 += np.transpose(tmp76, (1, 0, 3, 2)) * -1 - tmp3 = np.copy(np.transpose(tmp0, (1, 0, 3, 2))) - tmp3 += tmp2 - tmp46 = einsum(tmp45, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 4, 2, 5)) - del tmp45 - tmp17 = einsum(tmp2, (0, 1, 2, 3), t1, (0, 4), (1, 3, 2, 4)) - tmp59 = einsum(tmp58, (0, 1, 2, 3), t2, (0, 1, 4, 3), (2, 4)) * 0.5 - del tmp58 - tmp10 = einsum(tmp5, (0, 1), t1, (0, 2), (1, 2)) * 0.5 - tmp9 = einsum(tmp8, (0, 1, 2, 3), t2, (0, 1, 3, 4), (2, 4)) * 0.5 - tmp70 = np.copy(tmp16) - tmp70 += tmp26 * -1 - tmp23 = einsum(tmp0, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - tmp67 = np.copy(tmp25) - tmp67 += tmp21 * -1 - tmp12 = einsum(tmp6, (0, 1), t1, (0, 2), (1, 2)) - tmp14 = einsum(tmp13, (0, 1, 2, 3), l1, (3, 0), (1, 2)) - del tmp13 - tmp51 = np.copy(tmp16) - tmp51 += tmp19 - tmp51 += tmp21 * -1 - tmp34 = np.copy(tmp6) * 0.5 - tmp34 += tmp33 - del tmp33 - tmp31 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp31 += t2 * -1 - tmp107 = einsum(l2, (0, 1, 2, 3), t2, (3, 2, 4, 5), (0, 1, 5, 4)) - tmp108 = einsum(t1, (0, 1), tmp106, (0, 2, 3, 4), (3, 2, 4, 1)) - tmp104 = np.copy(tmp63) - tmp104 += tmp83 - tmp104 += tmp43 * -1 - tmp92 = einsum(tmp1, (0, 1, 2, 3), t2, (1, 0, 4, 5), (2, 3, 5, 4)) - tmp81 = np.copy(tmp79) - tmp81 += tmp80 - del tmp80 - tmp65 = einsum(t2, (0, 1, 2, 3), l2, (4, 2, 1, 5), (5, 0, 4, 3)) - tmp101 = einsum(t1, (0, 1), tmp100, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp100 - tmp88 = einsum(t2, (0, 1, 2, 3), l1, (4, 1), (0, 4, 2, 3)) - tmp98 = np.copy(tmp63) - tmp98 += tmp83 - tmp98 += tmp97 * -1 - del tmp97 - tmp90 = einsum(t1, (0, 1), tmp89, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp89 - tmp85 = np.copy(np.transpose(l2, (3, 2, 0, 1))) * -1 - tmp85 += np.transpose(l2, (2, 3, 0, 1)) - tmp29 = einsum(tmp3, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - tmp47 = einsum(t2, (0, 1, 2, 3), tmp46, (1, 4, 2, 5), (4, 0, 5, 3)) - tmp41 = einsum(tmp17, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - tmp44 = einsum(t2, (0, 1, 2, 3), tmp43, (1, 4, 3, 5), (4, 0, 5, 2)) - tmp60 = einsum(tmp59, (0, 1), t2, (2, 3, 0, 4), (2, 3, 1, 4)) * 2 - tmp61 = einsum(t2, (0, 1, 2, 3), tmp5, (1, 4), (0, 4, 3, 2)) - tmp11 = np.copy(tmp9) - del tmp9 - tmp11 += tmp10 - del tmp10 - tmp49 = einsum(t2, (0, 1, 2, 3), tmp6, (1, 4), (4, 0, 2, 3)) - tmp71 = einsum(tmp70, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp70 - tmp56 = einsum(t1, (0, 1), tmp23, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp54 = einsum(t2, (0, 1, 2, 3), tmp0, (1, 0, 4, 5), (4, 5, 3, 2)) - tmp55 = einsum(tmp2, (0, 1, 2, 3), t2, (0, 1, 4, 5), (2, 3, 4, 5)) - tmp68 = einsum(t1, (0, 1), tmp67, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp67 - tmp50 = einsum(t2, (0, 1, 2, 3), tmp43, (1, 4, 2, 5), (4, 0, 5, 3)) - tmp15 = np.copy(tmp12) - tmp15 += tmp14 * -1 - tmp52 = einsum(tmp51, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - del tmp51 - tmp35 = einsum(t1, (0, 1), tmp34, (0, 2), (2, 1)) * 2 - del tmp34 - tmp32 = einsum(tmp31, (0, 1, 2, 3), l1, (3, 0), (1, 2)) - del tmp31 - tmp30 = einsum(tmp8, (0, 1, 2, 3), t2, (0, 1, 3, 4), (2, 4)) - del tmp8 - tmp27 = np.copy(tmp1) * -1 - tmp27 += np.transpose(tmp1, (1, 0, 2, 3)) * 2 - tmp109 = np.copy(np.transpose(tmp107, (1, 0, 3, 2))) - tmp109 += np.transpose(tmp108, (1, 0, 3, 2)) - tmp105 = einsum(t1, (0, 1), tmp104, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp104 - tmp103 = np.copy(tmp92) - tmp103 += einsum(t1, (0, 1), tmp81, (2, 3), (0, 2, 1, 3)) - tmp95 = einsum(tmp65, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - tmp102 = np.copy(tmp88) - tmp102 += np.transpose(tmp101, (0, 1, 3, 2)) - del tmp101 - tmp99 = einsum(t1, (0, 1), tmp98, (0, 2, 3, 4), (2, 3, 4, 1)) - del tmp98 - tmp91 = np.copy(tmp88) - tmp91 += einsum(t1, (0, 1), tmp79, (2, 3), (0, 2, 1, 3)) - tmp91 += np.transpose(tmp90, (0, 1, 3, 2)) * -1 - del tmp90 - tmp93 = np.copy(tmp92) - tmp93 += einsum(t1, (0, 1), tmp59, (2, 3), (0, 2, 1, 3)) * 2 - tmp87 = np.copy(tmp79) * 0.5 - del tmp79 - tmp87 += tmp59 - del tmp59 - tmp94 = einsum(tmp83, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - tmp82 = einsum(tmp1, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - tmp84 = einsum(tmp18, (0, 1, 2, 3), t1, (0, 4), (1, 2, 3, 4)) - tmp86 = einsum(tmp85, (0, 1, 2, 3), t2, (4, 0, 3, 5), (1, 4, 2, 5)) - del tmp85 - tmp78 = einsum(tmp18, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - del tmp18 - tmp74 = np.copy(t1) - tmp74 += tmp12 * -1 - tmp73 = einsum(tmp29, (0, 1, 2, 3), t1, (0, 4), (2, 1, 3, 4)) - tmp66 = einsum(t2, (0, 1, 2, 3), tmp65, (1, 4, 2, 5), (4, 0, 5, 3)) - tmp48 = np.copy(tmp41) - del tmp41 - tmp48 += tmp44 * 2 - tmp48 += np.transpose(tmp47, (1, 0, 3, 2)) - del tmp47 - tmp62 = np.copy(np.transpose(tmp60, (1, 0, 3, 2))) - del tmp60 - tmp62 += np.transpose(tmp61, (0, 1, 3, 2)) - del tmp61 - tmp62 += einsum(tmp11, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - tmp64 = einsum(tmp63, (0, 1, 2, 3), t2, (4, 0, 2, 5), (1, 4, 3, 5)) - tmp72 = np.copy(tmp49) - tmp72 += np.transpose(tmp71, (0, 1, 3, 2)) - del tmp71 - tmp57 = np.copy(tmp54) - tmp57 += tmp55 - tmp57 += tmp56 - del tmp56 - tmp69 = np.copy(tmp50) * -1 - tmp69 += np.transpose(tmp68, (0, 1, 3, 2)) - del tmp68 - tmp69 += einsum(tmp14, (0, 1), t1, (2, 3), (2, 0, 3, 1)) - tmp53 = np.copy(tmp49) - del tmp49 - tmp53 += tmp50 * -1 - del tmp50 - tmp53 += np.transpose(tmp52, (0, 1, 3, 2)) - del tmp52 - tmp53 += einsum(tmp15, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -1 - tmp40 = einsum(tmp6, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp40 += tmp19 - tmp40 += tmp21 * -1 - tmp36 = np.copy(t1) * -1 - tmp36 += tmp30 - tmp36 += tmp32 * -1 - del tmp32 - tmp36 += tmp35 - tmp39 = np.copy(tmp16) - tmp39 += np.transpose(tmp29, (0, 2, 1, 3)) - tmp39 += einsum(tmp5, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp28 = einsum(t2, (0, 1, 2, 3), tmp27, (4, 1, 5, 3), (4, 5, 0, 2)) - del tmp27 - tmp38 = np.copy(tmp30) - del tmp30 - tmp38 += tmp35 - del tmp35 - tmp37 = np.copy(tmp6) - tmp37 += tmp5 - tmp24 = np.copy(tmp23) - del tmp23 - tmp24 += einsum(tmp5, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp22 = np.copy(tmp16) - tmp22 += tmp17 - del tmp17 - tmp22 += tmp19 - del tmp19 - tmp22 += tmp21 * -1 - del tmp21 - tmp7 = np.copy(delta.oo) - tmp7 += tmp6 * -1 - rdm2.vvvv = np.copy(np.transpose(tmp109, (0, 1, 3, 2))) * -2 - rdm2.vvvv += tmp109 * 2 - del tmp109 - rdm2.vvvv += np.transpose(tmp107, (1, 0, 3, 2)) * 2 - del tmp107 - rdm2.vvvv += np.transpose(tmp108, (1, 0, 3, 2)) * 2 - del tmp108 - rdm2.vvvo = np.copy(np.transpose(tmp106, (1, 2, 3, 0))) * -2 - rdm2.vvvo += np.transpose(tmp106, (2, 1, 3, 0)) * 4 - rdm2.vvov = np.copy(np.transpose(tmp106, (1, 2, 0, 3))) * 4 - rdm2.vvov += np.transpose(tmp106, (2, 1, 0, 3)) * -2 - del tmp106 - rdm2.vovv = np.copy(np.transpose(tmp102, (1, 0, 2, 3))) * -2 - rdm2.vovv += np.transpose(tmp102, (1, 0, 3, 2)) * 2 - del tmp102 - rdm2.vovv += np.transpose(tmp103, (1, 0, 2, 3)) * -2 - rdm2.vovv += np.transpose(tmp103, (1, 0, 3, 2)) * 2 - del tmp103 - rdm2.vovv += np.transpose(tmp95, (1, 0, 3, 2)) * -2 - rdm2.vovv += np.transpose(tmp92, (1, 0, 2, 3)) * -2 - rdm2.vovv += np.transpose(tmp88, (1, 0, 3, 2)) * 2 - rdm2.vovv += np.transpose(tmp105, (1, 0, 3, 2)) * -2 - del tmp105 - rdm2.vovv += einsum(tmp81, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.ovvv = np.copy(tmp91) * 2 - rdm2.ovvv += np.transpose(tmp91, (0, 1, 3, 2)) * -2 - del tmp91 - rdm2.ovvv += tmp93 * 2 - rdm2.ovvv += np.transpose(tmp93, (0, 1, 3, 2)) * -2 - del tmp93 - rdm2.ovvv += tmp94 * 2 - rdm2.ovvv += np.transpose(tmp94, (0, 1, 3, 2)) * -2 - del tmp94 - rdm2.ovvv += np.transpose(tmp92, (0, 1, 3, 2)) * -2 - del tmp92 - rdm2.ovvv += tmp95 * -2 - del tmp95 - rdm2.ovvv += tmp88 * 2 - del tmp88 - rdm2.ovvv += tmp99 * -2 - del tmp99 - rdm2.ovvv += einsum(t1, (0, 1), tmp87, (2, 3), (0, 2, 1, 3)) * 4 - rdm2.vvoo = np.copy(np.transpose(l2, (0, 1, 3, 2))) * -2 - rdm2.vvoo += l2 * 4 - rdm2.vovo = einsum(t1, (0, 1), l1, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.vovo += np.transpose(tmp43, (2, 1, 3, 0)) * -2 - rdm2.vovo += np.transpose(tmp86, (2, 1, 3, 0)) * -2 - del tmp86 - rdm2.vovo += np.transpose(tmp84, (2, 1, 3, 0)) * -2 - rdm2.vovo += einsum(tmp87, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 8 - del tmp87 - rdm2.vovo += np.transpose(tmp65, (2, 1, 3, 0)) * -2 - rdm2.vovo += np.transpose(tmp82, (2, 1, 3, 0)) * -2 - rdm2.voov = einsum(t1, (0, 1), l1, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.voov += np.transpose(tmp77, (3, 0, 1, 2)) * 2 - rdm2.voov += np.transpose(tmp76, (3, 0, 1, 2)) * -2 - rdm2.voov += np.transpose(tmp84, (2, 1, 0, 3)) * 2 - del tmp84 - rdm2.voov += einsum(delta.oo, (0, 1), tmp81, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.voov += np.transpose(tmp63, (2, 1, 0, 3)) * -2 - rdm2.voov += np.transpose(tmp83, (2, 1, 0, 3)) * -2 - rdm2.voov += np.transpose(tmp43, (2, 1, 0, 3)) * 2 - rdm2.ovvo = einsum(t1, (0, 1), l1, (2, 3), (0, 2, 1, 3)) * 4 - rdm2.ovvo += np.transpose(tmp43, (1, 2, 3, 0)) * 4 - del tmp43 - rdm2.ovvo += np.transpose(tmp46, (1, 2, 3, 0)) * -2 - del tmp46 - rdm2.ovvo += np.transpose(tmp78, (1, 2, 3, 0)) * -2 - rdm2.ovvo += einsum(delta.oo, (0, 1), tmp81, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.ovvo += np.transpose(tmp63, (1, 2, 3, 0)) * -2 - del tmp63 - rdm2.ovvo += np.transpose(tmp83, (1, 2, 3, 0)) * -2 - del tmp83 - rdm2.ovov = einsum(t1, (0, 1), l1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.ovov += np.transpose(tmp76, (0, 3, 1, 2)) * 2 - del tmp76 - rdm2.ovov += np.transpose(tmp77, (0, 3, 1, 2)) * -2 - del tmp77 - rdm2.ovov += np.transpose(tmp78, (1, 2, 0, 3)) * 2 - del tmp78 - rdm2.ovov += einsum(delta.oo, (0, 1), tmp81, (2, 3), (0, 2, 1, 3)) * 4 - del tmp81 - rdm2.ovov += np.transpose(tmp65, (1, 2, 0, 3)) * -2 - del tmp65 - rdm2.ovov += np.transpose(tmp82, (1, 2, 0, 3)) * -2 - del tmp82 - rdm2.oovv = np.copy(tmp48) * 2 - rdm2.oovv += np.transpose(tmp48, (0, 1, 3, 2)) * -2 - del tmp48 - rdm2.oovv += tmp53 * 2 - rdm2.oovv += np.transpose(tmp53, (0, 1, 3, 2)) * -2 - rdm2.oovv += np.transpose(tmp53, (1, 0, 2, 3)) * -2 - rdm2.oovv += np.transpose(tmp53, (1, 0, 3, 2)) * 2 - del tmp53 - rdm2.oovv += tmp57 * 2 - rdm2.oovv += np.transpose(tmp57, (0, 1, 3, 2)) * -2 - del tmp57 - rdm2.oovv += tmp62 * -4 - rdm2.oovv += np.transpose(tmp62, (0, 1, 3, 2)) * 2 - rdm2.oovv += np.transpose(tmp62, (1, 0, 2, 3)) * 2 - rdm2.oovv += np.transpose(tmp62, (1, 0, 3, 2)) * -4 - del tmp62 - rdm2.oovv += np.transpose(t2, (0, 1, 3, 2)) * -2 - rdm2.oovv += t2 * 4 - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.oovv += einsum(t1, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.oovv += tmp64 * 2 - del tmp64 - rdm2.oovv += np.transpose(tmp66, (0, 1, 3, 2)) * 2 - del tmp66 - rdm2.oovv += tmp54 * 2 - del tmp54 - rdm2.oovv += tmp55 * 2 - del tmp55 - rdm2.oovv += einsum(tmp12, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * -2 - del tmp12 - rdm2.oovv += tmp69 * 2 - rdm2.oovv += np.transpose(tmp69, (1, 0, 3, 2)) * 2 - del tmp69 - rdm2.oovv += np.transpose(tmp72, (0, 1, 3, 2)) * -2 - rdm2.oovv += np.transpose(tmp72, (1, 0, 2, 3)) * -2 - del tmp72 - rdm2.oovv += np.transpose(tmp44, (1, 0, 3, 2)) * 4 - del tmp44 - rdm2.oovv += np.transpose(tmp73, (0, 1, 3, 2)) * 2 - del tmp73 - rdm2.oovv += einsum(tmp74, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 2 - del tmp74 - rdm2.vooo = einsum(delta.oo, (0, 1), l1, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.vooo += einsum(l1, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.vooo += np.transpose(tmp1, (3, 2, 0, 1)) * -4 - rdm2.vooo += np.transpose(tmp1, (3, 2, 1, 0)) * 2 - rdm2.ovoo = einsum(delta.oo, (0, 1), l1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.ovoo += einsum(l1, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * 4 - rdm2.ovoo += np.transpose(tmp1, (2, 3, 0, 1)) * 2 - rdm2.ovoo += np.transpose(tmp1, (2, 3, 1, 0)) * -4 - del tmp1 - rdm2.oovo = einsum(delta.oo, (0, 1), tmp38, (2, 3), (2, 0, 3, 1)) * -2 - rdm2.oovo += einsum(tmp38, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * 2 - del tmp38 - rdm2.oovo += einsum(tmp14, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.oovo += einsum(tmp14, (0, 1), delta.oo, (2, 3), (2, 0, 1, 3)) * -2 - del tmp14 - rdm2.oovo += einsum(delta.oo, (0, 1), t1, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.oovo += einsum(delta.oo, (0, 1), t1, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.oovo += np.transpose(tmp39, (1, 2, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp39, (2, 1, 3, 0)) * 2 - del tmp39 - rdm2.oovo += np.transpose(tmp40, (1, 2, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp40, (2, 1, 3, 0)) * 2 - del tmp40 - rdm2.oovo += np.transpose(tmp16, (1, 2, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp26, (1, 2, 3, 0)) * 2 - rdm2.oovo += np.transpose(tmp25, (2, 1, 3, 0)) * 2 - rdm2.oovo += np.transpose(tmp28, (2, 1, 3, 0)) * -2 - rdm2.oovo += np.transpose(tmp29, (1, 2, 3, 0)) * 2 - rdm2.oovo += einsum(delta.oo, (0, 1), tmp36, (2, 3), (2, 0, 3, 1)) * -2 - rdm2.oovo += einsum(tmp37, (0, 1), t1, (2, 3), (2, 1, 3, 0)) * -2 - rdm2.ooov = einsum(delta.oo, (0, 1), tmp11, (2, 3), (2, 0, 1, 3)) * 4 - rdm2.ooov += einsum(tmp11, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * -4 - del tmp11 - rdm2.ooov += einsum(tmp15, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * 2 - rdm2.ooov += einsum(tmp15, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * -2 - del tmp15 - rdm2.ooov += einsum(delta.oo, (0, 1), t1, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.ooov += einsum(delta.oo, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.ooov += np.transpose(tmp22, (1, 2, 0, 3)) * 2 - rdm2.ooov += np.transpose(tmp22, (2, 1, 0, 3)) * -2 - del tmp22 - rdm2.ooov += einsum(tmp6, (0, 1), t1, (2, 3), (2, 1, 0, 3)) * 2 - rdm2.ooov += einsum(tmp6, (0, 1), t1, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.ooov += np.transpose(tmp24, (1, 2, 0, 3)) * 2 - rdm2.ooov += np.transpose(tmp24, (2, 1, 0, 3)) * -2 - del tmp24 - rdm2.ooov += np.transpose(tmp16, (2, 1, 0, 3)) * -2 - del tmp16 - rdm2.ooov += np.transpose(tmp25, (1, 2, 0, 3)) * 2 - del tmp25 - rdm2.ooov += np.transpose(tmp26, (2, 1, 0, 3)) * 2 - del tmp26 - rdm2.ooov += np.transpose(tmp28, (1, 2, 0, 3)) * -2 - del tmp28 - rdm2.ooov += np.transpose(tmp29, (2, 1, 0, 3)) * 2 - del tmp29 - rdm2.ooov += einsum(tmp36, (0, 1), delta.oo, (2, 3), (2, 0, 3, 1)) * -2 - del tmp36 - rdm2.ooov += einsum(tmp37, (0, 1), t1, (2, 3), (1, 2, 0, 3)) * -2 - del tmp37 - rdm2.oooo = np.copy(np.transpose(tmp3, (3, 2, 0, 1))) * -2 - rdm2.oooo += np.transpose(tmp3, (2, 3, 0, 1)) * 2 - del tmp3 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.oooo += einsum(delta.oo, (0, 1), delta.oo, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.oooo += einsum(tmp5, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * -4 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp5, (2, 3), (0, 3, 2, 1)) * 2 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp5, (2, 3), (3, 0, 1, 2)) * 2 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp5, (2, 3), (0, 3, 1, 2)) * -4 - del tmp5 - rdm2.oooo += einsum(tmp6, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp6, (2, 3), (0, 3, 2, 1)) * 2 - rdm2.oooo += einsum(tmp6, (0, 1), delta.oo, (2, 3), (1, 2, 3, 0)) * 2 - rdm2.oooo += einsum(delta.oo, (0, 1), tmp6, (2, 3), (0, 3, 1, 2)) * -4 - del tmp6 - rdm2.oooo += np.transpose(tmp0, (3, 2, 1, 0)) * 2 - del tmp0 - rdm2.oooo += np.transpose(tmp2, (3, 2, 1, 0)) * 2 - del tmp2 - rdm2.oooo += einsum(tmp7, (0, 1), delta.oo, (2, 3), (1, 2, 0, 3)) * 2 - del delta, tmp7 - rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv) - rdm2 = np.transpose(rdm2, (0, 2, 1, 3)) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:02:10.422849. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp103 : array - tmp105 : array - tmp106 : array - tmp107 : array - tmp108 : array - tmp109 : array - tmp11 : array - tmp110 : array - tmp112 : array - tmp113 : array - tmp114 : array - tmp118 : array - tmp119 : array - tmp120 : array - tmp121 : array - tmp122 : array - tmp123 : array - tmp129 : array - tmp130 : array - tmp14 : array - tmp17 : array - tmp18 : array - tmp20 : array - tmp21 : array - tmp23 : array - tmp24 : array - tmp29 : array - tmp31 : array - tmp32 : array - tmp33 : array - tmp35 : array - tmp37 : array - tmp38 : array - tmp4 : array - tmp40 : array - tmp42 : array - tmp43 : array - tmp44 : array - tmp48 : array - tmp5 : array - tmp50 : array - tmp51 : array - tmp52 : array - tmp55 : array - tmp56 : array - tmp57 : array - tmp59 : array - tmp62 : array - tmp63 : array - tmp65 : array - tmp66 : array - tmp67 : array - tmp7 : array - tmp72 : array - tmp73 : array - tmp74 : array - tmp75 : array - tmp76 : array - tmp78 : array - tmp84 : array - tmp85 : array - tmp86 : array - tmp87 : array - tmp89 : array - tmp9 : array - tmp95 : array - tmp96 : array - tmp98 : array - tmp99 : array - """ - - tmp6 = einsum(t1, (0, 1), v.xov, (2, 0, 1), (2,)) - tmp4 = einsum(v.xov, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp11 = einsum(tmp6, (0,), v.xov, (0, 1, 2), (1, 2)) - tmp9 = einsum(v.xov, (0, 1, 2), tmp4, (1, 3, 0), (3, 2)) - tmp17 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 2), (0, 3, 4)) - tmp20 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 3), (0, 2, 4)) - tmp37 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp24 = einsum(tmp11, (0, 1), t1, (2, 1), (2, 0)) - tmp23 = einsum(tmp9, (0, 1), t1, (2, 1), (2, 0)) - tmp44 = einsum(v.xoo, (0, 1, 2), tmp4, (3, 4, 0), (3, 1, 2, 4)) - tmp18 = einsum(v.xov, (0, 1, 2), tmp17, (3, 2, 0), (3, 1)) - tmp21 = einsum(v.xov, (0, 1, 2), tmp20, (3, 2, 0), (3, 1)) - tmp14 = einsum(v.xov, (0, 1, 2), tmp4, (3, 4, 0), (3, 1, 4, 2)) - tmp31 = einsum(t1, (0, 1), v.xvv, (2, 3, 1), (0, 3, 2)) - tmp0 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp110 = einsum(tmp4, (0, 1, 2), tmp4, (3, 4, 2), (3, 0, 4, 1)) - tmp29 = einsum(v.xvv, (0, 1, 2), tmp6, (0,), (1, 2)) - tmp7 = einsum(tmp6, (0,), v.xoo, (0, 1, 2), (1, 2)) - del tmp6 - tmp5 = einsum(v.xoo, (0, 1, 2), tmp4, (2, 3, 0), (1, 3)) - tmp1 = einsum(v.xov, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp57 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp38 = einsum(t2, (0, 1, 2, 3), tmp37, (4, 5, 3, 2), (0, 1, 5, 4)) - tmp34 = einsum(v.xov, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp130 = einsum(tmp24, (0, 1), t1, (1, 2), (0, 2)) - tmp129 = einsum(t1, (0, 1), tmp23, (2, 0), (2, 1)) - tmp123 = einsum(t1, (0, 1), tmp44, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp122 = einsum(tmp18, (0, 1), t1, (1, 2), (0, 2)) - tmp121 = einsum(tmp21, (0, 1), t1, (1, 2), (0, 2)) - tmp120 = einsum(tmp14, (0, 1, 2, 3), t2, (4, 2, 3, 5), (0, 4, 1, 5)) - tmp119 = einsum(tmp14, (0, 1, 2, 3), t2, (2, 1, 3, 4), (0, 4)) - tmp118 = einsum(tmp14, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp114 = einsum(v.xoo, (0, 1, 2), tmp31, (3, 4, 0), (3, 1, 2, 4)) - tmp113 = einsum(tmp0, (0, 1), t1, (0, 2), (1, 2)) - tmp112 = einsum(tmp110, (0, 1, 2, 3), t1, (2, 4), (1, 0, 3, 4)) - tmp109 = einsum(tmp4, (0, 1, 2), tmp31, (3, 4, 2), (0, 3, 1, 4)) - tmp108 = einsum(tmp4, (0, 1, 2), tmp31, (1, 3, 2), (0, 3)) - tmp107 = einsum(t1, (0, 1), tmp29, (2, 1), (0, 2)) - tmp106 = einsum(v.xvv, (0, 1, 2), tmp17, (3, 2, 0), (3, 1)) - tmp105 = einsum(tmp20, (0, 1, 2), v.xvv, (2, 3, 1), (0, 3)) - tmp103 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp99 = einsum(tmp7, (0, 1), t1, (1, 2), (0, 2)) - tmp98 = einsum(tmp5, (0, 1), t1, (1, 2), (0, 2)) - tmp96 = einsum(t2, (0, 1, 2, 3), tmp11, (4, 3), (0, 1, 4, 2)) - tmp95 = einsum(tmp9, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp89 = einsum(tmp20, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp87 = einsum(tmp17, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp86 = einsum(tmp1, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 2, 5)) - tmp85 = einsum(t2, (0, 1, 2, 3), tmp1, (4, 0, 1, 3), (4, 2)) - tmp84 = einsum(t2, (0, 1, 2, 3), tmp1, (4, 0, 1, 2), (4, 3)) - tmp78 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp76 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - tmp75 = einsum(t2, (0, 1, 2, 3), tmp11, (1, 3), (0, 2)) - tmp74 = einsum(t2, (0, 1, 2, 3), tmp11, (1, 2), (0, 3)) - tmp73 = einsum(t2, (0, 1, 2, 3), tmp9, (1, 3), (0, 2)) - tmp72 = einsum(t2, (0, 1, 2, 3), tmp9, (1, 2), (0, 3)) - tmp67 = einsum(t2, (0, 1, 2, 3), tmp37, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp66 = einsum(tmp37, (0, 1, 2, 3), t2, (4, 0, 3, 5), (4, 1, 5, 2)) - tmp65 = einsum(v.xoo, (0, 1, 2), tmp17, (3, 4, 0), (3, 1, 2, 4)) - tmp63 = einsum(v.xoo, (0, 1, 2), tmp20, (3, 4, 0), (3, 1, 2, 4)) - tmp62 = einsum(t2, (0, 1, 2, 3), tmp1, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp59 = einsum(t1, (0, 1), tmp57, (2, 3, 4, 0), (3, 4, 2, 1)) - tmp56 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp55 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp52 = einsum(t1, (0, 1), tmp44, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp51 = einsum(tmp17, (0, 1, 2), tmp4, (3, 4, 2), (3, 0, 4, 1)) - tmp50 = einsum(tmp14, (0, 1, 2, 3), t2, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp48 = einsum(tmp20, (0, 1, 2), tmp4, (3, 4, 2), (3, 0, 4, 1)) - tmp43 = einsum(v.xoo, (0, 1, 2), tmp31, (2, 3, 0), (1, 3)) - tmp42 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp40 = einsum(t1, (0, 1), tmp38, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp35 = einsum(tmp34, (0, 1, 2, 3), t2, (4, 5, 3, 2), (4, 5, 0, 1)) - del tmp34 - tmp33 = einsum(tmp4, (0, 1, 2), v.xvv, (2, 3, 4), (0, 1, 3, 4)) - tmp32 = einsum(tmp31, (0, 1, 2), v.xov, (2, 0, 3), (3, 1)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp103": tmp103, f"tmp105": tmp105, f"tmp106": tmp106, f"tmp107": tmp107, f"tmp108": tmp108, f"tmp109": tmp109, f"tmp11": tmp11, f"tmp110": tmp110, f"tmp112": tmp112, f"tmp113": tmp113, f"tmp114": tmp114, f"tmp118": tmp118, f"tmp119": tmp119, f"tmp120": tmp120, f"tmp121": tmp121, f"tmp122": tmp122, f"tmp123": tmp123, f"tmp129": tmp129, f"tmp130": tmp130, f"tmp14": tmp14, f"tmp17": tmp17, f"tmp18": tmp18, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp23": tmp23, f"tmp24": tmp24, f"tmp29": tmp29, f"tmp31": tmp31, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp35": tmp35, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp42": tmp42, f"tmp43": tmp43, f"tmp44": tmp44, f"tmp48": tmp48, f"tmp5": tmp5, f"tmp50": tmp50, f"tmp51": tmp51, f"tmp52": tmp52, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp62": tmp62, f"tmp63": tmp63, f"tmp65": tmp65, f"tmp66": tmp66, f"tmp67": tmp67, f"tmp7": tmp7, f"tmp72": tmp72, f"tmp73": tmp73, f"tmp74": tmp74, f"tmp75": tmp75, f"tmp76": tmp76, f"tmp78": tmp78, f"tmp84": tmp84, f"tmp85": tmp85, f"tmp86": tmp86, f"tmp87": tmp87, f"tmp89": tmp89, f"tmp9": tmp9, f"tmp95": tmp95, f"tmp96": tmp96, f"tmp98": tmp98, f"tmp99": tmp99} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:02:10.481108. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp3 = np.copy(r2) * 2 - tmp3 += np.transpose(r2, (1, 0, 2)) * -1 - tmp2 = np.copy(f.ov) * 0.5 - tmp2 += ints.tmp11 - tmp2 += ints.tmp9 * -0.5 - del ints.tmp9 - tmp15 = np.copy(ints.tmp4) - del ints.tmp4 - tmp15 += np.transpose(v.xoo, (1, 2, 0)) - tmp9 = einsum(v.xov, (0, 1, 2), tmp3, (1, 3, 2), (3, 0)) * 0.5 - tmp14 = np.copy(ints.tmp14) - tmp14 += np.transpose(ints.tmp1, (0, 2, 1, 3)) - tmp8 = np.copy(ints.tmp110) - del ints.tmp110 - tmp8 += np.transpose(ints.tmp44, (2, 0, 1, 3)) - tmp12 = np.copy(ints.tmp112) - del ints.tmp112 - tmp12 += np.transpose(ints.tmp120, (1, 0, 2, 3)) - del ints.tmp120 - tmp12 += np.transpose(ints.tmp123, (2, 0, 1, 3)) - del ints.tmp123 - tmp12 += ints.tmp40 - del ints.tmp40 - tmp12 += ints.tmp50 - del ints.tmp50 - tmp12 += ints.tmp51 - del ints.tmp51 - tmp12 += ints.tmp52 - del ints.tmp52 - tmp12 += np.transpose(ints.tmp59, (1, 2, 0, 3)) - del ints.tmp59 - tmp12 += np.transpose(ints.tmp62, (1, 0, 2, 3)) - del ints.tmp62 - tmp12 += np.transpose(ints.tmp65, (2, 0, 1, 3)) - del ints.tmp65 - tmp12 += ints.tmp86 - del ints.tmp86 - tmp12 += np.transpose(ints.tmp95, (1, 0, 2, 3)) - del ints.tmp95 - tmp12 += ints.tmp109 * -1 - del ints.tmp109 - tmp12 += np.transpose(ints.tmp114, (2, 0, 1, 3)) * -1 - del ints.tmp114 - tmp12 += ints.tmp14 * -1 - tmp12 += np.transpose(ints.tmp1, (0, 2, 1, 3)) * -1 - tmp12 += ints.tmp35 * -1 - del ints.tmp35 - tmp12 += ints.tmp48 * -2 - del ints.tmp48 - tmp12 += np.transpose(ints.tmp63, (2, 0, 1, 3)) * -2 - del ints.tmp63 - tmp12 += np.transpose(ints.tmp78, (2, 1, 0, 3)) * -1 - del ints.tmp78 - tmp12 += np.transpose(ints.tmp96, (1, 0, 2, 3)) * -2 - del ints.tmp96 - tmp10 = np.copy(ints.tmp20) * 2 - del ints.tmp20 - tmp10 += ints.tmp31 - del ints.tmp31 - tmp10 += np.transpose(v.xov, (1, 2, 0)) - tmp10 += ints.tmp17 * -1 - del ints.tmp17 - tmp6 = np.copy(ints.tmp33) - tmp6 += ints.tmp42 - tmp6 += ints.tmp66 * -1 - tmp18 = np.copy(ints.tmp106) - del ints.tmp106 - tmp18 += ints.tmp108 - del ints.tmp108 - tmp18 += ints.tmp113 - del ints.tmp113 - tmp18 += ints.tmp118 * 2 - del ints.tmp118 - tmp18 += ints.tmp121 * 2 - del ints.tmp121 - tmp18 += ints.tmp130 * 2 - del ints.tmp130 - tmp18 += ints.tmp43 - del ints.tmp43 - tmp18 += ints.tmp55 - del ints.tmp55 - tmp18 += ints.tmp73 * 2 - del ints.tmp73 - tmp18 += ints.tmp74 * 2 - del ints.tmp74 - tmp18 += ints.tmp76 - del ints.tmp76 - tmp18 += ints.tmp85 * 2 - del ints.tmp85 - tmp18 += ints.tmp99 * 2 - del ints.tmp99 - tmp18 += f.ov * -1 - tmp18 += ints.tmp103 * -1 - del ints.tmp103 - tmp18 += ints.tmp105 * -2 - del ints.tmp105 - tmp18 += ints.tmp107 * -2 - del ints.tmp107 - tmp18 += ints.tmp119 * -1 - del ints.tmp119 - tmp18 += ints.tmp11 * -2 - del ints.tmp11 - tmp18 += ints.tmp122 * -1 - del ints.tmp122 - tmp18 += ints.tmp129 * -1 - del ints.tmp129 - tmp18 += ints.tmp56 * -2 - del ints.tmp56 - tmp18 += ints.tmp72 * -1 - del ints.tmp72 - tmp18 += ints.tmp75 * -4 - del ints.tmp75 - tmp18 += ints.tmp84 * -1 - del ints.tmp84 - tmp18 += ints.tmp98 * -1 - del ints.tmp98 - tmp17 = einsum(tmp3, (0, 1, 2), ints.tmp37, (0, 1, 2, 3), (3,)) * 0.5 - del ints.tmp37 - tmp7 = np.copy(ints.tmp38) - del ints.tmp38 - tmp7 += np.transpose(ints.tmp44, (2, 0, 1, 3)) - del ints.tmp44 - tmp7 += np.transpose(ints.tmp57, (2, 0, 1, 3)) - del ints.tmp57 - tmp5 = np.copy(ints.tmp33) * 0.5 - del ints.tmp33 - tmp5 += ints.tmp42 * 0.5 - del ints.tmp42 - tmp5 += ints.tmp67 - tmp5 += ints.tmp66 * -0.5 - del ints.tmp66 - tmp13 = np.copy(f.oo) * 0.5 - tmp13 += ints.tmp0 * 0.5 - tmp13 += np.transpose(ints.tmp21, (1, 0)) - tmp13 += np.transpose(ints.tmp24, (1, 0)) - tmp13 += np.transpose(ints.tmp7, (1, 0)) - tmp13 += np.transpose(ints.tmp18, (1, 0)) * -0.5 - tmp13 += np.transpose(ints.tmp23, (1, 0)) * -0.5 - tmp13 += np.transpose(ints.tmp5, (1, 0)) * -0.5 - tmp11 = np.copy(ints.tmp32) - del ints.tmp32 - tmp11 += np.transpose(ints.tmp89, (1, 0)) * 2 - del ints.tmp89 - tmp11 += f.vv * -1 - tmp11 += np.transpose(ints.tmp29, (1, 0)) * -2 - del ints.tmp29 - tmp11 += np.transpose(ints.tmp87, (1, 0)) * -1 - del ints.tmp87 - tmp11 += einsum(t1, (0, 1), tmp2, (0, 2), (2, 1)) * 2 - tmp16 = einsum(r2, (0, 1, 2), tmp14, (3, 4, 1, 2), (3, 4, 0)) - tmp16 += einsum(tmp14, (0, 1, 2, 3), r2, (2, 4, 3), (4, 1, 0)) - del tmp14 - tmp16 += einsum(tmp15, (0, 1, 2), tmp9, (3, 2), (3, 1, 0)) * -2 - del tmp15 - tmp4 = np.copy(f.oo) - tmp4 += ints.tmp0 - del ints.tmp0 - tmp4 += np.transpose(ints.tmp21, (1, 0)) * 2 - del ints.tmp21 - tmp4 += np.transpose(ints.tmp24, (1, 0)) * 2 - del ints.tmp24 - tmp4 += np.transpose(ints.tmp7, (1, 0)) * 2 - del ints.tmp7 - tmp4 += np.transpose(ints.tmp18, (1, 0)) * -1 - del ints.tmp18 - tmp4 += np.transpose(ints.tmp23, (1, 0)) * -1 - del ints.tmp23 - tmp4 += np.transpose(ints.tmp5, (1, 0)) * -1 - del ints.tmp5 - tmp1 = np.copy(r2) - tmp1 += np.transpose(r2, (1, 0, 2)) * -0.5 - tmp0 = np.copy(r2) * -1 - tmp0 += np.transpose(r2, (1, 0, 2)) * 2 - r2new = einsum(ints.tmp67, (0, 1, 2, 3), r2, (4, 1, 3), (0, 4, 2)) - del ints.tmp67 - r2new += einsum(r2, (0, 1, 2), tmp5, (3, 0, 4, 2), (3, 1, 4)) * -2 - del tmp5 - r2new += einsum(r2, (0, 1, 2), tmp6, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp6 - r2new += einsum(r2, (0, 1, 2), tmp7, (3, 4, 0, 1), (3, 4, 2)) - del tmp7 - r2new += einsum(r2, (0, 1, 2), tmp8, (3, 4, 1, 0), (4, 3, 2)) - del tmp8 - r2new += einsum(tmp9, (0, 1), tmp10, (2, 3, 1), (2, 0, 3)) * 2 - del tmp9, tmp10 - r2new += einsum(r2, (0, 1, 2), tmp11, (2, 3), (0, 1, 3)) * -1 - del tmp11 - r2new += einsum(r1, (0,), tmp12, (1, 2, 0, 3), (2, 1, 3)) * -1 - del tmp12 - r2new += einsum(tmp13, (0, 1), r2, (0, 2, 3), (1, 2, 3)) * -2 - r2new += einsum(r2, (0, 1, 2), tmp13, (1, 3), (0, 3, 2)) * -2 - del tmp13 - r2new += einsum(t1, (0, 1), tmp16, (2, 0, 3), (3, 2, 1)) - del tmp16 - r2new += einsum(t2, (0, 1, 2, 3), tmp17, (3,), (0, 1, 2)) * -2 - del tmp17 - r2new += einsum(r1, (0,), tmp18, (1, 2), (1, 0, 2)) - del tmp18 - r1new = einsum(ints.tmp14, (0, 1, 2, 3), tmp0, (2, 1, 3), (0,)) - del ints.tmp14, tmp0 - r1new += einsum(tmp1, (0, 1, 2), ints.tmp1, (3, 1, 0, 2), (3,)) * 2 - del ints.tmp1, tmp1 - r1new += einsum(tmp3, (0, 1, 2), tmp2, (0, 2), (1,)) * -2 - del tmp3, tmp2 - r1new += einsum(r1, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:02:54.892046. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp100 : array - tmp101 : array - tmp102 : array - tmp108 : array - tmp109 : array - tmp110 : array - tmp111 : array - tmp113 : array - tmp114 : array - tmp117 : array - tmp119 : array - tmp12 : array - tmp120 : array - tmp123 : array - tmp128 : array - tmp129 : array - tmp130 : array - tmp131 : array - tmp132 : array - tmp136 : array - tmp15 : array - tmp20 : array - tmp21 : array - tmp23 : array - tmp24 : array - tmp36 : array - tmp39 : array - tmp44 : array - tmp45 : array - tmp46 : array - tmp47 : array - tmp49 : array - tmp5 : array - tmp51 : array - tmp62 : array - tmp63 : array - tmp64 : array - tmp66 : array - tmp68 : array - tmp7 : array - tmp70 : array - tmp71 : array - tmp72 : array - tmp74 : array - tmp76 : array - tmp77 : array - tmp79 : array - tmp8 : array - tmp80 : array - tmp81 : array - tmp83 : array - tmp84 : array - tmp89 : array - tmp9 : array - tmp91 : array - tmp92 : array - tmp93 : array - tmp94 : array - """ - - tmp4 = einsum(t1, (0, 1), v.xov, (2, 0, 1), (2,)) - tmp9 = einsum(v.xov, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp12 = einsum(tmp4, (0,), v.xov, (0, 1, 2), (1, 2)) - tmp10 = einsum(v.xov, (0, 1, 2), tmp9, (1, 3, 0), (3, 2)) - tmp20 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 2), (0, 3, 4)) - tmp23 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 3), (0, 2, 4)) - tmp15 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp1 = einsum(v.xov, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp47 = einsum(tmp4, (0,), v.xoo, (0, 1, 2), (1, 2)) - tmp46 = einsum(v.xoo, (0, 1, 2), tmp9, (2, 3, 0), (1, 3)) - tmp49 = einsum(v.xov, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp84 = einsum(tmp12, (0, 1), t1, (2, 1), (2, 0)) - tmp83 = einsum(tmp10, (0, 1), t1, (2, 1), (2, 0)) - tmp72 = einsum(v.xov, (0, 1, 2), tmp20, (3, 2, 0), (3, 1)) - tmp74 = einsum(v.xov, (0, 1, 2), tmp23, (3, 2, 0), (3, 1)) - tmp76 = einsum(v.xov, (0, 1, 2), tmp9, (3, 4, 0), (3, 1, 4, 2)) - tmp63 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp7 = einsum(t1, (0, 1), v.xvv, (2, 3, 1), (0, 3, 2)) - tmp5 = einsum(tmp4, (0,), v.xvv, (0, 1, 2), (1, 2)) - del tmp4 - tmp136 = einsum(tmp20, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 1, 4)) - tmp132 = einsum(tmp23, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 1, 4)) - tmp131 = einsum(t2, (0, 1, 2, 3), tmp12, (1, 3), (0, 2)) - tmp130 = einsum(t2, (0, 1, 2, 3), tmp12, (1, 2), (0, 3)) - tmp129 = einsum(tmp10, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp128 = einsum(tmp10, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp123 = einsum(tmp15, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp120 = einsum(tmp20, (0, 1, 2), v.xvv, (2, 3, 4), (0, 1, 3, 4)) - tmp119 = einsum(t2, (0, 1, 2, 3), tmp1, (1, 4, 3, 5), (0, 2, 5, 4)) - tmp117 = einsum(tmp23, (0, 1, 2), v.xvv, (2, 3, 4), (0, 1, 3, 4)) - tmp114 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp113 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp111 = einsum(tmp47, (0, 1), t1, (1, 2), (0, 2)) - tmp110 = einsum(tmp46, (0, 1), t1, (1, 2), (0, 2)) - tmp109 = einsum(t2, (0, 1, 2, 3), tmp49, (4, 0, 1, 3), (4, 2)) - tmp108 = einsum(t2, (0, 1, 2, 3), tmp49, (4, 0, 1, 2), (4, 3)) - tmp102 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - tmp101 = einsum(tmp84, (0, 1), t1, (1, 2), (0, 2)) - tmp100 = einsum(tmp83, (0, 1), t1, (1, 2), (0, 2)) - tmp94 = einsum(tmp72, (0, 1), t1, (1, 2), (0, 2)) - tmp93 = einsum(tmp74, (0, 1), t1, (1, 2), (0, 2)) - tmp92 = einsum(tmp76, (0, 1, 2, 3), t2, (2, 1, 3, 4), (0, 4)) - tmp91 = einsum(tmp76, (0, 1, 2, 3), t2, (2, 1, 4, 3), (0, 4)) - tmp89 = einsum(tmp63, (0, 1), t1, (0, 2), (1, 2)) - tmp81 = einsum(v.xov, (0, 1, 2), tmp7, (3, 4, 0), (3, 1, 2, 4)) - tmp80 = einsum(tmp7, (0, 1, 2), tmp9, (3, 0, 2), (3, 1)) - tmp79 = einsum(t1, (0, 1), tmp5, (2, 1), (0, 2)) - tmp77 = einsum(tmp76, (0, 1, 2, 3), t2, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp71 = einsum(tmp20, (0, 1, 2), v.xvv, (2, 3, 1), (0, 3)) - tmp70 = einsum(tmp23, (0, 1, 2), v.xvv, (2, 3, 1), (0, 3)) - tmp68 = einsum(v.xvv, (0, 1, 2), tmp9, (3, 4, 0), (3, 4, 1, 2)) - tmp66 = einsum(tmp7, (0, 1, 2), v.xvv, (2, 3, 4), (0, 3, 4, 1)) - tmp64 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp62 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp51 = einsum(tmp49, (0, 1, 2, 3), t2, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp45 = einsum(tmp7, (0, 1, 2), v.xoo, (2, 3, 0), (3, 1)) - tmp44 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp39 = einsum(tmp15, (0, 1, 2, 3), t2, (4, 0, 3, 5), (4, 1, 5, 2)) - tmp36 = einsum(tmp1, (0, 1, 2, 3), t2, (4, 0, 2, 5), (4, 5, 3, 1)) - tmp24 = einsum(tmp23, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp21 = einsum(tmp20, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp8 = einsum(tmp7, (0, 1, 2), v.xov, (2, 0, 3), (3, 1)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp100": tmp100, f"tmp101": tmp101, f"tmp102": tmp102, f"tmp108": tmp108, f"tmp109": tmp109, f"tmp110": tmp110, f"tmp111": tmp111, f"tmp113": tmp113, f"tmp114": tmp114, f"tmp117": tmp117, f"tmp119": tmp119, f"tmp12": tmp12, f"tmp120": tmp120, f"tmp123": tmp123, f"tmp128": tmp128, f"tmp129": tmp129, f"tmp130": tmp130, f"tmp131": tmp131, f"tmp132": tmp132, f"tmp136": tmp136, f"tmp15": tmp15, f"tmp20": tmp20, f"tmp21": tmp21, f"tmp23": tmp23, f"tmp24": tmp24, f"tmp36": tmp36, f"tmp39": tmp39, f"tmp44": tmp44, f"tmp45": tmp45, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp51": tmp51, f"tmp62": tmp62, f"tmp63": tmp63, f"tmp64": tmp64, f"tmp66": tmp66, f"tmp68": tmp68, f"tmp7": tmp7, f"tmp70": tmp70, f"tmp71": tmp71, f"tmp72": tmp72, f"tmp74": tmp74, f"tmp76": tmp76, f"tmp77": tmp77, f"tmp79": tmp79, f"tmp8": tmp8, f"tmp80": tmp80, f"tmp81": tmp81, f"tmp83": tmp83, f"tmp84": tmp84, f"tmp89": tmp89, f"tmp9": tmp9, f"tmp91": tmp91, f"tmp92": tmp92, f"tmp93": tmp93, f"tmp94": tmp94} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:02:54.944078. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp14 = np.copy(f.ov) * 0.5 - tmp14 += ints.tmp12 - tmp14 += ints.tmp10 * -0.5 - tmp7 = np.copy(ints.tmp49) - del ints.tmp49 - tmp7 += np.transpose(ints.tmp76, (0, 2, 1, 3)) - del ints.tmp76 - tmp0 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp0 += np.transpose(r2, (2, 1, 0)) * -0.5 - tmp1 = np.copy(f.ov) - tmp1 += ints.tmp12 * 2 - tmp1 += ints.tmp10 * -1 - del ints.tmp10 - tmp6 = einsum(ints.tmp15, (0, 1, 2, 3), r2, (3, 2, 4), (0, 1, 4)) - tmp18 = np.copy(ints.tmp132) - del ints.tmp132 - tmp18 += ints.tmp15 * 0.5 - tmp18 += np.transpose(ints.tmp81, (0, 1, 3, 2)) * 0.5 - del ints.tmp81 - tmp18 += ints.tmp123 * -0.5 - tmp18 += ints.tmp136 * -0.5 - del ints.tmp136 - tmp9 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp9 += einsum(t1, (0, 1), r1, (2,), (0, 1, 2)) * -1 - tmp12 = np.copy(ints.tmp9) - del ints.tmp9 - tmp12 += np.transpose(v.xoo, (1, 2, 0)) - tmp2 = np.copy(np.transpose(r2, (2, 0, 1))) * -1 - tmp2 += np.transpose(r2, (2, 1, 0)) * 2 - tmp15 = einsum(t1, (0, 1), tmp14, (0, 2), (1, 2)) * 2 - del tmp14 - tmp17 = np.copy(ints.tmp117) * 2 - del ints.tmp117 - tmp17 += np.transpose(ints.tmp1, (0, 3, 2, 1)) - tmp17 += np.transpose(ints.tmp51, (0, 1, 3, 2)) - del ints.tmp51 - tmp17 += np.transpose(ints.tmp66, (0, 3, 1, 2)) - del ints.tmp66 - tmp17 += np.transpose(ints.tmp77, (0, 2, 3, 1)) - del ints.tmp77 - tmp17 += ints.tmp119 * -1 - del ints.tmp119 - tmp17 += ints.tmp120 * -1 - del ints.tmp120 - tmp17 += np.transpose(ints.tmp36, (0, 3, 2, 1)) * -1 - del ints.tmp36 - tmp5 = einsum(ints.tmp1, (0, 1, 2, 3), r2, (3, 2, 4), (0, 4, 1)) - tmp20 = np.copy(f.oo) - tmp20 += np.transpose(ints.tmp47, (1, 0)) * 2 - del ints.tmp47 - tmp20 += ints.tmp63 - del ints.tmp63 - tmp20 += np.transpose(ints.tmp74, (1, 0)) * 2 - del ints.tmp74 - tmp20 += np.transpose(ints.tmp84, (1, 0)) * 2 - del ints.tmp84 - tmp20 += np.transpose(ints.tmp46, (1, 0)) * -1 - del ints.tmp46 - tmp20 += np.transpose(ints.tmp72, (1, 0)) * -1 - del ints.tmp72 - tmp20 += np.transpose(ints.tmp83, (1, 0)) * -1 - del ints.tmp83 - tmp8 = np.copy(ints.tmp123) - tmp8 += ints.tmp44 * 0.5 - tmp8 += ints.tmp68 * 0.5 - tmp8 += ints.tmp39 * -0.5 - tmp8 += einsum(tmp7, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) * -0.5 - tmp21 = einsum(tmp0, (0, 1, 2), ints.tmp15, (0, 3, 1, 2), (3,)) * -2 - tmp21 += einsum(r1, (0,), tmp1, (1, 0), (1,)) - tmp10 = np.copy(ints.tmp44) - del ints.tmp44 - tmp10 += ints.tmp68 - del ints.tmp68 - tmp10 += ints.tmp39 * -1 - del ints.tmp39 - tmp19 = einsum(ints.tmp1, (0, 1, 2, 3), r2, (2, 3, 4), (4, 0, 1)) * -1 - tmp19 += einsum(t1, (0, 1), tmp6, (2, 0, 3), (3, 2, 1)) - tmp19 += einsum(tmp9, (0, 1, 2), tmp7, (3, 0, 4, 2), (3, 4, 1)) - del tmp7 - tmp19 += einsum(tmp18, (0, 1, 2, 3), r1, (3,), (0, 1, 2)) * 2 - del tmp18 - tmp22 = np.copy(ints.tmp101) * 2 - del ints.tmp101 - tmp22 += ints.tmp102 - del ints.tmp102 - tmp22 += ints.tmp109 * 2 - del ints.tmp109 - tmp22 += ints.tmp111 * 2 - del ints.tmp111 - tmp22 += ints.tmp113 - del ints.tmp113 - tmp22 += ints.tmp129 * 2 - del ints.tmp129 - tmp22 += ints.tmp130 * 2 - del ints.tmp130 - tmp22 += ints.tmp45 - del ints.tmp45 - tmp22 += ints.tmp71 - del ints.tmp71 - tmp22 += ints.tmp80 - del ints.tmp80 - tmp22 += ints.tmp89 - del ints.tmp89 - tmp22 += ints.tmp91 * 2 - del ints.tmp91 - tmp22 += ints.tmp93 * 2 - del ints.tmp93 - tmp22 += f.ov * -1 - tmp22 += ints.tmp100 * -1 - del ints.tmp100 - tmp22 += ints.tmp108 * -1 - del ints.tmp108 - tmp22 += ints.tmp110 * -1 - del ints.tmp110 - tmp22 += ints.tmp114 * -2 - del ints.tmp114 - tmp22 += ints.tmp128 * -1 - del ints.tmp128 - tmp22 += ints.tmp12 * -2 - del ints.tmp12 - tmp22 += ints.tmp131 * -4 - del ints.tmp131 - tmp22 += ints.tmp62 * -1 - del ints.tmp62 - tmp22 += ints.tmp70 * -2 - del ints.tmp70 - tmp22 += ints.tmp79 * -2 - del ints.tmp79 - tmp22 += ints.tmp92 * -1 - del ints.tmp92 - tmp22 += ints.tmp94 * -1 - del ints.tmp94 - tmp13 = np.copy(ints.tmp23) * 2 - del ints.tmp23 - tmp13 += ints.tmp7 - del ints.tmp7 - tmp13 += np.transpose(v.xov, (1, 2, 0)) - tmp13 += ints.tmp20 * -1 - del ints.tmp20 - tmp13 += einsum(tmp12, (0, 1, 2), t1, (1, 3), (0, 3, 2)) * -1 - del tmp12 - tmp11 = einsum(tmp2, (0, 1, 2), v.xov, (3, 0, 2), (1, 3)) * 0.5 - tmp16 = np.copy(np.transpose(ints.tmp24, (1, 0))) * 2 - tmp16 += ints.tmp8 - tmp16 += f.vv * -1 - tmp16 += np.transpose(ints.tmp21, (1, 0)) * -1 - tmp16 += np.transpose(ints.tmp5, (1, 0)) * -2 - tmp16 += np.transpose(tmp15, (1, 0)) - del tmp15 - tmp4 = einsum(tmp0, (0, 1, 2), ints.tmp15, (0, 3, 1, 2), (3,)) * -1 - del ints.tmp15 - tmp4 += einsum(r1, (0,), tmp1, (1, 0), (1,)) * 0.5 - tmp3 = np.copy(f.vv) - tmp3 += np.transpose(ints.tmp21, (1, 0)) - del ints.tmp21 - tmp3 += np.transpose(ints.tmp5, (1, 0)) * 2 - del ints.tmp5 - tmp3 += np.transpose(ints.tmp24, (1, 0)) * -2 - del ints.tmp24 - tmp3 += ints.tmp8 * -1 - del ints.tmp8 - r2new = einsum(r2, (0, 1, 2), ints.tmp123, (3, 2, 4, 1), (4, 0, 3)) - del ints.tmp123 - r2new += einsum(t1, (0, 1), tmp5, (0, 2, 3), (1, 3, 2)) * -1 - del tmp5 - r2new += einsum(ints.tmp64, (0, 1, 2, 3), r2, (1, 3, 4), (2, 0, 4)) - del ints.tmp64 - r2new += einsum(tmp6, (0, 1, 2), t2, (1, 0, 3, 4), (3, 4, 2)) - del tmp6 - r2new += einsum(tmp8, (0, 1, 2, 3), r2, (3, 4, 1), (2, 4, 0)) * -2 - del tmp8 - r2new += einsum(tmp10, (0, 1, 2, 3), tmp9, (1, 4, 3), (4, 2, 0)) * -1 - del tmp9, tmp10 - r2new += einsum(tmp11, (0, 1), tmp13, (2, 3, 1), (3, 0, 2)) * 2 - del tmp11, tmp13 - r2new += einsum(r2, (0, 1, 2), tmp16, (0, 3), (3, 1, 2)) * -1 - r2new += einsum(tmp16, (0, 1), r2, (2, 0, 3), (2, 1, 3)) * -1 - del tmp16 - r2new += einsum(r1, (0,), tmp17, (1, 2, 0, 3), (2, 3, 1)) * -1 - del tmp17 - r2new += einsum(tmp19, (0, 1, 2), t1, (1, 3), (2, 3, 0)) - del tmp19 - r2new += einsum(r2, (0, 1, 2), tmp20, (2, 3), (0, 1, 3)) * -1 - del tmp20 - r2new += einsum(t2, (0, 1, 2, 3), tmp21, (1,), (2, 3, 0)) - del tmp21 - r2new += einsum(tmp22, (0, 1), r1, (2,), (1, 2, 0)) - del tmp22 - r1new = einsum(tmp0, (0, 1, 2), ints.tmp1, (0, 3, 2, 1), (3,)) * -2 - del ints.tmp1, tmp0 - r1new += einsum(tmp1, (0, 1), tmp2, (0, 2, 1), (2,)) * -1 - del tmp1, tmp2 - r1new += einsum(tmp3, (0, 1), r1, (0,), (1,)) - del tmp3 - r1new += einsum(tmp4, (0,), t1, (0, 1), (1,)) * -2 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:04:15.547381. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp0 : array - tmp1 : array - tmp10 : array - tmp101 : array - tmp102 : array - tmp103 : array - tmp106 : array - tmp107 : array - tmp109 : array - tmp111 : array - tmp114 : array - tmp115 : array - tmp117 : array - tmp119 : array - tmp120 : array - tmp123 : array - tmp125 : array - tmp128 : array - tmp13 : array - tmp130 : array - tmp133 : array - tmp134 : array - tmp139 : array - tmp14 : array - tmp145 : array - tmp149 : array - tmp150 : array - tmp16 : array - tmp177 : array - tmp178 : array - tmp18 : array - tmp180 : array - tmp19 : array - tmp2 : array - tmp22 : array - tmp25 : array - tmp26 : array - tmp28 : array - tmp3 : array - tmp30 : array - tmp32 : array - tmp33 : array - tmp35 : array - tmp36 : array - tmp38 : array - tmp4 : array - tmp41 : array - tmp44 : array - tmp46 : array - tmp48 : array - tmp50 : array - tmp52 : array - tmp55 : array - tmp59 : array - tmp6 : array - tmp62 : array - tmp63 : array - tmp65 : array - tmp68 : array - tmp71 : array - tmp74 : array - tmp77 : array - tmp80 : array - tmp83 : array - tmp86 : array - tmp88 : array - tmp9 : array - tmp91 : array - tmp93 : array - tmp95 : array - tmp98 : array - """ - - tmp15 = einsum(t1, (0, 1), v.xov, (2, 0, 1), (2,)) - tmp13 = einsum(v.xov, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp22 = einsum(tmp15, (0,), v.xov, (0, 1, 2), (1, 2)) - tmp62 = einsum(v.xov, (0, 1, 2), tmp13, (1, 3, 0), (3, 2)) - tmp101 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp32 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 2), (0, 3, 4)) - tmp35 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 3), (0, 2, 4)) - tmp25 = einsum(t1, (0, 1), v.xvv, (2, 3, 1), (0, 3, 2)) - tmp133 = einsum(tmp13, (0, 1, 2), tmp13, (3, 4, 2), (0, 3, 1, 4)) - tmp107 = einsum(tmp22, (0, 1), t1, (2, 1), (2, 0)) - tmp106 = einsum(t1, (0, 1), tmp62, (2, 1), (0, 2)) - tmp119 = einsum(v.xvv, (0, 1, 2), tmp15, (0,), (1, 2)) - tmp114 = einsum(v.xoo, (0, 1, 2), tmp13, (3, 4, 0), (3, 1, 2, 4)) - tmp16 = einsum(tmp15, (0,), v.xoo, (0, 1, 2), (1, 2)) - del tmp15 - tmp14 = einsum(v.xoo, (0, 1, 2), tmp13, (2, 3, 0), (1, 3)) - tmp102 = einsum(t2, (0, 1, 2, 3), tmp101, (4, 5, 2, 3), (0, 1, 4, 5)) - tmp33 = einsum(tmp32, (0, 1, 2), v.xov, (2, 3, 1), (0, 3)) - tmp36 = einsum(v.xov, (0, 1, 2), tmp35, (3, 2, 0), (3, 1)) - tmp28 = einsum(v.xov, (0, 1, 2), tmp13, (3, 4, 0), (3, 1, 4, 2)) - tmp58 = einsum(v.xov, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp10 = einsum(v.xov, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp18 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp0 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp180 = einsum(v.xov, (0, 1, 2), tmp35, (1, 3, 0), (3, 2)) - tmp178 = einsum(tmp32, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp177 = einsum(tmp25, (0, 1, 2), v.xov, (2, 0, 3), (3, 1)) - tmp150 = einsum(tmp101, (0, 1, 2, 3), t2, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp149 = einsum(tmp101, (0, 1, 2, 3), t2, (4, 0, 3, 5), (4, 1, 5, 2)) - tmp145 = einsum(tmp13, (0, 1, 2), v.xvv, (2, 3, 4), (0, 1, 3, 4)) - tmp139 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp134 = einsum(t1, (0, 1), tmp133, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp130 = einsum(tmp107, (0, 1), t1, (1, 2), (0, 2)) - tmp128 = einsum(t1, (0, 1), tmp106, (2, 0), (2, 1)) - tmp125 = einsum(tmp25, (0, 1, 2), tmp13, (3, 4, 2), (3, 0, 4, 1)) - tmp123 = einsum(tmp25, (0, 1, 2), tmp13, (3, 0, 2), (3, 1)) - tmp120 = einsum(t1, (0, 1), tmp119, (2, 1), (0, 2)) - tmp117 = einsum(t1, (0, 1), tmp114, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp115 = einsum(t1, (0, 1), tmp114, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp111 = einsum(tmp16, (0, 1), t1, (1, 2), (0, 2)) - tmp109 = einsum(t1, (0, 1), tmp14, (2, 0), (2, 1)) - tmp103 = einsum(t1, (0, 1), tmp102, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp98 = einsum(tmp33, (0, 1), t1, (1, 2), (0, 2)) - tmp95 = einsum(tmp36, (0, 1), t1, (1, 2), (0, 2)) - tmp93 = einsum(t2, (0, 1, 2, 3), tmp28, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp91 = einsum(t2, (0, 1, 2, 3), tmp28, (4, 5, 1, 2), (4, 0, 5, 3)) - tmp88 = einsum(tmp35, (0, 1, 2), tmp13, (3, 4, 2), (3, 0, 4, 1)) - tmp86 = einsum(tmp32, (0, 1, 2), tmp13, (3, 4, 2), (3, 0, 4, 1)) - tmp83 = einsum(t2, (0, 1, 2, 3), tmp28, (4, 1, 0, 2), (4, 3)) - tmp80 = einsum(t2, (0, 1, 2, 3), tmp28, (4, 1, 0, 3), (4, 2)) - tmp77 = einsum(t2, (0, 1, 2, 3), tmp22, (4, 3), (0, 1, 4, 2)) - tmp74 = einsum(t2, (0, 1, 2, 3), tmp62, (4, 3), (0, 1, 4, 2)) - tmp71 = einsum(t2, (0, 1, 2, 3), tmp22, (1, 3), (0, 2)) - tmp68 = einsum(tmp22, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp65 = einsum(tmp62, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp63 = einsum(tmp62, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp59 = einsum(tmp58, (0, 1, 2, 3), t2, (4, 5, 3, 1), (4, 5, 0, 2)) - del tmp58 - tmp55 = einsum(v.xvv, (0, 1, 2), tmp32, (3, 2, 0), (3, 1)) - tmp52 = einsum(v.xvv, (0, 1, 2), tmp35, (3, 2, 0), (3, 1)) - tmp50 = einsum(v.xoo, (0, 1, 2), tmp35, (3, 4, 0), (3, 1, 2, 4)) - tmp48 = einsum(tmp32, (0, 1, 2), v.xoo, (2, 3, 4), (0, 3, 4, 1)) - tmp46 = einsum(t2, (0, 1, 2, 3), tmp10, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp44 = einsum(t2, (0, 1, 2, 3), tmp10, (4, 1, 5, 2), (0, 4, 5, 3)) - tmp41 = einsum(tmp10, (0, 1, 2, 3), t2, (1, 2, 4, 3), (0, 4)) - tmp38 = einsum(tmp10, (0, 1, 2, 3), t2, (1, 2, 3, 4), (0, 4)) - tmp30 = einsum(tmp25, (0, 1, 2), v.xoo, (2, 3, 4), (0, 3, 4, 1)) - tmp26 = einsum(tmp25, (0, 1, 2), v.xoo, (2, 3, 0), (3, 1)) - tmp19 = einsum(t1, (0, 1), tmp18, (2, 0, 3, 4), (4, 2, 3, 1)) - tmp9 = einsum(tmp0, (0, 1), t1, (0, 2), (1, 2)) - tmp6 = einsum(f.ov, (0, 1), t2, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp4 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp3 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp2 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp1 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - - return {f"tmp0": tmp0, f"tmp1": tmp1, f"tmp10": tmp10, f"tmp101": tmp101, f"tmp102": tmp102, f"tmp103": tmp103, f"tmp106": tmp106, f"tmp107": tmp107, f"tmp109": tmp109, f"tmp111": tmp111, f"tmp114": tmp114, f"tmp115": tmp115, f"tmp117": tmp117, f"tmp119": tmp119, f"tmp120": tmp120, f"tmp123": tmp123, f"tmp125": tmp125, f"tmp128": tmp128, f"tmp13": tmp13, f"tmp130": tmp130, f"tmp133": tmp133, f"tmp134": tmp134, f"tmp139": tmp139, f"tmp14": tmp14, f"tmp145": tmp145, f"tmp149": tmp149, f"tmp150": tmp150, f"tmp16": tmp16, f"tmp177": tmp177, f"tmp178": tmp178, f"tmp18": tmp18, f"tmp180": tmp180, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp22": tmp22, f"tmp25": tmp25, f"tmp26": tmp26, f"tmp28": tmp28, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp35": tmp35, f"tmp36": tmp36, f"tmp38": tmp38, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp44": tmp44, f"tmp46": tmp46, f"tmp48": tmp48, f"tmp50": tmp50, f"tmp52": tmp52, f"tmp55": tmp55, f"tmp59": tmp59, f"tmp6": tmp6, f"tmp62": tmp62, f"tmp63": tmp63, f"tmp65": tmp65, f"tmp68": tmp68, f"tmp71": tmp71, f"tmp74": tmp74, f"tmp77": tmp77, f"tmp80": tmp80, f"tmp83": tmp83, f"tmp86": tmp86, f"tmp88": tmp88, f"tmp9": tmp9, f"tmp91": tmp91, f"tmp93": tmp93, f"tmp95": tmp95, f"tmp98": tmp98} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:04:15.604810. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp10 = einsum(r2, (0, 1, 2), t1, (3, 2), (0, 1, 3)) - tmp13 = np.copy(tmp10) * -1 - tmp13 += np.transpose(tmp10, (1, 0, 2)) * 2 - tmp0 = np.copy(r2) - tmp0 += np.transpose(r2, (1, 0, 2)) * -0.5 - tmp12 = np.copy(ints.tmp25) - del ints.tmp25 - tmp12 += ints.tmp35 * 2 - del ints.tmp35 - tmp12 += np.transpose(v.xov, (1, 2, 0)) - tmp12 += ints.tmp32 * -1 - del ints.tmp32 - tmp14 = np.copy(ints.tmp13) - del ints.tmp13 - tmp14 += np.transpose(v.xoo, (1, 2, 0)) - tmp16 = np.copy(f.ov) - tmp16 += ints.tmp22 * 2 - tmp16 += ints.tmp62 * -1 - del ints.tmp62 - tmp19 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp19 += t2 * -0.5 - tmp8 = np.copy(ints.tmp139) - tmp8 += ints.tmp145 - tmp8 += ints.tmp149 * -1 - tmp21 = np.copy(ints.tmp10) - tmp21 += np.transpose(ints.tmp28, (2, 0, 1, 3)) - tmp15 = einsum(tmp12, (0, 1, 2), tmp0, (0, 3, 1), (3, 2)) * -1 - del tmp12 - tmp15 += einsum(tmp13, (0, 1, 2), tmp14, (1, 2, 3), (0, 3)) * 0.5 - del tmp13, tmp14 - tmp18 = np.copy(f.oo) * 0.5 - tmp18 += np.transpose(ints.tmp0, (1, 0)) * 0.5 - tmp18 += ints.tmp107 - tmp18 += ints.tmp16 - tmp18 += ints.tmp36 - tmp18 += ints.tmp106 * -0.5 - tmp18 += ints.tmp14 * -0.5 - tmp18 += ints.tmp33 * -0.5 - tmp17 = np.copy(np.transpose(ints.tmp177, (1, 0))) - del ints.tmp177 - tmp17 += ints.tmp180 * 2 - del ints.tmp180 - tmp17 += f.vv * -1 - tmp17 += ints.tmp119 * -2 - del ints.tmp119 - tmp17 += ints.tmp178 * -1 - del ints.tmp178 - tmp17 += einsum(tmp16, (0, 1), t1, (0, 2), (2, 1)) - tmp7 = np.copy(ints.tmp139) * 0.5 - del ints.tmp139 - tmp7 += ints.tmp145 * 0.5 - del ints.tmp145 - tmp7 += ints.tmp150 - tmp7 += ints.tmp149 * -0.5 - del ints.tmp149 - tmp20 = einsum(r2, (0, 1, 2), tmp19, (0, 1, 3, 2), (3,)) - del tmp19 - tmp9 = np.copy(ints.tmp102) - del ints.tmp102 - tmp9 += np.transpose(ints.tmp114, (0, 1, 3, 2)) - tmp9 += ints.tmp133 - del ints.tmp133 - tmp9 += np.transpose(ints.tmp18, (2, 3, 1, 0)) - del ints.tmp18 - tmp11 = np.copy(ints.tmp10) - tmp11 += np.transpose(ints.tmp28, (0, 2, 1, 3)) - tmp4 = np.copy(ints.tmp111) * 2 - del ints.tmp111 - tmp4 += ints.tmp123 - del ints.tmp123 - tmp4 += ints.tmp130 * 2 - del ints.tmp130 - tmp4 += ints.tmp1 - del ints.tmp1 - tmp4 += ints.tmp26 - del ints.tmp26 - tmp4 += ints.tmp3 - del ints.tmp3 - tmp4 += ints.tmp41 * 2 - del ints.tmp41 - tmp4 += ints.tmp55 - del ints.tmp55 - tmp4 += ints.tmp65 * 2 - del ints.tmp65 - tmp4 += ints.tmp68 * 2 - del ints.tmp68 - tmp4 += ints.tmp80 * 2 - del ints.tmp80 - tmp4 += ints.tmp95 * 2 - del ints.tmp95 - tmp4 += ints.tmp9 - del ints.tmp9 - tmp4 += f.ov * -1 - tmp4 += ints.tmp109 * -1 - del ints.tmp109 - tmp4 += ints.tmp120 * -2 - del ints.tmp120 - tmp4 += ints.tmp128 * -1 - del ints.tmp128 - tmp4 += ints.tmp22 * -2 - del ints.tmp22 - tmp4 += ints.tmp2 * -1 - del ints.tmp2 - tmp4 += ints.tmp38 * -1 - del ints.tmp38 - tmp4 += ints.tmp4 * -2 - del ints.tmp4 - tmp4 += ints.tmp52 * -2 - del ints.tmp52 - tmp4 += ints.tmp63 * -1 - del ints.tmp63 - tmp4 += ints.tmp71 * -4 - del ints.tmp71 - tmp4 += ints.tmp83 * -1 - del ints.tmp83 - tmp4 += ints.tmp98 * -1 - del ints.tmp98 - tmp6 = np.copy(f.oo) - tmp6 += np.transpose(ints.tmp0, (1, 0)) - del ints.tmp0 - tmp6 += ints.tmp107 * 2 - del ints.tmp107 - tmp6 += np.transpose(ints.tmp16, (1, 0)) * 2 - del ints.tmp16 - tmp6 += ints.tmp36 * 2 - del ints.tmp36 - tmp6 += ints.tmp106 * -1 - del ints.tmp106 - tmp6 += ints.tmp14 * -1 - del ints.tmp14 - tmp6 += ints.tmp33 * -1 - del ints.tmp33 - tmp2 = np.copy(r2) * -1 - tmp2 += np.transpose(r2, (1, 0, 2)) * 2 - tmp3 = np.copy(ints.tmp117) - del ints.tmp117 - tmp3 += np.transpose(ints.tmp46, (0, 2, 1, 3)) - del ints.tmp46 - tmp3 += np.transpose(ints.tmp48, (0, 2, 1, 3)) - del ints.tmp48 - tmp3 += np.transpose(ints.tmp74, (0, 2, 1, 3)) - del ints.tmp74 - tmp3 += np.transpose(ints.tmp91, (0, 2, 1, 3)) - del ints.tmp91 - tmp3 += ints.tmp30 * -1 - del ints.tmp30 - tmp3 += np.transpose(ints.tmp50, (0, 2, 1, 3)) * -2 - del ints.tmp50 - tmp3 += np.transpose(ints.tmp6, (1, 0, 2, 3)) * -1 - del ints.tmp6 - tmp3 += np.transpose(ints.tmp77, (0, 2, 1, 3)) * -2 - del ints.tmp77 - tmp1 = np.copy(ints.tmp103) - del ints.tmp103 - tmp1 += ints.tmp115 - del ints.tmp115 - tmp1 += ints.tmp134 - del ints.tmp134 - tmp1 += np.transpose(ints.tmp19, (0, 2, 1, 3)) - del ints.tmp19 - tmp1 += ints.tmp44 - del ints.tmp44 - tmp1 += ints.tmp86 - del ints.tmp86 - tmp1 += ints.tmp93 - del ints.tmp93 - tmp1 += np.transpose(ints.tmp10, (1, 2, 0, 3)) * -1 - del ints.tmp10 - tmp1 += ints.tmp125 * -1 - del ints.tmp125 - tmp1 += ints.tmp28 * -1 - del ints.tmp28 - tmp1 += ints.tmp59 * -1 - del ints.tmp59 - tmp1 += ints.tmp88 * -2 - del ints.tmp88 - tmp5 = np.copy(r2) * 2 - tmp5 += np.transpose(r2, (1, 0, 2)) * -1 - r2new = einsum(r2, (0, 1, 2), ints.tmp114, (1, 0, 3, 4), (3, 4, 2)) - del ints.tmp114 - r2new += einsum(ints.tmp150, (0, 1, 2, 3), r2, (4, 0, 2), (1, 4, 3)) - del ints.tmp150 - r2new += einsum(r2, (0, 1, 2), tmp7, (0, 3, 2, 4), (3, 1, 4)) * -2 - del tmp7 - r2new += einsum(r2, (0, 1, 2), tmp8, (1, 3, 2, 4), (0, 3, 4)) * -1 - del tmp8 - r2new += einsum(tmp9, (0, 1, 2, 3), r2, (0, 1, 4), (2, 3, 4)) - del tmp9 - r2new += einsum(tmp11, (0, 1, 2, 3), tmp10, (0, 4, 2), (1, 4, 3)) - r2new += einsum(tmp10, (0, 1, 2), tmp11, (1, 3, 2, 4), (0, 3, 4)) - del tmp10, tmp11 - r2new += einsum(tmp15, (0, 1), v.xov, (1, 2, 3), (2, 0, 3)) * -2 - del tmp15 - r2new += einsum(r2, (0, 1, 2), tmp17, (2, 3), (0, 1, 3)) * -1 - del tmp17 - r2new += einsum(tmp18, (0, 1), r2, (0, 2, 3), (1, 2, 3)) * -2 - r2new += einsum(r2, (0, 1, 2), tmp18, (1, 3), (0, 3, 2)) * -2 - del tmp18 - r2new += einsum(tmp20, (0,), ints.tmp101, (1, 2, 3, 0), (1, 2, 3)) * -2 - del tmp20, ints.tmp101 - r2new += einsum(r1, (0,), tmp21, (1, 0, 2, 3), (2, 1, 3)) - del tmp21 - r2new += einsum(r1, (0,), tmp16, (1, 2), (1, 0, 2)) * -1 - del tmp16 - r1new = einsum(tmp0, (0, 1, 2), tmp1, (1, 0, 3, 2), (3,)) * -2 - del tmp0, tmp1 - r1new += einsum(tmp2, (0, 1, 2), tmp3, (1, 3, 0, 2), (3,)) * -1 - del tmp2, tmp3 - r1new += einsum(tmp4, (0, 1), tmp5, (0, 2, 1), (2,)) - del tmp4, tmp5 - r1new += einsum(r1, (0,), tmp6, (0, 1), (1,)) * -1 - del tmp6 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:05:39.663415. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp100 : array - tmp102 : array - tmp105 : array - tmp107 : array - tmp11 : array - tmp110 : array - tmp111 : array - tmp113 : array - tmp114 : array - tmp12 : array - tmp120 : array - tmp123 : array - tmp125 : array - tmp127 : array - tmp129 : array - tmp130 : array - tmp132 : array - tmp133 : array - tmp16 : array - tmp163 : array - tmp18 : array - tmp19 : array - tmp2 : array - tmp20 : array - tmp23 : array - tmp25 : array - tmp29 : array - tmp3 : array - tmp31 : array - tmp34 : array - tmp35 : array - tmp37 : array - tmp38 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp44 : array - tmp47 : array - tmp50 : array - tmp53 : array - tmp56 : array - tmp58 : array - tmp61 : array - tmp63 : array - tmp65 : array - tmp66 : array - tmp67 : array - tmp69 : array - tmp72 : array - tmp75 : array - tmp82 : array - tmp83 : array - tmp86 : array - tmp89 : array - tmp92 : array - tmp93 : array - tmp96 : array - tmp97 : array - """ - - tmp15 = einsum(t1, (0, 1), v.xov, (2, 0, 1), (2,)) - tmp65 = einsum(v.xov, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp20 = einsum(tmp15, (0,), v.xov, (0, 1, 2), (1, 2)) - tmp66 = einsum(tmp65, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp34 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 2), (0, 3, 4)) - tmp37 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 3), (0, 2, 4)) - tmp132 = einsum(t1, (0, 1), tmp20, (2, 1), (0, 2)) - tmp129 = einsum(t1, (0, 1), tmp66, (2, 1), (0, 2)) - tmp18 = einsum(t1, (0, 1), v.xvv, (2, 3, 1), (0, 3, 2)) - tmp16 = einsum(v.xvv, (0, 1, 2), tmp15, (0,), (1, 2)) - tmp113 = einsum(tmp15, (0,), v.xoo, (0, 1, 2), (1, 2)) - del tmp15 - tmp110 = einsum(v.xoo, (0, 1, 2), tmp65, (2, 3, 0), (1, 3)) - tmp25 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp96 = einsum(v.xov, (0, 1, 2), tmp34, (3, 2, 0), (3, 1)) - tmp92 = einsum(v.xov, (0, 1, 2), tmp37, (3, 2, 0), (3, 1)) - tmp82 = einsum(tmp65, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 1, 4)) - tmp12 = einsum(v.xov, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp40 = einsum(v.xov, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp10 = einsum(t1, (0, 1), f.ov, (2, 1), (2, 0)) - tmp163 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp133 = einsum(tmp132, (0, 1), t1, (1, 2), (0, 2)) - tmp130 = einsum(tmp129, (0, 1), t1, (1, 2), (0, 2)) - tmp127 = einsum(v.xov, (0, 1, 2), tmp18, (3, 4, 0), (3, 1, 2, 4)) - tmp125 = einsum(v.xvv, (0, 1, 2), tmp65, (3, 4, 0), (3, 4, 1, 2)) - tmp123 = einsum(tmp18, (0, 1, 2), tmp65, (3, 0, 2), (3, 1)) - tmp120 = einsum(t1, (0, 1), tmp16, (2, 1), (0, 2)) - tmp114 = einsum(t1, (0, 1), tmp113, (2, 0), (2, 1)) - tmp111 = einsum(tmp110, (0, 1), t1, (1, 2), (0, 2)) - tmp107 = einsum(t2, (0, 1, 2, 3), tmp25, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp105 = einsum(tmp25, (0, 1, 2, 3), t2, (4, 0, 3, 5), (4, 1, 5, 2)) - tmp102 = einsum(tmp37, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 1, 4)) - tmp100 = einsum(tmp34, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 1, 4)) - tmp97 = einsum(tmp96, (0, 1), t1, (1, 2), (0, 2)) - tmp93 = einsum(tmp92, (0, 1), t1, (1, 2), (0, 2)) - tmp89 = einsum(tmp82, (0, 1, 2, 3), t2, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp86 = einsum(t2, (0, 1, 2, 3), tmp82, (4, 1, 0, 2), (4, 3)) - tmp83 = einsum(t2, (0, 1, 2, 3), tmp82, (4, 1, 0, 3), (4, 2)) - tmp75 = einsum(t2, (0, 1, 2, 3), tmp20, (1, 3), (0, 2)) - tmp72 = einsum(tmp20, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp69 = einsum(t2, (0, 1, 2, 3), tmp66, (1, 3), (0, 2)) - tmp67 = einsum(tmp66, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp63 = einsum(t2, (0, 1, 2, 3), tmp12, (1, 3, 4, 5), (0, 2, 5, 4)) - tmp61 = einsum(tmp12, (0, 1, 2, 3), t2, (4, 0, 1, 5), (4, 5, 3, 2)) - tmp58 = einsum(v.xvv, (0, 1, 2), tmp37, (3, 4, 0), (3, 4, 1, 2)) - tmp56 = einsum(tmp34, (0, 1, 2), v.xvv, (2, 3, 4), (0, 1, 3, 4)) - tmp53 = einsum(v.xvv, (0, 1, 2), tmp34, (3, 2, 0), (3, 1)) - tmp50 = einsum(tmp37, (0, 1, 2), v.xvv, (2, 3, 1), (0, 3)) - tmp47 = einsum(t2, (0, 1, 2, 3), tmp40, (0, 4, 1, 5), (4, 2, 3, 5)) - tmp44 = einsum(tmp40, (0, 1, 2, 3), t2, (0, 2, 4, 3), (1, 4)) - tmp41 = einsum(tmp40, (0, 1, 2, 3), t2, (0, 2, 3, 4), (1, 4)) - tmp38 = einsum(v.xov, (0, 1, 2), tmp37, (1, 3, 0), (3, 2)) - tmp35 = einsum(tmp34, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) - tmp31 = einsum(tmp18, (0, 1, 2), v.xvv, (2, 3, 4), (0, 3, 4, 1)) - tmp29 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp23 = einsum(tmp18, (0, 1, 2), v.xoo, (2, 3, 0), (3, 1)) - tmp19 = einsum(tmp18, (0, 1, 2), v.xov, (2, 0, 3), (3, 1)) - tmp11 = einsum(tmp10, (0, 1), t1, (0, 2), (1, 2)) - tmp4 = einsum(f.ov, (0, 1), t2, (2, 0, 3, 1), (2, 3)) - tmp3 = einsum(f.ov, (0, 1), t2, (2, 0, 1, 3), (2, 3)) - tmp2 = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - tmp1 = einsum(f.oo, (0, 1), t1, (1, 2), (0, 2)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp100": tmp100, f"tmp102": tmp102, f"tmp105": tmp105, f"tmp107": tmp107, f"tmp11": tmp11, f"tmp110": tmp110, f"tmp111": tmp111, f"tmp113": tmp113, f"tmp114": tmp114, f"tmp12": tmp12, f"tmp120": tmp120, f"tmp123": tmp123, f"tmp125": tmp125, f"tmp127": tmp127, f"tmp129": tmp129, f"tmp130": tmp130, f"tmp132": tmp132, f"tmp133": tmp133, f"tmp16": tmp16, f"tmp163": tmp163, f"tmp18": tmp18, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp23": tmp23, f"tmp25": tmp25, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp31": tmp31, f"tmp34": tmp34, f"tmp35": tmp35, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp44": tmp44, f"tmp47": tmp47, f"tmp50": tmp50, f"tmp53": tmp53, f"tmp56": tmp56, f"tmp58": tmp58, f"tmp61": tmp61, f"tmp63": tmp63, f"tmp65": tmp65, f"tmp66": tmp66, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp72": tmp72, f"tmp75": tmp75, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp86": tmp86, f"tmp89": tmp89, f"tmp92": tmp92, f"tmp93": tmp93, f"tmp96": tmp96, f"tmp97": tmp97} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:05:39.714441. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp25 = np.copy(ints.tmp65) - del ints.tmp65 - tmp25 += np.transpose(v.xoo, (1, 2, 0)) - tmp16 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp16 += t2 * 2 - tmp19 = np.copy(f.ov) - tmp19 += ints.tmp20 * 2 - tmp19 += ints.tmp66 * -1 - del ints.tmp66 - tmp10 = einsum(r2, (0, 1, 2), t1, (3, 1), (2, 3, 0)) - tmp4 = np.copy(np.transpose(r2, (2, 0, 1))) * -0.5 - tmp4 += np.transpose(r2, (2, 1, 0)) - tmp26 = np.copy(ints.tmp18) - del ints.tmp18 - tmp26 += ints.tmp37 * 2 - del ints.tmp37 - tmp26 += np.transpose(v.xov, (1, 2, 0)) - tmp26 += ints.tmp34 * -1 - del ints.tmp34 - tmp26 += einsum(tmp25, (0, 1, 2), t1, (1, 3), (0, 3, 2)) * -1 - del tmp25 - tmp22 = np.copy(ints.tmp40) - tmp22 += np.transpose(ints.tmp82, (0, 2, 1, 3)) - tmp17 = einsum(r2, (0, 1, 2), tmp16, (2, 3, 0, 1), (3,)) - del tmp16 - tmp15 = einsum(r1, (0,), t1, (1, 0), (1,)) - tmp28 = einsum(tmp19, (0, 1), t1, (0, 2), (2, 1)) - tmp11 = einsum(tmp10, (0, 1, 2), t1, (3, 2), (0, 3, 1)) - tmp0 = np.copy(np.transpose(r2, (2, 0, 1))) - tmp0 += np.transpose(r2, (2, 1, 0)) * -0.5 - tmp21 = einsum(t2, (0, 1, 2, 3), r2, (2, 3, 4), (4, 0, 1)) - tmp30 = np.copy(f.oo) - tmp30 += np.transpose(ints.tmp10, (1, 0)) - del ints.tmp10 - tmp30 += ints.tmp113 * 2 - del ints.tmp113 - tmp30 += ints.tmp132 * 2 - del ints.tmp132 - tmp30 += ints.tmp92 * 2 - del ints.tmp92 - tmp30 += ints.tmp110 * -1 - del ints.tmp110 - tmp30 += ints.tmp129 * -1 - del ints.tmp129 - tmp30 += ints.tmp96 * -1 - del ints.tmp96 - tmp27 = einsum(tmp4, (0, 1, 2), tmp26, (0, 2, 3), (1, 3)) * -1 - del tmp26 - tmp24 = np.copy(ints.tmp105) - tmp24 += ints.tmp125 * -1 - tmp24 += ints.tmp29 * -1 - tmp24 += einsum(t1, (0, 1), tmp22, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp18 = np.copy(tmp15) - del tmp15 - tmp18 += tmp17 * -1 - del tmp17 - tmp29 = np.copy(np.transpose(ints.tmp19, (1, 0))) - tmp29 += ints.tmp38 * 2 - tmp29 += f.vv * -1 - tmp29 += ints.tmp16 * -2 - tmp29 += ints.tmp35 * -1 - tmp29 += tmp28 - del tmp28 - tmp23 = np.copy(ints.tmp107) - tmp23 += ints.tmp125 * 0.5 - tmp23 += ints.tmp29 * 0.5 - tmp23 += ints.tmp105 * -0.5 - tmp23 += einsum(t1, (0, 1), tmp22, (2, 3, 0, 4), (2, 3, 1, 4)) * -0.5 - del tmp22 - tmp20 = einsum(t1, (0, 1), r2, (1, 2, 3), (3, 0, 2)) - tmp8 = np.copy(ints.tmp102) * 2 - del ints.tmp102 - tmp8 += np.transpose(ints.tmp127, (0, 1, 3, 2)) - del ints.tmp127 - tmp8 += ints.tmp25 - tmp8 += ints.tmp100 * -1 - del ints.tmp100 - tmp8 += ints.tmp107 * -1 - tmp12 = np.copy(tmp11) - tmp12 += np.transpose(tmp11, (0, 2, 1)) * -0.5 - tmp6 = np.copy(np.transpose(ints.tmp125, (0, 1, 3, 2))) - del ints.tmp125 - tmp6 += np.transpose(ints.tmp29, (0, 1, 3, 2)) - del ints.tmp29 - tmp6 += ints.tmp105 * -1 - del ints.tmp105 - tmp2 = np.copy(np.transpose(r2, (2, 0, 1))) * -1 - tmp2 += np.transpose(r2, (2, 1, 0)) * 2 - tmp3 = np.copy(ints.tmp47) - del ints.tmp47 - tmp3 += ints.tmp58 * 2 - del ints.tmp58 - tmp3 += ints.tmp56 * -1 - del ints.tmp56 - tmp3 += np.transpose(ints.tmp63, (0, 1, 3, 2)) * -1 - del ints.tmp63 - tmp1 = np.copy(ints.tmp12) - tmp1 += ints.tmp31 - del ints.tmp31 - tmp1 += np.transpose(ints.tmp89, (0, 3, 1, 2)) - del ints.tmp89 - tmp1 += np.transpose(ints.tmp61, (0, 2, 1, 3)) * -1 - del ints.tmp61 - tmp14 = np.copy(f.vv) - tmp14 += np.transpose(ints.tmp16, (1, 0)) * 2 - del ints.tmp16 - tmp14 += ints.tmp35 - del ints.tmp35 - tmp14 += np.transpose(ints.tmp19, (1, 0)) * -1 - del ints.tmp19 - tmp14 += ints.tmp38 * -2 - del ints.tmp38 - tmp7 = einsum(tmp0, (0, 1, 2), t1, (3, 2), (0, 3, 1)) * 2 - tmp5 = einsum(tmp4, (0, 1, 2), t1, (3, 2), (0, 3, 1)) - del tmp4 - tmp9 = np.copy(ints.tmp114) * 2 - del ints.tmp114 - tmp9 += ints.tmp11 - del ints.tmp11 - tmp9 += ints.tmp123 - del ints.tmp123 - tmp9 += ints.tmp133 * 2 - del ints.tmp133 - tmp9 += ints.tmp1 - del ints.tmp1 - tmp9 += ints.tmp23 - del ints.tmp23 - tmp9 += ints.tmp3 - del ints.tmp3 - tmp9 += ints.tmp44 * 2 - del ints.tmp44 - tmp9 += ints.tmp53 - del ints.tmp53 - tmp9 += ints.tmp69 * 2 - del ints.tmp69 - tmp9 += ints.tmp72 * 2 - del ints.tmp72 - tmp9 += ints.tmp83 * 2 - del ints.tmp83 - tmp9 += ints.tmp93 * 2 - del ints.tmp93 - tmp9 += f.ov * -1 - tmp9 += ints.tmp111 * -1 - del ints.tmp111 - tmp9 += ints.tmp120 * -2 - del ints.tmp120 - tmp9 += ints.tmp130 * -1 - del ints.tmp130 - tmp9 += ints.tmp20 * -2 - del ints.tmp20 - tmp9 += ints.tmp2 * -1 - del ints.tmp2 - tmp9 += ints.tmp41 * -1 - del ints.tmp41 - tmp9 += ints.tmp4 * -2 - del ints.tmp4 - tmp9 += ints.tmp50 * -2 - del ints.tmp50 - tmp9 += ints.tmp67 * -1 - del ints.tmp67 - tmp9 += ints.tmp75 * -4 - del ints.tmp75 - tmp9 += ints.tmp86 * -1 - del ints.tmp86 - tmp9 += ints.tmp97 * -1 - del ints.tmp97 - tmp13 = np.copy(tmp11) * -1 - tmp13 += np.transpose(tmp11, (0, 2, 1)) * 2 - r2new = einsum(ints.tmp107, (0, 1, 2, 3), r2, (4, 2, 0), (3, 4, 1)) - del ints.tmp107 - r2new += einsum(tmp10, (0, 1, 2), ints.tmp12, (1, 3, 2, 4), (3, 4, 0)) * -1 - del tmp10 - r2new += einsum(tmp20, (0, 1, 2), ints.tmp12, (1, 3, 2, 4), (4, 3, 0)) * -1 - del tmp20 - r2new += einsum(ints.tmp12, (0, 1, 2, 3), r1, (2,), (3, 1, 0)) * -1 - del ints.tmp12 - r2new += einsum(ints.tmp163, (0, 1, 2, 3), r2, (2, 3, 4), (1, 0, 4)) - del ints.tmp163 - r2new += einsum(ints.tmp25, (0, 1, 2, 3), tmp21, (4, 1, 0), (3, 2, 4)) - del tmp21 - r2new += einsum(tmp11, (0, 1, 2), ints.tmp25, (2, 1, 3, 4), (4, 3, 0)) - del tmp11 - r2new += einsum(r2, (0, 1, 2), tmp23, (2, 3, 0, 4), (4, 1, 3)) * -2 - del tmp23 - r2new += einsum(tmp24, (0, 1, 2, 3), r2, (4, 2, 0), (4, 3, 1)) - del tmp24 - r2new += einsum(v.xov, (0, 1, 2), tmp27, (3, 0), (2, 3, 1)) * -2 - del tmp27 - r2new += einsum(tmp29, (0, 1), r2, (0, 2, 3), (1, 2, 3)) * -1 - r2new += einsum(tmp29, (0, 1), r2, (2, 0, 3), (2, 1, 3)) * -1 - del tmp29 - r2new += einsum(r2, (0, 1, 2), tmp30, (2, 3), (0, 1, 3)) * -1 - del tmp30 - r2new += einsum(tmp18, (0,), ints.tmp25, (0, 1, 2, 3), (3, 2, 1)) - del ints.tmp25 - r2new += einsum(tmp19, (0, 1), r1, (2,), (1, 2, 0)) * -1 - r1new = einsum(tmp1, (0, 1, 2, 3), tmp0, (0, 3, 2), (1,)) * -2 - del tmp0, tmp1 - r1new += einsum(tmp3, (0, 1, 2, 3), tmp2, (0, 2, 1), (3,)) * -1 - del tmp3 - r1new += einsum(tmp5, (0, 1, 2), tmp6, (0, 1, 2, 3), (3,)) * 2 - del tmp5, tmp6 - r1new += einsum(tmp7, (0, 1, 2), tmp8, (0, 1, 2, 3), (3,)) - del tmp7, tmp8 - r1new += einsum(tmp2, (0, 1, 2), tmp9, (0, 2), (1,)) - del tmp2, tmp9 - r1new += einsum(tmp12, (0, 1, 2), ints.tmp82, (0, 2, 1, 3), (3,)) * -2 - del ints.tmp82, tmp12 - r1new += einsum(tmp13, (0, 1, 2), ints.tmp40, (0, 2, 1, 3), (3,)) * -1 - del ints.tmp40, tmp13 - r1new += einsum(tmp14, (0, 1), r1, (0,), (1,)) - del tmp14 - r1new += einsum(tmp18, (0,), tmp19, (0, 1), (1,)) * -1 - del tmp19, tmp18 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/RDFDCD.py b/ebcc/codegen/RDFDCD.py deleted file mode 100644 index da3e3ac8..00000000 --- a/ebcc/codegen/RDFDCD.py +++ /dev/null @@ -1,129 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:07:22.125856 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:07:22.686275. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp0 += t2 * 2 - tmp1 = einsum(tmp0, (0, 1, 2, 3), v.xov, (4, 0, 2), (1, 3, 4)) * 0.5 - del tmp0 - e_cc = einsum(tmp1, (0, 1, 2), v.xov, (2, 0, 1), ()) * 2 - del tmp1 - - return e_cc - -def update_amps(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:07:27.111378. - - Parameters - ---------- - f : array - Fock matrix. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t2new : array - Updated T2 residuals. - """ - - tmp6 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp6 += t2 * 2 - tmp7 = einsum(tmp6, (0, 1, 2, 3), v.xov, (4, 0, 2), (1, 3, 4)) - del tmp6 - tmp18 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp18 += t2 * 2 - tmp10 = einsum(v.xov, (0, 1, 2), tmp7, (3, 2, 0), (1, 3)) - tmp8 = einsum(v.xov, (0, 1, 2), tmp7, (1, 3, 0), (2, 3)) * 0.5 - del tmp7 - tmp1 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 2), (0, 3, 4)) - tmp2 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 3), (0, 2, 4)) - tmp14 = einsum(v.xvv, (0, 1, 2), v.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp19 = einsum(v.xov, (0, 1, 2), tmp18, (1, 3, 2, 4), (3, 4, 0)) - del tmp18 - tmp11 = einsum(t2, (0, 1, 2, 3), tmp10, (1, 4), (0, 4, 3, 2)) * 0.5 - del tmp10 - tmp9 = einsum(tmp8, (0, 1), t2, (2, 3, 0, 4), (2, 3, 4, 1)) - del tmp8 - tmp5 = einsum(tmp2, (0, 1, 2), tmp1, (3, 4, 2), (0, 3, 1, 4)) - tmp17 = einsum(t2, (0, 1, 2, 3), tmp14, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp20 = einsum(v.xov, (0, 1, 2), tmp19, (3, 4, 0), (1, 3, 2, 4)) - del tmp19 - tmp15 = einsum(t2, (0, 1, 2, 3), tmp14, (4, 1, 5, 2), (0, 4, 3, 5)) - del tmp14 - tmp13 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp4 = einsum(f.oo, (0, 1), t2, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp0 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp3 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp12 = np.copy(tmp5) * 2 - del tmp5 - tmp12 += np.transpose(tmp9, (1, 0, 2, 3)) - del tmp9 - tmp12 += np.transpose(tmp11, (0, 1, 3, 2)) - del tmp11 - tmp21 = np.copy(tmp17) - del tmp17 - tmp21 += np.transpose(tmp20, (1, 0, 3, 2)) * -1 - del tmp20 - tmp16 = np.copy(tmp13) - del tmp13 - tmp16 += tmp15 * -1 - del tmp15 - t2new = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (1, 3, 2, 4)) - t2new += einsum(tmp0, (0, 1, 2, 3), t2, (1, 3, 4, 5), (2, 0, 4, 5)) - del tmp0 - t2new += einsum(tmp1, (0, 1, 2), tmp1, (3, 4, 2), (0, 3, 1, 4)) - del tmp1 - t2new += einsum(tmp2, (0, 1, 2), tmp2, (3, 4, 2), (0, 3, 1, 4)) * 4 - del tmp2 - t2new += einsum(tmp3, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 2, 0)) - del tmp3 - t2new += np.transpose(tmp4, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp4, (1, 0, 2, 3)) * -1 - del tmp4 - t2new += tmp12 * -1 - t2new += np.transpose(tmp12, (1, 0, 3, 2)) * -1 - del tmp12 - t2new += np.transpose(tmp16, (0, 1, 3, 2)) - t2new += np.transpose(tmp16, (1, 0, 2, 3)) - del tmp16 - t2new += tmp21 * -1 - t2new += np.transpose(tmp21, (1, 0, 3, 2)) * -1 - del tmp21 - - return {f"t2new": t2new} - diff --git a/ebcc/codegen/RDFDCSD.py b/ebcc/codegen/RDFDCSD.py deleted file mode 100644 index 43101004..00000000 --- a/ebcc/codegen/RDFDCSD.py +++ /dev/null @@ -1,330 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:09:16.673466 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:09:17.810863. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp3 = einsum(v.xov, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp0 = einsum(t1, (0, 1), v.xov, (2, 0, 1), (2,)) - tmp1 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp1 += t2 * 2 - tmp4 = np.copy(f.ov) * 2 - tmp4 += einsum(v.xov, (0, 1, 2), tmp3, (1, 3, 0), (3, 2)) * -1 - del tmp3 - tmp2 = einsum(tmp0, (0,), t1, (1, 2), (1, 2, 0)) - del tmp0 - tmp2 += einsum(v.xov, (0, 1, 2), tmp1, (1, 3, 2, 4), (3, 4, 0)) * 0.5 - del tmp1 - e_cc = einsum(tmp2, (0, 1, 2), v.xov, (2, 0, 1), ()) * 2 - del tmp2 - e_cc += einsum(t1, (0, 1), tmp4, (0, 1), ()) - del tmp4 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:09:49.145269. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - """ - - tmp2 = einsum(v.xov, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp0 = einsum(t1, (0, 1), v.xov, (2, 0, 1), (2,)) - tmp29 = einsum(v.xov, (0, 1, 2), tmp2, (3, 4, 0), (3, 1, 4, 2)) - tmp31 = einsum(v.xoo, (0, 1, 2), v.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp1 = einsum(tmp0, (0,), v.xov, (0, 1, 2), (1, 2)) - tmp9 = einsum(v.xov, (0, 1, 2), tmp2, (1, 3, 0), (3, 2)) - tmp36 = np.copy(t2) - tmp36 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp18 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 2, 4), (3, 4, 0)) - tmp59 = np.copy(tmp29) * -1 - tmp59 += np.transpose(tmp29, (0, 2, 1, 3)) * 2 - tmp49 = einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp49 += np.transpose(t2, (0, 1, 3, 2)) * -2 - tmp49 += t2 - tmp17 = einsum(t1, (0, 1), v.xvv, (2, 3, 1), (0, 3, 2)) - tmp11 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp11 += t2 * 2 - tmp32 = np.copy(np.transpose(tmp31, (1, 0, 2, 3))) * -1 - tmp32 += np.transpose(tmp31, (2, 1, 0, 3)) * 2 - tmp34 = np.copy(tmp1) * 2 - tmp34 += tmp9 * -1 - tmp37 = einsum(v.xov, (0, 1, 2), tmp36, (1, 3, 4, 2), (3, 4, 0)) - del tmp36 - tmp5 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -1 - tmp5 += t2 * 2 - tmp57 = einsum(t2, (0, 1, 2, 3), tmp31, (4, 1, 5, 2), (0, 4, 5, 3)) - del tmp31 - tmp58 = einsum(tmp2, (0, 1, 2), tmp18, (3, 4, 2), (0, 3, 1, 4)) - tmp60 = einsum(tmp59, (0, 1, 2, 3), t2, (4, 2, 5, 3), (0, 1, 4, 5)) - del tmp59 - tmp50 = einsum(v.xov, (0, 1, 2), tmp49, (1, 3, 4, 2), (3, 4, 0)) - del tmp49 - tmp6 = einsum(v.xoo, (0, 1, 2), t1, (2, 3), (1, 3, 0)) - tmp12 = einsum(v.xoo, (0, 1, 2), tmp0, (0,), (1, 2)) - tmp63 = einsum(tmp2, (0, 1, 2), v.xoo, (2, 3, 0), (3, 1)) - tmp54 = einsum(tmp17, (0, 1, 2), v.xov, (2, 0, 3), (3, 1)) - tmp53 = einsum(tmp0, (0,), v.xvv, (0, 1, 2), (1, 2)) - tmp26 = einsum(v.xov, (0, 1, 2), tmp11, (1, 3, 2, 4), (3, 4, 0)) - tmp33 = einsum(t2, (0, 1, 2, 3), tmp32, (1, 4, 5, 3), (4, 5, 0, 2)) - del tmp32 - tmp35 = einsum(t2, (0, 1, 2, 3), tmp34, (4, 2), (4, 0, 1, 3)) - tmp30 = einsum(t2, (0, 1, 2, 3), tmp29, (4, 5, 1, 2), (4, 0, 5, 3)) - del tmp29 - tmp38 = einsum(v.xoo, (0, 1, 2), tmp37, (3, 4, 0), (1, 2, 3, 4)) - del tmp37 - tmp67 = einsum(v.xov, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp13 = einsum(v.xov, (0, 1, 2), tmp5, (1, 3, 2, 4), (3, 4, 0)) - tmp22 = einsum(v.xoo, (0, 1, 2), v.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp61 = np.copy(tmp57) - del tmp57 - tmp61 += tmp58 - del tmp58 - tmp61 += np.transpose(tmp60, (0, 2, 1, 3)) * -1 - del tmp60 - tmp51 = np.copy(tmp6) - tmp51 += tmp50 - del tmp50 - tmp64 = np.copy(np.transpose(tmp63, (1, 0))) * -1 - del tmp63 - tmp64 += np.transpose(tmp12, (1, 0)) * 2 - tmp55 = np.copy(np.transpose(tmp53, (1, 0))) * 2 - del tmp53 - tmp55 += tmp54 * -1 - del tmp54 - tmp20 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp45 = einsum(tmp17, (0, 1, 2), tmp2, (3, 4, 2), (3, 0, 4, 1)) - tmp24 = einsum(tmp2, (0, 1, 2), v.xvv, (2, 3, 4), (0, 1, 3, 4)) - tmp27 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp27 += tmp6 * -1 - tmp27 += tmp26 - del tmp26 - tmp41 = einsum(tmp34, (0, 1), t1, (2, 1), (0, 2)) - del tmp34 - tmp39 = np.copy(np.transpose(tmp30, (0, 2, 1, 3))) - del tmp30 - tmp39 += np.transpose(tmp33, (2, 1, 0, 3)) * -1 - del tmp33 - tmp39 += np.transpose(tmp35, (2, 0, 1, 3)) * -1 - del tmp35 - tmp39 += np.transpose(tmp38, (2, 1, 0, 3)) - del tmp38 - tmp68 = einsum(t2, (0, 1, 2, 3), tmp67, (4, 5, 3, 2), (0, 1, 4, 5)) - del tmp67 - tmp71 = einsum(v.xov, (0, 1, 2), tmp13, (1, 3, 0), (3, 2)) * 0.5 - tmp73 = einsum(v.xov, (0, 1, 2), tmp13, (3, 2, 0), (3, 1)) - tmp19 = einsum(v.xov, (0, 1, 2), t2, (3, 1, 4, 2), (3, 4, 0)) - tmp80 = einsum(v.xoo, (0, 1, 2), tmp2, (3, 4, 0), (3, 1, 2, 4)) - tmp76 = einsum(f.ov, (0, 1), t1, (2, 1), (0, 2)) - tmp78 = einsum(t2, (0, 1, 2, 3), f.ov, (4, 3), (4, 0, 1, 2)) - tmp48 = einsum(tmp22, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp62 = einsum(t1, (0, 1), tmp61, (2, 3, 0, 4), (2, 3, 4, 1)) - del tmp61 - tmp52 = einsum(v.xov, (0, 1, 2), tmp51, (3, 4, 0), (3, 1, 4, 2)) - del tmp51 - tmp65 = einsum(t2, (0, 1, 2, 3), tmp64, (1, 4), (4, 0, 3, 2)) - del tmp64 - tmp56 = einsum(t2, (0, 1, 2, 3), tmp55, (2, 4), (0, 1, 4, 3)) - del tmp55 - tmp86 = einsum(tmp20, (0, 1, 2, 3), t1, (1, 4), (0, 4, 2, 3)) - tmp46 = einsum(t1, (0, 1), tmp45, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp45 - tmp44 = einsum(t2, (0, 1, 2, 3), tmp24, (4, 1, 5, 2), (4, 0, 3, 5)) - tmp28 = einsum(tmp27, (0, 1, 2), tmp17, (3, 4, 2), (3, 0, 4, 1)) - del tmp27 - tmp23 = einsum(t2, (0, 1, 2, 3), tmp22, (4, 1, 5, 2), (0, 4, 3, 5)) - del tmp22 - tmp21 = einsum(t2, (0, 1, 2, 3), f.vv, (4, 3), (0, 1, 4, 2)) - tmp42 = einsum(tmp41, (0, 1), t2, (2, 0, 3, 4), (1, 2, 4, 3)) - del tmp41 - tmp40 = einsum(tmp39, (0, 1, 2, 3), t1, (1, 4), (0, 2, 3, 4)) - del tmp39 - tmp25 = einsum(tmp24, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 5, 2)) - del tmp24 - tmp69 = einsum(tmp68, (0, 1, 2, 3), t1, (2, 4), (0, 1, 4, 3)) - del tmp68 - tmp72 = einsum(tmp71, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) - del tmp71 - tmp74 = einsum(t2, (0, 1, 2, 3), tmp73, (4, 1), (4, 0, 3, 2)) * 0.5 - del tmp73 - tmp70 = einsum(tmp18, (0, 1, 2), tmp19, (3, 4, 2), (3, 0, 4, 1)) - tmp81 = einsum(t2, (0, 1, 2, 3), tmp80, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp80 - tmp77 = einsum(t2, (0, 1, 2, 3), tmp76, (1, 4), (4, 0, 2, 3)) - del tmp76 - tmp79 = einsum(tmp78, (0, 1, 2, 3), t1, (0, 4), (1, 2, 4, 3)) - del tmp78 - tmp7 = einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) * 0.5 - tmp7 += np.transpose(t2, (0, 1, 3, 2)) * -1 - tmp7 += t2 * 0.5 - tmp14 = np.copy(tmp6) * -1 - tmp14 += einsum(tmp0, (0,), t1, (1, 2), (1, 2, 0)) * 2 - tmp14 += tmp13 - del tmp13 - tmp15 = np.copy(f.ov) - tmp15 += tmp9 * -1 - tmp3 = np.copy(np.transpose(v.xoo, (1, 2, 0))) - tmp3 += np.transpose(tmp2, (1, 0, 2)) - tmp84 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp84 += einsum(tmp2, (0, 1, 2), tmp2, (3, 4, 2), (1, 3, 4, 0)) - del tmp2 - tmp66 = np.copy(tmp48) - del tmp48 - tmp66 += tmp52 - del tmp52 - tmp66 += np.transpose(tmp56, (1, 0, 3, 2)) * -1 - del tmp56 - tmp66 += np.transpose(tmp62, (0, 1, 3, 2)) * -1 - del tmp62 - tmp66 += np.transpose(tmp65, (1, 0, 3, 2)) - del tmp65 - tmp87 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp87 += einsum(t1, (0, 1), tmp86, (0, 2, 3, 4), (4, 3, 1, 2)) - del tmp86 - tmp85 = np.copy(t2) - tmp85 += einsum(t1, (0, 1), t1, (2, 3), (0, 2, 1, 3)) - tmp47 = np.copy(tmp44) - del tmp44 - tmp47 += tmp46 - del tmp46 - tmp83 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - tmp43 = np.copy(tmp21) - del tmp21 - tmp43 += tmp23 * -1 - del tmp23 - tmp43 += tmp25 * -1 - del tmp25 - tmp43 += np.transpose(tmp28, (0, 1, 3, 2)) - del tmp28 - tmp43 += np.transpose(tmp40, (0, 1, 3, 2)) - del tmp40 - tmp43 += np.transpose(tmp42, (0, 1, 3, 2)) * -1 - del tmp42 - tmp75 = np.copy(tmp69) - del tmp69 - tmp75 += tmp70 * 2 - del tmp70 - tmp75 += np.transpose(tmp72, (1, 0, 3, 2)) - del tmp72 - tmp75 += np.transpose(tmp74, (1, 0, 3, 2)) - del tmp74 - tmp82 = np.copy(tmp77) - del tmp77 - tmp82 += tmp79 - del tmp79 - tmp82 += tmp81 * -1 - del tmp81 - tmp8 = np.copy(tmp6) * 0.5 - del tmp6 - tmp8 += einsum(tmp0, (0,), t1, (1, 2), (1, 2, 0)) * -1 - del tmp0 - tmp8 += einsum(v.xov, (0, 1, 2), tmp7, (1, 3, 4, 2), (3, 4, 0)) - del tmp7 - tmp16 = np.copy(f.oo) * 0.5 - tmp16 += np.transpose(tmp12, (1, 0)) - del tmp12 - tmp16 += einsum(tmp14, (0, 1, 2), v.xov, (2, 3, 1), (3, 0)) * 0.5 - del tmp14 - tmp16 += einsum(tmp15, (0, 1), t1, (2, 1), (0, 2)) * 0.5 - del tmp15 - tmp10 = np.copy(f.ov) - tmp10 += tmp1 * 2 - tmp10 += tmp9 * -1 - del tmp9 - tmp4 = einsum(v.xov, (0, 1, 2), tmp3, (3, 4, 0), (4, 1, 3, 2)) - del tmp3 - t2new = einsum(tmp17, (0, 1, 2), tmp17, (3, 4, 2), (3, 0, 4, 1)) - del tmp17 - t2new += einsum(tmp18, (0, 1, 2), tmp18, (3, 4, 2), (3, 0, 4, 1)) - del tmp18 - t2new += einsum(tmp19, (0, 1, 2), tmp19, (3, 4, 2), (3, 0, 4, 1)) * 4 - del tmp19 - t2new += np.transpose(tmp20, (1, 0, 3, 2)) - del tmp20 - t2new += np.transpose(tmp43, (0, 1, 3, 2)) - t2new += np.transpose(tmp43, (1, 0, 2, 3)) - del tmp43 - t2new += tmp47 * -1 - t2new += np.transpose(tmp47, (1, 0, 3, 2)) * -1 - del tmp47 - t2new += tmp66 * -1 - t2new += np.transpose(tmp66, (1, 0, 3, 2)) * -1 - del tmp66 - t2new += tmp75 * -1 - t2new += np.transpose(tmp75, (1, 0, 3, 2)) * -1 - del tmp75 - t2new += np.transpose(tmp82, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp82, (1, 0, 2, 3)) * -1 - del tmp82 - t2new += np.transpose(tmp83, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp83, (1, 0, 2, 3)) * -1 - del tmp83 - t2new += einsum(tmp85, (0, 1, 2, 3), tmp84, (0, 4, 1, 5), (4, 5, 3, 2)) - del tmp85, tmp84 - t2new += einsum(tmp87, (0, 1, 2, 3), t2, (4, 5, 0, 1), (4, 5, 3, 2)) - del tmp87 - t1new = np.copy(tmp1) * 2 - del tmp1 - t1new += einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - t1new += f.ov - t1new += einsum(tmp5, (0, 1, 2, 3), tmp4, (4, 0, 1, 2), (4, 3)) * -1 - del tmp5, tmp4 - t1new += einsum(v.xvv, (0, 1, 2), tmp8, (3, 2, 0), (3, 1)) * -2 - del tmp8 - t1new += einsum(tmp11, (0, 1, 2, 3), tmp10, (0, 2), (1, 3)) - del tmp11, tmp10 - t1new += einsum(tmp16, (0, 1), t1, (0, 2), (1, 2)) * -2 - del tmp16 - - return {f"t1new": t1new, f"t2new": t2new} - diff --git a/ebcc/codegen/RDFQCISD.py b/ebcc/codegen/RDFQCISD.py deleted file mode 100644 index 9744c353..00000000 --- a/ebcc/codegen/RDFQCISD.py +++ /dev/null @@ -1,186 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T16:30:05.630627 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:30:06.188962. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp0 += t2 * -1 - tmp1 = einsum(v.xov, (0, 1, 2), tmp0, (1, 3, 4, 2), (3, 4, 0)) * 0.5 - del tmp0 - e_cc = einsum(v.xov, (0, 1, 2), tmp1, (1, 2, 0), ()) * 2 - del tmp1 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:30:15.200019. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - """ - - tmp14 = einsum(t2, (0, 1, 2, 3), v.xov, (4, 1, 2), (0, 3, 4)) - tmp19 = np.copy(np.transpose(v.xov, (1, 2, 0))) - tmp19 += tmp14 * -1 - tmp13 = einsum(v.xov, (0, 1, 2), v.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp5 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp5 += t2 * -1 - tmp6 = einsum(v.xoo, (0, 1, 2), t1, (2, 3), (1, 3, 0)) - tmp20 = einsum(tmp19, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 1, 4)) - del tmp19 - tmp18 = einsum(v.xoo, (0, 1, 2), v.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp15 = einsum(t2, (0, 1, 2, 3), tmp13, (1, 4, 5, 2), (0, 4, 3, 5)) - tmp26 = einsum(v.xov, (0, 1, 2), tmp5, (1, 3, 4, 2), (3, 4, 0)) - tmp23 = np.copy(tmp6) - tmp23 += tmp14 - tmp21 = np.copy(np.transpose(tmp18, (1, 0, 3, 2))) - tmp21 += tmp15 * -1 - tmp21 += tmp20 * -2 - del tmp20 - tmp33 = einsum(t1, (0, 1), v.xvv, (2, 3, 1), (0, 3, 2)) - tmp27 = einsum(tmp26, (0, 1, 2), v.xov, (2, 0, 3), (1, 3)) * 0.5 - tmp29 = einsum(tmp26, (0, 1, 2), v.xov, (2, 3, 1), (0, 3)) - del tmp26 - tmp0 = einsum(v.xov, (0, 1, 2), t1, (1, 2), (0,)) - tmp2 = einsum(v.xov, (0, 1, 2), t1, (3, 2), (3, 1, 0)) - tmp38 = np.copy(np.transpose(tmp13, (1, 0, 2, 3))) * -1 - tmp38 += np.transpose(tmp13, (1, 0, 3, 2)) * 2 - tmp24 = einsum(v.xov, (0, 1, 2), tmp23, (3, 4, 0), (3, 1, 4, 2)) - del tmp23 - tmp22 = einsum(t2, (0, 1, 2, 3), tmp21, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp21 - tmp34 = einsum(tmp33, (0, 1, 2), v.xov, (2, 3, 4), (0, 3, 4, 1)) - del tmp33 - tmp35 = einsum(tmp18, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 5, 2)) - del tmp18 - tmp32 = einsum(t2, (0, 1, 2, 3), f.vv, (4, 3), (0, 1, 4, 2)) - tmp28 = einsum(tmp27, (0, 1), t2, (2, 3, 1, 4), (2, 3, 0, 4)) * 2 - del tmp27 - tmp30 = einsum(tmp29, (0, 1), t2, (2, 1, 3, 4), (0, 2, 4, 3)) - del tmp29 - tmp1 = einsum(tmp0, (0,), v.xov, (0, 1, 2), (1, 2)) - del tmp0 - tmp11 = einsum(v.xov, (0, 1, 2), tmp5, (1, 3, 4, 2), (3, 4, 0)) * 0.5 - tmp7 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp7 += t2 * -0.5 - tmp3 = np.copy(np.transpose(v.xoo, (1, 2, 0))) - tmp3 += np.transpose(tmp2, (1, 0, 2)) - tmp16 = einsum(v.xvv, (0, 1, 2), v.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp39 = einsum(tmp38, (0, 1, 2, 3), t2, (4, 0, 5, 2), (4, 1, 5, 3)) - del tmp38 - tmp25 = np.copy(np.transpose(tmp22, (1, 0, 3, 2))) - del tmp22 - tmp25 += tmp24 - del tmp24 - tmp36 = np.copy(tmp32) - del tmp32 - tmp36 += tmp34 - del tmp34 - tmp36 += tmp35 * -1 - del tmp35 - tmp37 = einsum(v.xoo, (0, 1, 2), v.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp37 += einsum(t2, (0, 1, 2, 3), tmp13, (4, 5, 3, 2), (4, 0, 5, 1)) - tmp17 = einsum(f.oo, (0, 1), t2, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp31 = np.copy(np.transpose(tmp28, (1, 0, 3, 2))) - del tmp28 - tmp31 += np.transpose(tmp30, (1, 0, 3, 2)) - del tmp30 - tmp9 = np.copy(f.ov) - tmp9 += tmp1 * 2 - tmp9 += einsum(v.xov, (0, 1, 2), tmp2, (1, 3, 0), (3, 2)) * -1 - del tmp2 - tmp12 = np.copy(f.oo) - tmp12 += einsum(v.xov, (0, 1, 2), tmp11, (3, 2, 0), (1, 3)) * 2 - del tmp11 - tmp8 = np.copy(tmp6) * 0.5 - del tmp6 - tmp8 += einsum(tmp7, (0, 1, 2, 3), v.xov, (4, 0, 3), (1, 2, 4)) * -1 - del tmp7 - tmp4 = einsum(v.xov, (0, 1, 2), tmp3, (3, 4, 0), (4, 1, 3, 2)) - del tmp3 - tmp10 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp10 += t2 * -1 - t2new = np.copy(np.transpose(tmp13, (1, 0, 3, 2))) - del tmp13 - t2new += einsum(tmp14, (0, 1, 2), tmp14, (3, 4, 2), (0, 3, 1, 4)) - del tmp14 - t2new += einsum(t2, (0, 1, 2, 3), tmp15, (4, 1, 5, 2), (0, 4, 5, 3)) - del tmp15 - t2new += einsum(tmp16, (0, 1, 2, 3), t2, (4, 5, 3, 1), (4, 5, 0, 2)) - del tmp16 - t2new += np.transpose(tmp17, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp17, (1, 0, 2, 3)) * -1 - del tmp17 - t2new += tmp25 * -1 - t2new += np.transpose(tmp25, (1, 0, 3, 2)) * -1 - del tmp25 - t2new += tmp31 * -1 - t2new += np.transpose(tmp31, (1, 0, 3, 2)) * -1 - del tmp31 - t2new += np.transpose(tmp36, (0, 1, 3, 2)) - t2new += np.transpose(tmp36, (1, 0, 2, 3)) - del tmp36 - t2new += einsum(tmp37, (0, 1, 2, 3), t2, (0, 2, 4, 5), (1, 3, 5, 4)) - del tmp37 - t2new += einsum(tmp39, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp39 - t1new = np.copy(tmp1) * 2 - del tmp1 - t1new += einsum(f.vv, (0, 1), t1, (2, 1), (2, 0)) - t1new += einsum(tmp5, (0, 1, 2, 3), tmp4, (4, 0, 1, 3), (4, 2)) * -1 - del tmp5, tmp4 - t1new += einsum(v.xvv, (0, 1, 2), tmp8, (3, 2, 0), (3, 1)) * -2 - del tmp8 - t1new += einsum(tmp9, (0, 1), tmp10, (0, 2, 3, 1), (2, 3)) - del tmp9, tmp10 - t1new += einsum(t1, (0, 1), tmp12, (0, 2), (2, 1)) * -1 - del tmp12 - - return {f"t1new": t1new, f"t2new": t2new} - diff --git a/ebcc/codegen/RMP2.py b/ebcc/codegen/RMP2.py deleted file mode 100644 index 615572e9..00000000 --- a/ebcc/codegen/RMP2.py +++ /dev/null @@ -1,258 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:16:33.671935 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:33.930687. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_mp : array - """ - - e_mp = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 2, 1, 3), ()) * 2 - e_mp += einsum(t2, (0, 1, 2, 3), v.ovov, (0, 3, 1, 2), ()) * -1 - - return e_mp - -def make_rdm1_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:34.438301. - - Parameters - ---------- - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm1 : array - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - delta = Namespace( - oo=np.eye(t2.shape[0]), - vv=np.eye(t2.shape[-1]), - ) - tmp0 = np.copy(np.transpose(t2, (0, 1, 3, 2))) - tmp0 += t2 * -0.5 - rdm1.vv = einsum(l2, (0, 1, 2, 3), tmp0, (2, 3, 1, 4), (0, 4)) * 4 - rdm1.oo = np.copy(delta.oo) * 2 - del delta - rdm1.oo += einsum(l2, (0, 1, 2, 3), tmp0, (2, 4, 1, 0), (4, 3)) * -4 - del tmp0 - rdm1.ov = np.zeros((t2.shape[0], t2.shape[-1])) - rdm1.vo = np.zeros((t2.shape[-1], t2.shape[0])) - rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]]) - - return rdm1 - -def make_rdm2_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:34.617502. - - Parameters - ---------- - l2 : array - L2 amplitudes. - t2 : array - T2 amplitudes. - - Returns - ------- - rdm2 : array - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - rdm2.vvoo = np.copy(np.transpose(l2, (0, 1, 3, 2))) * -2 - rdm2.vvoo += l2 * 4 - rdm2.oovv = np.copy(np.transpose(t2, (0, 1, 3, 2))) * -2 - rdm2.oovv += t2 * 4 - rdm2.oooo = np.zeros((t2.shape[0], t2.shape[0], t2.shape[0], t2.shape[0])) - rdm2.ooov = np.zeros((t2.shape[0], t2.shape[0], t2.shape[0], t2.shape[-1])) - rdm2.oovo = np.zeros((t2.shape[0], t2.shape[0], t2.shape[-1], t2.shape[0])) - rdm2.ovoo = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[0], t2.shape[0])) - rdm2.vooo = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[0], t2.shape[0])) - rdm2.ovov = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[0], t2.shape[-1])) - rdm2.ovvo = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[-1], t2.shape[0])) - rdm2.voov = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[0], t2.shape[-1])) - rdm2.vovo = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[-1], t2.shape[0])) - rdm2.ovvv = np.zeros((t2.shape[0], t2.shape[-1], t2.shape[-1], t2.shape[-1])) - rdm2.vovv = np.zeros((t2.shape[-1], t2.shape[0], t2.shape[-1], t2.shape[-1])) - rdm2.vvov = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[0], t2.shape[-1])) - rdm2.vvvo = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[-1], t2.shape[0])) - rdm2.vvvv = np.zeros((t2.shape[-1], t2.shape[-1], t2.shape[-1], t2.shape[-1])) - rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv) - rdm2 = np.transpose(rdm2, (0, 2, 1, 3)) - rdm1 = make_rdm1_f(t2=t2, l2=l2) - delta = np.diag(np.concatenate([np.ones(t2.shape[0]), np.zeros(t2.shape[-1])])) - rdm1 -= delta * 2 - rdm2 += einsum(delta, (0, 1), rdm1, (3, 2), (0, 1, 2, 3)) * 2 - rdm2 += einsum(rdm1, (1, 0), delta, (2, 3), (0, 1, 2, 3)) * 2 - rdm2 -= einsum(delta, (0, 3), rdm1, (2, 1), (0, 1, 2, 3)) - rdm2 -= einsum(rdm1, (0, 3), delta, (1, 2), (0, 1, 2, 3)) - rdm2 += einsum(delta, (0, 1), delta, (2, 3), (0, 1, 2, 3)) * 4 - rdm2 -= einsum(delta, (0, 3), delta, (1, 2), (0, 1, 2, 3)) * 2 - - return rdm2 - -def hbar_matvec_ip_intermediates(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:36.516300. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp2 : array - tmp4 : array - """ - - tmp4 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 3), (4, 0)) - tmp2 = einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 3, 1), (4, 0)) - - return {f"tmp2": tmp2, f"tmp4": tmp4} - -def hbar_matvec_ip(f=None, r1=None, r2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:36.519931. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp1 = np.copy(ints.tmp4) * 2 - del ints.tmp4 - tmp1 += ints.tmp2 * -1 - del ints.tmp2 - tmp2 = np.copy(f.oo) * 2 - tmp2 += tmp1 - tmp2 += np.transpose(tmp1, (1, 0)) - del tmp1 - tmp0 = np.copy(v.ooov) - tmp0 += np.transpose(v.ovoo, (0, 2, 3, 1)) * -0.5 - r2new = einsum(r2, (0, 1, 2), f.vv, (3, 2), (0, 1, 3)) - r2new += einsum(r1, (0,), v.ovoo, (1, 2, 3, 0), (1, 3, 2)) - r2new += einsum(r2, (0, 1, 2), f.oo, (3, 0), (3, 1, 2)) * -1 - r2new += einsum(f.oo, (0, 1), r2, (2, 1, 3), (2, 0, 3)) * -1 - r1new = einsum(r2, (0, 1, 2), tmp0, (1, 3, 0, 2), (3,)) * 2 - del tmp0 - r1new += einsum(tmp2, (0, 1), r1, (0,), (1,)) * -0.5 - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:38.480480. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - tmp2 : array - tmp4 : array - """ - - tmp4 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 1, 4), (4, 3)) - tmp2 = einsum(v.ovov, (0, 1, 2, 3), t2, (0, 2, 3, 4), (4, 1)) - - return {f"tmp2": tmp2, f"tmp4": tmp4} - -def hbar_matvec_ea(f=None, r1=None, r2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:38.484090. - - Parameters - ---------- - f : array - Fock matrix. - r1 : array - R1 amplitudes. - r2 : array - R2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - r1new : array - Updated R1 residuals. - r2new : array - Updated R2 residuals. - """ - - ints = kwargs["ints"] - tmp1 = np.copy(ints.tmp4) - del ints.tmp4 - tmp1 += ints.tmp2 * -0.5 - del ints.tmp2 - tmp2 = np.copy(f.vv) - tmp2 += tmp1 * -1 - tmp2 += np.transpose(tmp1, (1, 0)) * -1 - del tmp1 - tmp0 = np.copy(v.ovvv) * 2 - tmp0 += np.transpose(v.ovvv, (0, 2, 1, 3)) * -1 - r2new = einsum(f.vv, (0, 1), r2, (1, 2, 3), (0, 2, 3)) - r2new += einsum(f.vv, (0, 1), r2, (2, 1, 3), (2, 0, 3)) - r2new += einsum(r1, (0,), v.ovvv, (1, 2, 3, 0), (2, 3, 1)) * -1 - r2new += einsum(f.oo, (0, 1), r2, (2, 3, 1), (2, 3, 0)) * -1 - r1new = einsum(r2, (0, 1, 2), tmp0, (2, 0, 1, 3), (3,)) * -1 - del tmp0 - r1new += einsum(r1, (0,), tmp2, (0, 1), (1,)) - del tmp2 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/RMP3.py b/ebcc/codegen/RMP3.py deleted file mode 100644 index 78ffc3eb..00000000 --- a/ebcc/codegen/RMP3.py +++ /dev/null @@ -1,65 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:16:58.954881 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:17:02.937649. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_mp : array - """ - - tmp4 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) - tmp4 += v.oovv * -0.5 - tmp6 = einsum(t2, (0, 1, 2, 3), t2, (4, 5, 2, 3), (0, 4, 5, 1)) - tmp2 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp2 += v.oovv * -1 - tmp1 = np.copy(v.oovv) - tmp1 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp0 = einsum(t2, (0, 1, 2, 3), v.vvvv, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp5 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -0.5 - tmp5 += np.transpose(v.ovov, (0, 2, 1, 3)) - tmp5 += einsum(t2, (0, 1, 2, 3), tmp4, (1, 4, 3, 5), (0, 4, 2, 5)) * 4 - del tmp4 - tmp7 = np.copy(np.transpose(tmp6, (3, 1, 2, 0))) * -0.5 - tmp7 += np.transpose(tmp6, (3, 2, 1, 0)) - del tmp6 - tmp3 = np.copy(np.transpose(tmp0, (1, 0, 2, 3))) - tmp3 += np.transpose(tmp0, (1, 0, 3, 2)) * -0.5 - del tmp0 - tmp3 += einsum(tmp1, (0, 1, 2, 3), t2, (4, 0, 2, 5), (4, 1, 5, 3)) * -2 - del tmp1 - tmp3 += einsum(t2, (0, 1, 2, 3), tmp2, (1, 4, 3, 5), (0, 4, 2, 5)) * -2 - del tmp2 - e_mp = einsum(t2, (0, 1, 2, 3), tmp3, (1, 0, 2, 3), ()) * 2 - del tmp3 - e_mp += einsum(tmp5, (0, 1, 2, 3), t2, (1, 0, 3, 2), ()) * 2 - del tmp5 - e_mp += einsum(v.oooo, (0, 1, 2, 3), tmp7, (0, 1, 3, 2), ()) * 2 - del tmp7 - - return e_mp - diff --git a/ebcc/codegen/RQCISD.py b/ebcc/codegen/RQCISD.py deleted file mode 100644 index 2f5ced5c..00000000 --- a/ebcc/codegen/RQCISD.py +++ /dev/null @@ -1,167 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T16:29:33.609917 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:29:33.870947. - - Parameters - ---------- - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - e_cc = einsum(t2, (0, 1, 2, 3), v.ovov, (0, 2, 1, 3), ()) * 2 - e_cc += einsum(t2, (0, 1, 2, 3), v.ovov, (0, 3, 1, 2), ()) * -1 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:29:39.660584. - - Parameters - ---------- - f : array - Fock matrix. - t1 : array - T1 amplitudes. - t2 : array - T2 amplitudes. - v : array - Electron repulsion integrals. - - Returns - ------- - t1new : array - Updated T1 residuals. - t2new : array - Updated T2 residuals. - """ - - tmp19 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) - tmp19 += np.transpose(v.ovov, (0, 2, 1, 3)) * -0.5 - tmp12 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * -1 - tmp12 += np.transpose(v.ovov, (0, 2, 1, 3)) * 2 - tmp20 = einsum(t2, (0, 1, 2, 3), tmp19, (0, 1, 4, 2), (3, 4)) - tmp22 = einsum(t2, (0, 1, 2, 3), tmp19, (1, 4, 2, 3), (0, 4)) * 2 - del tmp19 - tmp13 = einsum(tmp12, (0, 1, 2, 3), t2, (4, 0, 5, 2), (4, 1, 5, 3)) - del tmp12 - tmp17 = einsum(v.ovvv, (0, 1, 2, 3), t1, (4, 3), (4, 0, 1, 2)) - tmp16 = einsum(f.vv, (0, 1), t2, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp21 = einsum(tmp20, (0, 1), t2, (2, 3, 1, 4), (2, 3, 4, 0)) * 2 - del tmp20 - tmp23 = einsum(t2, (0, 1, 2, 3), tmp22, (4, 1), (0, 4, 3, 2)) - del tmp22 - tmp9 = einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 2), (0, 4, 3, 5)) - tmp14 = einsum(t2, (0, 1, 2, 3), tmp13, (4, 1, 5, 2), (0, 4, 3, 5)) - tmp11 = einsum(t1, (0, 1), v.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp3 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * 2 - tmp3 += np.transpose(v.ovov, (0, 2, 1, 3)) * -1 - tmp1 = einsum(t1, (0, 1), v.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp7 = np.copy(np.transpose(v.ovov, (0, 2, 3, 1))) * 2 - tmp7 += np.transpose(v.ovov, (0, 2, 1, 3)) * -1 - tmp18 = np.copy(tmp16) - del tmp16 - tmp18 += tmp17 - del tmp17 - tmp24 = np.copy(np.transpose(tmp21, (1, 0, 2, 3))) - del tmp21 - tmp24 += np.transpose(tmp23, (0, 1, 3, 2)) - del tmp23 - tmp27 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * -1 - tmp27 += tmp9 - tmp10 = einsum(t2, (0, 1, 2, 3), f.oo, (4, 1), (4, 0, 2, 3)) - tmp25 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp25 += v.oovv * -1 - tmp25 += tmp13 * 2 - del tmp13 - tmp15 = np.copy(tmp11) - del tmp11 - tmp15 += np.transpose(tmp14, (1, 0, 3, 2)) - del tmp14 - tmp28 = np.copy(v.oovv) * -1 - tmp28 += einsum(v.ovov, (0, 1, 2, 3), t2, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp26 = np.copy(v.oooo) - tmp26 += einsum(v.ovov, (0, 1, 2, 3), t2, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp0 = np.copy(v.ovvv) - tmp0 += np.transpose(v.ovvv, (0, 2, 1, 3)) * -0.5 - tmp5 = np.copy(np.transpose(t2, (0, 1, 3, 2))) * 2 - tmp5 += t2 * -1 - tmp4 = np.copy(f.ov) - tmp4 += einsum(t1, (0, 1), tmp3, (0, 2, 3, 1), (2, 3)) - del tmp3 - tmp6 = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) * 2 - tmp6 += v.oovv * -1 - tmp2 = np.copy(v.ooov) * -0.5 - tmp2 += np.transpose(v.ooov, (0, 2, 1, 3)) - tmp2 += tmp1 - tmp2 += np.transpose(tmp1, (0, 2, 1, 3)) * -0.5 - del tmp1 - tmp8 = np.copy(f.oo) - tmp8 += einsum(t2, (0, 1, 2, 3), tmp7, (1, 4, 2, 3), (4, 0)) - del tmp7 - t2new = np.copy(np.transpose(v.ovov, (0, 2, 1, 3))) - t2new += einsum(v.oovv, (0, 1, 2, 3), t2, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - t2new += np.transpose(tmp9, (1, 0, 3, 2)) * -1 - del tmp9 - t2new += einsum(t2, (0, 1, 2, 3), v.oovv, (4, 1, 5, 2), (0, 4, 5, 3)) * -1 - t2new += einsum(t2, (0, 1, 2, 3), v.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) * 2 - t2new += einsum(v.vvvv, (0, 1, 2, 3), t2, (4, 5, 1, 3), (4, 5, 0, 2)) - t2new += np.transpose(tmp10, (0, 1, 3, 2)) * -1 - t2new += np.transpose(tmp10, (1, 0, 2, 3)) * -1 - del tmp10 - t2new += tmp15 * -1 - t2new += np.transpose(tmp15, (1, 0, 3, 2)) * -1 - del tmp15 - t2new += np.transpose(tmp18, (0, 1, 3, 2)) - t2new += np.transpose(tmp18, (1, 0, 2, 3)) - del tmp18 - t2new += tmp24 * -1 - t2new += np.transpose(tmp24, (1, 0, 3, 2)) * -1 - del tmp24 - t2new += einsum(tmp25, (0, 1, 2, 3), t2, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp25 - t2new += einsum(tmp26, (0, 1, 2, 3), t2, (0, 3, 4, 5), (2, 1, 5, 4)) - del tmp26 - t2new += einsum(tmp27, (0, 1, 2, 3), t2, (4, 1, 3, 5), (4, 0, 5, 2)) - del tmp27 - t2new += einsum(tmp28, (0, 1, 2, 3), t2, (4, 1, 3, 5), (0, 4, 5, 2)) - del tmp28 - t1new = einsum(t1, (0, 1), f.vv, (2, 1), (0, 2)) - t1new += einsum(tmp0, (0, 1, 2, 3), t2, (4, 0, 2, 1), (4, 3)) * 2 - del tmp0 - t1new += einsum(t2, (0, 1, 2, 3), tmp2, (4, 0, 1, 2), (4, 3)) * -2 - del tmp2 - t1new += einsum(tmp4, (0, 1), tmp5, (0, 2, 3, 1), (2, 3)) - del tmp4, tmp5 - t1new += einsum(tmp6, (0, 1, 2, 3), t1, (0, 2), (1, 3)) - del tmp6 - t1new += einsum(t1, (0, 1), tmp8, (0, 2), (2, 1)) * -1 - del tmp8 - - return {f"t1new": t1new, f"t2new": t2new} - diff --git a/ebcc/codegen/UCC2.py b/ebcc/codegen/UCC2.py deleted file mode 100644 index c391855b..00000000 --- a/ebcc/codegen/UCC2.py +++ /dev/null @@ -1,5278 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T16:35:03.729014 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:35:05.012635. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp2 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp2 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp0 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp0 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp3 = np.copy(f.aa.ov) * 2 - tmp3 += einsum(tmp2, (0, 1, 2, 3), t1.aa, (0, 2), (1, 3)) * -1 - del tmp2 - tmp1 = np.copy(f.bb.ov) - tmp1 += einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - tmp1 += einsum(tmp0, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) * -0.5 - del tmp0 - e_cc = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 3, 1), ()) * -1 - e_cc += einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 3, 1), ()) * -1 - e_cc += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 3), ()) - e_cc += einsum(tmp1, (0, 1), t1.bb, (0, 1), ()) - del tmp1 - e_cc += einsum(t1.aa, (0, 1), tmp3, (0, 1), ()) * 0.5 - del tmp3 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:35:21.407192. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t1new : Namespace of arrays - Updated T1 residuals. - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - tmp16 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp2 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 2, 1)) - tmp11 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp11 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp5 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp5 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp78 = einsum(tmp16, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 2, 1)) - tmp72 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp68 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp17 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 2, 1)) - tmp39 = einsum(t1.aa, (0, 1), tmp2, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp33 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp36 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp12 = einsum(tmp11, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) - del tmp11 - tmp10 = einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - tmp6 = einsum(tmp5, (0, 1, 2, 3), t1.aa, (0, 2), (1, 3)) - del tmp5 - tmp0 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp61 = einsum(t1.bb, (0, 1), v.bbbb.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp79 = einsum(t1.bb, (0, 1), tmp78, (2, 3, 0, 4), (3, 2, 4, 1)) - del tmp78 - tmp65 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp74 = einsum(t1.bb, (0, 1), v.bbbb.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp76 = einsum(tmp72, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) - tmp47 = einsum(t1.bb, (0, 1), f.bb.ov, (0, 2), (2, 1)) - tmp69 = einsum(tmp68, (0, 1, 2, 3), t1.bb, (3, 4), (0, 2, 1, 4)) - del tmp68 - tmp51 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp56 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 2, 0, 1)) - tmp57 = einsum(t1.aa, (0, 1), tmp17, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp54 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - tmp49 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp52 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp26 = einsum(t1.aa, (0, 1), f.aa.ov, (0, 2), (2, 1)) - tmp31 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp40 = einsum(tmp39, (0, 1, 2, 3), t1.aa, (2, 4), (1, 0, 3, 4)) - del tmp39 - tmp34 = einsum(tmp33, (0, 1, 2, 3), t1.aa, (3, 4), (0, 2, 1, 4)) - del tmp33 - tmp29 = einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp23 = einsum(v.aaaa.oooo, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp44 = einsum(v.aaaa.vvvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp42 = einsum(tmp36, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 1, 3)) - tmp21 = np.copy(v.bbbb.ooov) - tmp21 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) * -1 - tmp13 = np.copy(f.bb.ov) - tmp13 += tmp10 - tmp13 += tmp12 * -1 - del tmp12 - tmp14 = np.copy(v.aaaa.ooov) * -1 - tmp14 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) - tmp7 = np.copy(f.aa.ov) - tmp7 += tmp0 - tmp7 += tmp6 * -1 - del tmp6 - tmp62 = einsum(t1.bb, (0, 1), tmp61, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp61 - tmp80 = einsum(tmp79, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - del tmp79 - tmp63 = einsum(f.bb.oo, (0, 1), t2.bbbb, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp73 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp66 = einsum(t1.bb, (0, 1), tmp65, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp65 - tmp75 = einsum(tmp74, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) - del tmp74 - tmp77 = einsum(t1.bb, (0, 1), tmp76, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp76 - tmp71 = einsum(tmp16, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - tmp48 = np.copy(f.bb.vv) - tmp48 += tmp47 * -1 - tmp64 = np.copy(f.bb.vv) - tmp64 += tmp47 * -1 - del tmp47 - tmp70 = einsum(t1.bb, (0, 1), tmp69, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp69 - tmp67 = einsum(t2.bbbb, (0, 1, 2, 3), tmp51, (1, 4), (4, 0, 2, 3)) - tmp58 = einsum(t1.aa, (0, 1), tmp56, (2, 3, 4, 1), (0, 2, 3, 4)) - del tmp56 - tmp58 += einsum(t1.aa, (0, 1), tmp57, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - del tmp57 - tmp60 = einsum(t1.aa, (0, 1), tmp54, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp50 = einsum(tmp49, (0, 1, 2, 3), t1.bb, (3, 4), (1, 0, 2, 4)) - del tmp49 - tmp55 = np.copy(np.transpose(v.aabb.vvov, (2, 0, 1, 3))) - tmp55 += einsum(v.aabb.vvvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp53 = einsum(t1.aa, (0, 1), v.aabb.vvoo, (2, 1, 3, 4), (0, 3, 4, 2)) - tmp53 += einsum(t1.aa, (0, 1), tmp52, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - del tmp52 - tmp46 = einsum(v.aabb.oooo, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp27 = np.copy(f.aa.vv) - tmp27 += tmp26 * -1 - tmp59 = einsum(v.aabb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp1 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp25 = einsum(f.aa.oo, (0, 1), t2.aaaa, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp32 = einsum(tmp31, (0, 1), t2.aaaa, (2, 0, 3, 4), (1, 2, 3, 4)) - tmp41 = einsum(tmp40, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp40 - tmp38 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - tmp35 = einsum(t1.aa, (0, 1), tmp34, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp34 - tmp30 = einsum(tmp29, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp29 - tmp37 = einsum(tmp2, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - tmp28 = np.copy(f.aa.vv) - tmp28 += tmp26 * -1 - del tmp26 - tmp24 = einsum(tmp23, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp23 - tmp45 = einsum(tmp44, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 1, 3)) - del tmp44 - tmp43 = einsum(tmp42, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp42 - tmp22 = np.copy(f.bb.oo) - tmp22 += einsum(t1.aa, (0, 1), v.aabb.ovoo, (0, 1, 2, 3), (2, 3)) - tmp22 += einsum(t1.bb, (0, 1), tmp21, (0, 2, 3, 1), (3, 2)) * -1 - del tmp21 - tmp18 = np.copy(t2.bbbb) * 2 - tmp18 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) - tmp19 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (2, 4)) - tmp19 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (4, 0)) * -2 - tmp19 += einsum(tmp13, (0, 1), t1.bb, (2, 1), (0, 2)) - tmp3 = np.copy(t2.abab) - tmp3 += einsum(t1.aa, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - tmp20 = np.copy(f.bb.vv) - tmp20 += einsum(t1.bb, (0, 1), v.bbbb.ovvv, (0, 2, 3, 1), (2, 3)) * -1 - tmp4 = np.copy(t2.aaaa) * 2 - tmp4 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - tmp9 = np.copy(f.aa.vv) - tmp9 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) * -1 - tmp15 = np.copy(f.aa.oo) - tmp15 += einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp15 += einsum(tmp14, (0, 1, 2, 3), t1.aa, (2, 3), (1, 0)) * -1 - del tmp14 - tmp8 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 3, 1), (0, 4)) * -2 - tmp8 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (4, 0)) - tmp8 += einsum(t1.aa, (0, 1), tmp7, (2, 1), (2, 0)) - t2new.bbbb = np.copy(tmp62) - t2new.bbbb += np.transpose(tmp63, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp62, (0, 1, 3, 2)) * -1 - del tmp62 - t2new.bbbb += np.transpose(tmp63, (0, 1, 3, 2)) * -2 - del tmp63 - t2new.bbbb += einsum(tmp64, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 1, 4)) * -2 - del tmp64 - t2new.bbbb += einsum(tmp48, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 4, 1)) * 2 - t2new.bbbb += np.transpose(tmp66, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp67, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp70, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp70, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp66, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp67, (0, 1, 3, 2)) * -2 - del tmp67 - t2new.bbbb += np.transpose(tmp66, (0, 1, 3, 2)) * -1 - t2new.bbbb += tmp70 * -1 - t2new.bbbb += np.transpose(tmp70, (0, 1, 3, 2)) - del tmp70 - t2new.bbbb += tmp66 - del tmp66 - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - t2new.bbbb += np.transpose(tmp71, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp72, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 3, 1)) * -1 - t2new.bbbb += np.transpose(tmp71, (0, 1, 3, 2)) - t2new.bbbb += tmp72 * -1 - t2new.bbbb += np.transpose(tmp73, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp73, (1, 0, 3, 2)) * -1 - t2new.bbbb += tmp73 * -1 - t2new.bbbb += np.transpose(tmp73, (1, 0, 2, 3)) - del tmp73 - t2new.bbbb += np.transpose(tmp72, (0, 1, 3, 2)) - t2new.bbbb += tmp75 - t2new.bbbb += np.transpose(tmp75, (0, 1, 3, 2)) * -1 - del tmp75 - t2new.bbbb += np.transpose(tmp77, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp77, (1, 0, 3, 2)) * -1 - t2new.bbbb += tmp80 - t2new.bbbb += np.transpose(tmp80, (0, 1, 3, 2)) * -1 - del tmp80 - t2new.bbbb += np.transpose(tmp72, (1, 0, 3, 2)) * -1 - del tmp72 - t2new.bbbb += tmp71 * -1 - t2new.bbbb += np.transpose(tmp71, (1, 0, 2, 3)) - del tmp71 - t2new.bbbb += tmp77 * -1 - t2new.bbbb += np.transpose(tmp77, (1, 0, 2, 3)) - del tmp77 - t2new.abab = einsum(t2.abab, (0, 1, 2, 3), f.bb.oo, (4, 1), (0, 4, 2, 3)) * -1 - t2new.abab += einsum(tmp46, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp46 - t2new.abab += einsum(f.aa.oo, (0, 1), t2.abab, (1, 2, 3, 4), (0, 2, 3, 4)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp27, (2, 4), (0, 1, 4, 3)) - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp48, (3, 4), (0, 1, 2, 4)) - del tmp48 - t2new.abab += einsum(tmp50, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - del tmp50 - t2new.abab += einsum(tmp51, (0, 1), t2.abab, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - del tmp51 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp31, (0, 4), (4, 1, 2, 3)) * -1 - del tmp31 - t2new.abab += einsum(tmp53, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) * -1 - del tmp53 - t2new.abab += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - t2new.abab += einsum(tmp17, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) * -1 - t2new.abab += tmp54 - del tmp54 - t2new.abab += einsum(v.aabb.ovoo, (0, 1, 2, 3), t1.bb, (3, 4), (0, 2, 1, 4)) * -1 - t2new.abab += einsum(t1.aa, (0, 1), v.aabb.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - t2new.abab += einsum(t1.aa, (0, 1), tmp55, (2, 1, 3, 4), (0, 2, 3, 4)) - del tmp55 - t2new.abab += einsum(tmp58, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) * -1 - del tmp58 - t2new.abab += einsum(t1.aa, (0, 1), tmp1, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - t2new.abab += einsum(t1.aa, (0, 1), tmp59, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp59 - t2new.abab += einsum(t1.aa, (0, 1), tmp60, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp60 - t2new.aaaa = np.copy(tmp24) - t2new.aaaa += np.transpose(tmp25, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp24, (0, 1, 3, 2)) * -1 - del tmp24 - t2new.aaaa += np.transpose(tmp25, (0, 1, 3, 2)) * -2 - del tmp25 - t2new.aaaa += einsum(tmp27, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 1, 4)) * -2 - del tmp27 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp28, (3, 4), (0, 1, 2, 4)) * 2 - del tmp28 - t2new.aaaa += np.transpose(tmp30, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp32, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp35, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(tmp35, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp30, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp32, (0, 1, 3, 2)) * -2 - del tmp32 - t2new.aaaa += np.transpose(tmp30, (0, 1, 3, 2)) * -1 - t2new.aaaa += tmp35 * -1 - t2new.aaaa += np.transpose(tmp35, (0, 1, 3, 2)) - del tmp35 - t2new.aaaa += tmp30 - del tmp30 - t2new.aaaa += np.transpose(tmp36, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - t2new.aaaa += np.transpose(tmp37, (1, 0, 3, 2)) * -1 - t2new.aaaa += tmp36 * -1 - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 3, 1)) * -1 - t2new.aaaa += np.transpose(tmp37, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp38, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp38, (1, 0, 3, 2)) * -1 - t2new.aaaa += tmp38 * -1 - t2new.aaaa += np.transpose(tmp38, (1, 0, 2, 3)) - del tmp38 - t2new.aaaa += np.transpose(tmp36, (0, 1, 3, 2)) - t2new.aaaa += tmp41 - t2new.aaaa += np.transpose(tmp41, (0, 1, 3, 2)) * -1 - del tmp41 - t2new.aaaa += np.transpose(tmp43, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp43, (1, 0, 3, 2)) * -1 - t2new.aaaa += tmp45 - t2new.aaaa += np.transpose(tmp45, (0, 1, 3, 2)) * -1 - del tmp45 - t2new.aaaa += np.transpose(tmp36, (1, 0, 3, 2)) * -1 - del tmp36 - t2new.aaaa += tmp37 * -1 - t2new.aaaa += np.transpose(tmp37, (1, 0, 2, 3)) - del tmp37 - t2new.aaaa += tmp43 * -1 - t2new.aaaa += np.transpose(tmp43, (1, 0, 2, 3)) - del tmp43 - t1new.bb = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 0, 1), (2, 3)) - t1new.bb += f.bb.ov - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp16, (4, 1, 0, 3), (4, 2)) * -2 - del tmp16 - t1new.bb += tmp10 - del tmp10 - t1new.bb += einsum(tmp17, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) * -1 - del tmp17 - t1new.bb += einsum(tmp3, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 3), (1, 4)) - t1new.bb += einsum(tmp18, (0, 1, 2, 3), v.bbbb.ovvv, (0, 2, 4, 3), (1, 4)) - del tmp18 - t1new.bb += einsum(tmp19, (0, 1), t1.bb, (0, 2), (1, 2)) * -1 - del tmp19 - t1new.bb += einsum(tmp20, (0, 1), t1.bb, (2, 0), (2, 1)) - del tmp20 - t1new.bb += einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) * -1 - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 3), (4, 2)) * -2 - t1new.bb += einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) * -1 - t1new.bb += einsum(tmp13, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) * 2 - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), tmp7, (0, 2), (1, 3)) - t1new.bb += einsum(tmp22, (0, 1), t1.bb, (0, 2), (1, 2)) * -1 - del tmp22 - t1new.aa = np.copy(tmp0) - del tmp0 - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), tmp1, (4, 0, 1, 3), (4, 2)) * -1 - del tmp1 - t1new.aa += einsum(tmp2, (0, 1, 2, 3), t2.aaaa, (2, 1, 4, 3), (0, 4)) * -2 - del tmp2 - t1new.aa += f.aa.ov - t1new.aa += einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - t1new.aa += einsum(tmp3, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - del tmp3 - t1new.aa += einsum(v.aaaa.ovvv, (0, 1, 2, 3), tmp4, (0, 4, 1, 3), (4, 2)) - del tmp4 - t1new.aa += einsum(t1.aa, (0, 1), tmp8, (0, 2), (2, 1)) * -1 - del tmp8 - t1new.aa += einsum(t1.aa, (0, 1), tmp9, (1, 2), (0, 2)) - del tmp9 - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 3), (4, 2)) * -1 - t1new.aa += einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) * -2 - t1new.aa += einsum(v.aaaa.oovv, (0, 1, 2, 3), t1.aa, (1, 3), (0, 2)) * -1 - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), tmp13, (1, 3), (0, 2)) - del tmp13 - t1new.aa += einsum(tmp7, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) * 2 - del tmp7 - t1new.aa += einsum(tmp15, (0, 1), t1.aa, (0, 2), (1, 2)) * -1 - del tmp15 - - return {f"t1new": t1new, f"t2new": t2new} - -def update_lams(f=None, l1=None, l2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:37:08.579466. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - l1new : Namespace of arrays - Updated L1 residuals. - l2new : Namespace of arrays - Updated L2 residuals. - """ - - l1new = Namespace() - l2new = Namespace() - tmp92 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp92 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp150 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp150 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp7 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp7 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp2 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 2, 1)) - tmp186 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp186 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp204 = np.copy(v.bbbb.ovvv) - tmp204 += np.transpose(v.bbbb.ovvv, (0, 2, 3, 1)) * -1 - tmp217 = np.copy(v.bbbb.ovvv) * -1 - tmp217 += np.transpose(v.bbbb.ovvv, (0, 2, 3, 1)) - tmp91 = einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - tmp93 = einsum(tmp92, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) - del tmp92 - tmp6 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp151 = einsum(tmp150, (0, 1, 2, 3), t1.aa, (0, 2), (1, 3)) - del tmp150 - tmp161 = np.copy(v.aaaa.ovvv) - tmp161 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) * -1 - tmp142 = np.copy(v.aaaa.ovvv) - tmp142 += np.transpose(v.aaaa.ovvv, (0, 2, 3, 1)) * -1 - tmp8 = einsum(tmp7, (0, 1, 2, 3), t1.aa, (0, 2), (1, 3)) - del tmp7 - tmp52 = einsum(l1.bb, (0, 1), t1.bb, (2, 0), (1, 2)) - tmp53 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 0, 4), (4, 1)) - tmp54 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp89 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp42 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 4, 1), (4, 0)) - tmp40 = einsum(t1.aa, (0, 1), l1.aa, (1, 2), (2, 0)) - tmp41 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (2, 4)) - tmp48 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (4, 1), (2, 3, 4, 0)) - tmp14 = np.copy(np.transpose(v.aabb.ovoo, (0, 2, 3, 1))) - tmp14 += tmp2 - tmp0 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp36 = einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp187 = einsum(t1.bb, (0, 1), tmp186, (0, 2, 1, 3), (2, 3)) - del tmp186 - tmp205 = einsum(tmp204, (0, 1, 2, 3), t1.bb, (4, 1), (0, 4, 2, 3)) - del tmp204 - tmp50 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp127 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (0, 1, 2, 3), (2, 3)) - tmp218 = einsum(tmp217, (0, 1, 2, 3), t1.bb, (0, 1), (2, 3)) - del tmp217 - tmp175 = einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (0, 3, 2, 4)) - tmp106 = np.copy(v.bbbb.ooov) - tmp106 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) * -1 - tmp94 = np.copy(f.bb.ov) - tmp94 += tmp91 - tmp94 += tmp93 * -1 - del tmp93 - tmp85 = np.copy(v.aaaa.ovvv) - tmp85 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) * -1 - tmp148 = np.copy(v.aaaa.ooov) * -1 - tmp148 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) - tmp152 = np.copy(f.aa.ov) - tmp152 += tmp6 - tmp152 += tmp151 * -1 - del tmp151 - tmp84 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp162 = einsum(tmp161, (0, 1, 2, 3), t1.aa, (0, 2), (1, 3)) - del tmp161 - tmp143 = einsum(t1.aa, (0, 1), tmp142, (2, 1, 3, 4), (2, 0, 3, 4)) - del tmp142 - tmp10 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - tmp9 = np.copy(f.aa.ov) - tmp9 += tmp6 - tmp9 += tmp8 * -1 - del tmp8 - tmp60 = np.copy(v.aaaa.ooov) * -1 - tmp60 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) - tmp55 = np.copy(tmp52) - tmp55 += tmp53 - tmp55 += tmp54 * 2 - tmp101 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp100 = einsum(tmp89, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp38 = einsum(t1.aa, (0, 1), l2.abab, (1, 2, 3, 4), (3, 0, 4, 2)) - tmp43 = np.copy(tmp40) * 0.5 - tmp43 += tmp41 - tmp43 += tmp42 * 0.5 - tmp70 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 4, 5), (4, 0, 5, 1)) - tmp71 = einsum(tmp48, (0, 1, 2, 3), t1.aa, (4, 3), (0, 4, 1, 2)) - tmp12 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp13 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp15 = einsum(t1.aa, (0, 1), tmp14, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp4 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp95 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 2, 0, 1)) - tmp21 = einsum(t1.aa, (0, 1), tmp0, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp22 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp66 = einsum(tmp36, (0, 1, 2, 3), t1.aa, (4, 3), (1, 0, 2, 4)) - tmp65 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp105 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (0, 1, 2, 3), (2, 3)) - tmp188 = np.copy(f.bb.ov) - tmp188 += tmp91 - tmp188 += tmp187 * -1 - del tmp187 - tmp209 = np.copy(v.bbbb.ooov) - tmp209 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) * -1 - tmp214 = np.copy(v.bbbb.ovvv) * -1 - tmp214 += np.transpose(v.bbbb.ovvv, (0, 2, 3, 1)) - tmp206 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp206 += v.bbbb.oovv * -1 - tmp206 += np.transpose(tmp205, (1, 0, 3, 2)) * -1 - del tmp205 - tmp104 = np.copy(v.bbbb.ovvv) - tmp104 += np.transpose(v.bbbb.ovvv, (0, 2, 3, 1)) * -1 - tmp120 = einsum(t1.bb, (0, 1), tmp50, (2, 3, 4, 1), (3, 2, 4, 0)) - tmp219 = np.copy(f.bb.vv) - tmp219 += np.transpose(tmp127, (1, 0)) - tmp219 += np.transpose(tmp218, (1, 0)) * -1 - del tmp218 - tmp177 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 0, 1), (2, 3)) - tmp176 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp176 += tmp175 - tmp194 = np.copy(np.transpose(v.bbbb.ooov, (0, 2, 1, 3))) - tmp194 += tmp89 - tmp180 = einsum(t1.bb, (0, 1), tmp106, (0, 2, 3, 1), (2, 3)) - tmp181 = einsum(tmp94, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp29 = np.copy(v.aaaa.ovvv) * -1 - tmp29 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) - tmp140 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - tmp86 = einsum(t1.aa, (0, 1), tmp85, (0, 2, 1, 3), (2, 3)) - del tmp85 - tmp173 = np.copy(v.bbbb.ovvv) * -1 - tmp173 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) - tmp149 = einsum(tmp148, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - del tmp148 - tmp153 = einsum(t1.aa, (0, 1), tmp152, (2, 1), (2, 0)) - tmp59 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp3 = np.copy(np.transpose(v.aabb.ovoo, (0, 2, 3, 1))) - tmp3 += np.transpose(tmp2, (0, 2, 1, 3)) - tmp163 = np.copy(f.aa.vv) - tmp163 += np.transpose(tmp84, (1, 0)) - tmp163 += tmp162 * -1 - del tmp162 - tmp144 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp144 += v.aaaa.oovv * -1 - tmp144 += np.transpose(tmp143, (1, 0, 3, 2)) * -1 - del tmp143 - tmp146 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp146 += tmp10 - tmp62 = einsum(t1.aa, (0, 1), tmp9, (2, 1), (0, 2)) - tmp61 = einsum(tmp60, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - del tmp60 - tmp68 = np.copy(v.aaaa.ovvv) - tmp68 += np.transpose(v.aaaa.ovvv, (0, 2, 3, 1)) * -1 - tmp131 = np.copy(np.transpose(v.aaaa.ooov, (0, 2, 1, 3))) - tmp131 += tmp0 - tmp31 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 0, 1), (4, 3)) - tmp30 = einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp32 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) - tmp51 = einsum(t2.bbbb, (0, 1, 2, 3), tmp50, (1, 0, 4, 3), (4, 2)) - tmp46 = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 0), (1, 3)) - tmp56 = einsum(tmp55, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp49 = einsum(tmp48, (0, 1, 2, 3), t2.abab, (0, 1, 3, 4), (2, 4)) - tmp47 = einsum(t2.bbbb, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) - tmp128 = np.copy(v.bbbb.ovvv) * -1 - tmp128 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) - tmp112 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 0, 5), (5, 1, 4, 3)) - tmp113 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp102 = np.copy(v.bbbb.oooo) - tmp102 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 5, 2), (4, 0, 5, 1)) * -1 - tmp102 += np.transpose(tmp100, (3, 1, 2, 0)) - tmp102 += np.transpose(tmp101, (2, 1, 3, 0)) - tmp102 += np.transpose(tmp101, (3, 2, 1, 0)) * -1 - tmp99 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 1, 3))) - tmp99 += v.bbbb.oovv * -1 - tmp99 += einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp98 = np.copy(v.bbbb.ooov) * -1 - tmp98 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) - tmp98 += tmp89 - tmp98 += np.transpose(tmp89, (0, 2, 1, 3)) * -1 - tmp119 = einsum(t2.bbbb, (0, 1, 2, 3), tmp50, (4, 1, 5, 3), (4, 5, 0, 2)) * -1 - tmp118 = einsum(tmp48, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 2, 4, 5)) - tmp27 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (4, 3, 0, 1), (4, 2)) - tmp25 = einsum(l1.aa, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp26 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 0, 1), (4, 2)) - tmp39 = einsum(t2.abab, (0, 1, 2, 3), tmp38, (0, 4, 1, 3), (4, 2)) - tmp35 = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) - tmp44 = einsum(tmp43, (0, 1), t1.aa, (0, 2), (1, 2)) * 2 - tmp34 = einsum(t2.aaaa, (0, 1, 2, 3), l1.aa, (3, 1), (0, 2)) - tmp37 = einsum(tmp36, (0, 1, 2, 3), t2.aaaa, (1, 0, 4, 3), (2, 4)) - tmp122 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp72 = np.copy(tmp70) - tmp72 += tmp71 - tmp16 = np.copy(v.aabb.oooo) - tmp16 += np.transpose(tmp12, (1, 0, 3, 2)) - tmp16 += np.transpose(tmp13, (1, 0, 3, 2)) - del tmp13 - tmp16 += np.transpose(tmp15, (1, 0, 3, 2)) - del tmp15 - tmp5 = np.copy(v.aabb.ooov) - tmp5 += np.transpose(tmp4, (1, 0, 2, 3)) - tmp96 = np.copy(np.transpose(v.aabb.vvoo, (2, 3, 0, 1))) - tmp96 += np.transpose(tmp95, (1, 0, 3, 2)) - tmp90 = np.copy(v.bbbb.ooov) - tmp90 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) * -1 - tmp90 += np.transpose(tmp89, (1, 0, 2, 3)) * -1 - tmp90 += np.transpose(tmp89, (2, 0, 1, 3)) - tmp74 = einsum(t2.aaaa, (0, 1, 2, 3), tmp36, (4, 1, 5, 3), (4, 5, 0, 2)) * -1 - tmp75 = einsum(t2.abab, (0, 1, 2, 3), tmp38, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp11 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp11 += tmp10 - del tmp10 - tmp1 = np.copy(v.aaaa.ooov) - tmp1 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) * -1 - tmp1 += np.transpose(tmp0, (1, 0, 2, 3)) * -1 - tmp1 += np.transpose(tmp0, (2, 0, 1, 3)) - tmp23 = np.copy(v.aaaa.oooo) - tmp23 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 5, 3, 1), (0, 4, 2, 5)) * -1 - tmp23 += np.transpose(tmp21, (3, 1, 2, 0)) - tmp23 += np.transpose(tmp22, (2, 1, 3, 0)) - tmp23 += np.transpose(tmp22, (3, 2, 1, 0)) * -1 - tmp18 = np.copy(v.aaaa.ooov) * -1 - tmp18 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) - tmp18 += tmp0 - tmp18 += np.transpose(tmp0, (0, 2, 1, 3)) * -1 - tmp20 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) - tmp20 += v.aaaa.oovv * -1 - tmp20 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 2, 1)) - tmp19 = np.copy(v.aabb.ooov) - tmp19 += tmp4 - tmp76 = np.copy(np.transpose(tmp65, (1, 0, 3, 2))) - tmp76 += np.transpose(tmp66, (0, 1, 3, 2)) * -1 - tmp222 = np.copy(v.bbbb.oooo) - tmp222 += np.transpose(tmp100, (0, 3, 1, 2)) * -1 - del tmp100 - tmp198 = einsum(tmp4, (0, 1, 2, 3), tmp38, (0, 1, 4, 5), (4, 2, 5, 3)) - tmp225 = einsum(tmp50, (0, 1, 2, 3), tmp89, (1, 2, 4, 5), (0, 4, 3, 5)) - tmp210 = np.copy(f.bb.oo) - tmp210 += np.transpose(tmp105, (1, 0)) - tmp210 += einsum(t1.bb, (0, 1), tmp209, (0, 2, 3, 1), (2, 3)) * -1 - del tmp209 - tmp210 += einsum(tmp188, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp213 = einsum(tmp50, (0, 1, 2, 3), v.bbbb.ovvv, (2, 4, 5, 3), (1, 0, 4, 5)) - tmp215 = np.copy(f.bb.vv) - tmp215 += np.transpose(tmp127, (1, 0)) - tmp215 += einsum(tmp214, (0, 1, 2, 3), t1.bb, (0, 1), (3, 2)) * -1 - del tmp214 - tmp207 = einsum(l2.bbbb, (0, 1, 2, 3), tmp206, (3, 4, 5, 1), (4, 2, 5, 0)) - del tmp206 - tmp212 = einsum(l2.bbbb, (0, 1, 2, 3), v.bbbb.vvvv, (4, 1, 5, 0), (2, 3, 4, 5)) * -1 - tmp201 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp201 += v.bbbb.oovv * -1 - tmp201 += einsum(t1.bb, (0, 1), tmp104, (2, 1, 3, 4), (0, 2, 4, 3)) * -1 - tmp224 = einsum(v.bbbb.ooov, (0, 1, 2, 3), tmp50, (1, 4, 2, 5), (4, 0, 5, 3)) * -1 - tmp211 = einsum(tmp120, (0, 1, 2, 3), v.bbbb.ovov, (3, 4, 2, 5), (0, 1, 5, 4)) - tmp199 = einsum(v.bbbb.ovoo, (0, 1, 2, 3), tmp50, (3, 4, 2, 5), (4, 0, 5, 1)) * -1 - tmp220 = einsum(tmp219, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) * -1 - del tmp219 - tmp203 = np.copy(f.bb.ov) - tmp203 += tmp91 - tmp203 += tmp177 - tmp208 = einsum(tmp176, (0, 1, 2, 3), l2.abab, (2, 4, 0, 5), (1, 5, 3, 4)) - tmp202 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp202 += tmp175 - del tmp175 - tmp223 = np.copy(v.bbbb.ooov) - tmp223 += np.transpose(tmp89, (0, 2, 1, 3)) - tmp221 = einsum(tmp101, (0, 1, 2, 3), l2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - del tmp101 - tmp197 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), l1.bb, (3, 4), (4, 0, 1, 2)) - tmp216 = einsum(tmp188, (0, 1), tmp50, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp226 = einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp52, (4, 2), (4, 0, 1, 3)) - tmp178 = np.copy(f.bb.ov) - tmp178 += tmp91 - del tmp91 - tmp178 += tmp177 - del tmp177 - tmp195 = einsum(l1.bb, (0, 1), tmp194, (1, 2, 3, 4), (2, 3, 4, 0)) - del tmp194 - tmp182 = np.copy(f.bb.oo) - tmp182 += np.transpose(tmp105, (1, 0)) - tmp182 += tmp180 * -1 - del tmp180 - tmp182 += tmp181 - del tmp181 - tmp193 = np.copy(v.bbbb.ooov) - tmp193 += np.transpose(tmp89, (0, 2, 1, 3)) - tmp196 = einsum(tmp89, (0, 1, 2, 3), tmp50, (0, 4, 2, 5), (4, 1, 5, 3)) * -1 - tmp200 = einsum(tmp38, (0, 1, 2, 3), v.aabb.ooov, (1, 0, 4, 5), (2, 4, 3, 5)) - tmp192 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 1, 0, 3), (2, 3)) - tmp168 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 1), (0, 3)) - tmp172 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) - tmp172 += v.aaaa.oovv * -1 - tmp172 += einsum(tmp29, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 3, 1)) * -1 - tmp179 = np.copy(np.transpose(v.aabb.vvoo, (2, 3, 0, 1))) - tmp179 += np.transpose(tmp95, (0, 1, 3, 2)) - del tmp95 - tmp155 = np.copy(f.aa.ov) - tmp155 += tmp140 - tmp155 += tmp6 - tmp87 = np.copy(f.aa.vv) - tmp87 += np.transpose(tmp84, (1, 0)) - tmp87 += np.transpose(tmp86, (1, 0)) * -1 - tmp183 = einsum(v.aabb.ovov, (0, 1, 2, 3), tmp71, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp185 = np.copy(f.bb.vv) - tmp185 += np.transpose(tmp127, (1, 0)) - tmp185 += einsum(tmp173, (0, 1, 2, 3), t1.bb, (0, 1), (3, 2)) * -1 - tmp174 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 1, 3))) - tmp174 += v.bbbb.oovv * -1 - tmp174 += einsum(tmp173, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 3, 1)) * -1 - del tmp173 - tmp191 = np.copy(v.aabb.oovv) - tmp191 += einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp154 = np.copy(f.aa.oo) - tmp154 += np.transpose(tmp59, (1, 0)) - tmp154 += np.transpose(tmp149, (1, 0)) * -1 - del tmp149 - tmp154 += np.transpose(tmp153, (1, 0)) - del tmp153 - tmp184 = einsum(l2.abab, (0, 1, 2, 3), v.aabb.vvvv, (4, 0, 5, 1), (2, 3, 4, 5)) - tmp190 = np.copy(v.aabb.oooo) - tmp190 += np.transpose(tmp12, (1, 0, 2, 3)) - del tmp12 - tmp190 += einsum(t1.aa, (0, 1), tmp3, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp189 = np.copy(v.aabb.ooov) - tmp189 += tmp4 - tmp164 = einsum(tmp163, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) * -1 - del tmp163 - tmp145 = einsum(l2.aaaa, (0, 1, 2, 3), tmp144, (3, 4, 5, 1), (4, 2, 5, 0)) - del tmp144 - tmp147 = einsum(l2.abab, (0, 1, 2, 3), tmp146, (4, 3, 5, 1), (4, 2, 5, 0)) - tmp139 = np.copy(f.aa.oo) - tmp139 += np.transpose(tmp59, (1, 0)) - tmp139 += np.transpose(tmp61, (1, 0)) * -1 - tmp139 += tmp62 - tmp130 = np.copy(v.aaaa.ooov) - tmp130 += np.transpose(tmp0, (0, 2, 1, 3)) - tmp166 = np.copy(v.aaaa.oooo) - tmp166 += np.transpose(tmp21, (0, 3, 1, 2)) * -1 - del tmp21 - tmp135 = einsum(v.aabb.ovoo, (0, 1, 2, 3), tmp48, (4, 3, 2, 5), (4, 0, 5, 1)) - tmp138 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp138 += v.aaaa.oovv * -1 - tmp138 += einsum(t1.aa, (0, 1), tmp68, (2, 1, 3, 4), (0, 2, 4, 3)) * -1 - tmp136 = einsum(l1.aa, (0, 1), v.aaaa.ovvv, (2, 3, 4, 0), (1, 2, 3, 4)) - tmp169 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp40, (4, 2), (4, 0, 1, 3)) - tmp134 = einsum(tmp48, (0, 1, 2, 3), tmp2, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp167 = np.copy(v.aaaa.ooov) - tmp167 += np.transpose(tmp0, (0, 2, 1, 3)) - tmp159 = np.copy(f.aa.vv) - tmp159 += np.transpose(tmp84, (1, 0)) - del tmp84 - tmp159 += tmp86 * -1 - del tmp86 - tmp158 = einsum(l2.aaaa, (0, 1, 2, 3), v.aaaa.vvvv, (4, 1, 5, 0), (2, 3, 4, 5)) * -1 - tmp157 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), tmp36, (4, 5, 0, 3), (5, 4, 1, 2)) - tmp133 = einsum(tmp36, (0, 1, 2, 3), tmp0, (0, 4, 2, 5), (1, 4, 3, 5)) * -1 - tmp170 = einsum(tmp0, (0, 1, 2, 3), tmp36, (4, 0, 1, 5), (4, 2, 5, 3)) - tmp165 = einsum(l2.aaaa, (0, 1, 2, 3), tmp22, (2, 3, 4, 5), (4, 5, 0, 1)) - del tmp22 - tmp137 = einsum(v.aaaa.ovoo, (0, 1, 2, 3), tmp36, (3, 4, 2, 5), (4, 0, 5, 1)) * -1 - tmp132 = einsum(tmp131, (0, 1, 2, 3), l1.aa, (4, 0), (1, 2, 3, 4)) - del tmp131 - tmp171 = einsum(v.aaaa.ooov, (0, 1, 2, 3), tmp36, (1, 4, 2, 5), (4, 0, 5, 3)) * -1 - tmp141 = np.copy(f.aa.ov) - tmp141 += tmp140 - del tmp140 - tmp141 += tmp6 - del tmp6 - tmp156 = einsum(tmp66, (0, 1, 2, 3), v.aaaa.ovov, (3, 4, 2, 5), (0, 1, 5, 4)) - tmp160 = einsum(tmp152, (0, 1), tmp36, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp109 = einsum(v.aabb.vvvv, (0, 1, 2, 3), t1.aa, (4, 1), (4, 0, 2, 3)) - tmp33 = np.copy(tmp30) - del tmp30 - tmp33 += tmp31 - del tmp31 - tmp33 += tmp32 * 2 - del tmp32 - tmp88 = np.copy(tmp40) - tmp88 += tmp41 * 2 - del tmp41 - tmp88 += tmp42 - del tmp42 - tmp126 = np.copy(t1.bb) * -1 - tmp126 += tmp46 * -1 - tmp126 += tmp47 * -2 - tmp126 += tmp49 - tmp126 += tmp51 * 2 - tmp126 += tmp56 - tmp108 = einsum(t1.bb, (0, 1), v.bbbb.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp110 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (4, 1), (4, 0, 2, 3)) - tmp129 = np.copy(f.bb.vv) - tmp129 += np.transpose(tmp127, (1, 0)) - del tmp127 - tmp129 += einsum(tmp128, (0, 1, 2, 3), t1.bb, (0, 1), (3, 2)) * -1 - del tmp128 - tmp115 = np.copy(tmp112) - tmp115 += tmp113 * 4 - tmp115 += einsum(tmp50, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) * 2 - tmp117 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (4, 3, 0, 5), (5, 1, 4, 2)) - tmp117 += einsum(t1.aa, (0, 1), tmp48, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp111 = np.copy(np.transpose(l2.abab, (2, 3, 0, 1))) * 0.5 - tmp111 += einsum(l2.abab, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 0), (4, 3, 5, 1)) - tmp111 += einsum(tmp38, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -0.5 - tmp111 += einsum(l2.bbbb, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (4, 2, 5, 0)) - tmp103 = np.copy(np.transpose(v.bbbb.ooov, (0, 2, 1, 3))) - tmp103 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (4, 2, 5, 3), (4, 0, 1, 5)) * -1 - tmp103 += einsum(t2.bbbb, (0, 1, 2, 3), tmp98, (4, 1, 5, 3), (5, 0, 4, 2)) * 2 - del tmp98 - tmp103 += einsum(tmp14, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (2, 4, 1, 5)) - tmp103 += einsum(t2.bbbb, (0, 1, 2, 3), tmp94, (4, 3), (4, 0, 1, 2)) - tmp103 += einsum(tmp99, (0, 1, 2, 3), t1.bb, (4, 3), (1, 0, 4, 2)) - del tmp99 - tmp103 += einsum(t1.bb, (0, 1), tmp102, (0, 2, 3, 4), (3, 2, 4, 1)) * -1 - del tmp102 - tmp121 = einsum(t2.bbbb, (0, 1, 2, 3), l1.bb, (3, 4), (4, 0, 1, 2)) - tmp121 += np.transpose(tmp50, (1, 0, 2, 3)) - tmp121 += np.transpose(tmp118, (0, 2, 1, 3)) * 0.5 - tmp121 += np.transpose(tmp119, (0, 2, 1, 3)) * 2 - tmp121 += einsum(t1.bb, (0, 1), tmp120, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - tmp28 = np.copy(tmp25) - del tmp25 - tmp28 += tmp26 * 2 - del tmp26 - tmp28 += tmp27 - del tmp27 - tmp45 = np.copy(np.transpose(l1.aa, (1, 0))) * -1 - tmp45 += t1.aa * -1 - tmp45 += tmp34 * -2 - tmp45 += tmp35 * -1 - tmp45 += tmp37 * 2 - tmp45 += tmp39 - tmp45 += tmp44 - del tmp44 - tmp125 = np.copy(np.transpose(tmp122, (1, 0, 3, 2))) - tmp125 += np.transpose(tmp120, (2, 1, 0, 3)) - del tmp120 - tmp124 = np.copy(tmp70) - tmp124 += np.transpose(tmp71, (1, 0, 2, 3)) - tmp114 = np.copy(np.transpose(l2.bbbb, (2, 3, 0, 1))) - tmp114 += tmp112 * 0.5 - del tmp112 - tmp114 += tmp113 * 2 - del tmp113 - tmp116 = einsum(l1.bb, (0, 1), t2.abab, (2, 3, 4, 0), (2, 1, 3, 4)) - tmp116 += tmp48 - tmp116 += einsum(tmp48, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 2, 5)) * 2 - tmp116 += einsum(tmp38, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (1, 2, 4, 5)) * -1 - tmp116 += einsum(t2.abab, (0, 1, 2, 3), tmp50, (4, 1, 5, 3), (0, 4, 5, 2)) * -2 - tmp116 += einsum(t1.aa, (0, 1), tmp72, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - tmp107 = np.copy(f.bb.oo) * 0.5 - tmp107 += np.transpose(tmp105, (1, 0)) * 0.5 - del tmp105 - tmp107 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) * 0.5 - tmp107 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp107 += einsum(t1.bb, (0, 1), tmp106, (0, 2, 3, 1), (2, 3)) * -0.5 - del tmp106 - tmp107 += einsum(tmp94, (0, 1), t1.bb, (2, 1), (2, 0)) * 0.5 - tmp123 = np.copy(tmp118) - del tmp118 - tmp123 += tmp119 * 4 - del tmp119 - tmp123 += einsum(t1.bb, (0, 1), tmp122, (2, 0, 3, 4), (2, 4, 3, 1)) * 2 - del tmp122 - tmp57 = np.copy(np.transpose(l1.bb, (1, 0))) * -1 - tmp57 += t1.bb * -1 - tmp57 += tmp46 * -1 - del tmp46 - tmp57 += tmp47 * -2 - del tmp47 - tmp57 += tmp49 - del tmp49 - tmp57 += tmp51 * 2 - del tmp51 - tmp57 += tmp56 - del tmp56 - tmp97 = np.copy(np.transpose(v.aabb.ovoo, (0, 2, 3, 1))) - tmp97 += tmp2 - tmp97 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 5, 3), (0, 1, 5, 4)) - tmp97 += einsum(tmp90, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 1, 0, 5)) - del tmp90 - tmp97 += einsum(tmp3, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 2, 1, 5)) * 2 - tmp97 += einsum(t2.abab, (0, 1, 2, 3), tmp5, (0, 4, 5, 3), (4, 1, 5, 2)) * -1 - tmp97 += einsum(t2.abab, (0, 1, 2, 3), tmp94, (4, 3), (0, 1, 4, 2)) - tmp97 += einsum(t1.aa, (0, 1), tmp96, (2, 3, 1, 4), (0, 3, 2, 4)) - del tmp96 - tmp97 += einsum(t1.aa, (0, 1), tmp16, (0, 2, 3, 4), (2, 4, 3, 1)) * -1 - tmp81 = np.copy(tmp74) * 4 - tmp81 += tmp75 - tmp82 = np.copy(tmp70) - del tmp70 - tmp82 += np.transpose(tmp71, (0, 1, 3, 2)) - del tmp71 - tmp63 = np.copy(f.aa.oo) - tmp63 += np.transpose(tmp59, (1, 0)) - del tmp59 - tmp63 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 3, 1), (4, 0)) * -2 - tmp63 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp63 += np.transpose(tmp61, (1, 0)) * -1 - del tmp61 - tmp63 += tmp62 - del tmp62 - tmp80 = einsum(t1.aa, (0, 1), tmp36, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - tmp73 = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 4), (4, 0, 1, 3)) - tmp73 += tmp38 - tmp73 += einsum(t2.abab, (0, 1, 2, 3), tmp36, (4, 0, 5, 2), (4, 5, 1, 3)) * -2 - tmp73 += einsum(t2.bbbb, (0, 1, 2, 3), tmp38, (4, 5, 1, 3), (4, 5, 0, 2)) * 2 - tmp73 += einsum(tmp48, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (0, 4, 2, 5)) * -1 - tmp73 += einsum(tmp72, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) * -1 - del tmp72 - tmp17 = np.copy(v.aabb.ooov) - tmp17 += einsum(v.aabb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp17 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp17 += einsum(t2.abab, (0, 1, 2, 3), tmp1, (4, 5, 0, 2), (5, 4, 1, 3)) - del tmp1 - tmp17 += einsum(tmp3, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (4, 0, 2, 5)) * -1 - del tmp3 - tmp17 += einsum(tmp5, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (1, 0, 4, 5)) * 2 - del tmp5 - tmp17 += einsum(t2.abab, (0, 1, 2, 3), tmp9, (4, 2), (0, 4, 1, 3)) - tmp17 += einsum(t1.aa, (0, 1), tmp11, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp17 += einsum(tmp16, (0, 1, 2, 3), t1.bb, (2, 4), (1, 0, 3, 4)) * -1 - del tmp16 - tmp24 = np.copy(np.transpose(v.aaaa.ooov, (0, 2, 1, 3))) - tmp24 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (0, 4, 5, 2)) * -1 - tmp24 += einsum(tmp18, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (2, 4, 0, 5)) * 2 - del tmp18 - tmp24 += einsum(t2.abab, (0, 1, 2, 3), tmp19, (4, 5, 1, 3), (5, 0, 4, 2)) - del tmp19 - tmp24 += einsum(tmp9, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp24 += einsum(t1.aa, (0, 1), tmp20, (2, 3, 4, 1), (3, 2, 0, 4)) - del tmp20 - tmp24 += einsum(tmp23, (0, 1, 2, 3), t1.aa, (0, 4), (2, 1, 3, 4)) * -1 - del tmp23 - tmp64 = einsum(v.aabb.vvvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp58 = np.copy(tmp52) * 0.5 - tmp58 += tmp53 * 0.5 - del tmp53 - tmp58 += tmp54 - del tmp54 - tmp78 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 5, 1), (5, 0, 4, 3)) - tmp78 += einsum(tmp38, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - tmp69 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 5, 1), (5, 0, 4, 2)) * 4 - tmp69 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp83 = np.copy(t1.aa) * -0.5 - tmp83 += tmp34 * -1 - del tmp34 - tmp83 += tmp35 * -0.5 - del tmp35 - tmp83 += tmp37 - del tmp37 - tmp83 += tmp39 * 0.5 - del tmp39 - tmp83 += einsum(tmp43, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp79 = np.copy(v.aaaa.ovvv) - tmp79 += einsum(v.aaaa.vvvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 2, 1)) * -1 - tmp77 = einsum(l1.aa, (0, 1), t2.aaaa, (2, 3, 4, 0), (1, 2, 3, 4)) - tmp77 += np.transpose(tmp36, (1, 0, 2, 3)) - tmp77 += np.transpose(tmp74, (0, 2, 1, 3)) * 2 - del tmp74 - tmp77 += np.transpose(tmp75, (0, 2, 1, 3)) * 0.5 - del tmp75 - tmp77 += einsum(tmp76, (0, 1, 2, 3), t1.aa, (0, 4), (1, 3, 2, 4)) - del tmp76 - tmp67 = np.copy(np.transpose(l2.abab, (2, 3, 0, 1))) * 0.5 - tmp67 += einsum(l2.aaaa, (0, 1, 2, 3), t2.abab, (3, 4, 1, 5), (2, 4, 0, 5)) - tmp67 += einsum(t2.bbbb, (0, 1, 2, 3), l2.abab, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp67 += einsum(tmp48, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) * -0.5 - l2new.bbbb = np.copy(np.transpose(v.bbbb.ovov, (1, 3, 0, 2))) - l2new.bbbb += einsum(tmp193, (0, 1, 2, 3), l1.bb, (4, 0), (3, 4, 2, 1)) * -1 - del tmp193 - l2new.bbbb += np.transpose(v.bbbb.ovov, (3, 1, 0, 2)) * -1 - l2new.bbbb += np.transpose(tmp195, (3, 2, 0, 1)) - l2new.bbbb += np.transpose(tmp196, (3, 2, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp197, (2, 3, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp198, (3, 2, 0, 1)) - l2new.bbbb += np.transpose(tmp199, (3, 2, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp200, (3, 2, 0, 1)) - l2new.bbbb += einsum(tmp201, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 0), (2, 4, 5, 1)) * -2 - del tmp201 - l2new.bbbb += einsum(l2.abab, (0, 1, 2, 3), tmp202, (2, 4, 0, 5), (5, 1, 3, 4)) * -1 - del tmp202 - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp182, (3, 4), (0, 1, 2, 4)) * -2 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp203, (2, 3), (3, 0, 1, 2)) * -1 - del tmp203 - l2new.bbbb += np.transpose(tmp196, (3, 2, 1, 0)) * -2 - l2new.bbbb += np.transpose(tmp197, (2, 3, 1, 0)) - l2new.bbbb += np.transpose(tmp198, (3, 2, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp199, (3, 2, 1, 0)) * -2 - l2new.bbbb += np.transpose(tmp200, (3, 2, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp207, (2, 3, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp208, (2, 3, 0, 1)) - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp210, (3, 4), (0, 1, 4, 2)) * 2 - del tmp210 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp178, (2, 3), (3, 0, 2, 1)) - l2new.bbbb += np.transpose(tmp196, (2, 3, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp197, (3, 2, 0, 1)) - l2new.bbbb += np.transpose(tmp198, (2, 3, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp199, (2, 3, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp200, (2, 3, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp207, (3, 2, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp208, (3, 2, 1, 0)) - l2new.bbbb += einsum(tmp178, (0, 1), l1.bb, (2, 3), (2, 1, 3, 0)) - l2new.bbbb += np.transpose(tmp196, (2, 3, 1, 0)) * 2 - del tmp196 - l2new.bbbb += np.transpose(tmp197, (3, 2, 1, 0)) * -1 - del tmp197 - l2new.bbbb += np.transpose(tmp198, (2, 3, 1, 0)) - del tmp198 - l2new.bbbb += np.transpose(tmp199, (2, 3, 1, 0)) * 2 - del tmp199 - l2new.bbbb += np.transpose(tmp200, (2, 3, 1, 0)) - del tmp200 - l2new.bbbb += np.transpose(tmp207, (3, 2, 0, 1)) * -2 - del tmp207 - l2new.bbbb += np.transpose(tmp208, (3, 2, 0, 1)) * -1 - del tmp208 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp178, (2, 3), (0, 3, 2, 1)) * -1 - l2new.bbbb += np.transpose(tmp211, (3, 2, 1, 0)) * 2 - del tmp211 - l2new.bbbb += np.transpose(tmp212, (3, 2, 1, 0)) * 2 - del tmp212 - l2new.bbbb += np.transpose(tmp213, (2, 3, 1, 0)) * 2 - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp215, (4, 1), (4, 0, 2, 3)) * -1 - del tmp215 - l2new.bbbb += np.transpose(tmp216, (2, 3, 1, 0)) * -2 - l2new.bbbb += np.transpose(tmp220, (2, 3, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp213, (3, 2, 1, 0)) * -2 - del tmp213 - l2new.bbbb += np.transpose(tmp220, (3, 2, 1, 0)) * 2 - del tmp220 - l2new.bbbb += np.transpose(tmp216, (3, 2, 1, 0)) * 2 - del tmp216 - l2new.bbbb += np.transpose(tmp221, (2, 3, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp221, (2, 3, 1, 0)) * 2 - del tmp221 - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp222, (2, 4, 3, 5), (0, 1, 4, 5)) * 2 - del tmp222 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp223, (1, 2, 3, 4), (4, 0, 2, 3)) - del tmp223 - l2new.bbbb += np.transpose(tmp195, (3, 2, 1, 0)) * -1 - del tmp195 - l2new.bbbb += np.transpose(tmp224, (3, 2, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp225, (3, 2, 0, 1)) * -2 - l2new.bbbb += einsum(tmp192, (0, 1), l1.bb, (2, 3), (1, 2, 3, 0)) - l2new.bbbb += np.transpose(tmp226, (3, 2, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp224, (2, 3, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp225, (2, 3, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp226, (2, 3, 0, 1)) - l2new.bbbb += einsum(tmp192, (0, 1), l1.bb, (2, 3), (2, 1, 3, 0)) * -1 - l2new.bbbb += np.transpose(tmp224, (3, 2, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp225, (3, 2, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp226, (3, 2, 1, 0)) - l2new.bbbb += einsum(l1.bb, (0, 1), tmp192, (2, 3), (3, 0, 2, 1)) * -1 - l2new.bbbb += np.transpose(tmp224, (2, 3, 1, 0)) * -2 - del tmp224 - l2new.bbbb += np.transpose(tmp225, (2, 3, 1, 0)) * -2 - del tmp225 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp192, (2, 3), (0, 3, 2, 1)) - l2new.bbbb += np.transpose(tmp226, (2, 3, 1, 0)) * -1 - del tmp226 - l2new.abab = np.copy(np.transpose(v.aabb.ovov, (1, 3, 0, 2))) - l2new.abab += einsum(l1.bb, (0, 1), tmp14, (2, 1, 3, 4), (4, 0, 2, 3)) * -1 - l2new.abab += einsum(tmp2, (0, 1, 2, 3), tmp50, (4, 1, 2, 5), (3, 5, 0, 4)) * -2 - del tmp2 - l2new.abab += einsum(tmp0, (0, 1, 2, 3), tmp38, (0, 2, 4, 5), (3, 5, 1, 4)) * -1 - l2new.abab += einsum(tmp50, (0, 1, 2, 3), v.aabb.ovoo, (4, 5, 2, 1), (5, 3, 4, 0)) * -2 - l2new.abab += einsum(v.aaaa.ovoo, (0, 1, 2, 3), tmp38, (3, 2, 4, 5), (1, 5, 0, 4)) * -1 - l2new.abab += einsum(v.aabb.ovvv, (0, 1, 2, 3), l1.bb, (3, 4), (1, 2, 0, 4)) - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp172, (2, 4, 0, 5), (5, 1, 4, 3)) - del tmp172 - l2new.abab += einsum(l2.bbbb, (0, 1, 2, 3), tmp146, (4, 3, 5, 1), (5, 0, 4, 2)) * 2 - del tmp146 - l2new.abab += einsum(tmp154, (0, 1), l2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1 - l2new.abab += einsum(l1.bb, (0, 1), tmp155, (2, 3), (3, 0, 2, 1)) - l2new.abab += einsum(l1.aa, (0, 1), v.aabb.vvov, (2, 0, 3, 4), (2, 4, 1, 3)) - l2new.abab += einsum(tmp89, (0, 1, 2, 3), tmp48, (4, 0, 2, 5), (5, 3, 4, 1)) * -1 - l2new.abab += einsum(tmp4, (0, 1, 2, 3), tmp36, (4, 0, 1, 5), (5, 3, 4, 2)) * -2 - del tmp4 - l2new.abab += einsum(v.bbbb.ovoo, (0, 1, 2, 3), tmp48, (4, 3, 2, 5), (5, 1, 4, 0)) * -1 - l2new.abab += einsum(tmp36, (0, 1, 2, 3), v.aabb.ooov, (2, 1, 4, 5), (3, 5, 0, 4)) * -2 - l2new.abab += einsum(tmp174, (0, 1, 2, 3), l2.abab, (4, 2, 5, 0), (4, 3, 5, 1)) - del tmp174 - l2new.abab += einsum(tmp176, (0, 1, 2, 3), l2.aaaa, (4, 2, 5, 0), (4, 3, 5, 1)) * 2 - del tmp176 - l2new.abab += einsum(l1.aa, (0, 1), tmp178, (2, 3), (0, 3, 1, 2)) - del tmp178 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp179, (3, 4, 0, 5), (5, 1, 2, 4)) * -1 - del tmp179 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp182, (3, 4), (0, 1, 2, 4)) * -1 - del tmp182 - l2new.abab += einsum(tmp38, (0, 1, 2, 3), v.aabb.ovvv, (1, 4, 5, 3), (4, 5, 0, 2)) * -1 - l2new.abab += np.transpose(tmp183, (2, 3, 0, 1)) - del tmp183 - l2new.abab += np.transpose(tmp184, (2, 3, 0, 1)) - del tmp184 - l2new.abab += einsum(tmp87, (0, 1), l2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) - l2new.abab += einsum(tmp152, (0, 1), tmp38, (2, 0, 3, 4), (1, 4, 2, 3)) * -1 - del tmp152 - l2new.abab += einsum(tmp48, (0, 1, 2, 3), v.aabb.vvov, (4, 3, 2, 5), (4, 5, 0, 1)) * -1 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp185, (1, 4), (0, 4, 2, 3)) - del tmp185 - l2new.abab += einsum(tmp188, (0, 1), tmp48, (2, 3, 0, 4), (4, 1, 2, 3)) * -1 - del tmp188 - l2new.abab += einsum(tmp189, (0, 1, 2, 3), l1.aa, (4, 0), (4, 3, 1, 2)) * -1 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp190, (2, 4, 3, 5), (0, 1, 4, 5)) - del tmp190 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp191, (2, 4, 1, 5), (0, 5, 4, 3)) * -1 - del tmp191 - l2new.abab += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp40, (4, 0), (1, 3, 4, 2)) * -1 - del tmp40 - l2new.abab += einsum(tmp14, (0, 1, 2, 3), tmp38, (4, 0, 1, 5), (3, 5, 4, 2)) - del tmp14 - l2new.abab += einsum(tmp52, (0, 1), v.aabb.ovov, (2, 3, 1, 4), (3, 4, 2, 0)) * -1 - del tmp52 - l2new.abab += einsum(tmp189, (0, 1, 2, 3), tmp48, (0, 4, 2, 5), (5, 3, 1, 4)) - del tmp189 - l2new.abab += einsum(v.aaaa.ooov, (0, 1, 2, 3), tmp38, (1, 2, 4, 5), (3, 5, 0, 4)) - l2new.abab += einsum(tmp168, (0, 1), l1.bb, (2, 3), (1, 2, 0, 3)) * -1 - l2new.abab += einsum(tmp38, (0, 1, 2, 3), tmp0, (0, 1, 4, 5), (5, 3, 4, 2)) - del tmp0 - l2new.abab += einsum(v.bbbb.ooov, (0, 1, 2, 3), tmp48, (4, 1, 2, 5), (5, 3, 4, 0)) - l2new.abab += einsum(l1.aa, (0, 1), tmp192, (2, 3), (0, 3, 1, 2)) * -1 - del tmp192 - l2new.abab += einsum(tmp48, (0, 1, 2, 3), tmp89, (1, 2, 4, 5), (3, 5, 0, 4)) - del tmp89 - l2new.aaaa = np.copy(np.transpose(v.aaaa.ovov, (1, 3, 0, 2))) - l2new.aaaa += einsum(tmp130, (0, 1, 2, 3), l1.aa, (4, 0), (3, 4, 2, 1)) * -1 - del tmp130 - l2new.aaaa += np.transpose(v.aaaa.ovov, (3, 1, 0, 2)) * -1 - l2new.aaaa += np.transpose(tmp132, (3, 2, 0, 1)) - l2new.aaaa += np.transpose(tmp133, (3, 2, 0, 1)) * 2 - l2new.aaaa += np.transpose(tmp134, (3, 2, 0, 1)) - l2new.aaaa += np.transpose(tmp135, (3, 2, 0, 1)) - l2new.aaaa += np.transpose(tmp136, (2, 3, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp137, (3, 2, 0, 1)) * 2 - l2new.aaaa += einsum(tmp138, (0, 1, 2, 3), l2.aaaa, (4, 3, 5, 0), (2, 4, 5, 1)) * -2 - del tmp138 - l2new.aaaa += einsum(tmp11, (0, 1, 2, 3), l2.abab, (4, 3, 5, 1), (2, 4, 5, 0)) * -1 - del tmp11 - l2new.aaaa += einsum(l2.aaaa, (0, 1, 2, 3), tmp139, (3, 4), (0, 1, 2, 4)) * -2 - del tmp139 - l2new.aaaa += einsum(tmp141, (0, 1), l1.aa, (2, 3), (1, 2, 3, 0)) * -1 - del tmp141 - l2new.aaaa += np.transpose(tmp133, (3, 2, 1, 0)) * -2 - l2new.aaaa += np.transpose(tmp134, (3, 2, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp135, (3, 2, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp136, (2, 3, 1, 0)) - l2new.aaaa += np.transpose(tmp137, (3, 2, 1, 0)) * -2 - l2new.aaaa += np.transpose(tmp145, (2, 3, 0, 1)) * 2 - l2new.aaaa += np.transpose(tmp147, (2, 3, 0, 1)) - l2new.aaaa += einsum(tmp154, (0, 1), l2.aaaa, (2, 3, 4, 0), (2, 3, 1, 4)) * 2 - del tmp154 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp155, (2, 3), (3, 0, 2, 1)) - l2new.aaaa += np.transpose(tmp134, (2, 3, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp133, (2, 3, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp135, (2, 3, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp136, (3, 2, 0, 1)) - l2new.aaaa += np.transpose(tmp137, (2, 3, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp145, (3, 2, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp147, (3, 2, 1, 0)) - l2new.aaaa += einsum(tmp155, (0, 1), l1.aa, (2, 3), (2, 1, 3, 0)) - l2new.aaaa += np.transpose(tmp134, (2, 3, 1, 0)) - del tmp134 - l2new.aaaa += np.transpose(tmp133, (2, 3, 1, 0)) * 2 - del tmp133 - l2new.aaaa += np.transpose(tmp135, (2, 3, 1, 0)) - del tmp135 - l2new.aaaa += np.transpose(tmp136, (3, 2, 1, 0)) * -1 - del tmp136 - l2new.aaaa += np.transpose(tmp137, (2, 3, 1, 0)) * 2 - del tmp137 - l2new.aaaa += np.transpose(tmp145, (3, 2, 0, 1)) * -2 - del tmp145 - l2new.aaaa += np.transpose(tmp147, (3, 2, 0, 1)) * -1 - del tmp147 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp155, (2, 3), (0, 3, 2, 1)) * -1 - del tmp155 - l2new.aaaa += np.transpose(tmp156, (3, 2, 1, 0)) * 2 - del tmp156 - l2new.aaaa += np.transpose(tmp157, (2, 3, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp158, (3, 2, 1, 0)) * 2 - del tmp158 - l2new.aaaa += einsum(tmp159, (0, 1), l2.aaaa, (2, 1, 3, 4), (0, 2, 3, 4)) * -1 - del tmp159 - l2new.aaaa += np.transpose(tmp160, (2, 3, 1, 0)) * -2 - l2new.aaaa += np.transpose(tmp164, (2, 3, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp157, (3, 2, 1, 0)) * -2 - del tmp157 - l2new.aaaa += np.transpose(tmp164, (3, 2, 1, 0)) * 2 - del tmp164 - l2new.aaaa += np.transpose(tmp160, (3, 2, 1, 0)) * 2 - del tmp160 - l2new.aaaa += np.transpose(tmp165, (2, 3, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp165, (2, 3, 1, 0)) * 2 - del tmp165 - l2new.aaaa += einsum(l2.aaaa, (0, 1, 2, 3), tmp166, (2, 4, 3, 5), (0, 1, 4, 5)) * 2 - del tmp166 - l2new.aaaa += einsum(tmp167, (0, 1, 2, 3), l1.aa, (4, 0), (3, 4, 1, 2)) - del tmp167 - l2new.aaaa += np.transpose(tmp132, (3, 2, 1, 0)) * -1 - del tmp132 - l2new.aaaa += einsum(tmp168, (0, 1), l1.aa, (2, 3), (1, 2, 3, 0)) - l2new.aaaa += np.transpose(tmp169, (3, 2, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp170, (3, 2, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp171, (3, 2, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp169, (2, 3, 0, 1)) - l2new.aaaa += einsum(tmp168, (0, 1), l1.aa, (2, 3), (2, 1, 3, 0)) * -1 - l2new.aaaa += np.transpose(tmp170, (2, 3, 0, 1)) * 2 - l2new.aaaa += np.transpose(tmp171, (2, 3, 0, 1)) * 2 - l2new.aaaa += np.transpose(tmp169, (3, 2, 1, 0)) - l2new.aaaa += einsum(tmp168, (0, 1), l1.aa, (2, 3), (1, 2, 0, 3)) * -1 - l2new.aaaa += np.transpose(tmp170, (3, 2, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp171, (3, 2, 1, 0)) * 2 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp168, (2, 3), (0, 3, 2, 1)) - del tmp168 - l2new.aaaa += np.transpose(tmp169, (2, 3, 1, 0)) * -1 - del tmp169 - l2new.aaaa += np.transpose(tmp170, (2, 3, 1, 0)) * -2 - del tmp170 - l2new.aaaa += np.transpose(tmp171, (2, 3, 1, 0)) * -2 - del tmp171 - l1new.bb = np.copy(np.transpose(f.bb.ov, (1, 0))) - l1new.bb += einsum(l1.bb, (0, 1), v.bbbb.oovv, (2, 1, 3, 0), (3, 2)) * -1 - l1new.bb += einsum(l2.abab, (0, 1, 2, 3), tmp97, (2, 3, 4, 0), (1, 4)) * -1 - del tmp97 - l1new.bb += einsum(l2.bbbb, (0, 1, 2, 3), tmp103, (4, 2, 3, 1), (0, 4)) * 2 - del tmp103 - l1new.bb += einsum(tmp104, (0, 1, 2, 3), tmp33, (2, 1), (3, 0)) * -1 - del tmp104 - l1new.bb += einsum(v.aabb.vvov, (0, 1, 2, 3), tmp28, (0, 1), (3, 2)) - l1new.bb += einsum(tmp45, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (3, 2)) * -1 - l1new.bb += einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp57, (2, 3), (1, 0)) * -1 - l1new.bb += einsum(tmp55, (0, 1), v.bbbb.ovoo, (2, 3, 0, 1), (3, 2)) * -1 - l1new.bb += einsum(v.aabb.ooov, (0, 1, 2, 3), tmp88, (1, 0), (3, 2)) * -1 - l1new.bb += einsum(l1.bb, (0, 1), tmp107, (1, 2), (0, 2)) * -2 - del tmp107 - l1new.bb += einsum(v.bbbb.oovv, (0, 1, 2, 3), tmp50, (4, 1, 0, 3), (2, 4)) * -2 - l1new.bb += einsum(tmp108, (0, 1, 2, 3), l2.bbbb, (3, 2, 4, 0), (1, 4)) * -2 - del tmp108 - l1new.bb += einsum(v.aabb.oovv, (0, 1, 2, 3), tmp38, (1, 0, 4, 3), (2, 4)) * -1 - del tmp38 - l1new.bb += einsum(l2.abab, (0, 1, 2, 3), tmp109, (2, 0, 4, 1), (4, 3)) - del tmp109 - l1new.bb += einsum(tmp110, (0, 1, 2, 3), tmp50, (4, 0, 1, 3), (2, 4)) * -2 - del tmp50, tmp110 - l1new.bb += einsum(tmp111, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 3), (4, 1)) * 2 - del tmp111 - l1new.bb += einsum(tmp114, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 2), (4, 0)) * 2 - del tmp114 - l1new.bb += einsum(tmp115, (0, 1, 2, 3), v.bbbb.ovvv, (1, 4, 3, 2), (4, 0)) * -1 - del tmp115 - l1new.bb += einsum(tmp116, (0, 1, 2, 3), v.aabb.ovov, (0, 3, 2, 4), (4, 1)) * -1 - del tmp116 - l1new.bb += einsum(tmp117, (0, 1, 2, 3), v.aabb.vvov, (3, 2, 1, 4), (4, 0)) * -1 - del tmp117 - l1new.bb += einsum(tmp121, (0, 1, 2, 3), v.bbbb.ovov, (1, 3, 2, 4), (4, 0)) * -2 - del tmp121 - l1new.bb += einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp123, (4, 2, 0, 3), (1, 4)) - del tmp123 - l1new.bb += einsum(v.aabb.ooov, (0, 1, 2, 3), tmp124, (1, 0, 4, 2), (3, 4)) - del tmp124 - l1new.bb += einsum(v.bbbb.ooov, (0, 1, 2, 3), tmp125, (1, 4, 0, 2), (3, 4)) * 2 - del tmp125 - l1new.bb += einsum(tmp126, (0, 1), v.bbbb.ovov, (2, 1, 0, 3), (3, 2)) - del tmp126 - l1new.bb += einsum(tmp55, (0, 1), v.bbbb.ooov, (2, 0, 1, 3), (3, 2)) - l1new.bb += einsum(tmp129, (0, 1), l1.bb, (0, 2), (1, 2)) - del tmp129 - l1new.bb += einsum(tmp94, (0, 1), tmp55, (2, 0), (1, 2)) * -1 - del tmp94, tmp55 - l1new.aa = einsum(v.aaaa.oovv, (0, 1, 2, 3), l1.aa, (3, 1), (2, 0)) * -1 - l1new.aa += np.transpose(f.aa.ov, (1, 0)) - l1new.aa += einsum(tmp17, (0, 1, 2, 3), l2.abab, (4, 3, 0, 2), (4, 1)) * -1 - del tmp17 - l1new.aa += einsum(tmp24, (0, 1, 2, 3), l2.aaaa, (4, 3, 1, 2), (4, 0)) * 2 - del tmp24 - l1new.aa += einsum(tmp28, (0, 1), tmp29, (2, 3, 1, 0), (3, 2)) * -1 - del tmp29, tmp28 - l1new.aa += einsum(v.aabb.ovvv, (0, 1, 2, 3), tmp33, (3, 2), (1, 0)) - del tmp33 - l1new.aa += einsum(tmp45, (0, 1), v.aaaa.ovov, (2, 3, 0, 1), (3, 2)) * -1 - del tmp45 - l1new.aa += einsum(tmp57, (0, 1), v.aabb.ovov, (2, 3, 0, 1), (3, 2)) * -1 - del tmp57 - l1new.aa += einsum(tmp43, (0, 1), v.aaaa.ovoo, (2, 3, 1, 0), (3, 2)) * -2 - l1new.aa += einsum(tmp58, (0, 1), v.aabb.ovoo, (2, 3, 1, 0), (3, 2)) * -2 - del tmp58 - l1new.aa += einsum(l1.aa, (0, 1), tmp63, (1, 2), (0, 2)) * -1 - del tmp63 - l1new.aa += einsum(tmp64, (0, 1, 2, 3), l2.abab, (2, 3, 4, 0), (1, 4)) - del tmp64 - l1new.aa += einsum(tmp48, (0, 1, 2, 3), v.aabb.vvoo, (4, 3, 2, 1), (4, 0)) * -1 - del tmp48 - l1new.aa += einsum(v.aaaa.oovv, (0, 1, 2, 3), tmp36, (4, 1, 0, 3), (2, 4)) * -2 - del tmp36 - l1new.aa += einsum(tmp65, (0, 1, 2, 3), v.aaaa.ooov, (1, 3, 2, 4), (4, 0)) * 2 - del tmp65 - l1new.aa += einsum(v.aaaa.ooov, (0, 1, 2, 3), tmp66, (4, 1, 0, 2), (3, 4)) * -2 - del tmp66 - l1new.aa += einsum(tmp67, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (4, 0)) * 2 - del tmp67 - l1new.aa += einsum(tmp69, (0, 1, 2, 3), tmp68, (1, 3, 2, 4), (4, 0)) - del tmp69 - l1new.aa += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp73, (4, 0, 2, 3), (1, 4)) * -1 - del tmp73 - l1new.aa += einsum(tmp77, (0, 1, 2, 3), v.aaaa.ovov, (1, 3, 2, 4), (4, 0)) * -2 - del tmp77 - l1new.aa += einsum(tmp78, (0, 1, 2, 3), v.aabb.ovvv, (1, 4, 3, 2), (4, 0)) * -1 - del tmp78 - l1new.aa += einsum(tmp79, (0, 1, 2, 3), l2.aaaa, (1, 2, 4, 0), (3, 4)) * -2 - del tmp79 - l1new.aa += einsum(tmp68, (0, 1, 2, 3), tmp80, (4, 0, 2, 1), (3, 4)) * -2 - del tmp68, tmp80 - l1new.aa += einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp81, (4, 2, 0, 3), (1, 4)) - del tmp81 - l1new.aa += einsum(v.aabb.ovoo, (0, 1, 2, 3), tmp82, (4, 0, 3, 2), (1, 4)) - del tmp82 - l1new.aa += einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp83, (2, 1), (3, 0)) * 2 - del tmp83 - l1new.aa += einsum(v.aaaa.ooov, (0, 1, 2, 3), tmp43, (1, 2), (3, 0)) * 2 - del tmp43 - l1new.aa += einsum(tmp87, (0, 1), l1.aa, (0, 2), (1, 2)) - del tmp87 - l1new.aa += einsum(tmp88, (0, 1), tmp9, (1, 2), (2, 0)) * -1 - del tmp9, tmp88 - - return {f"l1new": l1new, f"l2new": l2new} - -def make_rdm1_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:37:11.881813. - - Parameters - ---------- - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm1 : Namespace of arrays - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - rdm1.aa = Namespace() - rdm1.bb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - tmp4 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 0, 4), (4, 1)) - tmp3 = einsum(l1.bb, (0, 1), t1.bb, (2, 0), (1, 2)) - tmp5 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp2 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 4, 1), (4, 0)) - tmp0 = einsum(t1.aa, (0, 1), l1.aa, (1, 2), (2, 0)) - tmp1 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 1), (4, 0)) - tmp11 = np.copy(tmp3) - tmp11 += tmp4 - tmp11 += tmp5 * 2 - tmp9 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (4, 1), (2, 3, 4, 0)) - tmp10 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp7 = einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp6 = einsum(t1.aa, (0, 1), l2.abab, (1, 2, 3, 4), (3, 0, 4, 2)) - tmp8 = np.copy(tmp0) - tmp8 += tmp1 * 2 - tmp8 += tmp2 - rdm1.bb.vv = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) * 2 - rdm1.bb.vv += einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 0, 1), (4, 3)) - rdm1.bb.vv += einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - rdm1.aa.vv = einsum(l1.aa, (0, 1), t1.aa, (1, 2), (0, 2)) - rdm1.aa.vv += einsum(t2.abab, (0, 1, 2, 3), l2.abab, (4, 3, 0, 1), (4, 2)) - rdm1.aa.vv += einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 0, 1), (4, 2)) * 2 - rdm1.bb.vo = np.copy(l1.bb) - rdm1.aa.vo = np.copy(l1.aa) - rdm1.bb.ov = np.copy(t1.bb) - rdm1.bb.ov += einsum(t2.bbbb, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) * 2 - rdm1.bb.ov += einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 0), (1, 3)) - rdm1.bb.ov += einsum(tmp9, (0, 1, 2, 3), t2.abab, (0, 1, 3, 4), (2, 4)) * -1 - del tmp9 - rdm1.bb.ov += einsum(t2.bbbb, (0, 1, 2, 3), tmp10, (1, 0, 4, 3), (4, 2)) * -2 - del tmp10 - rdm1.bb.ov += einsum(tmp11, (0, 1), t1.bb, (0, 2), (1, 2)) * -1 - del tmp11 - rdm1.aa.ov = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) - rdm1.aa.ov += einsum(t2.aaaa, (0, 1, 2, 3), l1.aa, (3, 1), (0, 2)) * 2 - rdm1.aa.ov += t1.aa - rdm1.aa.ov += einsum(t2.abab, (0, 1, 2, 3), tmp6, (0, 4, 1, 3), (4, 2)) * -1 - del tmp6 - rdm1.aa.ov += einsum(tmp7, (0, 1, 2, 3), t2.aaaa, (1, 0, 4, 3), (2, 4)) * -2 - del tmp7 - rdm1.aa.ov += einsum(t1.aa, (0, 1), tmp8, (0, 2), (2, 1)) * -1 - del tmp8 - rdm1.bb.oo = np.copy(np.transpose(tmp3, (1, 0))) * -1 - del tmp3 - rdm1.bb.oo += np.transpose(tmp4, (1, 0)) * -1 - del tmp4 - rdm1.bb.oo += np.transpose(tmp5, (1, 0)) * -2 - del tmp5 - rdm1.bb.oo += delta.bb.oo - rdm1.aa.oo = np.copy(np.transpose(tmp0, (1, 0))) * -1 - del tmp0 - rdm1.aa.oo += np.transpose(tmp1, (1, 0)) * -2 - del tmp1 - rdm1.aa.oo += delta.aa.oo - del delta - rdm1.aa.oo += np.transpose(tmp2, (1, 0)) * -1 - del tmp2 - rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]]) - rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]]) - - return rdm1 - -def make_rdm2_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:38:15.176887. - - Parameters - ---------- - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm2 : Namespace of arrays - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - rdm2.aaaa = Namespace() - rdm2.abab = Namespace() - rdm2.bbbb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - tmp18 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp9 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 0, 4), (4, 1)) - tmp8 = einsum(l1.bb, (0, 1), t1.bb, (2, 0), (1, 2)) - tmp10 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp13 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (4, 1), (2, 3, 4, 0)) - tmp2 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 4, 1), (4, 0)) - tmp0 = einsum(t1.aa, (0, 1), l1.aa, (1, 2), (2, 0)) - tmp1 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 1), (4, 0)) - tmp6 = einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp26 = einsum(t1.aa, (0, 1), l2.abab, (1, 2, 3, 4), (3, 0, 4, 2)) - tmp88 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp87 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 0, 5), (5, 1, 4, 3)) - tmp69 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp71 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp17 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp19 = einsum(t1.bb, (0, 1), tmp18, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp15 = np.copy(tmp8) - tmp15 += tmp9 - tmp15 += tmp10 * 2 - tmp51 = einsum(t2.abab, (0, 1, 2, 3), tmp13, (0, 4, 5, 2), (4, 5, 1, 3)) - tmp50 = einsum(tmp18, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 2, 4, 5)) * -1 - tmp4 = np.copy(tmp0) * 0.5 - tmp4 += tmp1 - tmp4 += tmp2 * 0.5 - tmp12 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 4, 5), (4, 0, 5, 1)) - tmp14 = einsum(t1.aa, (0, 1), tmp13, (2, 3, 4, 1), (2, 0, 3, 4)) - tmp7 = einsum(tmp6, (0, 1, 2, 3), t1.aa, (4, 3), (0, 1, 4, 2)) - tmp5 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp31 = einsum(tmp6, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (0, 2, 4, 5)) * -1 - tmp30 = einsum(t2.abab, (0, 1, 2, 3), tmp26, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp82 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) - tmp107 = einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp81 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 0, 1), (4, 3)) - tmp110 = einsum(tmp18, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) - tmp89 = np.copy(tmp87) - tmp89 += tmp88 * 4 - tmp104 = einsum(l1.aa, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp64 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 0, 1), (4, 2)) - tmp65 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (4, 3, 0, 1), (4, 2)) - tmp84 = einsum(l2.aaaa, (0, 1, 2, 3), t2.abab, (3, 4, 1, 5), (2, 4, 0, 5)) - tmp85 = einsum(t2.bbbb, (0, 1, 2, 3), l2.abab, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp106 = einsum(t1.aa, (0, 1), tmp6, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp118 = np.copy(tmp69) * 4 - tmp118 += tmp71 - tmp112 = einsum(l2.abab, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 0), (4, 3, 5, 1)) - tmp67 = einsum(t2.abab, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 1), (0, 5, 2, 4)) - tmp52 = np.copy(np.transpose(tmp17, (1, 0, 3, 2))) - tmp52 += np.transpose(tmp19, (0, 1, 3, 2)) * -1 - tmp39 = einsum(tmp13, (0, 1, 2, 3), t2.abab, (0, 1, 3, 4), (2, 4)) - tmp40 = einsum(t2.bbbb, (0, 1, 2, 3), tmp18, (1, 0, 4, 3), (4, 2)) - tmp41 = einsum(tmp15, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp62 = einsum(tmp15, (0, 1), t1.bb, (0, 2), (1, 2)) * 0.5 - tmp102 = np.copy(tmp51) - tmp102 += tmp50 * 4 - tmp35 = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 0), (1, 3)) - tmp36 = einsum(t2.bbbb, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) - tmp49 = einsum(t2.bbbb, (0, 1, 2, 3), l1.bb, (3, 4), (4, 0, 1, 2)) - tmp21 = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) - tmp20 = einsum(t2.aaaa, (0, 1, 2, 3), l1.aa, (3, 1), (0, 2)) - tmp58 = einsum(tmp13, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 2, 5)) - tmp59 = einsum(t2.abab, (0, 1, 2, 3), tmp18, (4, 1, 5, 3), (0, 4, 5, 2)) * -1 - tmp27 = einsum(t2.abab, (0, 1, 2, 3), tmp26, (0, 4, 1, 3), (4, 2)) - tmp25 = einsum(tmp6, (0, 1, 2, 3), t2.aaaa, (1, 0, 4, 3), (2, 4)) - tmp28 = einsum(t1.aa, (0, 1), tmp4, (0, 2), (2, 1)) * 2 - tmp45 = np.copy(tmp12) - tmp45 += tmp14 - tmp44 = einsum(t2.abab, (0, 1, 2, 3), tmp6, (4, 0, 5, 2), (4, 5, 1, 3)) * -1 - tmp43 = einsum(t2.bbbb, (0, 1, 2, 3), tmp26, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp33 = np.copy(np.transpose(tmp5, (1, 0, 3, 2))) - tmp33 += np.transpose(tmp7, (0, 1, 3, 2)) * -1 - tmp24 = einsum(l1.aa, (0, 1), t2.aaaa, (2, 3, 4, 0), (1, 2, 3, 4)) - tmp79 = np.copy(tmp31) * 4 - tmp79 += tmp30 - tmp55 = einsum(t1.aa, (0, 1), tmp4, (0, 2), (2, 1)) - tmp132 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 5, 0, 1), (4, 5, 2, 3)) - tmp130 = einsum(l2.bbbb, (0, 1, 2, 3), t1.bb, (3, 4), (2, 0, 1, 4)) - tmp129 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (3, 4), (2, 0, 1, 4)) - tmp128 = einsum(t1.aa, (0, 1), l2.aaaa, (2, 3, 4, 0), (4, 2, 3, 1)) - tmp131 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 5, 0, 1), (4, 5, 2, 3)) - tmp114 = np.copy(tmp107) - tmp114 += tmp81 - tmp114 += tmp82 * 2 - tmp127 = einsum(tmp110, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 3, 4)) * -1 - tmp126 = einsum(t2.bbbb, (0, 1, 2, 3), tmp18, (1, 0, 4, 5), (4, 5, 2, 3)) * -1 - tmp123 = einsum(t2.bbbb, (0, 1, 2, 3), l1.bb, (4, 1), (0, 4, 2, 3)) - tmp108 = np.copy(tmp107) * 0.5 - del tmp107 - tmp108 += tmp81 * 0.5 - tmp108 += tmp82 - tmp125 = einsum(tmp89, (0, 1, 2, 3), t1.bb, (0, 4), (1, 4, 2, 3)) - tmp105 = np.copy(tmp104) - tmp105 += tmp64 * 2 - tmp105 += tmp65 - tmp90 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (4, 3, 0, 5), (5, 1, 4, 2)) - tmp86 = np.copy(tmp84) - tmp86 += tmp85 - tmp115 = einsum(tmp13, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) - tmp120 = einsum(tmp6, (0, 1, 2, 3), t2.aaaa, (1, 0, 4, 5), (2, 3, 4, 5)) * -1 - tmp116 = einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 4), (2, 0, 3, 4)) - tmp121 = einsum(t1.aa, (0, 1), tmp106, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - tmp119 = einsum(t1.aa, (0, 1), tmp118, (0, 2, 3, 4), (2, 1, 3, 4)) - del tmp118 - tmp124 = np.copy(tmp87) * 0.25 - tmp124 += tmp88 - tmp109 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 5, 1), (5, 0, 4, 3)) - tmp122 = np.copy(tmp112) - tmp122 += tmp67 - tmp113 = einsum(t1.aa, (0, 1), tmp26, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp117 = np.copy(tmp69) * 4 - tmp117 += tmp71 - tmp111 = np.copy(tmp104) * 0.5 - del tmp104 - tmp111 += tmp64 - tmp111 += tmp65 * 0.5 - tmp101 = einsum(t1.bb, (0, 1), tmp52, (0, 2, 3, 4), (2, 4, 3, 1)) - tmp94 = einsum(t2.bbbb, (0, 1, 2, 3), tmp88, (1, 4, 3, 5), (0, 4, 2, 5)) - tmp42 = np.copy(tmp39) - tmp42 += tmp40 * 2 - tmp42 += tmp41 - del tmp41 - tmp63 = np.copy(tmp39) * 0.5 - del tmp39 - tmp63 += tmp40 - del tmp40 - tmp63 += tmp62 - del tmp62 - tmp103 = einsum(t1.bb, (0, 1), tmp102, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp102 - tmp96 = einsum(t2.abab, (0, 1, 2, 3), tmp85, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp100 = einsum(tmp52, (0, 1, 2, 3), t2.bbbb, (0, 1, 4, 5), (2, 3, 4, 5)) - tmp93 = np.copy(tmp81) * 0.5 - tmp93 += tmp82 - tmp83 = np.copy(tmp81) - del tmp81 - tmp83 += tmp82 * 2 - del tmp82 - tmp99 = einsum(tmp15, (0, 1), t2.bbbb, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - tmp37 = np.copy(t1.bb) - tmp37 += tmp35 - tmp37 += tmp36 * 2 - tmp98 = einsum(tmp49, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) - tmp95 = einsum(tmp84, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp48 = np.copy(t1.bb) * 0.5 - tmp48 += tmp35 * 0.5 - tmp48 += tmp36 - tmp97 = np.copy(tmp35) - tmp97 += tmp36 * 2 - tmp73 = np.copy(tmp20) * 2 - tmp73 += tmp21 - tmp47 = einsum(tmp13, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (0, 4, 2, 5)) - tmp60 = einsum(tmp26, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (1, 2, 4, 5)) - tmp38 = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 4), (4, 0, 1, 3)) - tmp92 = np.copy(tmp58) - tmp92 += tmp59 - tmp29 = np.copy(tmp25) * 2 - tmp29 += tmp27 - tmp29 += tmp28 - del tmp28 - tmp46 = einsum(tmp45, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) - tmp91 = np.copy(tmp44) - tmp91 += tmp43 - tmp57 = einsum(l1.bb, (0, 1), t2.abab, (2, 3, 4, 0), (2, 1, 3, 4)) - tmp75 = np.copy(tmp64) * 2 - tmp75 += tmp65 - tmp23 = np.copy(t1.aa) - tmp23 += tmp20 * 2 - tmp23 += tmp21 - tmp22 = np.copy(t1.aa) - tmp22 += tmp20 * 2 - tmp22 += tmp21 - tmp78 = einsum(tmp33, (0, 1, 2, 3), t1.aa, (0, 4), (1, 3, 2, 4)) - tmp74 = einsum(tmp24, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - tmp80 = einsum(tmp79, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - del tmp79 - tmp76 = einsum(tmp4, (0, 1), t2.aaaa, (2, 0, 3, 4), (1, 2, 3, 4)) * -2 - tmp66 = np.copy(tmp64) - del tmp64 - tmp66 += tmp65 * 0.5 - del tmp65 - tmp77 = einsum(tmp33, (0, 1, 2, 3), t2.aaaa, (0, 1, 4, 5), (2, 3, 4, 5)) - tmp70 = einsum(t2.aaaa, (0, 1, 2, 3), tmp69, (1, 4, 3, 5), (4, 0, 5, 2)) - tmp72 = einsum(tmp71, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (4, 1, 5, 3)) - tmp68 = einsum(t2.abab, (0, 1, 2, 3), tmp67, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp53 = einsum(t1.bb, (0, 1), tmp52, (0, 2, 3, 4), (2, 3, 4, 1)) * 2 - del tmp52 - tmp16 = np.copy(tmp8) * 0.5 - tmp16 += tmp9 * 0.5 - tmp16 += tmp10 - tmp61 = np.copy(t1.bb) - tmp61 += tmp35 - del tmp35 - tmp61 += tmp36 * 2 - del tmp36 - tmp56 = np.copy(tmp25) - del tmp25 - tmp56 += tmp27 * 0.5 - del tmp27 - tmp56 += tmp55 - del tmp55 - tmp32 = np.copy(tmp0) - tmp32 += tmp1 * 2 - tmp32 += tmp2 - tmp54 = np.copy(t1.aa) * 0.5 - tmp54 += tmp20 - del tmp20 - tmp54 += tmp21 * 0.5 - del tmp21 - tmp34 = einsum(t1.aa, (0, 1), tmp33, (0, 2, 3, 4), (2, 3, 4, 1)) * 2 - del tmp33 - tmp11 = np.copy(delta.bb.oo) * -1 - tmp11 += tmp8 - del tmp8 - tmp11 += tmp9 - del tmp9 - tmp11 += tmp10 * 2 - del tmp10 - tmp3 = np.copy(delta.aa.oo) * -1 - tmp3 += tmp0 - del tmp0 - tmp3 += tmp1 * 2 - del tmp1 - tmp3 += tmp2 - del tmp2 - rdm2.bbbb.vvvv = np.copy(np.transpose(tmp132, (1, 0, 3, 2))) * 2 - del tmp132 - rdm2.bbbb.vvvv += einsum(tmp130, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) * 2 - rdm2.abab.vvvv = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (4, 5, 0, 1), (4, 5, 2, 3)) - rdm2.abab.vvvv += einsum(t1.aa, (0, 1), tmp129, (0, 2, 3, 4), (2, 3, 1, 4)) - rdm2.aaaa.vvvv = np.copy(np.transpose(tmp131, (1, 0, 3, 2))) * 2 - del tmp131 - rdm2.aaaa.vvvv += einsum(tmp128, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * 2 - rdm2.bbbb.vvvo = np.copy(np.transpose(tmp130, (2, 1, 3, 0))) * 2 - rdm2.abab.vvvo = einsum(t1.aa, (0, 1), l2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) - rdm2.aaaa.vvvo = np.copy(np.transpose(tmp128, (2, 1, 3, 0))) * 2 - rdm2.bbbb.vvov = np.copy(np.transpose(tmp130, (2, 1, 0, 3))) * -2 - del tmp130 - rdm2.abab.vvov = np.copy(np.transpose(tmp129, (1, 2, 0, 3))) - del tmp129 - rdm2.aaaa.vvov = np.copy(np.transpose(tmp128, (2, 1, 0, 3))) * -2 - del tmp128 - rdm2.bbbb.vovv = np.copy(np.transpose(tmp123, (1, 0, 3, 2))) * 2 - rdm2.bbbb.vovv += einsum(tmp108, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.bbbb.vovv += einsum(tmp114, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.vovv += np.transpose(tmp125, (2, 0, 1, 3)) - rdm2.bbbb.vovv += np.transpose(tmp125, (2, 0, 3, 1)) * -1 - rdm2.bbbb.vovv += np.transpose(tmp126, (1, 0, 3, 2)) * 2 - rdm2.bbbb.vovv += np.transpose(tmp127, (1, 0, 3, 2)) * 2 - rdm2.abab.vovv = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (4, 0), (4, 1, 2, 3)) - rdm2.abab.vovv += einsum(tmp105, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.vovv += einsum(tmp86, (0, 1, 2, 3), t1.aa, (0, 4), (2, 1, 4, 3)) * 2 - rdm2.abab.vovv += einsum(tmp90, (0, 1, 2, 3), t1.bb, (0, 4), (2, 1, 3, 4)) * -1 - rdm2.abab.vovv += einsum(tmp13, (0, 1, 2, 3), t2.abab, (0, 1, 4, 5), (3, 2, 4, 5)) * -1 - rdm2.abab.vovv += einsum(t1.aa, (0, 1), tmp115, (0, 2, 3, 4), (3, 2, 1, 4)) * -1 - rdm2.aaaa.vovv = np.copy(np.transpose(tmp116, (1, 0, 3, 2))) * 2 - rdm2.aaaa.vovv += einsum(t1.aa, (0, 1), tmp105, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.vovv += einsum(tmp105, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.vovv += np.transpose(tmp119, (2, 0, 1, 3)) - rdm2.aaaa.vovv += np.transpose(tmp119, (2, 0, 3, 1)) * -1 - rdm2.aaaa.vovv += np.transpose(tmp120, (1, 0, 3, 2)) * 2 - rdm2.aaaa.vovv += np.transpose(tmp121, (1, 0, 3, 2)) * 2 - rdm2.bbbb.ovvv = np.copy(np.transpose(tmp123, (0, 1, 3, 2))) * -2 - del tmp123 - rdm2.bbbb.ovvv += einsum(tmp108, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.bbbb.ovvv += einsum(tmp114, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.ovvv += einsum(tmp124, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) * -4 - del tmp124 - rdm2.bbbb.ovvv += np.transpose(tmp125, (0, 2, 3, 1)) - del tmp125 - rdm2.bbbb.ovvv += np.transpose(tmp126, (0, 1, 3, 2)) * -2 - del tmp126 - rdm2.bbbb.ovvv += np.transpose(tmp127, (0, 1, 3, 2)) * -2 - del tmp127 - rdm2.abab.ovvv = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (4, 1), (0, 4, 2, 3)) - rdm2.abab.ovvv += einsum(t1.aa, (0, 1), tmp108, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.abab.ovvv += einsum(t1.aa, (0, 1), tmp109, (0, 2, 3, 4), (2, 3, 1, 4)) * -1 - rdm2.abab.ovvv += einsum(tmp122, (0, 1, 2, 3), t1.bb, (1, 4), (0, 3, 2, 4)) * 2 - del tmp122 - rdm2.abab.ovvv += einsum(t2.abab, (0, 1, 2, 3), tmp26, (0, 4, 1, 5), (4, 5, 2, 3)) * -1 - rdm2.abab.ovvv += einsum(tmp113, (0, 1, 2, 3), t1.bb, (1, 4), (0, 3, 2, 4)) * -1 - rdm2.aaaa.ovvv = np.copy(np.transpose(tmp116, (0, 1, 3, 2))) * -2 - del tmp116 - rdm2.aaaa.ovvv += einsum(t1.aa, (0, 1), tmp105, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.ovvv += einsum(tmp105, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.ovvv += einsum(tmp117, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -1 - del tmp117 - rdm2.aaaa.ovvv += np.transpose(tmp119, (0, 2, 3, 1)) - del tmp119 - rdm2.aaaa.ovvv += np.transpose(tmp120, (0, 1, 3, 2)) * -2 - del tmp120 - rdm2.aaaa.ovvv += np.transpose(tmp121, (0, 1, 3, 2)) * -2 - del tmp121 - rdm2.bbbb.vvoo = np.copy(l2.bbbb) * 2 - rdm2.abab.vvoo = np.copy(l2.abab) - rdm2.aaaa.vvoo = np.copy(l2.aaaa) * 2 - rdm2.bbbb.vovo = einsum(tmp114, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.vovo += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.vovo += np.transpose(tmp88, (2, 1, 3, 0)) * -4 - rdm2.bbbb.vovo += np.transpose(tmp87, (2, 1, 3, 0)) * -1 - rdm2.bbbb.vovo += np.transpose(tmp110, (2, 1, 3, 0)) * 2 - rdm2.abab.vovo = einsum(delta.bb.oo, (0, 1), tmp105, (2, 3), (2, 0, 3, 1)) - rdm2.abab.vovo += np.transpose(tmp90, (2, 1, 3, 0)) * -1 - rdm2.abab.vovo += einsum(tmp13, (0, 1, 2, 3), t1.aa, (0, 4), (3, 2, 4, 1)) * -1 - rdm2.aaaa.vovo = einsum(delta.aa.oo, (0, 1), tmp105, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.vovo += np.transpose(tmp71, (2, 1, 3, 0)) * -1 - rdm2.aaaa.vovo += np.transpose(tmp69, (2, 1, 3, 0)) * -4 - rdm2.aaaa.vovo += einsum(t1.aa, (0, 1), l1.aa, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.vovo += np.transpose(tmp106, (2, 1, 3, 0)) * 2 - rdm2.bbbb.voov = einsum(delta.bb.oo, (0, 1), tmp108, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.bbbb.voov += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.voov += np.transpose(tmp88, (2, 1, 0, 3)) * 4 - rdm2.bbbb.voov += np.transpose(tmp87, (2, 1, 0, 3)) - rdm2.bbbb.voov += np.transpose(tmp110, (2, 1, 0, 3)) * -2 - rdm2.abab.voov = np.copy(np.transpose(tmp84, (2, 1, 0, 3))) * 2 - del tmp84 - rdm2.abab.voov += einsum(l1.aa, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.voov += np.transpose(tmp85, (2, 1, 0, 3)) * 2 - del tmp85 - rdm2.abab.voov += np.transpose(tmp115, (2, 1, 0, 3)) * -1 - del tmp115 - rdm2.aaaa.voov = einsum(delta.aa.oo, (0, 1), tmp105, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.voov += np.transpose(tmp71, (2, 1, 0, 3)) - rdm2.aaaa.voov += np.transpose(tmp69, (2, 1, 0, 3)) * 4 - rdm2.aaaa.voov += einsum(t1.aa, (0, 1), l1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.voov += np.transpose(tmp106, (2, 1, 0, 3)) * -2 - rdm2.bbbb.ovvo = einsum(tmp114, (0, 1), delta.bb.oo, (2, 3), (2, 0, 1, 3)) * -1 - del tmp114 - rdm2.bbbb.ovvo += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.ovvo += np.transpose(tmp88, (1, 2, 3, 0)) * 4 - rdm2.bbbb.ovvo += np.transpose(tmp87, (1, 2, 3, 0)) - rdm2.bbbb.ovvo += np.transpose(tmp110, (1, 2, 3, 0)) * -2 - rdm2.abab.ovvo = np.copy(np.transpose(tmp112, (0, 3, 2, 1))) * 2 - del tmp112 - rdm2.abab.ovvo += einsum(t1.aa, (0, 1), l1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.ovvo += np.transpose(tmp67, (0, 3, 2, 1)) * 2 - del tmp67 - rdm2.abab.ovvo += np.transpose(tmp113, (0, 3, 2, 1)) * -1 - del tmp113 - rdm2.aaaa.ovvo = einsum(delta.aa.oo, (0, 1), tmp111, (2, 3), (0, 2, 3, 1)) * -2 - del tmp111 - rdm2.aaaa.ovvo += np.transpose(tmp71, (1, 2, 3, 0)) - rdm2.aaaa.ovvo += np.transpose(tmp69, (1, 2, 3, 0)) * 4 - rdm2.aaaa.ovvo += einsum(t1.aa, (0, 1), l1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.ovvo += np.transpose(tmp106, (1, 2, 3, 0)) * -2 - rdm2.bbbb.ovov = einsum(delta.bb.oo, (0, 1), tmp108, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.bbbb.ovov += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.ovov += np.transpose(tmp88, (1, 2, 0, 3)) * -4 - del tmp88 - rdm2.bbbb.ovov += np.transpose(tmp87, (1, 2, 0, 3)) * -1 - del tmp87 - rdm2.bbbb.ovov += np.transpose(tmp110, (1, 2, 0, 3)) * 2 - del tmp110 - rdm2.abab.ovov = einsum(delta.aa.oo, (0, 1), tmp108, (2, 3), (0, 2, 1, 3)) * 2 - del tmp108 - rdm2.abab.ovov += np.transpose(tmp109, (1, 2, 0, 3)) * -1 - del tmp109 - rdm2.abab.ovov += einsum(tmp26, (0, 1, 2, 3), t1.bb, (2, 4), (1, 3, 0, 4)) * -1 - rdm2.aaaa.ovov = einsum(delta.aa.oo, (0, 1), tmp105, (2, 3), (0, 2, 1, 3)) - del tmp105 - rdm2.aaaa.ovov += np.transpose(tmp71, (1, 2, 0, 3)) * -1 - del tmp71 - rdm2.aaaa.ovov += np.transpose(tmp69, (1, 2, 0, 3)) * -4 - del tmp69 - rdm2.aaaa.ovov += einsum(t1.aa, (0, 1), l1.aa, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.ovov += np.transpose(tmp106, (1, 2, 0, 3)) * 2 - del tmp106 - rdm2.bbbb.oovv = np.copy(t2.bbbb) * 2 - rdm2.bbbb.oovv += einsum(tmp93, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 4, 1)) * -4 - del tmp93 - rdm2.bbbb.oovv += np.transpose(tmp94, (0, 1, 3, 2)) * -8 - rdm2.bbbb.oovv += np.transpose(tmp95, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp96, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp96, (1, 0, 2, 3)) * -2 - rdm2.bbbb.oovv += einsum(tmp48, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.bbbb.oovv += tmp94 * 8 - del tmp94 - rdm2.bbbb.oovv += np.transpose(tmp95, (1, 0, 3, 2)) * 2 - del tmp95 - rdm2.bbbb.oovv += tmp96 * 2 - rdm2.bbbb.oovv += np.transpose(tmp96, (1, 0, 3, 2)) * 2 - del tmp96 - rdm2.bbbb.oovv += einsum(tmp37, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.oovv += einsum(tmp97, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.oovv += einsum(tmp97, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -1 - del tmp97 - rdm2.bbbb.oovv += tmp98 * 2 - rdm2.bbbb.oovv += einsum(tmp83, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 1, 4)) * 2 - rdm2.bbbb.oovv += np.transpose(tmp98, (0, 1, 3, 2)) * -2 - del tmp98 - rdm2.bbbb.oovv += np.transpose(tmp99, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += einsum(tmp63, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) * -2 - rdm2.bbbb.oovv += einsum(tmp42, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) - rdm2.bbbb.oovv += np.transpose(tmp99, (1, 0, 3, 2)) * 2 - del tmp99 - rdm2.bbbb.oovv += einsum(tmp63, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * 2 - rdm2.bbbb.oovv += einsum(tmp42, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.bbbb.oovv += np.transpose(tmp100, (1, 0, 3, 2)) * 2 - del tmp100 - rdm2.bbbb.oovv += einsum(tmp101, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) * 2 - del tmp101 - rdm2.bbbb.oovv += np.transpose(tmp103, (1, 0, 2, 3)) - rdm2.bbbb.oovv += tmp103 * -1 - rdm2.bbbb.oovv += np.transpose(tmp103, (1, 0, 3, 2)) * -1 - rdm2.bbbb.oovv += np.transpose(tmp103, (0, 1, 3, 2)) - del tmp103 - rdm2.abab.oovv = np.copy(t2.abab) - rdm2.abab.oovv += einsum(tmp83, (0, 1), t2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -1 - del tmp83 - rdm2.abab.oovv += einsum(tmp86, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (4, 1, 5, 3)) * 4 - del tmp86 - rdm2.abab.oovv += einsum(tmp89, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) - del tmp89 - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp37, (2, 3), (0, 2, 1, 3)) - rdm2.abab.oovv += einsum(tmp73, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.oovv += einsum(tmp38, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -1 - rdm2.abab.oovv += einsum(tmp75, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1 - rdm2.abab.oovv += einsum(tmp57, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) * -1 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp15, (1, 4), (0, 4, 2, 3)) * -1 - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp42, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp4, (0, 4), (4, 1, 2, 3)) * -2 - rdm2.abab.oovv += einsum(tmp45, (0, 1, 2, 3), t2.abab, (0, 2, 4, 5), (1, 3, 4, 5)) - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp46, (0, 2, 3, 4), (2, 3, 1, 4)) - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp90, (1, 4, 2, 5), (0, 4, 5, 3)) - del tmp90 - rdm2.abab.oovv += einsum(tmp29, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.abab.oovv += einsum(tmp47, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp91, (0, 2, 3, 4), (2, 3, 1, 4)) * -2 - del tmp91 - rdm2.abab.oovv += einsum(tmp92, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) * -2 - del tmp92 - rdm2.abab.oovv += einsum(tmp60, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) - rdm2.aaaa.oovv = np.copy(t2.aaaa) * 2 - rdm2.aaaa.oovv += einsum(tmp66, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 4, 1)) * -4 - del tmp66 - rdm2.aaaa.oovv += np.transpose(tmp68, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp70, (0, 1, 3, 2)) * -8 - rdm2.aaaa.oovv += np.transpose(tmp72, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp72, (1, 0, 2, 3)) * -2 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp22, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.oovv += tmp68 * 2 - del tmp68 - rdm2.aaaa.oovv += tmp70 * 8 - del tmp70 - rdm2.aaaa.oovv += tmp72 * 2 - rdm2.aaaa.oovv += np.transpose(tmp72, (1, 0, 3, 2)) * 2 - del tmp72 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp23, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.oovv += einsum(tmp73, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp73, (2, 3), (0, 2, 3, 1)) * -1 - del tmp73 - rdm2.aaaa.oovv += tmp74 * 2 - rdm2.aaaa.oovv += einsum(t2.aaaa, (0, 1, 2, 3), tmp75, (3, 4), (0, 1, 4, 2)) * 2 - del tmp75 - rdm2.aaaa.oovv += np.transpose(tmp74, (0, 1, 3, 2)) * -2 - del tmp74 - rdm2.aaaa.oovv += np.transpose(tmp76, (1, 0, 3, 2)) * -2 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp29, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.aaaa.oovv += einsum(tmp29, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) - rdm2.aaaa.oovv += np.transpose(tmp76, (0, 1, 3, 2)) * 2 - del tmp76 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp29, (2, 3), (2, 0, 1, 3)) - rdm2.aaaa.oovv += einsum(tmp29, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.aaaa.oovv += np.transpose(tmp77, (1, 0, 3, 2)) * 2 - del tmp77 - rdm2.aaaa.oovv += einsum(tmp78, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * 2 - del tmp78 - rdm2.aaaa.oovv += np.transpose(tmp80, (1, 0, 2, 3)) - rdm2.aaaa.oovv += tmp80 * -1 - rdm2.aaaa.oovv += np.transpose(tmp80, (1, 0, 3, 2)) * -1 - rdm2.aaaa.oovv += np.transpose(tmp80, (0, 1, 3, 2)) - del tmp80 - rdm2.bbbb.vooo = einsum(l1.bb, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.vooo += einsum(delta.bb.oo, (0, 1), l1.bb, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.vooo += np.transpose(tmp18, (3, 2, 1, 0)) * 2 - rdm2.abab.vooo = einsum(delta.bb.oo, (0, 1), l1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.abab.vooo += np.transpose(tmp13, (3, 2, 0, 1)) * -1 - del tmp13 - rdm2.aaaa.vooo = einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.vooo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.vooo += np.transpose(tmp6, (3, 2, 1, 0)) * 2 - rdm2.bbbb.ovoo = einsum(l1.bb, (0, 1), delta.bb.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.ovoo += einsum(delta.bb.oo, (0, 1), l1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.ovoo += np.transpose(tmp18, (2, 3, 1, 0)) * -2 - del tmp18 - rdm2.abab.ovoo = einsum(delta.aa.oo, (0, 1), l1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.ovoo += np.transpose(tmp26, (1, 3, 0, 2)) * -1 - del tmp26 - rdm2.aaaa.ovoo = einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.ovoo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.ovoo += np.transpose(tmp6, (2, 3, 1, 0)) * -2 - del tmp6 - rdm2.bbbb.oovo = einsum(delta.bb.oo, (0, 1), tmp61, (2, 3), (2, 0, 3, 1)) - del tmp61 - rdm2.bbbb.oovo += einsum(tmp37, (0, 1), delta.bb.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.oovo += np.transpose(tmp49, (2, 1, 3, 0)) * 2 - rdm2.bbbb.oovo += einsum(delta.bb.oo, (0, 1), tmp63, (2, 3), (2, 0, 3, 1)) * -2 - rdm2.bbbb.oovo += einsum(tmp63, (0, 1), delta.bb.oo, (2, 3), (2, 0, 1, 3)) * 2 - del tmp63 - rdm2.bbbb.oovo += np.transpose(tmp50, (1, 2, 3, 0)) * 4 - rdm2.bbbb.oovo += np.transpose(tmp51, (1, 2, 3, 0)) - rdm2.bbbb.oovo += einsum(tmp16, (0, 1), t1.bb, (2, 3), (1, 2, 3, 0)) * 2 - rdm2.bbbb.oovo += np.transpose(tmp50, (2, 1, 3, 0)) * -4 - rdm2.bbbb.oovo += np.transpose(tmp51, (2, 1, 3, 0)) * -1 - rdm2.bbbb.oovo += einsum(tmp16, (0, 1), t1.bb, (2, 3), (2, 1, 3, 0)) * -2 - rdm2.bbbb.oovo += np.transpose(tmp53, (2, 1, 3, 0)) * -1 - rdm2.abab.oovo = einsum(delta.bb.oo, (0, 1), tmp22, (2, 3), (2, 0, 3, 1)) - rdm2.abab.oovo += np.transpose(tmp57, (0, 2, 3, 1)) * -1 - del tmp57 - rdm2.abab.oovo += einsum(delta.bb.oo, (0, 1), tmp56, (2, 3), (2, 0, 3, 1)) * -2 - rdm2.abab.oovo += np.transpose(tmp58, (0, 2, 3, 1)) * -2 - del tmp58 - rdm2.abab.oovo += np.transpose(tmp59, (0, 2, 3, 1)) * -2 - del tmp59 - rdm2.abab.oovo += einsum(t1.aa, (0, 1), tmp15, (2, 3), (0, 3, 1, 2)) * -1 - rdm2.abab.oovo += einsum(t1.aa, (0, 1), tmp45, (0, 2, 3, 4), (2, 4, 1, 3)) - del tmp45 - rdm2.abab.oovo += np.transpose(tmp60, (0, 2, 3, 1)) - del tmp60 - rdm2.aaaa.oovo = einsum(tmp54, (0, 1), delta.aa.oo, (2, 3), (0, 2, 1, 3)) * 2 - del tmp54 - rdm2.aaaa.oovo += einsum(tmp23, (0, 1), delta.aa.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.oovo += np.transpose(tmp24, (2, 1, 3, 0)) * 2 - rdm2.aaaa.oovo += einsum(tmp56, (0, 1), delta.aa.oo, (2, 3), (0, 2, 1, 3)) * -2 - rdm2.aaaa.oovo += einsum(tmp56, (0, 1), delta.aa.oo, (2, 3), (2, 0, 1, 3)) * 2 - del tmp56 - rdm2.aaaa.oovo += np.transpose(tmp30, (1, 2, 3, 0)) - rdm2.aaaa.oovo += np.transpose(tmp31, (1, 2, 3, 0)) * 4 - rdm2.aaaa.oovo += einsum(tmp32, (0, 1), t1.aa, (2, 3), (1, 2, 3, 0)) - rdm2.aaaa.oovo += np.transpose(tmp30, (2, 1, 3, 0)) * -1 - rdm2.aaaa.oovo += np.transpose(tmp31, (2, 1, 3, 0)) * -4 - rdm2.aaaa.oovo += einsum(t1.aa, (0, 1), tmp32, (2, 3), (0, 3, 1, 2)) * -1 - rdm2.aaaa.oovo += np.transpose(tmp34, (2, 1, 3, 0)) * -1 - rdm2.bbbb.ooov = einsum(delta.bb.oo, (0, 1), tmp48, (2, 3), (2, 0, 1, 3)) * -2 - del tmp48 - rdm2.bbbb.ooov += einsum(tmp37, (0, 1), delta.bb.oo, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.ooov += np.transpose(tmp49, (2, 1, 0, 3)) * -2 - del tmp49 - rdm2.bbbb.ooov += einsum(delta.bb.oo, (0, 1), tmp42, (2, 3), (2, 0, 1, 3)) - rdm2.bbbb.ooov += einsum(tmp42, (0, 1), delta.bb.oo, (2, 3), (2, 0, 3, 1)) * -1 - rdm2.bbbb.ooov += np.transpose(tmp50, (1, 2, 0, 3)) * -4 - rdm2.bbbb.ooov += np.transpose(tmp51, (1, 2, 0, 3)) * -1 - rdm2.bbbb.ooov += einsum(tmp15, (0, 1), t1.bb, (2, 3), (1, 2, 0, 3)) * -1 - rdm2.bbbb.ooov += np.transpose(tmp50, (2, 1, 0, 3)) * 4 - del tmp50 - rdm2.bbbb.ooov += np.transpose(tmp51, (2, 1, 0, 3)) - del tmp51 - rdm2.bbbb.ooov += einsum(tmp15, (0, 1), t1.bb, (2, 3), (2, 1, 0, 3)) - rdm2.bbbb.ooov += np.transpose(tmp53, (2, 1, 0, 3)) - del tmp53 - rdm2.abab.ooov = einsum(tmp37, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) - del tmp37 - rdm2.abab.ooov += np.transpose(tmp38, (1, 2, 0, 3)) * -1 - del tmp38 - rdm2.abab.ooov += einsum(delta.aa.oo, (0, 1), tmp42, (2, 3), (0, 2, 1, 3)) * -1 - del tmp42 - rdm2.abab.ooov += np.transpose(tmp43, (1, 2, 0, 3)) * -2 - del tmp43 - rdm2.abab.ooov += np.transpose(tmp44, (1, 2, 0, 3)) * -2 - del tmp44 - rdm2.abab.ooov += einsum(tmp32, (0, 1), t1.bb, (2, 3), (1, 2, 0, 3)) * -1 - rdm2.abab.ooov += np.transpose(tmp46, (1, 2, 0, 3)) - del tmp46 - rdm2.abab.ooov += np.transpose(tmp47, (1, 2, 0, 3)) - del tmp47 - rdm2.aaaa.ooov = einsum(delta.aa.oo, (0, 1), tmp22, (2, 3), (2, 0, 1, 3)) * -1 - del tmp22 - rdm2.aaaa.ooov += einsum(tmp23, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) - del tmp23 - rdm2.aaaa.ooov += np.transpose(tmp24, (2, 1, 0, 3)) * -2 - del tmp24 - rdm2.aaaa.ooov += einsum(tmp29, (0, 1), delta.aa.oo, (2, 3), (0, 2, 3, 1)) - rdm2.aaaa.ooov += einsum(tmp29, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) * -1 - del tmp29 - rdm2.aaaa.ooov += np.transpose(tmp30, (1, 2, 0, 3)) * -1 - rdm2.aaaa.ooov += np.transpose(tmp31, (1, 2, 0, 3)) * -4 - rdm2.aaaa.ooov += einsum(tmp32, (0, 1), t1.aa, (2, 3), (1, 2, 0, 3)) * -1 - rdm2.aaaa.ooov += np.transpose(tmp30, (2, 1, 0, 3)) - del tmp30 - rdm2.aaaa.ooov += np.transpose(tmp31, (2, 1, 0, 3)) * 4 - del tmp31 - rdm2.aaaa.ooov += einsum(t1.aa, (0, 1), tmp32, (2, 3), (0, 3, 2, 1)) - del tmp32 - rdm2.aaaa.ooov += np.transpose(tmp34, (2, 1, 0, 3)) - del tmp34 - rdm2.bbbb.oooo = einsum(tmp11, (0, 1), delta.bb.oo, (2, 3), (2, 1, 3, 0)) * -1 - rdm2.bbbb.oooo += einsum(tmp11, (0, 1), delta.bb.oo, (2, 3), (1, 2, 3, 0)) - rdm2.bbbb.oooo += einsum(delta.bb.oo, (0, 1), tmp15, (2, 3), (3, 0, 2, 1)) * -1 - del tmp15 - rdm2.bbbb.oooo += einsum(tmp16, (0, 1), delta.bb.oo, (2, 3), (2, 1, 0, 3)) * 2 - del tmp16 - rdm2.bbbb.oooo += np.transpose(tmp17, (3, 2, 1, 0)) * 2 - del tmp17 - rdm2.bbbb.oooo += np.transpose(tmp19, (2, 3, 1, 0)) * -2 - del tmp19 - rdm2.abab.oooo = einsum(delta.aa.oo, (0, 1), tmp11, (2, 3), (0, 3, 1, 2)) * -1 - del tmp11 - rdm2.abab.oooo += einsum(delta.bb.oo, (0, 1), tmp4, (2, 3), (3, 0, 2, 1)) * -2 - rdm2.abab.oooo += np.transpose(tmp12, (1, 3, 0, 2)) - del tmp12 - rdm2.abab.oooo += np.transpose(tmp14, (1, 3, 0, 2)) - del tmp14 - rdm2.aaaa.oooo = einsum(delta.aa.oo, (0, 1), tmp3, (2, 3), (0, 3, 1, 2)) * -1 - rdm2.aaaa.oooo += einsum(delta.aa.oo, (0, 1), tmp3, (2, 3), (3, 0, 1, 2)) - del tmp3 - rdm2.aaaa.oooo += einsum(tmp4, (0, 1), delta.aa.oo, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.aaaa.oooo += einsum(delta.aa.oo, (0, 1), tmp4, (2, 3), (0, 3, 2, 1)) * 2 - del tmp4, delta - rdm2.aaaa.oooo += np.transpose(tmp5, (3, 2, 1, 0)) * 2 - del tmp5 - rdm2.aaaa.oooo += np.transpose(tmp7, (2, 3, 1, 0)) * -2 - del tmp7 - rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv) - rdm2.abab = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv) - rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv) - rdm2 = Namespace( - aaaa=np.transpose(rdm2.aaaa, (0, 2, 1, 3)), - aabb=np.transpose(rdm2.abab, (0, 2, 1, 3)), - bbbb=np.transpose(rdm2.bbbb, (0, 2, 1, 3)), - ) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:39:25.611137. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp102 : array - tmp104 : array - tmp107 : array - tmp108 : array - tmp109 : array - tmp11 : array - tmp117 : array - tmp118 : array - tmp12 : array - tmp121 : array - tmp13 : array - tmp131 : array - tmp134 : array - tmp135 : array - tmp137 : array - tmp138 : array - tmp139 : array - tmp141 : array - tmp143 : array - tmp145 : array - tmp147 : array - tmp149 : array - tmp15 : array - tmp151 : array - tmp152 : array - tmp154 : array - tmp155 : array - tmp156 : array - tmp157 : array - tmp158 : array - tmp16 : array - tmp160 : array - tmp162 : array - tmp165 : array - tmp166 : array - tmp167 : array - tmp170 : array - tmp176 : array - tmp178 : array - tmp18 : array - tmp184 : array - tmp186 : array - tmp188 : array - tmp198 : array - tmp20 : array - tmp22 : array - tmp24 : array - tmp25 : array - tmp26 : array - tmp28 : array - tmp31 : array - tmp32 : array - tmp33 : array - tmp37 : array - tmp39 : array - tmp4 : array - tmp41 : array - tmp43 : array - tmp45 : array - tmp46 : array - tmp47 : array - tmp49 : array - tmp5 : array - tmp52 : array - tmp53 : array - tmp54 : array - tmp56 : array - tmp59 : array - tmp6 : array - tmp62 : array - tmp63 : array - tmp65 : array - tmp66 : array - tmp67 : array - tmp69 : array - tmp7 : array - tmp71 : array - tmp73 : array - tmp75 : array - tmp77 : array - tmp79 : array - tmp81 : array - tmp83 : array - tmp85 : array - tmp87 : array - tmp89 : array - tmp9 : array - tmp96 : array - """ - - tmp28 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp1 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp15 = einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - tmp12 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 0, 1), (2, 3)) - tmp11 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 1, 0, 3), (2, 3)) - tmp13 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp9 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - tmp7 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 1), (0, 3)) - tmp198 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp188 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (0, 2, 4, 5), (1, 4, 5, 3)) - tmp186 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp184 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp178 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp176 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp170 = einsum(tmp28, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp167 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 3), (1, 4)) - tmp166 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 0, 3, 1), (4, 2)) * -1 - tmp165 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp162 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp160 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 4), (3, 4)) - tmp158 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 3), (4, 1)) - tmp157 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (4, 3, 1, 5), (4, 0, 2, 5)) - tmp156 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) - tmp155 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 3), (4, 2)) - tmp154 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (4, 2), (4, 0, 1, 3)) - tmp152 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp151 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp149 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp147 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp145 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp143 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp141 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 1, 5), (0, 4, 3, 5)) - tmp139 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ooov, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp138 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ooov, (4, 5, 0, 2), (4, 5, 1, 3)) - tmp137 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp135 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp134 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp131 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp121 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (1, 5, 2, 4)) - tmp118 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp117 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (4, 3), (0, 4, 1, 2)) - tmp109 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 3, 5)) - tmp108 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp107 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp104 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp102 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 5, 3), (0, 1, 5, 4)) - tmp96 = einsum(t1.aa, (0, 1), tmp1, (0, 2), (2, 1)) - tmp89 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp87 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 5, 3)) - tmp85 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp83 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp81 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp79 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp77 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp75 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp73 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 4, 3), (4, 1)) - tmp71 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp69 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp67 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp66 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 3), (4, 2)) - tmp65 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) - tmp63 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp62 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (1, 3), (0, 2)) - tmp59 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp56 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp54 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp53 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - tmp52 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 3, 1), (4, 2)) * -1 - tmp49 = einsum(f.aa.vv, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp47 = einsum(tmp15, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp46 = einsum(tmp12, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp45 = einsum(tmp11, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp43 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp41 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 1, 3), (4, 0)) - tmp39 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 2, 1)) - tmp37 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp33 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (0, 1, 2, 3), (2, 3)) - tmp32 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp31 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 0, 3, 1), (2, 3)) - tmp26 = einsum(t1.aa, (0, 1), tmp13, (2, 1), (0, 2)) - tmp25 = einsum(t1.aa, (0, 1), tmp9, (2, 1), (0, 2)) - tmp24 = einsum(t1.aa, (0, 1), tmp7, (2, 1), (0, 2)) - tmp22 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp20 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 1, 3), (0, 4)) - tmp18 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp16 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp6 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp5 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 3, 0, 1), (2, 3)) - tmp4 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (1, 3), (0, 2)) - - return {f"tmp1": tmp1, f"tmp102": tmp102, f"tmp104": tmp104, f"tmp107": tmp107, f"tmp108": tmp108, f"tmp109": tmp109, f"tmp11": tmp11, f"tmp117": tmp117, f"tmp118": tmp118, f"tmp12": tmp12, f"tmp121": tmp121, f"tmp13": tmp13, f"tmp131": tmp131, f"tmp134": tmp134, f"tmp135": tmp135, f"tmp137": tmp137, f"tmp138": tmp138, f"tmp139": tmp139, f"tmp141": tmp141, f"tmp143": tmp143, f"tmp145": tmp145, f"tmp147": tmp147, f"tmp149": tmp149, f"tmp15": tmp15, f"tmp151": tmp151, f"tmp152": tmp152, f"tmp154": tmp154, f"tmp155": tmp155, f"tmp156": tmp156, f"tmp157": tmp157, f"tmp158": tmp158, f"tmp16": tmp16, f"tmp160": tmp160, f"tmp162": tmp162, f"tmp165": tmp165, f"tmp166": tmp166, f"tmp167": tmp167, f"tmp170": tmp170, f"tmp176": tmp176, f"tmp178": tmp178, f"tmp18": tmp18, f"tmp184": tmp184, f"tmp186": tmp186, f"tmp188": tmp188, f"tmp198": tmp198, f"tmp20": tmp20, f"tmp22": tmp22, f"tmp24": tmp24, f"tmp25": tmp25, f"tmp26": tmp26, f"tmp28": tmp28, f"tmp31": tmp31, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp37": tmp37, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp43": tmp43, f"tmp45": tmp45, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp52": tmp52, f"tmp53": tmp53, f"tmp54": tmp54, f"tmp56": tmp56, f"tmp59": tmp59, f"tmp6": tmp6, f"tmp62": tmp62, f"tmp63": tmp63, f"tmp65": tmp65, f"tmp66": tmp66, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp7": tmp7, f"tmp71": tmp71, f"tmp73": tmp73, f"tmp75": tmp75, f"tmp77": tmp77, f"tmp79": tmp79, f"tmp81": tmp81, f"tmp83": tmp83, f"tmp85": tmp85, f"tmp87": tmp87, f"tmp89": tmp89, f"tmp9": tmp9, f"tmp96": tmp96} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:39:25.711584. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp58 = np.copy(f.bb.oo) - tmp58 += ints.tmp28 - tmp56 = np.copy(ints.tmp143) - tmp56 += ints.tmp149 * 2 - tmp60 = np.copy(ints.tmp188) - del ints.tmp188 - tmp60 += ints.tmp186 * 2 - del ints.tmp186 - tmp68 = np.copy(ints.tmp41) * 2 - tmp68 += ints.tmp43 - tmp70 = np.copy(ints.tmp184) - del ints.tmp184 - tmp70 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) * 0.5 - tmp66 = np.copy(ints.tmp147) - tmp66 += ints.tmp151 * 0.5 - tmp15 = np.copy(ints.tmp67) - del ints.tmp67 - tmp15 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) * 0.5 - tmp11 = np.copy(ints.tmp83) - tmp11 += ints.tmp87 * 2 - tmp13 = np.copy(ints.tmp20) * 2 - tmp13 += ints.tmp22 - tmp9 = np.copy(ints.tmp79) - tmp9 += ints.tmp85 * 0.5 - tmp22 = np.copy(f.aa.oo) - tmp22 += ints.tmp1 - tmp24 = np.copy(ints.tmp71) - del ints.tmp71 - tmp24 += ints.tmp69 * 2 - del ints.tmp69 - tmp54 = einsum(ints.tmp145, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (0, 4, 2)) - tmp59 = einsum(tmp58, (0, 1), r2.bbb, (2, 0, 3), (2, 1, 3)) * -1 - del tmp58 - tmp55 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 4, 1, 2), (0, 3, 4)) - tmp57 = einsum(r2.aba, (0, 1, 2), tmp56, (0, 3, 2, 4), (1, 3, 4)) - del tmp56 - tmp61 = einsum(r1.b, (0,), tmp60, (1, 2, 0, 3), (1, 2, 3)) - del tmp60 - tmp49 = einsum(t1.bb, (0, 1), f.bb.ov, (0, 2), (2, 1)) - tmp39 = einsum(r2.aba, (0, 1, 2), v.aabb.ovov, (0, 2, 1, 3), (3,)) - tmp40 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (0, 2, 1, 3), (3,)) * -1 - tmp69 = einsum(tmp68, (0, 1), r2.bbb, (2, 1, 3), (2, 0, 3)) * -2 - del tmp68 - tmp63 = einsum(r2.aba, (0, 1, 2), ints.tmp141, (0, 3, 2, 4), (3, 1, 4)) - tmp65 = einsum(r2.bbb, (0, 1, 2), v.bbbb.oovv, (3, 1, 4, 2), (0, 3, 4)) - tmp64 = einsum(r2.aba, (0, 1, 2), v.aabb.ovov, (0, 2, 3, 4), (1, 3, 4)) - tmp71 = einsum(tmp70, (0, 1, 2, 3), r1.b, (2,), (0, 1, 3)) * 2 - del tmp70 - tmp67 = einsum(r2.bbb, (0, 1, 2), tmp66, (3, 1, 4, 2), (0, 3, 4)) * -4 - del tmp66 - tmp31 = einsum(r2.bab, (0, 1, 2), v.aabb.ovov, (1, 3, 0, 2), (3,)) * -1 - tmp30 = einsum(r2.aaa, (0, 1, 2), v.aaaa.ovov, (0, 3, 1, 2), (3,)) - tmp28 = einsum(t1.aa, (0, 1), f.aa.ov, (0, 2), (2, 1)) - tmp16 = einsum(r1.a, (0,), tmp15, (1, 2, 0, 3), (1, 2, 3)) * 2 - del tmp15 - tmp12 = einsum(tmp11, (0, 1, 2, 3), r2.bab, (1, 4, 3), (4, 0, 2)) * -1 - del tmp11 - tmp8 = einsum(r2.aaa, (0, 1, 2), v.aaaa.oovv, (3, 1, 4, 2), (0, 3, 4)) - tmp14 = einsum(tmp13, (0, 1), r2.aaa, (2, 1, 3), (2, 0, 3)) * -2 - del tmp13 - tmp10 = einsum(tmp9, (0, 1, 2, 3), r2.aaa, (4, 1, 3), (4, 0, 2)) * -4 - del tmp9 - tmp21 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (2, 4, 3), (4, 0, 1)) * -1 - tmp23 = einsum(tmp22, (0, 1), r2.aaa, (2, 0, 3), (2, 1, 3)) * -1 - del tmp22 - tmp25 = einsum(r1.a, (0,), tmp24, (1, 2, 0, 3), (1, 2, 3)) - del tmp24 - tmp18 = einsum(ints.tmp77, (0, 1, 2, 3), r2.aaa, (4, 1, 3), (0, 4, 2)) - tmp20 = einsum(r2.bab, (0, 1, 2), ints.tmp81, (3, 0, 4, 2), (3, 1, 4)) * -1 - tmp19 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (4, 2, 3), (4, 0, 1)) - tmp53 = np.copy(ints.tmp152) - del ints.tmp152 - tmp53 += ints.tmp155 * 2 - del ints.tmp155 - tmp53 += ints.tmp156 - del ints.tmp156 - tmp53 += ints.tmp166 * 2 - del ints.tmp166 - tmp53 += ints.tmp170 - del ints.tmp170 - tmp53 += f.bb.ov * -1 - tmp53 += ints.tmp134 * -1 - del ints.tmp134 - tmp53 += ints.tmp135 * -2 - del ints.tmp135 - tmp53 += ints.tmp165 * -1 - del ints.tmp165 - tmp53 += ints.tmp167 * -1 - del ints.tmp167 - tmp62 = np.copy(tmp54) * 4 - del tmp54 - tmp62 += tmp55 * 2 - del tmp55 - tmp62 += np.transpose(tmp57, (1, 0, 2)) - del tmp57 - tmp62 += np.transpose(tmp59, (1, 0, 2)) * -2 - del tmp59 - tmp62 += tmp61 - del tmp61 - tmp50 = np.copy(np.transpose(ints.tmp158, (1, 0))) * 2 - del ints.tmp158 - tmp50 += np.transpose(ints.tmp160, (1, 0)) - del ints.tmp160 - tmp50 += f.bb.vv * -1 - tmp50 += tmp49 - del tmp49 - tmp74 = np.copy(tmp39) * -0.5 - tmp74 += tmp40 - tmp73 = np.copy(ints.tmp178) - del ints.tmp178 - tmp73 += np.transpose(v.bbbb.oooo, (0, 2, 3, 1)) * -1 - tmp75 = np.copy(ints.tmp176) - del ints.tmp176 - tmp75 += np.transpose(ints.tmp198, (1, 2, 0, 3)) * -1 - del ints.tmp198 - tmp72 = np.copy(tmp63) - del tmp63 - tmp72 += tmp64 - del tmp64 - tmp72 += tmp65 * 2 - del tmp65 - tmp72 += np.transpose(tmp67, (1, 0, 2)) * -1 - del tmp67 - tmp72 += np.transpose(tmp69, (1, 0, 2)) - del tmp69 - tmp72 += tmp71 - del tmp71 - tmp51 = np.copy(tmp30) - tmp51 += tmp31 * 0.5 - tmp46 = np.copy(ints.tmp143) - del ints.tmp143 - tmp46 += ints.tmp149 * 2 - del ints.tmp149 - tmp46 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp46 += ints.tmp141 * -1 - del ints.tmp141 - tmp52 = np.copy(ints.tmp131) - del ints.tmp131 - tmp52 += ints.tmp138 - del ints.tmp138 - tmp52 += ints.tmp139 * 2 - del ints.tmp139 - tmp52 += np.transpose(ints.tmp154, (1, 0, 2, 3)) - del ints.tmp154 - tmp52 += v.aabb.ooov - tmp52 += ints.tmp137 * -1 - del ints.tmp137 - tmp52 += ints.tmp157 * -1 - del ints.tmp157 - tmp44 = np.copy(f.bb.oo) - tmp44 += ints.tmp28 - tmp44 += np.transpose(ints.tmp41, (1, 0)) * 2 - tmp44 += np.transpose(ints.tmp43, (1, 0)) - tmp47 = np.copy(ints.tmp162) - del ints.tmp162 - tmp47 += v.aabb.oovv * -1 - tmp45 = np.copy(ints.tmp147) * 2 - del ints.tmp147 - tmp45 += ints.tmp151 - del ints.tmp151 - tmp45 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp45 += ints.tmp145 * -2 - del ints.tmp145 - tmp45 += v.bbbb.oovv * -1 - tmp48 = np.copy(ints.tmp104) - tmp48 += v.aabb.oooo - tmp43 = np.copy(f.aa.oo) - tmp43 += ints.tmp1 - tmp43 += np.transpose(ints.tmp20, (1, 0)) * 2 - tmp43 += np.transpose(ints.tmp22, (1, 0)) - tmp36 = np.copy(ints.tmp83) - del ints.tmp83 - tmp36 += ints.tmp87 * 2 - del ints.tmp87 - tmp36 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp36 += ints.tmp81 * -1 - del ints.tmp81 - tmp41 = np.copy(tmp39) * -1 - del tmp39 - tmp41 += tmp40 * 2 - del tmp40 - tmp42 = np.copy(ints.tmp102) - del ints.tmp102 - tmp42 += ints.tmp108 - del ints.tmp108 - tmp42 += ints.tmp109 * 2 - del ints.tmp109 - tmp42 += np.transpose(ints.tmp117, (0, 2, 1, 3)) - del ints.tmp117 - tmp42 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp42 += ints.tmp107 * -1 - del ints.tmp107 - tmp42 += ints.tmp118 * -1 - del ints.tmp118 - tmp38 = np.copy(ints.tmp104) - del ints.tmp104 - tmp38 += v.aabb.oooo - tmp35 = np.copy(ints.tmp79) * 2 - del ints.tmp79 - tmp35 += ints.tmp85 - del ints.tmp85 - tmp35 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp35 += ints.tmp77 * -2 - del ints.tmp77 - tmp35 += v.aaaa.oovv * -1 - tmp34 = np.copy(ints.tmp52) * 2 - del ints.tmp52 - tmp34 += ints.tmp59 - del ints.tmp59 - tmp34 += ints.tmp65 * 2 - del ints.tmp65 - tmp34 += ints.tmp66 - del ints.tmp66 - tmp34 += ints.tmp96 - del ints.tmp96 - tmp34 += f.aa.ov * -1 - tmp34 += ints.tmp49 * -1 - del ints.tmp49 - tmp34 += ints.tmp53 * -1 - del ints.tmp53 - tmp34 += ints.tmp62 * -2 - del ints.tmp62 - tmp34 += ints.tmp63 * -1 - del ints.tmp63 - tmp37 = np.copy(ints.tmp121) - del ints.tmp121 - tmp37 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) * -1 - tmp29 = np.copy(np.transpose(ints.tmp73, (1, 0))) * 2 - del ints.tmp73 - tmp29 += np.transpose(ints.tmp75, (1, 0)) - del ints.tmp75 - tmp29 += f.aa.vv * -1 - tmp29 += tmp28 - del tmp28 - tmp32 = np.copy(tmp30) * 2 - del tmp30 - tmp32 += tmp31 - del tmp31 - tmp27 = np.copy(ints.tmp56) - del ints.tmp56 - tmp27 += np.transpose(v.aaaa.oooo, (0, 2, 3, 1)) * -1 - tmp17 = np.copy(tmp8) * 2 - del tmp8 - tmp17 += np.transpose(tmp10, (1, 0, 2)) * -1 - del tmp10 - tmp17 += np.transpose(tmp12, (1, 0, 2)) - del tmp12 - tmp17 += np.transpose(tmp14, (1, 0, 2)) - del tmp14 - tmp17 += tmp16 - del tmp16 - tmp33 = np.copy(ints.tmp54) - del ints.tmp54 - tmp33 += np.transpose(ints.tmp89, (1, 2, 0, 3)) * -1 - del ints.tmp89 - tmp26 = np.copy(tmp18) * 4 - del tmp18 - tmp26 += tmp19 * 2 - del tmp19 - tmp26 += tmp20 - del tmp20 - tmp26 += tmp21 - del tmp21 - tmp26 += np.transpose(tmp23, (1, 0, 2)) * -2 - del tmp23 - tmp26 += tmp25 - del tmp25 - tmp7 = np.copy(f.bb.oo) - tmp7 += ints.tmp28 - del ints.tmp28 - tmp7 += np.transpose(ints.tmp32, (1, 0)) - del ints.tmp32 - tmp7 += np.transpose(ints.tmp33, (1, 0)) - del ints.tmp33 - tmp7 += np.transpose(ints.tmp41, (1, 0)) * 2 - del ints.tmp41 - tmp7 += np.transpose(ints.tmp43, (1, 0)) - del ints.tmp43 - tmp7 += np.transpose(ints.tmp46, (1, 0)) - del ints.tmp46 - tmp7 += np.transpose(ints.tmp47, (1, 0)) - del ints.tmp47 - tmp7 += np.transpose(ints.tmp31, (1, 0)) * -1 - del ints.tmp31 - tmp7 += np.transpose(ints.tmp45, (1, 0)) * -1 - del ints.tmp45 - tmp3 = np.copy(f.aa.ov) - tmp3 += ints.tmp13 - del ints.tmp13 - tmp3 += ints.tmp9 - del ints.tmp9 - tmp3 += ints.tmp7 * -1 - del ints.tmp7 - tmp5 = np.copy(ints.tmp39) - del ints.tmp39 - tmp5 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp2 = np.copy(f.bb.ov) - tmp2 += ints.tmp12 - del ints.tmp12 - tmp2 += ints.tmp15 - del ints.tmp15 - tmp2 += ints.tmp11 * -1 - del ints.tmp11 - tmp6 = np.copy(ints.tmp37) - del ints.tmp37 - tmp6 += v.bbbb.ooov * -1 - tmp4 = np.copy(f.aa.oo) - tmp4 += ints.tmp1 - del ints.tmp1 - tmp4 += np.transpose(ints.tmp20, (1, 0)) * 2 - del ints.tmp20 - tmp4 += np.transpose(ints.tmp22, (1, 0)) - del ints.tmp22 - tmp4 += np.transpose(ints.tmp25, (1, 0)) - del ints.tmp25 - tmp4 += np.transpose(ints.tmp26, (1, 0)) - del ints.tmp26 - tmp4 += np.transpose(ints.tmp5, (1, 0)) - del ints.tmp5 - tmp4 += np.transpose(ints.tmp6, (1, 0)) - del ints.tmp6 - tmp4 += np.transpose(ints.tmp24, (1, 0)) * -1 - del ints.tmp24 - tmp4 += np.transpose(ints.tmp4, (1, 0)) * -1 - del ints.tmp4 - tmp0 = np.copy(ints.tmp16) - del ints.tmp16 - tmp0 += v.aaaa.ooov * -1 - tmp1 = np.copy(ints.tmp18) - del ints.tmp18 - tmp1 += v.aabb.ooov - r2new.bbb = np.copy(tmp62) - r2new.bbb += np.transpose(tmp62, (1, 0, 2)) * -1 - del tmp62 - r2new.bbb += tmp72 * -1 - r2new.bbb += np.transpose(tmp72, (1, 0, 2)) - del tmp72 - r2new.bbb += einsum(tmp73, (0, 1, 2, 3), r2.bbb, (2, 3, 4), (0, 1, 4)) * 2 - del tmp73 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp50, (2, 3), (0, 1, 3)) * -2 - r2new.bbb += einsum(tmp74, (0,), t2.bbbb, (1, 2, 3, 0), (1, 2, 3)) * 4 - del tmp74 - r2new.bbb += einsum(tmp75, (0, 1, 2, 3), r1.b, (2,), (1, 0, 3)) * 2 - del tmp75 - r2new.bbb += einsum(r1.b, (0,), tmp53, (1, 2), (0, 1, 2)) * -1 - r2new.bbb += einsum(tmp53, (0, 1), r1.b, (2,), (0, 2, 1)) - r2new.bab = einsum(r2.bab, (0, 1, 2), tmp45, (3, 0, 4, 2), (3, 1, 4)) - del tmp45 - r2new.bab += einsum(r2.aaa, (0, 1, 2), tmp46, (1, 3, 2, 4), (3, 0, 4)) * -2 - del tmp46 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp47, (3, 1, 4, 2), (0, 3, 4)) - del tmp47 - r2new.bab += einsum(tmp48, (0, 1, 2, 3), r2.bab, (3, 1, 4), (2, 0, 4)) - del tmp48 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp50, (2, 3), (0, 1, 3)) * -1 - del tmp50 - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp51, (2,), (1, 0, 3)) * 2 - del tmp51 - r2new.bab += einsum(r1.a, (0,), tmp52, (1, 0, 2, 3), (2, 1, 3)) - del tmp52 - r2new.bab += einsum(tmp43, (0, 1), r2.bab, (2, 0, 3), (2, 1, 3)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp44, (0, 3), (3, 1, 2)) * -1 - r2new.bab += einsum(tmp53, (0, 1), r1.a, (2,), (0, 2, 1)) - del tmp53 - r2new.aba = einsum(r2.aba, (0, 1, 2), tmp35, (3, 0, 4, 2), (3, 1, 4)) - del tmp35 - r2new.aba += einsum(r2.bbb, (0, 1, 2), tmp36, (3, 1, 4, 2), (3, 0, 4)) * -2 - del tmp36 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp37, (3, 1, 4, 2), (0, 3, 4)) - del tmp37 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp38, (3, 0, 4, 1), (3, 4, 2)) - del tmp38 - r2new.aba += einsum(tmp29, (0, 1), r2.aba, (2, 3, 0), (2, 3, 1)) * -1 - r2new.aba += einsum(t2.abab, (0, 1, 2, 3), tmp41, (3,), (0, 1, 2)) - del tmp41 - r2new.aba += einsum(tmp42, (0, 1, 2, 3), r1.b, (2,), (0, 1, 3)) - del tmp42 - r2new.aba += einsum(tmp43, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - del tmp43 - r2new.aba += einsum(tmp44, (0, 1), r2.aba, (2, 0, 3), (2, 1, 3)) * -1 - del tmp44 - r2new.aba += einsum(r1.b, (0,), tmp34, (1, 2), (1, 0, 2)) - r2new.aaa = np.copy(tmp17) * -1 - r2new.aaa += np.transpose(tmp17, (1, 0, 2)) - del tmp17 - r2new.aaa += tmp26 - r2new.aaa += np.transpose(tmp26, (1, 0, 2)) * -1 - del tmp26 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp27, (3, 4, 0, 1), (3, 4, 2)) * 2 - del tmp27 - r2new.aaa += einsum(tmp29, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp29 - r2new.aaa += einsum(tmp32, (0,), t2.aaaa, (1, 2, 3, 0), (1, 2, 3)) * 2 - del tmp32 - r2new.aaa += einsum(r1.a, (0,), tmp33, (1, 2, 0, 3), (2, 1, 3)) * 2 - del tmp33 - r2new.aaa += einsum(tmp34, (0, 1), r1.a, (2,), (2, 0, 1)) * -1 - r2new.aaa += einsum(r1.a, (0,), tmp34, (1, 2), (1, 0, 2)) - del tmp34 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp5, (0, 3, 1, 2), (3,)) - del tmp5 - r1new.b += einsum(tmp6, (0, 1, 2, 3), r2.bbb, (2, 1, 3), (0,)) * -2 - del tmp6 - r1new.b += einsum(r2.aba, (0, 1, 2), tmp3, (0, 2), (1,)) * -1 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp2, (1, 2), (0,)) * 2 - r1new.b += einsum(r1.b, (0,), tmp7, (0, 1), (1,)) * -1 - del tmp7 - r1new.a = einsum(tmp0, (0, 1, 2, 3), r2.aaa, (2, 1, 3), (0,)) * -2 - del tmp0 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp1, (3, 1, 0, 2), (3,)) - del tmp1 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp2, (0, 2), (1,)) * -1 - del tmp2 - r1new.a += einsum(r2.aaa, (0, 1, 2), tmp3, (1, 2), (0,)) * 2 - del tmp3 - r1new.a += einsum(r1.a, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:40:37.234664. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp101 : array - tmp104 : array - tmp105 : array - tmp11 : array - tmp115 : array - tmp116 : array - tmp117 : array - tmp12 : array - tmp128 : array - tmp13 : array - tmp131 : array - tmp132 : array - tmp138 : array - tmp139 : array - tmp141 : array - tmp142 : array - tmp143 : array - tmp145 : array - tmp147 : array - tmp148 : array - tmp149 : array - tmp15 : array - tmp150 : array - tmp152 : array - tmp153 : array - tmp154 : array - tmp155 : array - tmp156 : array - tmp160 : array - tmp162 : array - tmp164 : array - tmp166 : array - tmp168 : array - tmp170 : array - tmp176 : array - tmp178 : array - tmp180 : array - tmp193 : array - tmp20 : array - tmp22 : array - tmp31 : array - tmp32 : array - tmp33 : array - tmp4 : array - tmp41 : array - tmp43 : array - tmp5 : array - tmp50 : array - tmp51 : array - tmp55 : array - tmp57 : array - tmp59 : array - tmp6 : array - tmp63 : array - tmp65 : array - tmp67 : array - tmp69 : array - tmp7 : array - tmp71 : array - tmp73 : array - tmp76 : array - tmp79 : array - tmp80 : array - tmp81 : array - tmp88 : array - tmp89 : array - tmp9 : array - tmp91 : array - tmp93 : array - tmp94 : array - tmp95 : array - tmp97 : array - """ - - tmp139 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp89 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp193 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp180 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 5), (1, 3, 4, 5)) - tmp178 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp176 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp170 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp168 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp166 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp164 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp162 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp160 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 1, 5), (0, 4, 3, 5)) - tmp156 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.vvov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp155 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovvv, (0, 4, 5, 2), (1, 4, 5, 3)) - tmp154 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovvv, (0, 2, 4, 5), (1, 4, 5, 3)) - tmp153 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp152 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp150 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) - tmp149 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 3), (4, 2)) - tmp148 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp147 = einsum(tmp139, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp145 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp143 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 3, 1), (4, 0)) * -1 - tmp142 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 3), (1, 4)) - tmp141 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 0, 3, 1), (4, 2)) * -1 - tmp138 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp132 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 4, 5), (2, 4, 1, 5)) - tmp131 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (1, 5, 2, 4)) - tmp128 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 4, 5, 3), (1, 2, 4, 5)) - tmp117 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp116 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp115 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.abab, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp105 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp104 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp101 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp97 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp95 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 1, 3), (0, 4)) - tmp94 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - tmp93 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovvv, (1, 2, 4, 3), (0, 4)) - tmp91 = einsum(t1.aa, (0, 1), tmp89, (0, 2), (2, 1)) - tmp88 = einsum(f.aa.vv, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp81 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp80 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 3), (4, 2)) - tmp79 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) - tmp76 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp73 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 5, 3)) - tmp71 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp69 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp67 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp65 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp63 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp59 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 5, 1, 3), (0, 2, 4, 5)) - tmp57 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp55 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp51 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp50 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (1, 3), (0, 2)) - tmp43 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 4), (3, 4)) - tmp41 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 1), (4, 3)) * -1 - tmp33 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (0, 1, 2, 3), (2, 3)) - tmp32 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (0, 2, 3, 1), (2, 3)) - tmp31 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 1), (2, 3)) - tmp22 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp20 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 3, 1, 4), (2, 4)) * -1 - tmp15 = einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - tmp13 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp12 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 0, 1), (2, 3)) - tmp11 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 1, 0, 3), (2, 3)) - tmp9 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - tmp7 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 1), (0, 3)) - tmp6 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp5 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) - tmp4 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - - return {f"tmp101": tmp101, f"tmp104": tmp104, f"tmp105": tmp105, f"tmp11": tmp11, f"tmp115": tmp115, f"tmp116": tmp116, f"tmp117": tmp117, f"tmp12": tmp12, f"tmp128": tmp128, f"tmp13": tmp13, f"tmp131": tmp131, f"tmp132": tmp132, f"tmp138": tmp138, f"tmp139": tmp139, f"tmp141": tmp141, f"tmp142": tmp142, f"tmp143": tmp143, f"tmp145": tmp145, f"tmp147": tmp147, f"tmp148": tmp148, f"tmp149": tmp149, f"tmp15": tmp15, f"tmp150": tmp150, f"tmp152": tmp152, f"tmp153": tmp153, f"tmp154": tmp154, f"tmp155": tmp155, f"tmp156": tmp156, f"tmp160": tmp160, f"tmp162": tmp162, f"tmp164": tmp164, f"tmp166": tmp166, f"tmp168": tmp168, f"tmp170": tmp170, f"tmp176": tmp176, f"tmp178": tmp178, f"tmp180": tmp180, f"tmp193": tmp193, f"tmp20": tmp20, f"tmp22": tmp22, f"tmp31": tmp31, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp43": tmp43, f"tmp5": tmp5, f"tmp50": tmp50, f"tmp51": tmp51, f"tmp55": tmp55, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp6": tmp6, f"tmp63": tmp63, f"tmp65": tmp65, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp7": tmp7, f"tmp71": tmp71, f"tmp73": tmp73, f"tmp76": tmp76, f"tmp79": tmp79, f"tmp80": tmp80, f"tmp81": tmp81, f"tmp88": tmp88, f"tmp89": tmp89, f"tmp9": tmp9, f"tmp91": tmp91, f"tmp93": tmp93, f"tmp94": tmp94, f"tmp95": tmp95, f"tmp97": tmp97} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:40:37.325915. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp67 = np.copy(ints.tmp162) - tmp67 += ints.tmp168 * 2 - tmp57 = np.copy(ints.tmp166) * 2 - tmp57 += ints.tmp170 - tmp61 = np.copy(ints.tmp176) - del ints.tmp176 - tmp61 += ints.tmp180 * 0.5 - del ints.tmp180 - tmp61 += v.bbbb.ovvv * 0.5 - tmp55 = einsum(f.bb.ov, (0, 1), r2.bbb, (2, 1, 3), (0, 3, 2)) - tmp59 = np.copy(np.transpose(ints.tmp41, (1, 0))) - tmp59 += np.transpose(ints.tmp43, (1, 0)) * 0.5 - tmp59 += f.bb.vv * -0.5 - tmp20 = np.copy(ints.tmp55) - del ints.tmp55 - tmp20 += ints.tmp59 * 0.5 - del ints.tmp59 - tmp20 += v.aaaa.ovvv * 0.5 - tmp12 = einsum(f.aa.ov, (0, 1), r2.aaa, (2, 1, 3), (0, 3, 2)) - tmp14 = np.copy(ints.tmp65) * 2 - tmp14 += ints.tmp71 - tmp16 = np.copy(ints.tmp69) * 0.5 - tmp16 += ints.tmp73 - tmp18 = np.copy(np.transpose(ints.tmp20, (1, 0))) - tmp18 += np.transpose(ints.tmp22, (1, 0)) * 0.5 - tmp18 += f.aa.vv * -0.5 - tmp66 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 4, 2, 1), (3, 0, 4)) - tmp64 = einsum(r1.b, (0,), ints.tmp178, (1, 2, 0, 3), (1, 2, 3)) - del ints.tmp178 - tmp65 = einsum(ints.tmp164, (0, 1, 2, 3), r2.bbb, (4, 3, 1), (0, 2, 4)) - tmp68 = einsum(tmp67, (0, 1, 2, 3), r2.aba, (2, 4, 0), (1, 4, 3)) - del tmp67 - tmp53 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.aba, (1, 4, 0), (2, 4, 3)) - tmp54 = einsum(r2.bbb, (0, 1, 2), v.bbbb.oovv, (3, 2, 4, 1), (3, 0, 4)) - tmp58 = einsum(r2.bbb, (0, 1, 2), tmp57, (3, 2, 4, 1), (3, 0, 4)) * -2 - del tmp57 - tmp62 = einsum(r1.b, (0,), tmp61, (1, 2, 3, 0), (1, 2, 3)) * 2 - del tmp61 - tmp56 = einsum(tmp55, (0, 1, 2), t1.bb, (0, 3), (1, 2, 3)) - del tmp55 - tmp52 = einsum(r2.aba, (0, 1, 2), ints.tmp160, (2, 3, 0, 4), (3, 4, 1)) - tmp60 = einsum(r2.bbb, (0, 1, 2), tmp59, (1, 3), (2, 0, 3)) * -4 - del tmp59 - tmp7 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.aba, (1, 3, 0), (2,)) - tmp42 = einsum(r1.b, (0,), f.bb.ov, (1, 0), (1,)) - tmp8 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 0, 2, 1), (3,)) - tmp38 = einsum(t1.aa, (0, 1), f.aa.ov, (0, 2), (2, 1)) - tmp40 = einsum(t1.bb, (0, 1), f.bb.ov, (0, 2), (2, 1)) - tmp30 = einsum(r1.a, (0,), f.aa.ov, (1, 0), (1,)) - tmp3 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (1, 3, 2), (0,)) - tmp4 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (3, 1, 2), (0,)) * -1 - tmp21 = einsum(tmp20, (0, 1, 2, 3), r1.a, (3,), (0, 1, 2)) * 2 - del tmp20 - tmp13 = einsum(tmp12, (0, 1, 2), t1.aa, (0, 3), (1, 2, 3)) - del tmp12 - tmp11 = einsum(v.aaaa.oovv, (0, 1, 2, 3), r2.aaa, (4, 3, 1), (0, 4, 2)) - tmp15 = einsum(r2.aaa, (0, 1, 2), tmp14, (3, 2, 4, 1), (3, 0, 4)) * -2 - del tmp14 - tmp17 = einsum(tmp16, (0, 1, 2, 3), r2.bab, (3, 4, 1), (0, 4, 2)) * -2 - del tmp16 - tmp19 = einsum(r2.aaa, (0, 1, 2), tmp18, (1, 3), (2, 0, 3)) * -4 - del tmp18 - tmp23 = einsum(ints.tmp57, (0, 1, 2, 3), r1.a, (2,), (0, 1, 3)) - del ints.tmp57 - tmp25 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (4, 3, 2), (0, 4, 1)) - tmp27 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (3, 4, 2), (0, 4, 1)) * -1 - tmp24 = einsum(ints.tmp63, (0, 1, 2, 3), r2.aaa, (4, 3, 1), (0, 2, 4)) - tmp26 = einsum(r2.bab, (0, 1, 2), ints.tmp67, (3, 2, 4, 0), (3, 4, 1)) * -1 - tmp0 = np.copy(f.bb.ov) - tmp0 += ints.tmp12 - del ints.tmp12 - tmp0 += ints.tmp15 - del ints.tmp15 - tmp0 += ints.tmp11 * -1 - del ints.tmp11 - tmp1 = np.copy(f.aa.ov) - tmp1 += ints.tmp13 - del ints.tmp13 - tmp1 += ints.tmp9 - del ints.tmp9 - tmp1 += ints.tmp7 * -1 - del ints.tmp7 - tmp51 = einsum(v.bbbb.ovov, (0, 1, 2, 3), r2.bbb, (3, 1, 4), (4, 0, 2)) * -1 - tmp50 = np.copy(ints.tmp141) * 2 - del ints.tmp141 - tmp50 += ints.tmp147 - del ints.tmp147 - tmp50 += ints.tmp148 - del ints.tmp148 - tmp50 += ints.tmp149 * 2 - del ints.tmp149 - tmp50 += ints.tmp150 - del ints.tmp150 - tmp50 += f.bb.ov * -1 - tmp50 += ints.tmp138 * -1 - del ints.tmp138 - tmp50 += ints.tmp142 * -1 - del ints.tmp142 - tmp50 += ints.tmp152 * -1 - del ints.tmp152 - tmp50 += ints.tmp153 * -2 - del ints.tmp153 - tmp69 = np.copy(tmp64) * 2 - del tmp64 - tmp69 += tmp65 * 4 - del tmp65 - tmp69 += tmp66 * 2 - del tmp66 - tmp69 += np.transpose(tmp68, (0, 2, 1)) - del tmp68 - tmp49 = np.copy(f.bb.oo) - tmp49 += ints.tmp139 - del ints.tmp139 - tmp49 += np.transpose(ints.tmp143, (1, 0)) * 2 - del ints.tmp143 - tmp49 += np.transpose(ints.tmp145, (1, 0)) - del ints.tmp145 - tmp63 = np.copy(tmp52) - del tmp52 - tmp63 += tmp53 - del tmp53 - tmp63 += tmp54 * 2 - del tmp54 - tmp63 += tmp56 * 2 - del tmp56 - tmp63 += np.transpose(tmp58, (0, 2, 1)) * -1 - del tmp58 - tmp63 += np.transpose(tmp60, (0, 2, 1)) - del tmp60 - tmp63 += tmp62 - del tmp62 - tmp43 = np.copy(tmp42) * 0.5 - del tmp42 - tmp43 += tmp7 * -0.5 - tmp43 += tmp8 - tmp39 = np.copy(np.transpose(ints.tmp20, (1, 0))) * 2 - tmp39 += np.transpose(ints.tmp22, (1, 0)) - tmp39 += f.aa.vv * -1 - tmp39 += tmp38 - del tmp38 - tmp46 = np.copy(ints.tmp162) - del ints.tmp162 - tmp46 += ints.tmp168 * 2 - del ints.tmp168 - tmp46 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp46 += ints.tmp160 * -1 - del ints.tmp160 - tmp41 = np.copy(np.transpose(ints.tmp41, (1, 0))) * 2 - tmp41 += np.transpose(ints.tmp43, (1, 0)) - tmp41 += f.bb.vv * -1 - tmp41 += tmp40 - del tmp40 - tmp31 = np.copy(tmp30) - del tmp30 - tmp31 += tmp3 * 2 - tmp31 += tmp4 - tmp44 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (3, 1, 4), (0, 4, 2)) * -1 - tmp47 = np.copy(ints.tmp131) - del ints.tmp131 - tmp47 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) * -1 - tmp45 = np.copy(ints.tmp166) * 2 - del ints.tmp166 - tmp45 += ints.tmp170 - del ints.tmp170 - tmp45 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp45 += ints.tmp164 * -2 - del ints.tmp164 - tmp45 += v.bbbb.oovv * -1 - tmp48 = np.copy(ints.tmp132) - del ints.tmp132 - tmp48 += ints.tmp154 - del ints.tmp154 - tmp48 += ints.tmp156 * 2 - del ints.tmp156 - tmp48 += np.transpose(v.aabb.vvov, (2, 0, 1, 3)) - tmp48 += ints.tmp128 * -1 - del ints.tmp128 - tmp48 += np.transpose(ints.tmp155, (0, 2, 1, 3)) * -1 - del ints.tmp155 - tmp36 = np.copy(ints.tmp104) - del ints.tmp104 - tmp36 += v.aabb.oovv * -1 - tmp33 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.aba, (1, 3, 4), (4, 0, 2)) - tmp32 = np.copy(ints.tmp76) - del ints.tmp76 - tmp32 += ints.tmp79 * 2 - del ints.tmp79 - tmp32 += ints.tmp80 - del ints.tmp80 - tmp32 += ints.tmp91 - del ints.tmp91 - tmp32 += ints.tmp93 * 2 - del ints.tmp93 - tmp32 += f.aa.ov * -1 - tmp32 += ints.tmp50 * -2 - del ints.tmp50 - tmp32 += ints.tmp51 * -1 - del ints.tmp51 - tmp32 += ints.tmp88 * -1 - del ints.tmp88 - tmp32 += ints.tmp94 * -1 - del ints.tmp94 - tmp35 = np.copy(ints.tmp69) - del ints.tmp69 - tmp35 += ints.tmp73 * 2 - del ints.tmp73 - tmp35 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp35 += ints.tmp67 * -1 - del ints.tmp67 - tmp34 = np.copy(ints.tmp65) * 2 - del ints.tmp65 - tmp34 += ints.tmp71 - del ints.tmp71 - tmp34 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp34 += ints.tmp63 * -2 - del ints.tmp63 - tmp34 += v.aaaa.oovv * -1 - tmp37 = np.copy(ints.tmp105) - del ints.tmp105 - tmp37 += ints.tmp115 - del ints.tmp115 - tmp37 += ints.tmp117 * 2 - del ints.tmp117 - tmp37 += v.aabb.ovvv - tmp37 += ints.tmp101 * -1 - del ints.tmp101 - tmp37 += np.transpose(ints.tmp116, (0, 1, 3, 2)) * -1 - del ints.tmp116 - tmp29 = np.copy(f.aa.oo) - tmp29 += ints.tmp89 - del ints.tmp89 - tmp29 += np.transpose(ints.tmp95, (1, 0)) * 2 - del ints.tmp95 - tmp29 += np.transpose(ints.tmp97, (1, 0)) - del ints.tmp97 - tmp22 = np.copy(tmp11) * 2 - del tmp11 - tmp22 += tmp13 * 2 - del tmp13 - tmp22 += np.transpose(tmp15, (0, 2, 1)) * -1 - del tmp15 - tmp22 += np.transpose(tmp17, (0, 2, 1)) - del tmp17 - tmp22 += np.transpose(tmp19, (0, 2, 1)) - del tmp19 - tmp22 += tmp21 - del tmp21 - tmp28 = np.copy(tmp23) * 2 - del tmp23 - tmp28 += tmp24 * 4 - del tmp24 - tmp28 += tmp25 * 2 - del tmp25 - tmp28 += tmp26 - del tmp26 - tmp28 += tmp27 - del tmp27 - tmp10 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (1, 3, 4), (4, 0, 2)) - tmp6 = np.copy(ints.tmp32) - del ints.tmp32 - tmp6 += np.transpose(ints.tmp41, (1, 0)) * 2 - del ints.tmp41 - tmp6 += np.transpose(ints.tmp43, (1, 0)) - del ints.tmp43 - tmp6 += f.bb.vv * -1 - tmp6 += np.transpose(ints.tmp31, (1, 0)) * -1 - del ints.tmp31 - tmp6 += np.transpose(ints.tmp33, (1, 0)) * -1 - del ints.tmp33 - tmp9 = np.copy(tmp7) * -1 - del tmp7 - tmp9 += tmp8 * 2 - del tmp8 - tmp9 += einsum(tmp0, (0, 1), r1.b, (1,), (0,)) - tmp5 = np.copy(tmp3) * 2 - del tmp3 - tmp5 += tmp4 - del tmp4 - tmp5 += einsum(tmp1, (0, 1), r1.a, (1,), (0,)) - tmp2 = np.copy(np.transpose(ints.tmp20, (1, 0))) * 2 - del ints.tmp20 - tmp2 += np.transpose(ints.tmp22, (1, 0)) - del ints.tmp22 - tmp2 += ints.tmp5 - del ints.tmp5 - tmp2 += f.aa.vv * -1 - tmp2 += np.transpose(ints.tmp4, (1, 0)) * -1 - del ints.tmp4 - tmp2 += np.transpose(ints.tmp6, (1, 0)) * -1 - del ints.tmp6 - r2new.bbb = einsum(ints.tmp193, (0, 1, 2, 3), r1.b, (3,), (2, 1, 0)) * 2 - del ints.tmp193 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), v.bbbb.vvvv, (3, 0, 4, 1), (3, 4, 2)) * 2 - r2new.bbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp51, (4, 1, 0), (2, 3, 4)) * -2 - del tmp51 - r2new.bbb += np.transpose(tmp63, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp63, (2, 1, 0)) - del tmp63 - r2new.bbb += np.transpose(tmp69, (1, 2, 0)) - r2new.bbb += np.transpose(tmp69, (2, 1, 0)) * -1 - del tmp69 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp49, (2, 3), (0, 1, 3)) * -2 - r2new.bbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp43, (1,), (2, 3, 0)) * 4 - r2new.bbb += einsum(r1.b, (0,), tmp50, (1, 2), (0, 2, 1)) * -1 - r2new.bbb += einsum(r1.b, (0,), tmp50, (1, 2), (2, 0, 1)) - r2new.bab = einsum(r2.bab, (0, 1, 2), v.aabb.vvvv, (3, 1, 4, 0), (4, 3, 2)) - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp44, (0, 4, 1), (3, 2, 4)) * -1 - del tmp44 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp45, (3, 2, 4, 0), (4, 1, 3)) - del tmp45 - r2new.bab += einsum(tmp46, (0, 1, 2, 3), r2.aaa, (4, 2, 0), (3, 4, 1)) * -2 - del tmp46 - r2new.bab += einsum(tmp47, (0, 1, 2, 3), r2.bab, (4, 3, 1), (4, 2, 0)) - del tmp47 - r2new.bab += einsum(r1.a, (0,), tmp48, (1, 2, 0, 3), (3, 2, 1)) * -1 - del tmp48 - r2new.bab += einsum(tmp41, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp39, (1, 3), (0, 3, 2)) * -1 - r2new.bab += einsum(tmp49, (0, 1), r2.bab, (2, 3, 0), (2, 3, 1)) * -1 - del tmp49 - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp31, (0,), (3, 2, 1)) - r2new.bab += einsum(r1.a, (0,), tmp50, (1, 2), (2, 0, 1)) - del tmp50 - r2new.aba = einsum(t2.abab, (0, 1, 2, 3), tmp33, (4, 0, 1), (2, 3, 4)) - del tmp33 - r2new.aba += einsum(v.aabb.vvvv, (0, 1, 2, 3), r2.aba, (1, 3, 4), (0, 2, 4)) - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp34, (3, 2, 4, 0), (4, 1, 3)) - del tmp34 - r2new.aba += einsum(r2.bbb, (0, 1, 2), tmp35, (3, 2, 4, 1), (4, 0, 3)) * -2 - del tmp35 - r2new.aba += einsum(tmp36, (0, 1, 2, 3), r2.aba, (4, 3, 1), (4, 2, 0)) - del tmp36 - r2new.aba += einsum(r1.b, (0,), tmp37, (1, 2, 3, 0), (2, 3, 1)) * -1 - del tmp37 - r2new.aba += einsum(tmp39, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - del tmp39 - r2new.aba += einsum(tmp41, (0, 1), r2.aba, (2, 0, 3), (2, 1, 3)) * -1 - del tmp41 - r2new.aba += einsum(tmp29, (0, 1), r2.aba, (2, 3, 0), (2, 3, 1)) * -1 - r2new.aba += einsum(t2.abab, (0, 1, 2, 3), tmp43, (1,), (2, 3, 0)) * 2 - del tmp43 - r2new.aba += einsum(tmp32, (0, 1), r1.b, (2,), (1, 2, 0)) - r2new.aaa = einsum(tmp10, (0, 1, 2), t2.aaaa, (2, 1, 3, 4), (3, 4, 0)) * -2 - del tmp10 - r2new.aaa += einsum(ints.tmp81, (0, 1, 2, 3), r1.a, (3,), (2, 1, 0)) * 2 - del ints.tmp81 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), v.aaaa.vvvv, (3, 1, 4, 0), (3, 4, 2)) * -2 - r2new.aaa += np.transpose(tmp22, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp22, (2, 1, 0)) - del tmp22 - r2new.aaa += np.transpose(tmp28, (1, 2, 0)) - r2new.aaa += np.transpose(tmp28, (2, 1, 0)) * -1 - del tmp28 - r2new.aaa += einsum(tmp29, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp29 - r2new.aaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp31, (1,), (2, 3, 0)) * 2 - del tmp31 - r2new.aaa += einsum(tmp32, (0, 1), r1.a, (2,), (2, 1, 0)) * -1 - r2new.aaa += einsum(tmp32, (0, 1), r1.a, (2,), (1, 2, 0)) - del tmp32 - r1new.b = einsum(v.aabb.ovvv, (0, 1, 2, 3), r2.aba, (1, 3, 0), (2,)) * -1 - r1new.b += einsum(r2.bbb, (0, 1, 2), v.bbbb.ovvv, (2, 1, 3, 0), (3,)) * 2 - r1new.b += einsum(tmp1, (0, 1), r2.aba, (1, 2, 0), (2,)) * -1 - r1new.b += einsum(tmp0, (0, 1), r2.bbb, (2, 1, 0), (2,)) * 2 - r1new.b += einsum(tmp6, (0, 1), r1.b, (0,), (1,)) * -1 - del tmp6 - r1new.b += einsum(tmp9, (0,), t1.bb, (0, 1), (1,)) * -1 - del tmp9 - r1new.a = einsum(r2.bab, (0, 1, 2), v.aabb.vvov, (3, 1, 2, 0), (3,)) * -1 - r1new.a += einsum(v.aaaa.ovvv, (0, 1, 2, 3), r2.aaa, (3, 1, 0), (2,)) * 2 - r1new.a += einsum(tmp0, (0, 1), r2.bab, (1, 2, 0), (2,)) * -1 - del tmp0 - r1new.a += einsum(tmp1, (0, 1), r2.aaa, (2, 1, 0), (2,)) * 2 - del tmp1 - r1new.a += einsum(tmp2, (0, 1), r1.a, (0,), (1,)) * -1 - del tmp2 - r1new.a += einsum(t1.aa, (0, 1), tmp5, (0,), (1,)) * -1 - del tmp5 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:43:17.462508. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp100 : array - tmp101 : array - tmp103 : array - tmp105 : array - tmp107 : array - tmp109 : array - tmp11 : array - tmp111 : array - tmp113 : array - tmp115 : array - tmp117 : array - tmp119 : array - tmp120 : array - tmp122 : array - tmp124 : array - tmp125 : array - tmp127 : array - tmp129 : array - tmp13 : array - tmp130 : array - tmp132 : array - tmp133 : array - tmp135 : array - tmp137 : array - tmp138 : array - tmp140 : array - tmp141 : array - tmp143 : array - tmp144 : array - tmp146 : array - tmp148 : array - tmp149 : array - tmp15 : array - tmp151 : array - tmp152 : array - tmp154 : array - tmp155 : array - tmp156 : array - tmp157 : array - tmp159 : array - tmp161 : array - tmp162 : array - tmp163 : array - tmp164 : array - tmp165 : array - tmp167 : array - tmp168 : array - tmp17 : array - tmp170 : array - tmp172 : array - tmp175 : array - tmp177 : array - tmp179 : array - tmp182 : array - tmp185 : array - tmp187 : array - tmp189 : array - tmp19 : array - tmp191 : array - tmp194 : array - tmp197 : array - tmp199 : array - tmp2 : array - tmp201 : array - tmp203 : array - tmp204 : array - tmp205 : array - tmp206 : array - tmp207 : array - tmp209 : array - tmp21 : array - tmp210 : array - tmp212 : array - tmp215 : array - tmp22 : array - tmp223 : array - tmp225 : array - tmp230 : array - tmp232 : array - tmp238 : array - tmp240 : array - tmp247 : array - tmp248 : array - tmp25 : array - tmp250 : array - tmp251 : array - tmp253 : array - tmp254 : array - tmp256 : array - tmp26 : array - tmp262 : array - tmp264 : array - tmp27 : array - tmp275 : array - tmp277 : array - tmp279 : array - tmp28 : array - tmp281 : array - tmp283 : array - tmp285 : array - tmp291 : array - tmp292 : array - tmp294 : array - tmp295 : array - tmp297 : array - tmp299 : array - tmp30 : array - tmp301 : array - tmp306 : array - tmp307 : array - tmp309 : array - tmp315 : array - tmp317 : array - tmp319 : array - tmp32 : array - tmp320 : array - tmp325 : array - tmp328 : array - tmp334 : array - tmp336 : array - tmp34 : array - tmp341 : array - tmp343 : array - tmp345 : array - tmp347 : array - tmp349 : array - tmp351 : array - tmp36 : array - tmp367 : array - tmp369 : array - tmp37 : array - tmp38 : array - tmp39 : array - tmp390 : array - tmp392 : array - tmp394 : array - tmp396 : array - tmp398 : array - tmp4 : array - tmp400 : array - tmp402 : array - tmp41 : array - tmp412 : array - tmp414 : array - tmp416 : array - tmp43 : array - tmp45 : array - tmp46 : array - tmp47 : array - tmp49 : array - tmp5 : array - tmp51 : array - tmp53 : array - tmp55 : array - tmp57 : array - tmp59 : array - tmp61 : array - tmp62 : array - tmp64 : array - tmp65 : array - tmp66 : array - tmp68 : array - tmp7 : array - tmp70 : array - tmp72 : array - tmp74 : array - tmp76 : array - tmp78 : array - tmp8 : array - tmp80 : array - tmp83 : array - tmp85 : array - tmp86 : array - tmp88 : array - tmp90 : array - tmp92 : array - tmp94 : array - tmp96 : array - tmp98 : array - """ - - tmp45 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp119 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp41 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp38 = einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - tmp39 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp36 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 0, 1), (2, 3)) - tmp89 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 1, 0, 3), (2, 3)) - tmp32 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - tmp82 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 1), (0, 3)) - tmp214 = einsum(tmp45, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp333 = einsum(tmp119, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp327 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 2, 0, 1)) - tmp324 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp174 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp176 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp314 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp151 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp306 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp124 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 2, 1)) - tmp211 = einsum(t1.aa, (0, 1), tmp41, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp209 = einsum(tmp38, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp156 = einsum(t1.aa, (0, 1), tmp39, (2, 1), (0, 2)) - tmp205 = einsum(tmp36, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp203 = einsum(tmp89, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp155 = einsum(t1.aa, (0, 1), tmp32, (2, 1), (0, 2)) - tmp154 = einsum(t1.aa, (0, 1), tmp82, (2, 1), (0, 2)) - tmp196 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp193 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp190 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp188 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (0, 1, 2, 3), (2, 3)) - tmp186 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 3), (1, 2)) - tmp184 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 1), (2, 3)) - tmp181 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) - tmp178 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp169 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp167 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (0, 1, 2, 3), (2, 3)) - tmp27 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp163 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp161 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) - tmp26 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 3, 0, 1), (2, 3)) - tmp25 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 0, 3, 1), (2, 3)) - tmp148 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp49 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp143 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp140 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp47 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 1, 3), (4, 0)) - tmp21 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp1 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp416 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp414 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 4), (3, 4)) - tmp412 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 3), (4, 1)) - tmp402 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp400 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 5, 3)) - tmp398 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp396 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp394 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp392 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp390 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (1, 5, 2, 4)) - tmp369 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp367 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 4, 3), (4, 1)) - tmp351 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp349 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp347 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp345 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp343 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 1, 5), (0, 4, 3, 5)) - tmp341 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp336 = einsum(tmp214, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 3, 4)) - tmp334 = einsum(tmp333, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - del tmp333 - tmp328 = einsum(t1.aa, (0, 1), tmp327, (2, 3, 4, 1), (0, 2, 3, 4)) - del tmp327 - tmp325 = einsum(tmp324, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) - del tmp324 - tmp320 = einsum(t1.aa, (0, 1), tmp174, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp319 = einsum(t1.aa, (0, 1), tmp176, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp317 = einsum(t1.bb, (0, 1), tmp314, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp315 = einsum(tmp314, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) - del tmp314 - tmp309 = einsum(t1.aa, (0, 1), tmp151, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp307 = einsum(tmp306, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp301 = einsum(t2.abab, (0, 1, 2, 3), tmp45, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp299 = einsum(tmp124, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 4, 2, 5)) - tmp297 = einsum(tmp124, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 2, 5)) - tmp295 = einsum(t2.bbbb, (0, 1, 2, 3), tmp119, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp294 = einsum(t2.abab, (0, 1, 2, 3), tmp119, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp292 = einsum(tmp119, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp291 = einsum(tmp119, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp285 = einsum(tmp38, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp283 = einsum(t2.abab, (0, 1, 2, 3), tmp38, (4, 3), (0, 1, 4, 2)) - tmp281 = einsum(t2.bbbb, (0, 1, 2, 3), tmp36, (4, 3), (0, 1, 4, 2)) - tmp279 = einsum(t2.abab, (0, 1, 2, 3), tmp36, (4, 3), (0, 1, 4, 2)) - tmp277 = einsum(t2.bbbb, (0, 1, 2, 3), tmp89, (4, 3), (0, 1, 4, 2)) - tmp275 = einsum(t2.abab, (0, 1, 2, 3), tmp89, (4, 3), (0, 1, 4, 2)) - tmp264 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 5, 3), (0, 1, 5, 4)) - tmp262 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp256 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (0, 2, 4, 5), (1, 4, 5, 3)) - tmp254 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 3, 5)) - tmp253 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp251 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp250 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp248 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp247 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp240 = einsum(t1.aa, (0, 1), v.aabb.vvoo, (2, 1, 3, 4), (0, 3, 4, 2)) - tmp238 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp232 = einsum(t1.aa, (0, 1), v.aabb.oooo, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp230 = einsum(t1.bb, (0, 1), v.bbbb.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp225 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp223 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (4, 3), (0, 4, 1, 2)) - tmp215 = einsum(tmp214, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - del tmp214 - tmp212 = einsum(tmp211, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - del tmp211 - tmp210 = einsum(tmp209, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp207 = einsum(tmp156, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp206 = einsum(tmp205, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp204 = einsum(tmp203, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp201 = einsum(t1.aa, (0, 1), tmp155, (2, 0), (2, 1)) - tmp199 = einsum(t1.aa, (0, 1), tmp154, (2, 0), (2, 1)) - tmp197 = einsum(tmp196, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - del tmp196 - tmp194 = einsum(t1.aa, (0, 1), tmp193, (2, 3, 1, 4), (0, 2, 3, 4)) - del tmp193 - tmp191 = einsum(tmp190, (0, 1), t1.aa, (2, 1), (2, 0)) - del tmp190 - tmp189 = einsum(tmp188, (0, 1), t1.bb, (2, 1), (2, 0)) - del tmp188 - tmp187 = einsum(tmp186, (0, 1), t1.bb, (2, 0), (2, 1)) - del tmp186 - tmp185 = einsum(tmp184, (0, 1), t1.bb, (2, 1), (2, 0)) - del tmp184 - tmp182 = einsum(t1.aa, (0, 1), tmp181, (1, 2), (0, 2)) - del tmp181 - tmp179 = einsum(t1.aa, (0, 1), tmp178, (2, 1), (0, 2)) - del tmp178 - tmp177 = einsum(tmp176, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - del tmp176 - tmp175 = einsum(tmp174, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - del tmp174 - tmp172 = einsum(tmp169, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp170 = einsum(tmp169, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 3, 4)) - del tmp169 - tmp168 = einsum(tmp167, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp165 = einsum(t1.aa, (0, 1), tmp27, (2, 0), (2, 1)) - tmp164 = einsum(tmp163, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp162 = einsum(tmp161, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp159 = einsum(t1.aa, (0, 1), tmp26, (2, 0), (2, 1)) - tmp157 = einsum(t1.aa, (0, 1), tmp25, (2, 0), (2, 1)) - tmp152 = einsum(tmp151, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp149 = einsum(tmp148, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp146 = einsum(t1.aa, (0, 1), tmp49, (2, 0), (2, 1)) - tmp144 = einsum(tmp143, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp141 = einsum(tmp140, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp138 = einsum(tmp47, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp137 = einsum(tmp124, (0, 1, 2, 3), t2.abab, (4, 2, 3, 5), (4, 0, 1, 5)) - tmp135 = einsum(t2.bbbb, (0, 1, 2, 3), tmp45, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp133 = einsum(t2.abab, (0, 1, 2, 3), tmp45, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp132 = einsum(t2.abab, (0, 1, 2, 3), tmp41, (4, 5, 0, 2), (4, 5, 1, 3)) - tmp130 = einsum(tmp41, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp129 = einsum(t2.abab, (0, 1, 2, 3), tmp41, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp127 = einsum(tmp41, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp125 = einsum(tmp124, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) - tmp122 = einsum(t2.abab, (0, 1, 2, 3), tmp45, (4, 0, 1, 3), (4, 2)) - tmp120 = einsum(t2.bbbb, (0, 1, 2, 3), tmp119, (4, 1, 0, 3), (4, 2)) - tmp117 = einsum(tmp41, (0, 1, 2, 3), t2.aaaa, (2, 1, 4, 3), (0, 4)) - tmp115 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (4, 2), (0, 4, 1, 3)) - tmp113 = einsum(t2.aaaa, (0, 1, 2, 3), tmp39, (4, 3), (0, 1, 4, 2)) - tmp111 = einsum(t2.abab, (0, 1, 2, 3), tmp32, (4, 2), (0, 4, 1, 3)) - tmp109 = einsum(tmp32, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp107 = einsum(tmp82, (0, 1), t2.abab, (2, 3, 1, 4), (2, 0, 3, 4)) - tmp105 = einsum(t2.aaaa, (0, 1, 2, 3), tmp82, (4, 3), (0, 1, 4, 2)) - tmp103 = einsum(tmp38, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp101 = einsum(t2.abab, (0, 1, 2, 3), tmp38, (1, 3), (0, 2)) - tmp100 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (0, 2), (1, 3)) - tmp98 = einsum(tmp39, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp96 = einsum(tmp36, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp94 = einsum(t2.abab, (0, 1, 2, 3), tmp36, (1, 3), (0, 2)) - tmp92 = einsum(tmp89, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp90 = einsum(t2.abab, (0, 1, 2, 3), tmp89, (1, 3), (0, 2)) - del tmp89 - tmp88 = einsum(t2.abab, (0, 1, 2, 3), tmp32, (0, 2), (1, 3)) - tmp86 = einsum(t2.aaaa, (0, 1, 2, 3), tmp32, (1, 3), (0, 2)) - tmp85 = einsum(t2.abab, (0, 1, 2, 3), tmp82, (0, 2), (1, 3)) - tmp83 = einsum(tmp82, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - del tmp82 - tmp80 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp78 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp76 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - tmp74 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 3), (1, 4)) - tmp72 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 0, 3, 1), (4, 2)) * -1 - tmp70 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovvv, (1, 3, 4, 2), (0, 4)) * -1 - tmp68 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp66 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp65 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (4, 3, 1, 5), (4, 0, 2, 5)) - tmp64 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ooov, (4, 5, 0, 2), (4, 5, 1, 3)) - tmp62 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp61 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp59 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp57 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 3), (4, 2)) - tmp55 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) - tmp53 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 3), (4, 2)) - tmp51 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 1, 3), (4, 2)) - tmp46 = einsum(v.aabb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp43 = einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp37 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) - tmp34 = einsum(v.aaaa.oovv, (0, 1, 2, 3), t1.aa, (1, 3), (0, 2)) - tmp30 = einsum(v.aabb.oooo, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp28 = einsum(v.aaaa.oooo, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp22 = einsum(tmp21, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp19 = einsum(t1.aa, (0, 1), tmp1, (0, 2), (2, 1)) - tmp17 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (4, 2), (4, 0, 1, 3)) - tmp15 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp13 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp11 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp10 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp8 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (1, 3), (0, 2)) - tmp7 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp5 = einsum(t1.aa, (0, 1), f.aa.vv, (2, 1), (0, 2)) - tmp4 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp2 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp100": tmp100, f"tmp101": tmp101, f"tmp103": tmp103, f"tmp105": tmp105, f"tmp107": tmp107, f"tmp109": tmp109, f"tmp11": tmp11, f"tmp111": tmp111, f"tmp113": tmp113, f"tmp115": tmp115, f"tmp117": tmp117, f"tmp119": tmp119, f"tmp120": tmp120, f"tmp122": tmp122, f"tmp124": tmp124, f"tmp125": tmp125, f"tmp127": tmp127, f"tmp129": tmp129, f"tmp13": tmp13, f"tmp130": tmp130, f"tmp132": tmp132, f"tmp133": tmp133, f"tmp135": tmp135, f"tmp137": tmp137, f"tmp138": tmp138, f"tmp140": tmp140, f"tmp141": tmp141, f"tmp143": tmp143, f"tmp144": tmp144, f"tmp146": tmp146, f"tmp148": tmp148, f"tmp149": tmp149, f"tmp15": tmp15, f"tmp151": tmp151, f"tmp152": tmp152, f"tmp154": tmp154, f"tmp155": tmp155, f"tmp156": tmp156, f"tmp157": tmp157, f"tmp159": tmp159, f"tmp161": tmp161, f"tmp162": tmp162, f"tmp163": tmp163, f"tmp164": tmp164, f"tmp165": tmp165, f"tmp167": tmp167, f"tmp168": tmp168, f"tmp17": tmp17, f"tmp170": tmp170, f"tmp172": tmp172, f"tmp175": tmp175, f"tmp177": tmp177, f"tmp179": tmp179, f"tmp182": tmp182, f"tmp185": tmp185, f"tmp187": tmp187, f"tmp189": tmp189, f"tmp19": tmp19, f"tmp191": tmp191, f"tmp194": tmp194, f"tmp197": tmp197, f"tmp199": tmp199, f"tmp2": tmp2, f"tmp201": tmp201, f"tmp203": tmp203, f"tmp204": tmp204, f"tmp205": tmp205, f"tmp206": tmp206, f"tmp207": tmp207, f"tmp209": tmp209, f"tmp21": tmp21, f"tmp210": tmp210, f"tmp212": tmp212, f"tmp215": tmp215, f"tmp22": tmp22, f"tmp223": tmp223, f"tmp225": tmp225, f"tmp230": tmp230, f"tmp232": tmp232, f"tmp238": tmp238, f"tmp240": tmp240, f"tmp247": tmp247, f"tmp248": tmp248, f"tmp25": tmp25, f"tmp250": tmp250, f"tmp251": tmp251, f"tmp253": tmp253, f"tmp254": tmp254, f"tmp256": tmp256, f"tmp26": tmp26, f"tmp262": tmp262, f"tmp264": tmp264, f"tmp27": tmp27, f"tmp275": tmp275, f"tmp277": tmp277, f"tmp279": tmp279, f"tmp28": tmp28, f"tmp281": tmp281, f"tmp283": tmp283, f"tmp285": tmp285, f"tmp291": tmp291, f"tmp292": tmp292, f"tmp294": tmp294, f"tmp295": tmp295, f"tmp297": tmp297, f"tmp299": tmp299, f"tmp30": tmp30, f"tmp301": tmp301, f"tmp306": tmp306, f"tmp307": tmp307, f"tmp309": tmp309, f"tmp315": tmp315, f"tmp317": tmp317, f"tmp319": tmp319, f"tmp32": tmp32, f"tmp320": tmp320, f"tmp325": tmp325, f"tmp328": tmp328, f"tmp334": tmp334, f"tmp336": tmp336, f"tmp34": tmp34, f"tmp341": tmp341, f"tmp343": tmp343, f"tmp345": tmp345, f"tmp347": tmp347, f"tmp349": tmp349, f"tmp351": tmp351, f"tmp36": tmp36, f"tmp367": tmp367, f"tmp369": tmp369, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp39": tmp39, f"tmp390": tmp390, f"tmp392": tmp392, f"tmp394": tmp394, f"tmp396": tmp396, f"tmp398": tmp398, f"tmp4": tmp4, f"tmp400": tmp400, f"tmp402": tmp402, f"tmp41": tmp41, f"tmp412": tmp412, f"tmp414": tmp414, f"tmp416": tmp416, f"tmp43": tmp43, f"tmp45": tmp45, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp51": tmp51, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp61": tmp61, f"tmp62": tmp62, f"tmp64": tmp64, f"tmp65": tmp65, f"tmp66": tmp66, f"tmp68": tmp68, f"tmp7": tmp7, f"tmp70": tmp70, f"tmp72": tmp72, f"tmp74": tmp74, f"tmp76": tmp76, f"tmp78": tmp78, f"tmp8": tmp8, f"tmp80": tmp80, f"tmp83": tmp83, f"tmp85": tmp85, f"tmp86": tmp86, f"tmp88": tmp88, f"tmp90": tmp90, f"tmp92": tmp92, f"tmp94": tmp94, f"tmp96": tmp96, f"tmp98": tmp98} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:43:17.655000. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp35 = einsum(r2.aba, (0, 1, 2), t2.abab, (0, 1, 2, 3), (3,)) - tmp36 = einsum(r2.bbb, (0, 1, 2), t2.bbbb, (0, 1, 3, 2), (3,)) - tmp53 = np.copy(tmp35) * -0.5 - tmp53 += tmp36 - tmp55 = np.copy(ints.tmp140) * 2 - tmp55 += ints.tmp143 - tmp51 = np.copy(ints.tmp398) - tmp51 += ints.tmp402 * 0.5 - tmp60 = np.copy(ints.tmp396) - tmp60 += ints.tmp400 * 2 - tmp62 = np.copy(f.bb.oo) - tmp62 += np.transpose(ints.tmp21, (1, 0)) - tmp23 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (1, 0, 3), (2,)) * -1 - tmp25 = np.copy(f.aa.oo) - tmp25 += np.transpose(ints.tmp1, (1, 0)) - tmp12 = np.copy(ints.tmp345) - tmp12 += ints.tmp349 * 0.5 - tmp10 = einsum(r2.aaa, (0, 1, 2), t2.aaaa, (0, 1, 3, 2), (3,)) - tmp14 = np.copy(ints.tmp347) - tmp14 += ints.tmp351 * 2 - tmp16 = np.copy(ints.tmp47) * 2 - tmp16 += ints.tmp49 - tmp54 = einsum(tmp53, (0,), v.bbbb.ovov, (1, 0, 2, 3), (1, 2, 3)) * 2 - del tmp53 - tmp56 = einsum(r2.bbb, (0, 1, 2), tmp55, (1, 3), (0, 3, 2)) * -2 - del tmp55 - tmp50 = einsum(r2.bbb, (0, 1, 2), v.bbbb.oovv, (3, 1, 4, 2), (0, 3, 4)) - tmp49 = einsum(r2.aba, (0, 1, 2), v.aabb.ovov, (0, 2, 3, 4), (1, 3, 4)) - tmp52 = einsum(r2.bbb, (0, 1, 2), tmp51, (1, 3, 2, 4), (0, 3, 4)) * -4 - del tmp51 - tmp47 = einsum(v.bbbb.ooov, (0, 1, 2, 3), r1.b, (1,), (0, 2, 3)) - tmp48 = einsum(r2.aba, (0, 1, 2), ints.tmp392, (0, 3, 2, 4), (3, 1, 4)) - tmp44 = einsum(t1.bb, (0, 1), f.bb.ov, (0, 2), (2, 1)) - tmp58 = einsum(ints.tmp394, (0, 1, 2, 3), r2.bbb, (4, 0, 2), (1, 4, 3)) - tmp61 = einsum(r2.aba, (0, 1, 2), tmp60, (0, 3, 2, 4), (1, 3, 4)) - del tmp60 - tmp63 = einsum(tmp62, (0, 1), r2.bbb, (2, 0, 3), (2, 1, 3)) * -1 - del tmp62 - tmp59 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 4, 1, 2), (0, 3, 4)) - tmp29 = einsum(t1.aa, (0, 1), f.aa.ov, (0, 2), (2, 1)) - tmp21 = einsum(r2.bab, (0, 1, 2), ints.tmp343, (3, 0, 4, 2), (3, 1, 4)) * -1 - tmp22 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (2, 4, 3), (4, 0, 1)) * -1 - tmp24 = einsum(tmp23, (0,), v.aaaa.ovov, (1, 2, 3, 0), (1, 3, 2)) - tmp20 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (4, 2, 3), (4, 0, 1)) - tmp19 = einsum(r2.aaa, (0, 1, 2), ints.tmp341, (1, 3, 2, 4), (3, 0, 4)) - tmp26 = einsum(tmp25, (0, 1), r2.aaa, (2, 0, 3), (2, 1, 3)) * -1 - del tmp25 - tmp13 = einsum(tmp12, (0, 1, 2, 3), r2.aaa, (4, 0, 2), (4, 1, 3)) * -4 - del tmp12 - tmp11 = einsum(tmp10, (0,), v.aaaa.ovov, (1, 2, 3, 0), (1, 3, 2)) * -1 - tmp15 = einsum(r2.bab, (0, 1, 2), tmp14, (3, 0, 4, 2), (1, 3, 4)) * -1 - del tmp14 - tmp17 = einsum(r2.aaa, (0, 1, 2), tmp16, (1, 3), (0, 3, 2)) * -2 - del tmp16 - tmp9 = einsum(r2.aaa, (0, 1, 2), v.aaaa.oovv, (3, 1, 4, 2), (0, 3, 4)) - tmp8 = einsum(r1.a, (0,), v.aaaa.ooov, (1, 0, 2, 3), (1, 2, 3)) - tmp65 = np.copy(ints.tmp306) - del ints.tmp306 - tmp65 += np.transpose(v.bbbb.oooo, (0, 2, 3, 1)) * -1 - tmp57 = einsum(r1.b, (0,), f.bb.ov, (1, 2), (1, 0, 2)) - tmp57 += tmp47 - del tmp47 - tmp57 += tmp48 - del tmp48 - tmp57 += tmp49 - del tmp49 - tmp57 += tmp50 * 2 - del tmp50 - tmp57 += np.transpose(tmp52, (1, 0, 2)) * -1 - del tmp52 - tmp57 += np.transpose(tmp54, (1, 0, 2)) * -1 - del tmp54 - tmp57 += np.transpose(tmp56, (1, 0, 2)) - del tmp56 - tmp45 = np.copy(ints.tmp412) * 2 - del ints.tmp412 - tmp45 += ints.tmp414 - del ints.tmp414 - tmp45 += f.bb.vv * -1 - tmp45 += np.transpose(tmp44, (1, 0)) - del tmp44 - tmp64 = np.copy(tmp58) * 4 - del tmp58 - tmp64 += tmp59 * 2 - del tmp59 - tmp64 += np.transpose(tmp61, (1, 0, 2)) - del tmp61 - tmp64 += np.transpose(tmp63, (1, 0, 2)) * -2 - del tmp63 - tmp39 = np.copy(f.bb.oo) - tmp39 += ints.tmp140 * 2 - tmp39 += ints.tmp143 - tmp39 += np.transpose(ints.tmp21, (1, 0)) - tmp41 = np.copy(ints.tmp396) - del ints.tmp396 - tmp41 += ints.tmp400 * 2 - del ints.tmp400 - tmp41 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp41 += ints.tmp392 * -1 - del ints.tmp392 - tmp42 = np.copy(ints.tmp416) - del ints.tmp416 - tmp42 += v.aabb.oovv * -1 - tmp38 = np.copy(f.aa.oo) - tmp38 += np.transpose(ints.tmp1, (1, 0)) - tmp38 += ints.tmp47 * 2 - tmp38 += ints.tmp49 - tmp46 = np.copy(tmp10) - del tmp10 - tmp46 += tmp23 * 0.5 - del tmp23 - tmp40 = np.copy(ints.tmp398) * 2 - del ints.tmp398 - tmp40 += ints.tmp402 - del ints.tmp402 - tmp40 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp40 += ints.tmp394 * -2 - del ints.tmp394 - tmp40 += v.bbbb.oovv * -1 - tmp43 = np.copy(ints.tmp151) - tmp43 += v.aabb.oooo - tmp32 = np.copy(ints.tmp347) - del ints.tmp347 - tmp32 += ints.tmp351 * 2 - del ints.tmp351 - tmp32 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp32 += ints.tmp343 * -1 - del ints.tmp343 - tmp33 = np.copy(ints.tmp390) - del ints.tmp390 - tmp33 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) * -1 - tmp31 = np.copy(ints.tmp345) * 2 - del ints.tmp345 - tmp31 += ints.tmp349 - del ints.tmp349 - tmp31 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp31 += ints.tmp341 * -2 - del ints.tmp341 - tmp31 += v.aaaa.oovv * -1 - tmp30 = np.copy(ints.tmp367) * 2 - del ints.tmp367 - tmp30 += ints.tmp369 - del ints.tmp369 - tmp30 += f.aa.vv * -1 - tmp30 += np.transpose(tmp29, (1, 0)) - del tmp29 - tmp34 = np.copy(ints.tmp151) - del ints.tmp151 - tmp34 += v.aabb.oooo - tmp37 = np.copy(tmp35) * -1 - del tmp35 - tmp37 += tmp36 * 2 - del tmp36 - tmp27 = np.copy(tmp19) * 4 - del tmp19 - tmp27 += tmp20 * 2 - del tmp20 - tmp27 += tmp21 - del tmp21 - tmp27 += tmp22 - del tmp22 - tmp27 += tmp24 - del tmp24 - tmp27 += np.transpose(tmp26, (1, 0, 2)) * -2 - del tmp26 - tmp18 = einsum(r1.a, (0,), f.aa.ov, (1, 2), (1, 0, 2)) - tmp18 += tmp8 - del tmp8 - tmp18 += tmp9 * 2 - del tmp9 - tmp18 += tmp11 * 2 - del tmp11 - tmp18 += np.transpose(tmp13, (1, 0, 2)) * -1 - del tmp13 - tmp18 += np.transpose(tmp15, (1, 0, 2)) - del tmp15 - tmp18 += np.transpose(tmp17, (1, 0, 2)) - del tmp17 - tmp28 = np.copy(ints.tmp148) - del ints.tmp148 - tmp28 += np.transpose(v.aaaa.oooo, (0, 2, 3, 1)) * -1 - tmp7 = np.copy(f.bb.oo) - tmp7 += ints.tmp140 * 2 - del ints.tmp140 - tmp7 += ints.tmp143 - del ints.tmp143 - tmp7 += np.transpose(ints.tmp163, (1, 0)) - del ints.tmp163 - tmp7 += np.transpose(ints.tmp167, (1, 0)) - del ints.tmp167 - tmp7 += ints.tmp205 - del ints.tmp205 - tmp7 += ints.tmp209 - del ints.tmp209 - tmp7 += np.transpose(ints.tmp21, (1, 0)) - del ints.tmp21 - tmp7 += ints.tmp161 * -1 - del ints.tmp161 - tmp7 += ints.tmp203 * -1 - del ints.tmp203 - tmp3 = np.copy(ints.tmp117) - del ints.tmp117 - tmp3 += ints.tmp122 * 0.5 - del ints.tmp122 - tmp3 += ints.tmp138 - del ints.tmp138 - tmp3 += ints.tmp146 * 0.5 - del ints.tmp146 - tmp3 += ints.tmp159 * 0.5 - del ints.tmp159 - tmp3 += ints.tmp165 * 0.5 - del ints.tmp165 - tmp3 += ints.tmp182 * 0.5 - del ints.tmp182 - tmp3 += ints.tmp19 * 0.5 - del ints.tmp19 - tmp3 += ints.tmp201 * 0.5 - del ints.tmp201 - tmp3 += ints.tmp207 * 0.5 - del ints.tmp207 - tmp3 += ints.tmp2 * 0.5 - del ints.tmp2 - tmp3 += ints.tmp34 * 0.5 - del ints.tmp34 - tmp3 += ints.tmp51 - del ints.tmp51 - tmp3 += ints.tmp57 * 0.5 - del ints.tmp57 - tmp3 += ints.tmp70 - del ints.tmp70 - tmp3 += ints.tmp83 - del ints.tmp83 - tmp3 += ints.tmp90 * 0.5 - del ints.tmp90 - tmp3 += f.aa.ov * -0.5 - tmp3 += ints.tmp101 * -0.5 - del ints.tmp101 - tmp3 += ints.tmp11 * -0.5 - del ints.tmp11 - tmp3 += ints.tmp157 * -0.5 - del ints.tmp157 - tmp3 += ints.tmp179 * -0.5 - del ints.tmp179 - tmp3 += ints.tmp191 * -0.5 - del ints.tmp191 - tmp3 += ints.tmp199 * -0.5 - del ints.tmp199 - tmp3 += ints.tmp32 * -0.5 - del ints.tmp32 - tmp3 += ints.tmp39 * -0.5 - del ints.tmp39 - tmp3 += ints.tmp5 * -0.5 - del ints.tmp5 - tmp3 += ints.tmp76 * -0.5 - del ints.tmp76 - tmp3 += ints.tmp86 * -1 - del ints.tmp86 - tmp3 += ints.tmp8 * -1 - del ints.tmp8 - tmp3 += ints.tmp94 * -0.5 - del ints.tmp94 - tmp3 += ints.tmp98 * -1 - del ints.tmp98 - tmp5 = np.copy(ints.tmp124) - del ints.tmp124 - tmp5 += np.transpose(ints.tmp223, (0, 2, 1, 3)) - del ints.tmp223 - tmp5 += np.transpose(ints.tmp240, (0, 2, 1, 3)) - del ints.tmp240 - tmp5 += np.transpose(ints.tmp250, (0, 2, 1, 3)) - del ints.tmp250 - tmp5 += np.transpose(ints.tmp254, (0, 2, 1, 3)) * 2 - del ints.tmp254 - tmp5 += ints.tmp264 - del ints.tmp264 - tmp5 += ints.tmp279 - del ints.tmp279 - tmp5 += ints.tmp283 - del ints.tmp283 - tmp5 += ints.tmp291 - del ints.tmp291 - tmp5 += ints.tmp297 * 2 - del ints.tmp297 - tmp5 += ints.tmp328 - del ints.tmp328 - tmp5 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp5 += np.transpose(ints.tmp232, (0, 2, 1, 3)) * -1 - del ints.tmp232 - tmp5 += ints.tmp247 * -1 - del ints.tmp247 - tmp5 += ints.tmp253 * -1 - del ints.tmp253 - tmp5 += ints.tmp275 * -1 - del ints.tmp275 - tmp5 += ints.tmp294 * -1 - del ints.tmp294 - tmp5 += ints.tmp301 * -1 - del ints.tmp301 - tmp5 += ints.tmp309 * -1 - del ints.tmp309 - tmp5 += ints.tmp319 * -1 - del ints.tmp319 - tmp5 += np.transpose(ints.tmp320, (0, 2, 1, 3)) * -1 - del ints.tmp320 - tmp5 += ints.tmp336 * -1 - del ints.tmp336 - tmp2 = np.copy(ints.tmp120) - del ints.tmp120 - tmp2 += ints.tmp125 * 0.5 - del ints.tmp125 - tmp2 += ints.tmp141 - del ints.tmp141 - tmp2 += ints.tmp144 * 0.5 - del ints.tmp144 - tmp2 += ints.tmp164 * 0.5 - del ints.tmp164 - tmp2 += ints.tmp168 * 0.5 - del ints.tmp168 - tmp2 += ints.tmp187 * 0.5 - del ints.tmp187 - tmp2 += ints.tmp206 * 0.5 - del ints.tmp206 - tmp2 += ints.tmp210 * 0.5 - del ints.tmp210 - tmp2 += ints.tmp22 * 0.5 - del ints.tmp22 - tmp2 += ints.tmp37 * 0.5 - del ints.tmp37 - tmp2 += ints.tmp4 * 0.5 - del ints.tmp4 - tmp2 += ints.tmp53 - del ints.tmp53 - tmp2 += ints.tmp55 * 0.5 - del ints.tmp55 - tmp2 += ints.tmp72 - del ints.tmp72 - tmp2 += ints.tmp85 * 0.5 - del ints.tmp85 - tmp2 += ints.tmp92 - del ints.tmp92 - tmp2 += f.bb.ov * -0.5 - tmp2 += ints.tmp100 * -0.5 - del ints.tmp100 - tmp2 += ints.tmp103 * -1 - del ints.tmp103 - tmp2 += ints.tmp10 * -0.5 - del ints.tmp10 - tmp2 += ints.tmp13 * -1 - del ints.tmp13 - tmp2 += ints.tmp162 * -0.5 - del ints.tmp162 - tmp2 += ints.tmp185 * -0.5 - del ints.tmp185 - tmp2 += ints.tmp189 * -0.5 - del ints.tmp189 - tmp2 += ints.tmp204 * -0.5 - del ints.tmp204 - tmp2 += ints.tmp36 * -0.5 - del ints.tmp36 - tmp2 += ints.tmp38 * -0.5 - del ints.tmp38 - tmp2 += ints.tmp74 * -0.5 - del ints.tmp74 - tmp2 += ints.tmp7 * -0.5 - del ints.tmp7 - tmp2 += ints.tmp88 * -0.5 - del ints.tmp88 - tmp2 += ints.tmp96 * -1 - del ints.tmp96 - tmp6 = np.copy(np.transpose(ints.tmp225, (1, 2, 0, 3))) - del ints.tmp225 - tmp6 += np.transpose(ints.tmp230, (1, 2, 0, 3)) - del ints.tmp230 - tmp6 += np.transpose(ints.tmp238, (0, 2, 1, 3)) - del ints.tmp238 - tmp6 += np.transpose(ints.tmp251, (0, 2, 1, 3)) * 2 - del ints.tmp251 - tmp6 += np.transpose(ints.tmp256, (0, 2, 1, 3)) - del ints.tmp256 - tmp6 += ints.tmp281 - del ints.tmp281 - tmp6 += ints.tmp285 - del ints.tmp285 - tmp6 += ints.tmp295 * 2 - del ints.tmp295 - tmp6 += ints.tmp307 - del ints.tmp307 - tmp6 += ints.tmp315 - del ints.tmp315 - tmp6 += ints.tmp334 - del ints.tmp334 - tmp6 += ints.tmp119 * -1 - del ints.tmp119 - tmp6 += ints.tmp248 * -2 - del ints.tmp248 - tmp6 += ints.tmp262 * -1 - del ints.tmp262 - tmp6 += ints.tmp277 * -1 - del ints.tmp277 - tmp6 += ints.tmp292 * -2 - del ints.tmp292 - tmp6 += ints.tmp299 * -1 - del ints.tmp299 - tmp6 += np.transpose(ints.tmp317, (0, 2, 1, 3)) * -1 - del ints.tmp317 - tmp6 += ints.tmp325 * -1 - del ints.tmp325 - tmp6 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) * -1 - tmp4 = np.copy(f.aa.oo) - tmp4 += ints.tmp155 - del ints.tmp155 - tmp4 += ints.tmp156 - del ints.tmp156 - tmp4 += np.transpose(ints.tmp1, (1, 0)) - del ints.tmp1 - tmp4 += np.transpose(ints.tmp26, (1, 0)) - del ints.tmp26 - tmp4 += np.transpose(ints.tmp27, (1, 0)) - del ints.tmp27 - tmp4 += ints.tmp47 * 2 - del ints.tmp47 - tmp4 += ints.tmp49 - del ints.tmp49 - tmp4 += ints.tmp154 * -1 - del ints.tmp154 - tmp4 += ints.tmp25 * -1 - del ints.tmp25 - tmp0 = np.copy(ints.tmp111) - del ints.tmp111 - tmp0 += ints.tmp115 - del ints.tmp115 - tmp0 += ints.tmp129 - del ints.tmp129 - tmp0 += ints.tmp135 * 2 - del ints.tmp135 - tmp0 += np.transpose(ints.tmp17, (1, 0, 2, 3)) - del ints.tmp17 - tmp0 += ints.tmp197 - del ints.tmp197 - tmp0 += ints.tmp45 - del ints.tmp45 - tmp0 += np.transpose(ints.tmp46, (1, 0, 2, 3)) - del ints.tmp46 - tmp0 += np.transpose(ints.tmp64, (1, 0, 2, 3)) - del ints.tmp64 - tmp0 += np.transpose(ints.tmp68, (1, 0, 2, 3)) * 2 - del ints.tmp68 - tmp0 += ints.tmp80 - del ints.tmp80 - tmp0 += v.aabb.ooov - tmp0 += ints.tmp107 * -1 - del ints.tmp107 - tmp0 += ints.tmp132 * -1 - del ints.tmp132 - tmp0 += ints.tmp137 * -1 - del ints.tmp137 - tmp0 += ints.tmp152 * -1 - del ints.tmp152 - tmp0 += ints.tmp175 * -1 - del ints.tmp175 - tmp0 += np.transpose(ints.tmp177, (1, 0, 2, 3)) * -1 - del ints.tmp177 - tmp0 += ints.tmp215 * -1 - del ints.tmp215 - tmp0 += np.transpose(ints.tmp30, (1, 0, 2, 3)) * -1 - del ints.tmp30 - tmp0 += ints.tmp61 * -1 - del ints.tmp61 - tmp0 += ints.tmp65 * -1 - del ints.tmp65 - tmp1 = np.copy(ints.tmp109) - del ints.tmp109 - tmp1 += ints.tmp113 - del ints.tmp113 - tmp1 += ints.tmp130 * 2 - del ints.tmp130 - tmp1 += ints.tmp149 - del ints.tmp149 - tmp1 += np.transpose(ints.tmp15, (1, 2, 0, 3)) - del ints.tmp15 - tmp1 += ints.tmp170 - del ints.tmp170 - tmp1 += ints.tmp212 - del ints.tmp212 - tmp1 += np.transpose(ints.tmp28, (1, 2, 0, 3)) - del ints.tmp28 - tmp1 += np.transpose(ints.tmp43, (0, 2, 1, 3)) - del ints.tmp43 - tmp1 += np.transpose(ints.tmp62, (0, 2, 1, 3)) * 2 - del ints.tmp62 - tmp1 += np.transpose(ints.tmp66, (0, 2, 1, 3)) - del ints.tmp66 - tmp1 += ints.tmp105 * -1 - del ints.tmp105 - tmp1 += ints.tmp127 * -2 - del ints.tmp127 - tmp1 += ints.tmp133 * -1 - del ints.tmp133 - tmp1 += np.transpose(ints.tmp172, (0, 2, 1, 3)) * -1 - del ints.tmp172 - tmp1 += ints.tmp194 * -1 - del ints.tmp194 - tmp1 += ints.tmp41 * -1 - del ints.tmp41 - tmp1 += ints.tmp59 * -2 - del ints.tmp59 - tmp1 += ints.tmp78 * -1 - del ints.tmp78 - tmp1 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) * -1 - r2new.bbb = np.copy(tmp57) * -1 - r2new.bbb += np.transpose(tmp57, (1, 0, 2)) - del tmp57 - r2new.bbb += tmp64 - r2new.bbb += np.transpose(tmp64, (1, 0, 2)) * -1 - del tmp64 - r2new.bbb += einsum(tmp65, (0, 1, 2, 3), r2.bbb, (0, 1, 4), (2, 3, 4)) * 2 - del tmp65 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp45, (2, 3), (0, 1, 3)) * -2 - r2new.bab = einsum(f.bb.ov, (0, 1), r1.a, (2,), (0, 2, 1)) * -1 - r2new.bab += einsum(r1.a, (0,), v.aabb.ooov, (1, 0, 2, 3), (2, 1, 3)) - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp40, (0, 3, 2, 4), (3, 1, 4)) - del tmp40 - r2new.bab += einsum(r2.aaa, (0, 1, 2), tmp41, (1, 3, 2, 4), (3, 0, 4)) * -2 - del tmp41 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp42, (1, 3, 2, 4), (0, 3, 4)) - del tmp42 - r2new.bab += einsum(tmp43, (0, 1, 2, 3), r2.bab, (2, 0, 4), (3, 1, 4)) - del tmp43 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp45, (2, 3), (0, 1, 3)) * -1 - del tmp45 - r2new.bab += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp46, (1,), (2, 0, 3)) * 2 - del tmp46 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp38, (1, 3), (0, 3, 2)) * -1 - r2new.bab += einsum(tmp39, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -1 - r2new.aba = einsum(r1.b, (0,), f.aa.ov, (1, 2), (1, 0, 2)) * -1 - r2new.aba += einsum(r1.b, (0,), v.aabb.ovoo, (1, 2, 3, 0), (1, 3, 2)) - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp31, (0, 3, 2, 4), (3, 1, 4)) - del tmp31 - r2new.aba += einsum(r2.bbb, (0, 1, 2), tmp32, (3, 1, 4, 2), (3, 0, 4)) * -2 - del tmp32 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp33, (1, 3, 2, 4), (0, 3, 4)) - del tmp33 - r2new.aba += einsum(tmp34, (0, 1, 2, 3), r2.aba, (0, 2, 4), (1, 3, 4)) - del tmp34 - r2new.aba += einsum(tmp30, (0, 1), r2.aba, (2, 3, 0), (2, 3, 1)) * -1 - r2new.aba += einsum(tmp37, (0,), v.aabb.ovov, (1, 2, 3, 0), (1, 3, 2)) - del tmp37 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp38, (0, 3), (3, 1, 2)) * -1 - del tmp38 - r2new.aba += einsum(tmp39, (0, 1), r2.aba, (2, 0, 3), (2, 1, 3)) * -1 - del tmp39 - r2new.aaa = np.copy(tmp18) * -1 - r2new.aaa += np.transpose(tmp18, (1, 0, 2)) - del tmp18 - r2new.aaa += tmp27 - r2new.aaa += np.transpose(tmp27, (1, 0, 2)) * -1 - del tmp27 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp28, (0, 1, 3, 4), (3, 4, 2)) * 2 - del tmp28 - r2new.aaa += einsum(tmp30, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp30 - r1new.b = einsum(tmp5, (0, 1, 2, 3), r2.aba, (0, 1, 3), (2,)) - del tmp5 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp6, (1, 0, 3, 2), (3,)) * -2 - del tmp6 - r1new.b += einsum(r2.aba, (0, 1, 2), tmp3, (0, 2), (1,)) * 2 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp2, (1, 2), (0,)) * -4 - r1new.b += einsum(r1.b, (0,), tmp7, (0, 1), (1,)) * -1 - del tmp7 - r1new.a = einsum(tmp0, (0, 1, 2, 3), r2.bab, (2, 0, 3), (1,)) - del tmp0 - r1new.a += einsum(tmp1, (0, 1, 2, 3), r2.aaa, (1, 0, 3), (2,)) * -2 - del tmp1 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp2, (0, 2), (1,)) * 2 - del tmp2 - r1new.a += einsum(r2.aaa, (0, 1, 2), tmp3, (1, 2), (0,)) * -4 - del tmp3 - r1new.a += einsum(r1.a, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:46:05.771922. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp10 : array - tmp100 : array - tmp101 : array - tmp103 : array - tmp11 : array - tmp111 : array - tmp112 : array - tmp114 : array - tmp115 : array - tmp117 : array - tmp118 : array - tmp120 : array - tmp121 : array - tmp123 : array - tmp125 : array - tmp127 : array - tmp128 : array - tmp13 : array - tmp130 : array - tmp131 : array - tmp133 : array - tmp134 : array - tmp136 : array - tmp137 : array - tmp139 : array - tmp141 : array - tmp142 : array - tmp144 : array - tmp145 : array - tmp147 : array - tmp149 : array - tmp151 : array - tmp154 : array - tmp157 : array - tmp159 : array - tmp161 : array - tmp164 : array - tmp169 : array - tmp171 : array - tmp173 : array - tmp174 : array - tmp175 : array - tmp176 : array - tmp177 : array - tmp178 : array - tmp179 : array - tmp181 : array - tmp183 : array - tmp185 : array - tmp186 : array - tmp188 : array - tmp19 : array - tmp191 : array - tmp194 : array - tmp196 : array - tmp198 : array - tmp2 : array - tmp20 : array - tmp201 : array - tmp22 : array - tmp226 : array - tmp228 : array - tmp23 : array - tmp230 : array - tmp232 : array - tmp238 : array - tmp240 : array - tmp246 : array - tmp247 : array - tmp249 : array - tmp250 : array - tmp252 : array - tmp254 : array - tmp256 : array - tmp26 : array - tmp27 : array - tmp276 : array - tmp278 : array - tmp28 : array - tmp284 : array - tmp285 : array - tmp287 : array - tmp288 : array - tmp29 : array - tmp290 : array - tmp292 : array - tmp294 : array - tmp305 : array - tmp307 : array - tmp309 : array - tmp31 : array - tmp310 : array - tmp33 : array - tmp34 : array - tmp35 : array - tmp36 : array - tmp4 : array - tmp43 : array - tmp45 : array - tmp47 : array - tmp49 : array - tmp5 : array - tmp51 : array - tmp53 : array - tmp55 : array - tmp57 : array - tmp59 : array - tmp61 : array - tmp63 : array - tmp65 : array - tmp67 : array - tmp69 : array - tmp7 : array - tmp71 : array - tmp73 : array - tmp74 : array - tmp76 : array - tmp77 : array - tmp79 : array - tmp8 : array - tmp81 : array - tmp82 : array - tmp83 : array - tmp85 : array - tmp86 : array - tmp88 : array - tmp89 : array - tmp90 : array - tmp92 : array - tmp94 : array - tmp96 : array - tmp98 : array - """ - - tmp35 = einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - tmp36 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp33 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 0, 1), (2, 3)) - tmp89 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 1, 0, 3), (2, 3)) - tmp29 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - tmp82 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 1), (0, 3)) - tmp117 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp114 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp200 = einsum(tmp35, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp197 = einsum(t1.aa, (0, 1), tmp36, (2, 1), (0, 2)) - tmp195 = einsum(tmp33, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp193 = einsum(tmp89, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp190 = einsum(t1.aa, (0, 1), tmp29, (2, 1), (0, 2)) - tmp187 = einsum(t1.aa, (0, 1), tmp82, (2, 1), (0, 2)) - tmp28 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp177 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (0, 1, 2, 3), (2, 3)) - tmp175 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 3), (1, 2)) - tmp173 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 1), (2, 3)) - tmp27 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) - tmp26 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp163 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (0, 1, 2, 3), (2, 3)) - tmp160 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp158 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp156 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) - tmp153 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 3, 0, 1), (2, 3)) - tmp150 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 0, 3, 1), (2, 3)) - tmp136 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp133 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp130 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp127 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 1, 3), (4, 0)) - tmp120 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 2, 1)) - tmp111 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 2, 1)) - tmp22 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp19 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp310 = einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (0, 3, 2, 4)) - tmp309 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp307 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp305 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (4, 1), (4, 0, 2, 3)) - tmp294 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp292 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp290 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 5, 3)) - tmp288 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp287 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp285 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp284 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp278 = einsum(t2.abab, (0, 1, 2, 3), tmp117, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp276 = einsum(t2.bbbb, (0, 1, 2, 3), tmp114, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp256 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp254 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 5), (1, 3, 4, 5)) - tmp252 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp250 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp249 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.abab, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp247 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp246 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.abab, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp240 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp238 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp232 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 4), (3, 4)) - tmp230 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 3), (4, 1)) - tmp228 = einsum(v.aabb.vvvv, (0, 1, 2, 3), t1.aa, (4, 1), (4, 0, 2, 3)) - tmp226 = einsum(t1.bb, (0, 1), v.bbbb.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp201 = einsum(tmp200, (0, 1), t1.bb, (1, 2), (0, 2)) - del tmp200 - tmp198 = einsum(t1.aa, (0, 1), tmp197, (2, 0), (2, 1)) - del tmp197 - tmp196 = einsum(tmp195, (0, 1), t1.bb, (1, 2), (0, 2)) - del tmp195 - tmp194 = einsum(tmp193, (0, 1), t1.bb, (1, 2), (0, 2)) - del tmp193 - tmp191 = einsum(t1.aa, (0, 1), tmp190, (2, 0), (2, 1)) - del tmp190 - tmp188 = einsum(t1.aa, (0, 1), tmp187, (2, 0), (2, 1)) - del tmp187 - tmp186 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - tmp185 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 2, 0, 1)) - tmp183 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp181 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 1), (4, 0, 2, 3)) - tmp179 = einsum(t1.aa, (0, 1), tmp28, (2, 1), (0, 2)) - tmp178 = einsum(tmp177, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp176 = einsum(tmp175, (0, 1), t1.bb, (2, 0), (2, 1)) - tmp174 = einsum(tmp173, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp171 = einsum(t1.aa, (0, 1), tmp27, (1, 2), (0, 2)) - tmp169 = einsum(tmp26, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp164 = einsum(tmp163, (0, 1), t1.bb, (1, 2), (0, 2)) - del tmp163 - tmp161 = einsum(t1.aa, (0, 1), tmp160, (2, 0), (2, 1)) - del tmp160 - tmp159 = einsum(tmp158, (0, 1), t1.bb, (1, 2), (0, 2)) - del tmp158 - tmp157 = einsum(tmp156, (0, 1), t1.bb, (1, 2), (0, 2)) - del tmp156 - tmp154 = einsum(t1.aa, (0, 1), tmp153, (2, 0), (2, 1)) - del tmp153 - tmp151 = einsum(t1.aa, (0, 1), tmp150, (2, 0), (2, 1)) - del tmp150 - tmp149 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (1, 5, 2, 4)) - tmp147 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp145 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp144 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 1, 5), (0, 4, 3, 5)) - tmp142 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp141 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp139 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp137 = einsum(tmp136, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp134 = einsum(tmp133, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp131 = einsum(tmp130, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp128 = einsum(t1.aa, (0, 1), tmp127, (2, 0), (2, 1)) - tmp125 = einsum(tmp120, (0, 1, 2, 3), t2.abab, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp123 = einsum(tmp111, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp121 = einsum(tmp120, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) - tmp118 = einsum(t2.abab, (0, 1, 2, 3), tmp117, (4, 0, 1, 3), (4, 2)) - tmp115 = einsum(t2.bbbb, (0, 1, 2, 3), tmp114, (4, 1, 0, 3), (4, 2)) - tmp112 = einsum(tmp111, (0, 1, 2, 3), t2.aaaa, (2, 1, 4, 3), (0, 4)) - tmp103 = einsum(t2.bbbb, (0, 1, 2, 3), tmp35, (1, 3), (0, 2)) - tmp101 = einsum(t2.abab, (0, 1, 2, 3), tmp35, (1, 3), (0, 2)) - tmp100 = einsum(t2.abab, (0, 1, 2, 3), tmp36, (0, 2), (1, 3)) - tmp98 = einsum(tmp36, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp96 = einsum(t2.bbbb, (0, 1, 2, 3), tmp33, (1, 3), (0, 2)) - tmp94 = einsum(t2.abab, (0, 1, 2, 3), tmp33, (1, 3), (0, 2)) - tmp92 = einsum(tmp89, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp90 = einsum(t2.abab, (0, 1, 2, 3), tmp89, (1, 3), (0, 2)) - tmp88 = einsum(t2.abab, (0, 1, 2, 3), tmp29, (0, 2), (1, 3)) - tmp86 = einsum(tmp29, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp85 = einsum(t2.abab, (0, 1, 2, 3), tmp82, (0, 2), (1, 3)) - tmp83 = einsum(tmp82, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp81 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 4, 5, 3), (1, 2, 4, 5)) - tmp79 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp77 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 5, 1, 3), (0, 2, 4, 5)) - tmp76 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (4, 1, 2, 5)) - tmp74 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp73 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovvv, (0, 2, 4, 5), (1, 4, 5, 3)) - tmp71 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp69 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - tmp67 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 3), (1, 4)) - tmp65 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 0, 3, 1), (4, 2)) * -1 - tmp63 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 1, 3), (4, 2)) - tmp61 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 4, 5), (2, 4, 1, 5)) - tmp59 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp57 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 3), (4, 2)) - tmp55 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) - tmp53 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 3), (4, 2)) - tmp51 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 1, 3), (4, 2)) - tmp49 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp47 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 4, 1), (4, 3)) * -1 - tmp45 = einsum(v.aabb.vvvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp43 = einsum(v.aaaa.vvvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp34 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) - tmp31 = einsum(v.aaaa.oovv, (0, 1, 2, 3), t1.aa, (1, 3), (0, 2)) - tmp23 = einsum(tmp22, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp20 = einsum(t1.aa, (0, 1), tmp19, (0, 2), (2, 1)) - tmp13 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp11 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp10 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp8 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (1, 3), (0, 2)) - tmp7 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp5 = einsum(f.aa.vv, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp4 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp2 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - - return {f"tmp10": tmp10, f"tmp100": tmp100, f"tmp101": tmp101, f"tmp103": tmp103, f"tmp11": tmp11, f"tmp111": tmp111, f"tmp112": tmp112, f"tmp114": tmp114, f"tmp115": tmp115, f"tmp117": tmp117, f"tmp118": tmp118, f"tmp120": tmp120, f"tmp121": tmp121, f"tmp123": tmp123, f"tmp125": tmp125, f"tmp127": tmp127, f"tmp128": tmp128, f"tmp13": tmp13, f"tmp130": tmp130, f"tmp131": tmp131, f"tmp133": tmp133, f"tmp134": tmp134, f"tmp136": tmp136, f"tmp137": tmp137, f"tmp139": tmp139, f"tmp141": tmp141, f"tmp142": tmp142, f"tmp144": tmp144, f"tmp145": tmp145, f"tmp147": tmp147, f"tmp149": tmp149, f"tmp151": tmp151, f"tmp154": tmp154, f"tmp157": tmp157, f"tmp159": tmp159, f"tmp161": tmp161, f"tmp164": tmp164, f"tmp169": tmp169, f"tmp171": tmp171, f"tmp173": tmp173, f"tmp174": tmp174, f"tmp175": tmp175, f"tmp176": tmp176, f"tmp177": tmp177, f"tmp178": tmp178, f"tmp179": tmp179, f"tmp181": tmp181, f"tmp183": tmp183, f"tmp185": tmp185, f"tmp186": tmp186, f"tmp188": tmp188, f"tmp19": tmp19, f"tmp191": tmp191, f"tmp194": tmp194, f"tmp196": tmp196, f"tmp198": tmp198, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp201": tmp201, f"tmp22": tmp22, f"tmp226": tmp226, f"tmp228": tmp228, f"tmp23": tmp23, f"tmp230": tmp230, f"tmp232": tmp232, f"tmp238": tmp238, f"tmp240": tmp240, f"tmp246": tmp246, f"tmp247": tmp247, f"tmp249": tmp249, f"tmp250": tmp250, f"tmp252": tmp252, f"tmp254": tmp254, f"tmp256": tmp256, f"tmp26": tmp26, f"tmp27": tmp27, f"tmp276": tmp276, f"tmp278": tmp278, f"tmp28": tmp28, f"tmp284": tmp284, f"tmp285": tmp285, f"tmp287": tmp287, f"tmp288": tmp288, f"tmp29": tmp29, f"tmp290": tmp290, f"tmp292": tmp292, f"tmp294": tmp294, f"tmp305": tmp305, f"tmp307": tmp307, f"tmp309": tmp309, f"tmp31": tmp31, f"tmp310": tmp310, f"tmp33": tmp33, f"tmp34": tmp34, f"tmp35": tmp35, f"tmp36": tmp36, f"tmp4": tmp4, f"tmp43": tmp43, f"tmp45": tmp45, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp51": tmp51, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp61": tmp61, f"tmp63": tmp63, f"tmp65": tmp65, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp7": tmp7, f"tmp71": tmp71, f"tmp73": tmp73, f"tmp74": tmp74, f"tmp76": tmp76, f"tmp77": tmp77, f"tmp79": tmp79, f"tmp8": tmp8, f"tmp81": tmp81, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp85": tmp85, f"tmp86": tmp86, f"tmp88": tmp88, f"tmp89": tmp89, f"tmp90": tmp90, f"tmp92": tmp92, f"tmp94": tmp94, f"tmp96": tmp96, f"tmp98": tmp98} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:46:05.926554. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp34 = einsum(r2.bbb, (0, 1, 2), t2.bbbb, (3, 2, 0, 1), (3,)) - tmp33 = einsum(t2.abab, (0, 1, 2, 3), r2.aba, (2, 3, 0), (1,)) - tmp21 = einsum(r2.bbb, (0, 1, 2), t1.bb, (3, 1), (2, 3, 0)) - tmp85 = np.copy(ints.tmp284) - tmp85 += ints.tmp290 * 2 - tmp64 = np.copy(tmp33) * -0.5 - tmp64 += tmp34 - tmp78 = np.copy(ints.tmp230) - tmp78 += ints.tmp232 * 0.5 - tmp78 += f.bb.vv * -0.5 - tmp76 = np.copy(ints.tmp285) * 2 - tmp76 += ints.tmp292 - tmp16 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (3, 2, 1), (0,)) * -1 - tmp2 = einsum(r2.aaa, (0, 1, 2), t1.aa, (3, 1), (2, 3, 0)) - tmp45 = np.copy(ints.tmp47) - tmp45 += ints.tmp49 * 0.5 - tmp45 += f.aa.vv * -0.5 - tmp41 = np.copy(ints.tmp139) * 2 - tmp41 += ints.tmp145 - tmp43 = np.copy(ints.tmp141) * 0.5 - tmp43 += ints.tmp147 - tmp15 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (2, 3, 1), (0,)) - tmp82 = einsum(ints.tmp288, (0, 1, 2, 3), r2.bbb, (4, 2, 0), (1, 3, 4)) - tmp84 = einsum(f.bb.ov, (0, 1), tmp21, (2, 0, 3), (2, 1, 3)) - tmp83 = einsum(v.bbbb.ovov, (0, 1, 2, 3), r2.bbb, (4, 3, 2), (0, 4, 1)) - tmp86 = einsum(tmp85, (0, 1, 2, 3), r2.aba, (2, 4, 0), (1, 4, 3)) - del tmp85 - tmp74 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.aba, (1, 4, 0), (2, 4, 3)) - tmp80 = einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp64, (2,), (0, 3, 1)) * 2 - tmp73 = einsum(ints.tmp287, (0, 1, 2, 3), r2.aba, (2, 4, 0), (1, 3, 4)) - tmp79 = einsum(r2.bbb, (0, 1, 2), tmp78, (1, 3), (2, 0, 3)) * -4 - del tmp78 - tmp75 = einsum(r2.bbb, (0, 1, 2), v.bbbb.oovv, (3, 2, 4, 1), (3, 0, 4)) - tmp77 = einsum(r2.bbb, (0, 1, 2), tmp76, (2, 3, 1, 4), (3, 0, 4)) * -2 - del tmp76 - tmp72 = einsum(r1.b, (0,), v.bbbb.ovvv, (1, 2, 3, 0), (1, 2, 3)) - tmp62 = einsum(t1.bb, (0, 1), f.bb.ov, (0, 2), (2, 1)) - tmp60 = einsum(t1.aa, (0, 1), f.aa.ov, (0, 2), (2, 1)) - tmp51 = einsum(r2.bab, (0, 1, 2), ints.tmp144, (3, 2, 4, 0), (3, 4, 1)) * -1 - tmp53 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp16, (2,), (0, 1, 3)) - tmp50 = einsum(tmp2, (0, 1, 2), f.aa.ov, (1, 3), (0, 3, 2)) - tmp49 = einsum(r2.aaa, (0, 1, 2), v.aaaa.ovov, (3, 4, 2, 1), (3, 0, 4)) - tmp52 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (3, 4, 2), (0, 4, 1)) * -1 - tmp48 = einsum(ints.tmp142, (0, 1, 2, 3), r2.aaa, (4, 2, 0), (1, 3, 4)) - tmp39 = einsum(v.aaaa.oovv, (0, 1, 2, 3), r2.aaa, (4, 3, 1), (0, 4, 2)) - tmp46 = einsum(tmp45, (0, 1), r2.aaa, (2, 0, 3), (3, 2, 1)) * -4 - del tmp45 - tmp42 = einsum(r2.aaa, (0, 1, 2), tmp41, (2, 3, 1, 4), (3, 0, 4)) * -2 - del tmp41 - tmp38 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), r1.a, (3,), (0, 1, 2)) - tmp44 = einsum(tmp43, (0, 1, 2, 3), r2.bab, (3, 4, 1), (0, 4, 2)) * -2 - del tmp43 - tmp40 = einsum(tmp15, (0,), v.aaaa.ovov, (1, 2, 0, 3), (1, 2, 3)) * -1 - tmp25 = einsum(t1.aa, (0, 1), r2.aba, (1, 2, 3), (3, 0, 2)) - tmp6 = einsum(r2.bab, (0, 1, 2), t1.bb, (3, 0), (2, 3, 1)) * -1 - tmp69 = np.copy(f.bb.oo) - tmp69 += ints.tmp130 * 2 - del ints.tmp130 - tmp69 += ints.tmp133 - del ints.tmp133 - tmp69 += np.transpose(ints.tmp22, (1, 0)) - del ints.tmp22 - tmp87 = np.copy(tmp82) * 4 - del tmp82 - tmp87 += tmp83 * 2 - del tmp83 - tmp87 += tmp84 * 2 - del tmp84 - tmp87 += np.transpose(tmp86, (0, 2, 1)) - del tmp86 - tmp81 = einsum(r1.b, (0,), f.bb.ov, (1, 2), (1, 2, 0)) - tmp81 += tmp72 - del tmp72 - tmp81 += tmp73 - del tmp73 - tmp81 += tmp74 - del tmp74 - tmp81 += tmp75 * 2 - del tmp75 - tmp81 += np.transpose(tmp77, (0, 2, 1)) * -1 - del tmp77 - tmp81 += np.transpose(tmp79, (0, 2, 1)) - del tmp79 - tmp81 += np.transpose(tmp80, (0, 2, 1)) * -1 - del tmp80 - tmp71 = einsum(t2.bbbb, (0, 1, 2, 3), r2.bbb, (2, 3, 4), (4, 0, 1)) - tmp63 = np.copy(ints.tmp230) * 2 - tmp63 += ints.tmp232 - tmp63 += f.bb.vv * -1 - tmp63 += np.transpose(tmp62, (1, 0)) - del tmp62 - tmp66 = np.copy(ints.tmp285) * 2 - tmp66 += ints.tmp292 - tmp66 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp66 += ints.tmp288 * -2 - tmp66 += v.bbbb.oovv * -1 - tmp65 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (3, 2, 4), (0, 4, 1)) * -1 - tmp61 = np.copy(ints.tmp47) * 2 - tmp61 += ints.tmp49 - tmp61 += f.aa.vv * -1 - tmp61 += np.transpose(tmp60, (1, 0)) - del tmp60 - tmp70 = np.copy(tmp15) - tmp70 += tmp16 * 0.5 - tmp67 = np.copy(ints.tmp284) - tmp67 += ints.tmp290 * 2 - tmp67 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp67 += ints.tmp287 * -1 - tmp68 = np.copy(ints.tmp149) - tmp68 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) * -1 - tmp56 = einsum(t2.abab, (0, 1, 2, 3), r2.aba, (2, 3, 4), (4, 0, 1)) - tmp59 = np.copy(ints.tmp294) - tmp59 += v.aabb.oovv * -1 - tmp55 = np.copy(f.aa.oo) - tmp55 += ints.tmp127 * 2 - del ints.tmp127 - tmp55 += ints.tmp136 - del ints.tmp136 - tmp55 += np.transpose(ints.tmp19, (1, 0)) - del ints.tmp19 - tmp58 = np.copy(ints.tmp141) - tmp58 += ints.tmp147 * 2 - tmp58 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp58 += ints.tmp144 * -1 - tmp57 = np.copy(ints.tmp139) * 2 - tmp57 += ints.tmp145 - tmp57 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp57 += ints.tmp142 * -2 - tmp57 += v.aaaa.oovv * -1 - tmp54 = np.copy(tmp48) * 4 - del tmp48 - tmp54 += tmp49 * 2 - del tmp49 - tmp54 += tmp50 * 2 - del tmp50 - tmp54 += tmp51 - del tmp51 - tmp54 += tmp52 - del tmp52 - tmp54 += tmp53 - del tmp53 - tmp47 = einsum(f.aa.ov, (0, 1), r1.a, (2,), (0, 1, 2)) - tmp47 += tmp38 - del tmp38 - tmp47 += tmp39 * 2 - del tmp39 - tmp47 += tmp40 * 2 - del tmp40 - tmp47 += np.transpose(tmp42, (0, 2, 1)) * -1 - del tmp42 - tmp47 += np.transpose(tmp44, (0, 2, 1)) - del tmp44 - tmp47 += np.transpose(tmp46, (0, 2, 1)) - del tmp46 - tmp37 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (2, 3, 4), (4, 0, 1)) - tmp22 = np.copy(ints.tmp285) * 2 - del ints.tmp285 - tmp22 += ints.tmp292 - del ints.tmp292 - tmp22 += np.transpose(ints.tmp307, (0, 1, 3, 2)) - del ints.tmp307 - tmp22 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp22 += ints.tmp288 * -2 - del ints.tmp288 - tmp22 += np.transpose(ints.tmp305, (0, 1, 3, 2)) * -1 - del ints.tmp305 - tmp22 += v.bbbb.oovv * -1 - tmp36 = np.copy(f.bb.ov) - tmp36 += ints.tmp33 - tmp36 += ints.tmp35 - tmp36 += ints.tmp89 * -1 - del ints.tmp89 - tmp24 = np.copy(ints.tmp284) - del ints.tmp284 - tmp24 += ints.tmp290 * 2 - del ints.tmp290 - tmp24 += ints.tmp310 - del ints.tmp310 - tmp24 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp24 += ints.tmp287 * -1 - del ints.tmp287 - tmp23 = einsum(r2.aba, (0, 1, 2), t1.bb, (3, 1), (2, 3, 0)) - tmp32 = np.copy(np.transpose(ints.tmp175, (1, 0))) - del ints.tmp175 - tmp32 += ints.tmp230 * 2 - del ints.tmp230 - tmp32 += ints.tmp232 - del ints.tmp232 - tmp32 += f.bb.vv * -1 - tmp32 += np.transpose(ints.tmp173, (1, 0)) * -1 - del ints.tmp173 - tmp32 += np.transpose(ints.tmp177, (1, 0)) * -1 - del ints.tmp177 - tmp35 = einsum(r1.b, (0,), t1.bb, (1, 0), (1,)) - tmp35 += tmp33 * -1 - del tmp33 - tmp35 += tmp34 * 2 - del tmp34 - tmp9 = np.copy(ints.tmp112) - del ints.tmp112 - tmp9 += ints.tmp118 * 0.5 - del ints.tmp118 - tmp9 += ints.tmp128 - del ints.tmp128 - tmp9 += ints.tmp137 * 0.5 - del ints.tmp137 - tmp9 += ints.tmp154 * 0.5 - del ints.tmp154 - tmp9 += ints.tmp161 * 0.5 - del ints.tmp161 - tmp9 += ints.tmp171 * 0.5 - del ints.tmp171 - tmp9 += ints.tmp191 * 0.5 - del ints.tmp191 - tmp9 += ints.tmp198 * 0.5 - del ints.tmp198 - tmp9 += ints.tmp20 * 0.5 - del ints.tmp20 - tmp9 += ints.tmp2 * 0.5 - del ints.tmp2 - tmp9 += ints.tmp31 * 0.5 - del ints.tmp31 - tmp9 += ints.tmp51 - del ints.tmp51 - tmp9 += ints.tmp57 * 0.5 - del ints.tmp57 - tmp9 += ints.tmp63 - del ints.tmp63 - tmp9 += ints.tmp83 - del ints.tmp83 - tmp9 += ints.tmp90 * 0.5 - del ints.tmp90 - tmp9 += f.aa.ov * -0.5 - tmp9 += ints.tmp101 * -0.5 - del ints.tmp101 - tmp9 += ints.tmp11 * -0.5 - del ints.tmp11 - tmp9 += ints.tmp151 * -0.5 - del ints.tmp151 - tmp9 += ints.tmp169 * -0.5 - del ints.tmp169 - tmp9 += ints.tmp179 * -0.5 - del ints.tmp179 - tmp9 += ints.tmp188 * -0.5 - del ints.tmp188 - tmp9 += ints.tmp29 * -0.5 - tmp9 += ints.tmp36 * -0.5 - tmp9 += ints.tmp5 * -0.5 - del ints.tmp5 - tmp9 += ints.tmp69 * -0.5 - del ints.tmp69 - tmp9 += ints.tmp86 * -1 - del ints.tmp86 - tmp9 += ints.tmp8 * -1 - del ints.tmp8 - tmp9 += ints.tmp94 * -0.5 - del ints.tmp94 - tmp9 += ints.tmp98 * -1 - del ints.tmp98 - tmp19 = np.copy(ints.tmp228) - del ints.tmp228 - tmp19 += np.transpose(ints.tmp240, (0, 1, 3, 2)) - del ints.tmp240 - tmp19 += ints.tmp246 - del ints.tmp246 - tmp19 += ints.tmp252 * 2 - del ints.tmp252 - tmp19 += np.transpose(ints.tmp278, (0, 1, 3, 2)) - del ints.tmp278 - tmp19 += v.aabb.ovvv - tmp19 += ints.tmp249 * -1 - del ints.tmp249 - tmp19 += np.transpose(ints.tmp256, (0, 1, 3, 2)) * -1 - del ints.tmp256 - tmp31 = np.copy(ints.tmp117) - del ints.tmp117 - tmp31 += v.aabb.ooov - tmp30 = einsum(tmp25, (0, 1, 2), t1.bb, (3, 2), (0, 1, 3)) - tmp28 = einsum(t1.bb, (0, 1), tmp21, (2, 3, 1), (2, 3, 0)) * -1 - tmp29 = np.copy(ints.tmp114) - del ints.tmp114 - tmp29 += v.bbbb.ooov * -1 - tmp27 = np.copy(ints.tmp115) * 2 - tmp27 += ints.tmp121 - tmp27 += ints.tmp131 * 2 - tmp27 += ints.tmp134 - tmp27 += ints.tmp159 - tmp27 += ints.tmp164 - tmp27 += ints.tmp176 - tmp27 += ints.tmp196 - tmp27 += ints.tmp201 - tmp27 += ints.tmp23 - tmp27 += ints.tmp34 - tmp27 += ints.tmp4 - tmp27 += ints.tmp53 * 2 - tmp27 += ints.tmp55 - tmp27 += ints.tmp65 * 2 - tmp27 += ints.tmp85 - tmp27 += ints.tmp92 * 2 - tmp27 += f.bb.ov * -1 - tmp27 += ints.tmp100 * -1 - tmp27 += ints.tmp103 * -2 - tmp27 += ints.tmp10 * -1 - tmp27 += ints.tmp13 * -2 - tmp27 += ints.tmp157 * -1 - tmp27 += ints.tmp174 * -1 - tmp27 += ints.tmp178 * -1 - tmp27 += ints.tmp194 * -1 - tmp27 += ints.tmp33 * -1 - tmp27 += ints.tmp35 * -1 - tmp27 += ints.tmp67 * -1 - tmp27 += ints.tmp7 * -1 - tmp27 += ints.tmp88 * -1 - tmp27 += ints.tmp96 * -2 - tmp20 = np.copy(np.transpose(ints.tmp238, (0, 3, 1, 2))) * 0.5 - del ints.tmp238 - tmp20 += np.transpose(ints.tmp247, (0, 2, 1, 3)) - del ints.tmp247 - tmp20 += np.transpose(ints.tmp254, (0, 2, 1, 3)) * 0.5 - del ints.tmp254 - tmp20 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) * 0.5 - tmp20 += ints.tmp226 * -0.5 - del ints.tmp226 - tmp20 += np.transpose(ints.tmp250, (0, 2, 1, 3)) * -1 - del ints.tmp250 - tmp20 += np.transpose(ints.tmp276, (0, 3, 1, 2)) * -0.5 - del ints.tmp276 - tmp26 = np.copy(np.transpose(ints.tmp309, (0, 1, 3, 2))) - del ints.tmp309 - tmp26 += v.aabb.oovv - tmp26 += ints.tmp294 * -1 - del ints.tmp294 - tmp17 = einsum(t1.aa, (0, 1), r1.a, (1,), (0,)) * 0.5 - tmp17 += tmp15 - del tmp15 - tmp17 += tmp16 * 0.5 - del tmp16 - tmp4 = einsum(t1.aa, (0, 1), r2.bab, (2, 1, 3), (0, 3, 2)) * -1 - tmp14 = np.copy(np.transpose(ints.tmp27, (1, 0))) - del ints.tmp27 - tmp14 += ints.tmp47 * 2 - del ints.tmp47 - tmp14 += ints.tmp49 - del ints.tmp49 - tmp14 += f.aa.vv * -1 - tmp14 += np.transpose(ints.tmp26, (1, 0)) * -1 - del ints.tmp26 - tmp14 += np.transpose(ints.tmp28, (1, 0)) * -1 - del ints.tmp28 - tmp11 = np.copy(ints.tmp111) - del ints.tmp111 - tmp11 += v.aaaa.ooov * -1 - tmp5 = np.copy(ints.tmp141) - del ints.tmp141 - tmp5 += ints.tmp147 * 2 - del ints.tmp147 - tmp5 += ints.tmp186 - del ints.tmp186 - tmp5 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp5 += ints.tmp144 * -1 - del ints.tmp144 - tmp18 = np.copy(f.aa.ov) - tmp18 += ints.tmp29 - del ints.tmp29 - tmp18 += ints.tmp36 - del ints.tmp36 - tmp18 += ints.tmp82 * -1 - del ints.tmp82 - tmp12 = einsum(t1.aa, (0, 1), tmp6, (2, 3, 1), (0, 2, 3)) - tmp10 = einsum(t1.aa, (0, 1), tmp2, (2, 3, 1), (2, 3, 0)) * -1 - tmp7 = np.copy(np.transpose(ints.tmp185, (0, 1, 3, 2))) - del ints.tmp185 - tmp7 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) - tmp7 += ints.tmp149 * -1 - del ints.tmp149 - tmp13 = np.copy(ints.tmp120) - del ints.tmp120 - tmp13 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp3 = np.copy(ints.tmp139) * 2 - del ints.tmp139 - tmp3 += ints.tmp145 - del ints.tmp145 - tmp3 += np.transpose(ints.tmp183, (0, 1, 3, 2)) - del ints.tmp183 - tmp3 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp3 += ints.tmp142 * -2 - del ints.tmp142 - tmp3 += np.transpose(ints.tmp181, (0, 1, 3, 2)) * -1 - del ints.tmp181 - tmp3 += v.aaaa.oovv * -1 - tmp0 = np.copy(ints.tmp125) - del ints.tmp125 - tmp0 += np.transpose(ints.tmp45, (0, 2, 1, 3)) - del ints.tmp45 - tmp0 += ints.tmp61 - del ints.tmp61 - tmp0 += np.transpose(ints.tmp73, (0, 2, 1, 3)) - del ints.tmp73 - tmp0 += np.transpose(ints.tmp79, (0, 2, 1, 3)) * 2 - del ints.tmp79 - tmp0 += np.transpose(v.aabb.vvov, (2, 0, 1, 3)) - tmp0 += np.transpose(ints.tmp76, (0, 2, 1, 3)) * -1 - del ints.tmp76 - tmp0 += ints.tmp81 * -1 - del ints.tmp81 - tmp8 = np.copy(ints.tmp115) - del ints.tmp115 - tmp8 += ints.tmp121 * 0.5 - del ints.tmp121 - tmp8 += ints.tmp131 - del ints.tmp131 - tmp8 += ints.tmp134 * 0.5 - del ints.tmp134 - tmp8 += ints.tmp159 * 0.5 - del ints.tmp159 - tmp8 += ints.tmp164 * 0.5 - del ints.tmp164 - tmp8 += ints.tmp176 * 0.5 - del ints.tmp176 - tmp8 += ints.tmp196 * 0.5 - del ints.tmp196 - tmp8 += ints.tmp201 * 0.5 - del ints.tmp201 - tmp8 += ints.tmp23 * 0.5 - del ints.tmp23 - tmp8 += ints.tmp34 * 0.5 - del ints.tmp34 - tmp8 += ints.tmp4 * 0.5 - del ints.tmp4 - tmp8 += ints.tmp53 - del ints.tmp53 - tmp8 += ints.tmp55 * 0.5 - del ints.tmp55 - tmp8 += ints.tmp65 - del ints.tmp65 - tmp8 += ints.tmp85 * 0.5 - del ints.tmp85 - tmp8 += ints.tmp92 - del ints.tmp92 - tmp8 += f.bb.ov * -0.5 - tmp8 += ints.tmp100 * -0.5 - del ints.tmp100 - tmp8 += ints.tmp103 * -1 - del ints.tmp103 - tmp8 += ints.tmp10 * -0.5 - del ints.tmp10 - tmp8 += ints.tmp13 * -1 - del ints.tmp13 - tmp8 += ints.tmp157 * -0.5 - del ints.tmp157 - tmp8 += ints.tmp174 * -0.5 - del ints.tmp174 - tmp8 += ints.tmp178 * -0.5 - del ints.tmp178 - tmp8 += ints.tmp194 * -0.5 - del ints.tmp194 - tmp8 += ints.tmp33 * -0.5 - del ints.tmp33 - tmp8 += ints.tmp35 * -0.5 - del ints.tmp35 - tmp8 += ints.tmp67 * -0.5 - del ints.tmp67 - tmp8 += ints.tmp7 * -0.5 - del ints.tmp7 - tmp8 += ints.tmp88 * -0.5 - del ints.tmp88 - tmp8 += ints.tmp96 * -1 - del ints.tmp96 - tmp1 = np.copy(ints.tmp59) * 0.5 - del ints.tmp59 - tmp1 += np.transpose(ints.tmp71, (0, 1, 3, 2)) - del ints.tmp71 - tmp1 += np.transpose(ints.tmp77, (0, 1, 3, 2)) * 0.5 - del ints.tmp77 - tmp1 += v.aaaa.ovvv * 0.5 - tmp1 += ints.tmp123 * -0.5 - del ints.tmp123 - tmp1 += np.transpose(ints.tmp43, (0, 2, 3, 1)) * -0.5 - del ints.tmp43 - tmp1 += np.transpose(ints.tmp74, (0, 1, 3, 2)) * -1 - del ints.tmp74 - r2new.bbb = einsum(r2.bbb, (0, 1, 2), v.bbbb.vvvv, (3, 0, 4, 1), (3, 4, 2)) * 2 - r2new.bbb += einsum(tmp71, (0, 1, 2), v.bbbb.ovov, (2, 3, 1, 4), (3, 4, 0)) * -2 - del tmp71 - r2new.bbb += np.transpose(tmp81, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp81, (2, 1, 0)) - del tmp81 - r2new.bbb += np.transpose(tmp87, (1, 2, 0)) - r2new.bbb += np.transpose(tmp87, (2, 1, 0)) * -1 - del tmp87 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp69, (2, 3), (0, 1, 3)) * -2 - r2new.bab = einsum(r1.a, (0,), v.aabb.vvov, (1, 0, 2, 3), (3, 1, 2)) * -1 - r2new.bab += einsum(r1.a, (0,), f.bb.ov, (1, 2), (2, 0, 1)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), v.aabb.vvvv, (3, 1, 4, 0), (4, 3, 2)) - r2new.bab += einsum(tmp65, (0, 1, 2), v.aabb.ovov, (0, 3, 2, 4), (4, 3, 1)) * -1 - del tmp65 - r2new.bab += einsum(tmp66, (0, 1, 2, 3), r2.bab, (2, 4, 0), (3, 4, 1)) - del tmp66 - r2new.bab += einsum(tmp67, (0, 1, 2, 3), r2.aaa, (4, 2, 0), (3, 4, 1)) * -2 - del tmp67 - r2new.bab += einsum(tmp68, (0, 1, 2, 3), r2.bab, (4, 2, 0), (4, 3, 1)) - del tmp68 - r2new.bab += einsum(tmp63, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -1 - r2new.bab += einsum(tmp61, (0, 1), r2.bab, (2, 0, 3), (2, 1, 3)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp69, (2, 3), (0, 1, 3)) * -1 - del tmp69 - r2new.bab += einsum(tmp70, (0,), v.aabb.ovov, (0, 1, 2, 3), (3, 1, 2)) * 2 - del tmp70 - r2new.aba = einsum(v.aabb.vvvv, (0, 1, 2, 3), r2.aba, (1, 3, 4), (0, 2, 4)) - r2new.aba += einsum(tmp56, (0, 1, 2), v.aabb.ovov, (1, 3, 2, 4), (3, 4, 0)) - del tmp56 - r2new.aba += einsum(f.aa.ov, (0, 1), r1.b, (2,), (1, 2, 0)) * -1 - r2new.aba += einsum(v.aabb.ovvv, (0, 1, 2, 3), r1.b, (3,), (1, 2, 0)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp57, (2, 3, 0, 4), (4, 1, 3)) - del tmp57 - r2new.aba += einsum(r2.bbb, (0, 1, 2), tmp58, (3, 2, 4, 1), (4, 0, 3)) * -2 - del tmp58 - r2new.aba += einsum(tmp59, (0, 1, 2, 3), r2.aba, (4, 2, 0), (4, 3, 1)) - del tmp59 - r2new.aba += einsum(tmp61, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - del tmp61 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp63, (1, 3), (0, 3, 2)) * -1 - del tmp63 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp55, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(tmp64, (0,), v.aabb.ovov, (1, 2, 0, 3), (2, 3, 1)) * 2 - del tmp64 - r2new.aaa = einsum(tmp37, (0, 1, 2), v.aaaa.ovov, (2, 3, 1, 4), (3, 4, 0)) * -2 - del tmp37 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), v.aaaa.vvvv, (3, 1, 4, 0), (3, 4, 2)) * -2 - r2new.aaa += np.transpose(tmp47, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp47, (2, 1, 0)) - del tmp47 - r2new.aaa += np.transpose(tmp54, (1, 2, 0)) - r2new.aaa += np.transpose(tmp54, (2, 1, 0)) * -1 - del tmp54 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp55, (2, 3), (0, 1, 3)) * -2 - del tmp55 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp19, (2, 0, 3, 1), (3,)) * -1 - del tmp19 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp20, (2, 3, 0, 1), (3,)) * -4 - del tmp20 - r1new.b += einsum(tmp22, (0, 1, 2, 3), tmp21, (0, 1, 2), (3,)) * 2 - del tmp21, tmp22 - r1new.b += einsum(tmp23, (0, 1, 2), tmp24, (0, 1, 2, 3), (3,)) - del tmp23, tmp24 - r1new.b += einsum(tmp26, (0, 1, 2, 3), tmp25, (0, 1, 2), (3,)) - del tmp25, tmp26 - r1new.b += einsum(tmp27, (0, 1), r2.bbb, (2, 1, 0), (2,)) * -2 - del tmp27 - r1new.b += einsum(tmp9, (0, 1), r2.aba, (1, 2, 0), (2,)) * 2 - r1new.b += einsum(tmp28, (0, 1, 2), tmp29, (0, 2, 1, 3), (3,)) * -2 - del tmp28, tmp29 - r1new.b += einsum(tmp30, (0, 1, 2), tmp31, (0, 1, 2, 3), (3,)) * -1 - del tmp30, tmp31 - r1new.b += einsum(tmp32, (0, 1), r1.b, (0,), (1,)) * -1 - del tmp32 - r1new.b += einsum(tmp35, (0,), tmp36, (0, 1), (1,)) * -1 - del tmp35, tmp36 - r1new.a = einsum(r2.bab, (0, 1, 2), tmp0, (2, 1, 3, 0), (3,)) * -1 - del tmp0 - r1new.a += einsum(r2.aaa, (0, 1, 2), tmp1, (2, 0, 1, 3), (3,)) * -4 - del tmp1 - r1new.a += einsum(tmp2, (0, 1, 2), tmp3, (0, 1, 2, 3), (3,)) * 2 - del tmp2, tmp3 - r1new.a += einsum(tmp5, (0, 1, 2, 3), tmp4, (0, 1, 3), (2,)) * -1 - del tmp5, tmp4 - r1new.a += einsum(tmp7, (0, 1, 2, 3), tmp6, (0, 1, 2), (3,)) * -1 - del tmp6, tmp7 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp8, (2, 0), (1,)) * 2 - del tmp8 - r1new.a += einsum(tmp9, (0, 1), r2.aaa, (2, 1, 0), (2,)) * -4 - del tmp9 - r1new.a += einsum(tmp10, (0, 1, 2), tmp11, (0, 2, 1, 3), (3,)) * -2 - del tmp10, tmp11 - r1new.a += einsum(tmp13, (0, 1, 2, 3), tmp12, (0, 1, 2), (3,)) - del tmp13, tmp12 - r1new.a += einsum(r1.a, (0,), tmp14, (0, 1), (1,)) * -1 - del tmp14 - r1new.a += einsum(tmp17, (0,), tmp18, (0, 1), (1,)) * -2 - del tmp17, tmp18 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/UCC3.py b/ebcc/codegen/UCC3.py deleted file mode 100644 index 8fca5442..00000000 --- a/ebcc/codegen/UCC3.py +++ /dev/null @@ -1,2451 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:12:15.129824 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:12:16.407354. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp0 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp2 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp2 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp1 = np.copy(f.bb.ov) - tmp1 += einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - tmp1 += einsum(t1.bb, (0, 1), tmp0, (0, 2, 1, 3), (2, 3)) * -0.5 - del tmp0 - tmp3 = np.copy(f.aa.ov) - tmp3 += einsum(tmp2, (0, 1, 2, 3), t1.aa, (0, 2), (1, 3)) * -0.5 - del tmp2 - e_cc = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 3), ()) - e_cc += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 2, 1, 3), ()) - e_cc += einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 3, 1), ()) * -1 - e_cc += einsum(t1.bb, (0, 1), tmp1, (0, 1), ()) - del tmp1 - e_cc += einsum(t1.aa, (0, 1), tmp3, (0, 1), ()) - del tmp3 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, t3=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:15:44.767599. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - t3 : Namespace of arrays - T3 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t1new : Namespace of arrays - Updated T1 residuals. - t2new : Namespace of arrays - Updated T2 residuals. - t3new : Namespace of arrays - Updated T3 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - t3new = Namespace() - tmp14 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp14 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp7 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp7 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp197 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp22 = einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp21 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp2 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 2, 1)) - tmp1 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp64 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp15 = einsum(t1.bb, (0, 1), tmp14, (0, 2, 1, 3), (2, 3)) - del tmp14 - tmp13 = einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - tmp0 = einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 0, 1), (2, 3)) - tmp8 = einsum(t1.aa, (0, 1), tmp7, (0, 2, 1, 3), (2, 3)) - tmp557 = np.copy(v.bbbb.ovvv) - tmp557 += np.transpose(v.bbbb.ovvv, (0, 2, 3, 1)) * -1 - tmp454 = np.copy(np.transpose(tmp197, (0, 2, 1, 3))) * -1 - tmp454 += np.transpose(tmp197, (0, 2, 3, 1)) - tmp543 = np.copy(np.transpose(tmp197, (0, 2, 1, 3))) * -1 - tmp543 += np.transpose(tmp197, (0, 3, 2, 1)) - tmp164 = np.copy(v.bbbb.ovvv) - tmp164 += np.transpose(v.bbbb.ovvv, (0, 2, 3, 1)) * -1 - tmp139 = einsum(tmp22, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) - tmp140 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - tmp206 = einsum(tmp21, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - tmp152 = einsum(t1.aa, (0, 1), tmp22, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp141 = einsum(t1.bb, (0, 1), v.aabb.vvov, (2, 3, 4, 1), (0, 4, 2, 3)) - tmp138 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t1.aa, (4, 1), (4, 0, 2, 3)) - tmp81 = np.copy(v.aaaa.ovvv) * -1 - tmp81 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) - tmp73 = einsum(t1.aa, (0, 1), tmp2, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp77 = einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (0, 3, 2, 4)) - tmp78 = einsum(tmp1, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - tmp135 = einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp264 = np.copy(np.transpose(tmp64, (0, 2, 1, 3))) - tmp264 += np.transpose(tmp64, (0, 3, 2, 1)) * -1 - tmp58 = np.copy(v.aaaa.ovvv) * -1 - tmp58 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) - tmp267 = np.copy(np.transpose(tmp64, (0, 2, 1, 3))) * -1 - tmp267 += np.transpose(tmp64, (0, 3, 2, 1)) - tmp157 = np.copy(v.bbbb.ooov) - tmp157 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) * -1 - tmp211 = np.copy(v.bbbb.ovvv) * -1 - tmp211 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) - tmp213 = np.copy(tmp21) - tmp213 += np.transpose(tmp21, (0, 2, 1, 3)) * -1 - tmp220 = np.copy(v.bbbb.ooov) * -1 - tmp220 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) - tmp16 = np.copy(f.bb.ov) - tmp16 += tmp13 - tmp16 += tmp15 * -1 - del tmp15 - tmp46 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp46 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp9 = np.copy(f.aa.ov) - tmp9 += tmp0 - tmp9 += tmp8 * -1 - del tmp8 - tmp92 = np.copy(v.aaaa.ooov) * -1 - tmp92 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) - tmp83 = np.copy(tmp2) - tmp83 += np.transpose(tmp2, (0, 2, 1, 3)) * -1 - tmp37 = np.copy(v.aaaa.ooov) - tmp37 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) * -1 - tmp558 = einsum(t1.bb, (0, 1), tmp557, (2, 1, 3, 4), (2, 0, 3, 4)) - del tmp557 - tmp524 = np.copy(np.transpose(tmp197, (0, 2, 1, 3))) - tmp524 += np.transpose(tmp197, (0, 3, 2, 1)) * -1 - tmp514 = einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), f.bb.ov, (6, 5), (6, 0, 1, 2, 3, 4)) - tmp513 = einsum(v.bbbb.oooo, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 6), (4, 0, 1, 2, 5, 6)) - tmp316 = einsum(f.bb.ov, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp510 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - tmp199 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp455 = einsum(t1.bb, (0, 1), tmp454, (2, 3, 4, 0), (2, 3, 4, 1)) - del tmp454 - tmp127 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 0, 4), (2, 1, 3, 4)) - tmp544 = einsum(t1.bb, (0, 1), tmp543, (2, 3, 4, 0), (2, 3, 4, 1)) - del tmp543 - tmp491 = np.copy(np.transpose(tmp197, (0, 2, 1, 3))) - tmp491 += np.transpose(tmp197, (0, 2, 3, 1)) * -1 - tmp231 = einsum(t1.bb, (0, 1), tmp21, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp431 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp176 = einsum(t1.bb, (0, 1), v.bbbb.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp205 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp521 = einsum(tmp21, (0, 1, 2, 3), t2.bbbb, (4, 5, 6, 3), (0, 4, 5, 2, 1, 6)) - tmp165 = einsum(tmp164, (0, 1, 2, 3), t1.bb, (4, 1), (4, 0, 2, 3)) - del tmp164 - tmp422 = einsum(t2.abab, (0, 1, 2, 3), tmp22, (4, 5, 6, 2), (0, 4, 5, 1, 6, 3)) - tmp168 = np.copy(tmp140) - tmp168 += tmp139 * -1 - tmp412 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (4, 2, 5, 6), (0, 4, 1, 5, 6, 3)) - tmp233 = einsum(t1.bb, (0, 1), v.bbbb.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp480 = einsum(t1.bb, (0, 1), tmp206, (2, 0, 3, 4), (2, 1, 3, 4)) - tmp147 = einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp253 = einsum(t1.aa, (0, 1), f.aa.ov, (0, 2), (2, 1)) - tmp329 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (4, 3), (0, 4, 1, 2)) - tmp328 = einsum(v.aabb.oooo, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 3, 4)) - tmp169 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp170 = einsum(t1.bb, (0, 1), tmp1, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp54 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.aa, (0, 4), (2, 4, 1, 3)) - tmp395 = einsum(tmp152, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 3, 4)) - tmp149 = einsum(t1.aa, (0, 1), tmp141, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp461 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - tmp362 = einsum(tmp138, (0, 1, 2, 3), t1.aa, (1, 4), (0, 3, 2, 4)) - tmp136 = einsum(v.aabb.vvoo, (0, 1, 2, 3), t1.aa, (4, 1), (4, 2, 3, 0)) - tmp145 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t1.aa, (0, 4), (2, 3, 4, 1)) - tmp399 = einsum(tmp152, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp174 = einsum(tmp140, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 1, 3)) - tmp162 = einsum(t1.aa, (0, 1), tmp81, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp359 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.abab, (4, 5, 3, 6), (4, 0, 1, 2, 5, 6)) - tmp142 = einsum(tmp22, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - tmp74 = einsum(t1.aa, (0, 1), v.aaaa.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp309 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 5, 6, 3), (0, 4, 5, 1, 6, 2)) - tmp381 = einsum(t1.aa, (0, 1), tmp73, (2, 0, 3, 4), (2, 1, 3, 4)) - tmp110 = einsum(t1.aa, (0, 1), v.aaaa.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp331 = einsum(f.aa.ov, (0, 1), t2.abab, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp334 = einsum(v.aabb.oooo, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp320 = einsum(tmp1, (0, 1, 2, 3), t2.abab, (4, 5, 6, 3), (0, 4, 1, 5, 2, 6)) - tmp87 = np.copy(tmp77) - tmp87 += tmp78 * -1 - tmp106 = einsum(tmp2, (0, 1, 2, 3), t1.aa, (4, 3), (0, 4, 2, 1)) - tmp173 = einsum(v.aabb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp354 = einsum(t1.bb, (0, 1), tmp135, (2, 3, 4, 0), (3, 2, 4, 1)) - tmp287 = einsum(t1.aa, (0, 1), tmp264, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp66 = einsum(v.aaaa.oovv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp129 = einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp51 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 0, 4), (2, 1, 3, 4)) - tmp244 = einsum(t1.aa, (0, 1), v.aaaa.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp270 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp261 = einsum(t2.aaaa, (0, 1, 2, 3), tmp2, (4, 5, 6, 3), (4, 0, 1, 6, 5, 2)) - tmp305 = einsum(t1.aa, (0, 1), tmp58, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp249 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.oooo, (4, 5, 6, 1), (0, 4, 5, 6, 2, 3)) - tmp250 = einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), f.aa.ov, (6, 5), (6, 0, 1, 2, 3, 4)) - tmp246 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - tmp292 = einsum(tmp267, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp180 = einsum(tmp157, (0, 1, 2, 3), t1.bb, (0, 3), (1, 2)) - tmp29 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (0, 1, 2, 3), (2, 3)) - tmp212 = einsum(t1.bb, (0, 1), tmp211, (2, 1, 3, 4), (2, 0, 3, 4)) - del tmp211 - tmp214 = einsum(tmp213, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) - del tmp213 - tmp190 = np.copy(v.bbbb.ovvv) * -1 - tmp190 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) - tmp30 = np.copy(v.bbbb.ooov) - tmp30 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) * -1 - tmp221 = einsum(tmp220, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 3, 4)) - del tmp220 - tmp24 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp26 = einsum(t1.bb, (0, 1), tmp16, (2, 1), (0, 2)) - tmp25 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 2, 1, 3), (0, 4)) - tmp47 = einsum(t1.bb, (0, 1), tmp46, (0, 2, 1, 3), (2, 3)) - tmp6 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp10 = einsum(tmp9, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp5 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 3, 1), (4, 0)) * -1 - tmp93 = einsum(tmp92, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - del tmp92 - tmp18 = np.copy(v.aaaa.ooov) - tmp18 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) * -1 - tmp82 = einsum(t1.aa, (0, 1), tmp81, (2, 1, 3, 4), (0, 2, 3, 4)) - del tmp81 - tmp84 = einsum(t1.aa, (0, 1), tmp83, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp83 - tmp38 = einsum(t1.aa, (0, 1), tmp37, (0, 2, 3, 1), (2, 3)) - tmp17 = einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 1), (2, 3)) - tmp559 = einsum(t2.bbbb, (0, 1, 2, 3), tmp558, (4, 5, 6, 3), (5, 4, 0, 1, 6, 2)) - del tmp558 - tmp525 = einsum(tmp524, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - del tmp524 - tmp515 = np.copy(np.transpose(tmp513, (0, 2, 1, 3, 5, 4))) - del tmp513 - tmp515 += np.transpose(tmp514, (1, 0, 2, 3, 5, 4)) * 3 - del tmp514 - tmp317 = np.copy(f.bb.vv) - tmp317 += tmp316 * -1 - tmp511 = einsum(t1.bb, (0, 1), tmp510, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - del tmp510 - tmp456 = np.copy(np.transpose(tmp199, (0, 2, 1, 3))) - tmp456 += np.transpose(tmp455, (0, 2, 1, 3)) - del tmp455 - tmp532 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.oovv, (4, 5, 6, 3), (0, 1, 4, 5, 2, 6)) - tmp536 = np.copy(v.bbbb.ovvv) - tmp536 += np.transpose(tmp127, (0, 2, 3, 1)) * -1 - tmp419 = np.copy(f.bb.vv) - tmp419 += tmp316 * -1 - del tmp316 - tmp553 = np.copy(np.transpose(tmp197, (0, 2, 1, 3))) - tmp553 += np.transpose(tmp197, (0, 3, 2, 1)) * -1 - tmp545 = np.copy(np.transpose(tmp199, (0, 2, 1, 3))) - tmp545 += np.transpose(tmp544, (0, 2, 1, 3)) - del tmp544 - tmp446 = np.copy(v.bbbb.ovvv) - tmp446 += np.transpose(tmp127, (0, 2, 3, 1)) * -1 - tmp445 = np.copy(np.transpose(v.bbbb.ovvv, (0, 2, 1, 3))) * -1 - tmp445 += tmp127 - tmp323 = einsum(f.bb.ov, (0, 1), t1.bb, (2, 1), (0, 2)) - tmp492 = einsum(t1.bb, (0, 1), tmp491, (2, 3, 4, 0), (2, 3, 4, 1)) - del tmp491 - tmp235 = einsum(t1.bb, (0, 1), tmp231, (2, 3, 0, 4), (3, 2, 4, 1)) - tmp547 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 6, 3), (0, 1, 4, 6, 2, 5)) - tmp528 = np.copy(np.transpose(tmp176, (1, 0, 2, 3))) * -1 - tmp528 += np.transpose(tmp431, (0, 2, 1, 3)) * 2 - tmp237 = einsum(tmp205, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) - tmp424 = np.copy(np.transpose(tmp197, (0, 2, 1, 3))) * -1 - tmp424 += np.transpose(tmp197, (0, 3, 2, 1)) - tmp522 = einsum(t1.bb, (0, 1), tmp521, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - del tmp521 - tmp551 = einsum(tmp165, (0, 1, 2, 3), t2.bbbb, (4, 5, 6, 3), (0, 1, 4, 5, 2, 6)) - tmp432 = np.copy(np.transpose(tmp176, (1, 0, 2, 3))) * -1 - tmp432 += np.transpose(tmp431, (0, 2, 1, 3)) * 2 - tmp423 = einsum(t1.aa, (0, 1), tmp422, (2, 0, 3, 4, 5, 6), (2, 3, 4, 5, 1, 6)) - del tmp422 - tmp376 = einsum(t1.aa, (0, 1), v.aabb.vvvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp459 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.oovv, (4, 5, 6, 3), (0, 1, 4, 5, 2, 6)) - tmp472 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 5, 1, 6), (4, 0, 5, 2, 6, 3)) - tmp483 = einsum(tmp165, (0, 1, 2, 3), t2.abab, (4, 5, 6, 3), (4, 0, 1, 5, 6, 2)) * -1 - tmp150 = einsum(v.aabb.vvvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp476 = einsum(tmp168, (0, 1, 2, 3), t1.aa, (0, 4), (1, 4, 2, 3)) - tmp393 = einsum(tmp138, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp413 = einsum(tmp412, (0, 1, 2, 3, 4, 5), t1.aa, (1, 6), (0, 2, 4, 3, 6, 5)) - tmp470 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 6, 3), (0, 1, 4, 6, 2, 5)) - tmp481 = np.copy(np.transpose(tmp233, (0, 2, 1, 3))) - tmp481 += np.transpose(tmp480, (0, 3, 1, 2)) - del tmp480 - tmp148 = np.copy(v.aabb.oovv) - tmp148 += np.transpose(tmp147, (1, 0, 3, 2)) * -1 - del tmp147 - tmp256 = np.copy(f.aa.vv) - tmp256 += tmp253 * -1 - tmp435 = np.copy(np.transpose(tmp328, (0, 2, 1, 3))) - tmp435 += tmp329 * -1 - tmp427 = einsum(t2.bbbb, (0, 1, 2, 3), tmp1, (4, 5, 6, 3), (4, 5, 0, 1, 6, 2)) - tmp478 = np.copy(np.transpose(tmp169, (0, 1, 3, 2))) - tmp478 += tmp170 * -1 - tmp55 = np.copy(np.transpose(v.aabb.vvov, (2, 0, 1, 3))) - tmp55 += np.transpose(tmp54, (0, 2, 1, 3)) * -1 - tmp416 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.bbbb, (4, 5, 6, 3), (0, 1, 4, 5, 2, 6)) - tmp504 = einsum(t2.abab, (0, 1, 2, 3), tmp140, (4, 5, 2, 6), (0, 4, 5, 1, 3, 6)) - tmp497 = np.copy(tmp149) - tmp497 += tmp395 * -1 - tmp462 = einsum(tmp461, (0, 1, 2, 3, 4, 5), t1.bb, (4, 6), (0, 1, 2, 3, 5, 6)) - del tmp461 - tmp486 = einsum(t1.bb, (0, 1), tmp141, (2, 0, 3, 4), (2, 4, 3, 1)) - tmp466 = einsum(v.aabb.vvoo, (0, 1, 2, 3), t2.abab, (4, 5, 1, 6), (4, 5, 2, 3, 0, 6)) - tmp364 = np.copy(np.transpose(tmp136, (0, 2, 1, 3))) - tmp364 += np.transpose(tmp362, (0, 2, 1, 3)) * -1 - tmp500 = einsum(tmp141, (0, 1, 2, 3), t2.abab, (4, 5, 3, 6), (4, 0, 5, 1, 2, 6)) - tmp391 = einsum(t1.aa, (0, 1), tmp135, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp437 = einsum(tmp412, (0, 1, 2, 3, 4, 5), t1.bb, (4, 6), (0, 1, 2, 3, 6, 5)) - del tmp412 - tmp259 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp339 = np.copy(np.transpose(v.aabb.vvoo, (2, 3, 0, 1))) - tmp339 += np.transpose(tmp145, (1, 0, 3, 2)) * -1 - tmp400 = np.copy(tmp174) - tmp400 += tmp399 * -1 - tmp387 = einsum(t1.aa, (0, 1), tmp169, (2, 0, 3, 4), (2, 1, 4, 3)) - tmp366 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.oovv, (4, 5, 6, 3), (0, 4, 5, 1, 2, 6)) - tmp384 = einsum(tmp162, (0, 1, 2, 3), t2.abab, (4, 5, 2, 6), (0, 1, 4, 5, 3, 6)) * -1 - tmp360 = einsum(t1.aa, (0, 1), tmp359, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 1, 6)) - del tmp359 - tmp370 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (4, 5, 3, 6), (4, 0, 2, 5, 1, 6)) - tmp403 = einsum(tmp169, (0, 1, 2, 3), t2.abab, (4, 5, 6, 3), (0, 4, 1, 5, 6, 2)) - tmp379 = np.copy(np.transpose(tmp141, (0, 1, 3, 2))) - tmp379 += tmp142 * -1 - tmp112 = einsum(tmp74, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 1, 3)) - tmp325 = einsum(t2.aaaa, (0, 1, 2, 3), tmp22, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - tmp357 = einsum(v.aaaa.oovv, (0, 1, 2, 3), t2.abab, (4, 5, 3, 6), (4, 0, 1, 5, 2, 6)) - tmp310 = einsum(t1.bb, (0, 1), tmp309, (2, 3, 4, 5, 0, 6), (2, 4, 3, 5, 6, 1)) - tmp382 = np.copy(np.transpose(tmp110, (0, 2, 1, 3))) - tmp382 += np.transpose(tmp381, (0, 3, 1, 2)) - del tmp381 - tmp335 = np.copy(np.transpose(tmp334, (1, 0, 2, 3))) - tmp335 += tmp331 * -1 - tmp337 = einsum(t1.aa, (0, 1), tmp309, (2, 3, 0, 4, 5, 6), (2, 3, 4, 5, 1, 6)) - del tmp309 - tmp321 = einsum(tmp320, (0, 1, 2, 3, 4, 5), t1.bb, (4, 6), (0, 1, 2, 3, 5, 6)) - del tmp320 - tmp377 = einsum(t1.bb, (0, 1), tmp87, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp407 = einsum(tmp77, (0, 1, 2, 3), t2.abab, (4, 5, 6, 3), (0, 4, 5, 1, 6, 2)) - tmp108 = einsum(t1.aa, (0, 1), tmp106, (2, 3, 0, 4), (3, 2, 4, 1)) - tmp355 = np.copy(np.transpose(tmp173, (1, 0, 2, 3))) - tmp355 += tmp354 * -1 - tmp288 = np.copy(np.transpose(tmp66, (0, 2, 1, 3))) - tmp288 += np.transpose(tmp287, (0, 2, 1, 3)) - del tmp287 - tmp130 = np.copy(v.aabb.ovvv) - tmp130 += np.transpose(tmp129, (0, 1, 3, 2)) * -1 - tmp372 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 5, 6, 3), (4, 0, 5, 2, 6, 1)) - tmp313 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovoo, (4, 3, 5, 6), (0, 1, 4, 5, 6, 2)) - tmp290 = np.copy(np.transpose(tmp64, (0, 2, 1, 3))) * -1 - tmp290 += np.transpose(tmp64, (0, 3, 2, 1)) - tmp284 = np.copy(v.aaaa.ovvv) - tmp284 += np.transpose(tmp51, (0, 2, 3, 1)) * -1 - tmp276 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.oovv, (4, 5, 6, 3), (0, 1, 4, 5, 2, 6)) - tmp271 = np.copy(np.transpose(tmp244, (1, 0, 2, 3))) * -0.5 - tmp271 += np.transpose(tmp270, (0, 2, 1, 3)) - tmp268 = einsum(t1.aa, (0, 1), tmp267, (2, 0, 3, 4), (2, 3, 4, 1)) - del tmp267 - tmp254 = np.copy(f.aa.vv) - tmp254 += tmp253 * -1 - del tmp253 - tmp299 = einsum(t2.aaaa, (0, 1, 2, 3), tmp162, (4, 5, 3, 6), (4, 5, 0, 1, 6, 2)) - tmp262 = einsum(t1.aa, (0, 1), tmp261, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - del tmp261 - tmp301 = np.copy(np.transpose(tmp64, (0, 2, 1, 3))) - tmp301 += np.transpose(tmp64, (0, 3, 2, 1)) * -1 - tmp265 = einsum(t1.aa, (0, 1), tmp264, (2, 3, 4, 0), (2, 3, 4, 1)) - del tmp264 - tmp280 = np.copy(v.aaaa.ovvv) - tmp280 += np.transpose(tmp51, (0, 2, 3, 1)) * -1 - tmp306 = einsum(t2.aaaa, (0, 1, 2, 3), tmp305, (4, 5, 3, 6), (4, 5, 0, 1, 6, 2)) - del tmp305 - tmp282 = np.copy(np.transpose(v.aaaa.ovvv, (0, 2, 1, 3))) * -1 - tmp282 += tmp51 - tmp273 = np.copy(np.transpose(tmp244, (1, 0, 2, 3))) * -1 - tmp273 += np.transpose(tmp270, (0, 2, 1, 3)) * 2 - tmp295 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 6, 3), (0, 1, 4, 6, 2, 5)) - tmp251 = np.copy(np.transpose(tmp249, (0, 2, 1, 3, 5, 4))) - del tmp249 - tmp251 += np.transpose(tmp250, (1, 0, 2, 3, 5, 4)) * 3 - del tmp250 - tmp247 = einsum(t1.aa, (0, 1), tmp246, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - del tmp246 - tmp293 = np.copy(np.transpose(tmp66, (0, 2, 1, 3))) - tmp293 += np.transpose(tmp292, (0, 2, 1, 3)) - del tmp292 - tmp239 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp100 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) * -1 - tmp100 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp224 = np.copy(v.bbbb.ooov) * -1 - tmp224 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) - tmp181 = np.copy(f.bb.oo) - tmp181 += np.transpose(tmp29, (1, 0)) - tmp181 += np.transpose(tmp180, (1, 0)) * -1 - del tmp180 - tmp201 = einsum(tmp197, (0, 1, 2, 3), t1.bb, (3, 4), (0, 2, 1, 4)) - tmp187 = np.copy(v.bbbb.ovvv) - tmp187 += np.transpose(tmp127, (0, 3, 2, 1)) - tmp122 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 4), (3, 4)) - tmp123 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 3, 1, 4), (2, 4)) * -1 - tmp91 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp91 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp144 = einsum(t1.bb, (0, 1), v.aabb.ovoo, (2, 3, 4, 0), (2, 4, 3, 1)) - tmp207 = np.copy(tmp21) - tmp207 += np.transpose(tmp21, (0, 2, 1, 3)) * -1 - tmp215 = np.copy(np.transpose(tmp212, (1, 0, 3, 2))) * -1 - del tmp212 - tmp215 += np.transpose(tmp214, (0, 1, 3, 2)) * -1 - del tmp214 - tmp191 = einsum(tmp190, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) - tmp131 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp192 = einsum(t1.bb, (0, 1), tmp16, (0, 2), (1, 2)) - tmp31 = einsum(tmp30, (0, 1, 2, 3), t1.bb, (0, 3), (1, 2)) - del tmp30 - tmp96 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) * -1 - tmp96 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp227 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 3, 5)) - tmp229 = np.copy(v.bbbb.oovv) - tmp229 += np.transpose(tmp221, (1, 0, 3, 2)) * -1 - tmp125 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp209 = np.copy(tmp140) * -1 - tmp209 += tmp139 - tmp203 = np.copy(tmp24) - tmp203 += tmp25 * 2 - tmp203 += tmp26 - tmp160 = np.copy(np.transpose(v.aabb.vvov, (2, 0, 1, 3))) - tmp160 += tmp54 * -1 - tmp95 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - tmp154 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp48 = np.copy(f.bb.ov) - tmp48 += tmp13 - tmp48 += tmp47 * -1 - del tmp47 - tmp132 = np.copy(v.bbbb.ovvv) - tmp132 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) * -1 - tmp49 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp166 = np.copy(tmp21) * -1 - tmp166 += np.transpose(tmp21, (0, 2, 1, 3)) - tmp57 = einsum(t1.bb, (0, 1), v.aabb.vvov, (2, 3, 0, 1), (2, 3)) - tmp43 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (4, 1)) - tmp60 = einsum(tmp9, (0, 1), t1.aa, (0, 2), (2, 1)) - tmp59 = einsum(t1.aa, (0, 1), tmp58, (0, 2, 1, 3), (2, 3)) - tmp42 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 4, 1, 3), (2, 4)) - tmp71 = np.copy(tmp5) * 2 - tmp71 += tmp6 - tmp71 += tmp10 - tmp98 = np.copy(v.aaaa.ooov) * -1 - tmp98 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) - tmp104 = np.copy(v.aaaa.oovv) - tmp104 += np.transpose(tmp93, (1, 0, 2, 3)) * -1 - tmp52 = np.copy(v.aaaa.ovvv) - tmp52 += np.transpose(tmp51, (0, 3, 2, 1)) - tmp69 = einsum(t1.aa, (0, 1), tmp64, (2, 3, 4, 0), (2, 4, 3, 1)) - tmp79 = np.copy(tmp77) * -1 - tmp79 += tmp78 - tmp19 = einsum(tmp18, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) - del tmp18 - tmp85 = np.copy(np.transpose(tmp82, (0, 1, 3, 2))) * -1 - del tmp82 - tmp85 += tmp84 * -1 - tmp114 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp102 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp75 = np.copy(tmp2) - tmp75 += np.transpose(tmp2, (0, 2, 1, 3)) * -1 - tmp39 = np.copy(f.aa.oo) - tmp39 += np.transpose(tmp17, (1, 0)) - tmp39 += np.transpose(tmp38, (1, 0)) * -1 - del tmp38 - tmp116 = np.copy(v.aaaa.ovvv) - tmp116 += np.transpose(tmp51, (0, 3, 1, 2)) - tmp535 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 5, 6, 3), (4, 5, 0, 6, 1, 2)) - tmp549 = einsum(tmp199, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 6), (0, 4, 1, 5, 6, 3)) - tmp560 = einsum(t1.bb, (0, 1), tmp559, (2, 0, 3, 4, 5, 6), (2, 4, 3, 6, 5, 1)) * -2 - del tmp559 - tmp550 = einsum(tmp233, (0, 1, 2, 3), t2.bbbb, (4, 5, 6, 2), (0, 4, 5, 6, 3, 1)) - tmp526 = einsum(tmp525, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 6), (0, 2, 4, 3, 5, 6)) * -1 - del tmp525 - tmp519 = einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), f.bb.vv, (6, 5), (0, 1, 2, 6, 3, 4)) - tmp534 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 6), (4, 0, 2, 5, 6, 3)) - tmp516 = einsum(t1.bb, (0, 1), tmp515, (2, 0, 3, 4, 5, 6), (2, 3, 4, 5, 6, 1)) - del tmp515 - tmp518 = einsum(tmp317, (0, 1), t3.bbbbbb, (2, 3, 4, 5, 6, 0), (2, 3, 4, 1, 5, 6)) - tmp512 = einsum(t1.bb, (0, 1), tmp511, (2, 3, 0, 4, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp511 - tmp541 = einsum(tmp456, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 6), (0, 2, 4, 3, 5, 6)) * -1 - tmp540 = einsum(tmp21, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 6), (0, 4, 1, 5, 6, 3)) - tmp533 = einsum(t1.bb, (0, 1), tmp532, (2, 3, 0, 4, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp532 - tmp537 = einsum(t2.bbbb, (0, 1, 2, 3), tmp536, (4, 5, 3, 6), (4, 0, 1, 5, 6, 2)) * -2 - del tmp536 - tmp517 = einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), tmp419, (5, 6), (0, 1, 2, 6, 3, 4)) * 3 - tmp554 = einsum(t1.bb, (0, 1), tmp553, (2, 3, 4, 0), (2, 4, 3, 1)) - del tmp553 - tmp546 = einsum(t2.bbbb, (0, 1, 2, 3), tmp545, (4, 5, 1, 6), (4, 5, 0, 6, 2, 3)) * -1 - del tmp545 - tmp539 = einsum(tmp446, (0, 1, 2, 3), t2.bbbb, (4, 5, 6, 2), (0, 4, 5, 1, 3, 6)) * -1 - tmp538 = einsum(tmp445, (0, 1, 2, 3), t2.bbbb, (4, 5, 6, 3), (0, 4, 5, 1, 2, 6)) * -1 - tmp520 = einsum(tmp323, (0, 1), t3.bbbbbb, (2, 3, 0, 4, 5, 6), (1, 2, 3, 4, 5, 6)) - tmp527 = einsum(tmp492, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 6), (0, 1, 4, 3, 5, 6)) * -1 - tmp555 = einsum(tmp235, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 6), (1, 0, 4, 3, 5, 6)) - tmp548 = einsum(t1.bb, (0, 1), tmp547, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp547 - tmp529 = einsum(tmp528, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 6), (1, 2, 4, 3, 5, 6)) * -1 - del tmp528 - tmp556 = einsum(tmp237, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 6), (0, 1, 4, 5, 6, 3)) - tmp531 = einsum(tmp431, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 6), (2, 1, 4, 3, 5, 6)) * -1 - tmp509 = einsum(f.bb.oo, (0, 1), t3.bbbbbb, (2, 3, 1, 4, 5, 6), (0, 2, 3, 4, 5, 6)) - tmp542 = np.copy(np.transpose(tmp199, (0, 2, 1, 3))) - tmp542 += einsum(t1.bb, (0, 1), tmp424, (2, 3, 4, 0), (2, 4, 3, 1)) - tmp523 = einsum(tmp522, (0, 1, 2, 3, 4, 5), t1.bb, (3, 6), (0, 1, 2, 6, 4, 5)) - del tmp522 - tmp508 = einsum(tmp176, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 6), (4, 2, 0, 3, 5, 6)) - tmp552 = einsum(t1.bb, (0, 1), tmp551, (2, 0, 3, 4, 5, 6), (2, 4, 3, 6, 5, 1)) * -1 - del tmp551 - tmp530 = einsum(tmp432, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 6), (1, 2, 4, 3, 5, 6)) * -1 - tmp496 = einsum(t2.abab, (0, 1, 2, 3), tmp237, (4, 5, 1, 6), (0, 4, 5, 2, 3, 6)) - tmp507 = einsum(t2.abab, (0, 1, 2, 3), tmp399, (4, 0, 5, 6), (4, 5, 1, 2, 6, 3)) - tmp452 = einsum(tmp1, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (0, 4, 2, 5, 6, 3)) - tmp425 = np.copy(tmp423) - tmp425 += einsum(t2.abab, (0, 1, 2, 3), tmp424, (4, 5, 6, 1), (0, 4, 6, 5, 2, 3)) - del tmp424 - tmp488 = np.copy(np.transpose(tmp376, (0, 1, 3, 2))) - tmp488 += einsum(t1.bb, (0, 1), tmp77, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - tmp460 = einsum(tmp459, (0, 1, 2, 3, 4, 5), t1.bb, (2, 6), (0, 1, 3, 4, 6, 5)) - del tmp459 - tmp444 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.abab, (4, 5, 6, 3), (4, 5, 0, 6, 1, 2)) - tmp473 = einsum(tmp472, (0, 1, 2, 3, 4, 5), t1.aa, (1, 6), (0, 2, 3, 6, 4, 5)) - del tmp472 - tmp484 = einsum(t1.bb, (0, 1), tmp483, (2, 3, 0, 4, 5, 6), (2, 3, 4, 5, 6, 1)) * -1 - del tmp483 - tmp485 = np.copy(np.transpose(tmp150, (0, 2, 1, 3))) - tmp485 += np.transpose(tmp476, (0, 2, 1, 3)) * -1 - tmp464 = np.copy(np.transpose(tmp173, (1, 0, 2, 3))) * -1 - tmp464 += tmp354 - tmp441 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 5, 6), (0, 4, 5, 2, 3, 6)) - tmp495 = einsum(t2.abab, (0, 1, 2, 3), tmp235, (4, 5, 1, 6), (0, 5, 4, 2, 6, 3)) - tmp434 = einsum(tmp331, (0, 1, 2, 3), t2.abab, (0, 4, 5, 6), (1, 2, 4, 5, 3, 6)) - tmp503 = einsum(t2.abab, (0, 1, 2, 3), tmp174, (4, 0, 5, 6), (4, 5, 1, 2, 3, 6)) - tmp465 = einsum(tmp22, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 6), (0, 1, 4, 3, 5, 6)) - tmp457 = einsum(t2.abab, (0, 1, 2, 3), tmp456, (4, 1, 5, 6), (0, 4, 5, 2, 6, 3)) - del tmp456 - tmp430 = np.copy(np.transpose(tmp334, (1, 0, 2, 3))) - tmp430 += tmp331 * -1 - tmp502 = einsum(tmp77, (0, 1, 2, 3), t2.bbbb, (4, 5, 6, 3), (0, 4, 5, 1, 2, 6)) - del tmp77 - tmp490 = einsum(tmp393, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (0, 4, 2, 5, 3, 6)) - tmp418 = einsum(t3.babbab, (0, 1, 2, 3, 4, 5), f.bb.ov, (6, 5), (1, 6, 0, 2, 4, 3)) * 2 - tmp418 += np.transpose(tmp413, (0, 3, 2, 1, 4, 5)) - tmp471 = einsum(tmp470, (0, 1, 2, 3, 4, 5), t1.bb, (3, 6), (0, 1, 2, 4, 6, 5)) - del tmp470 - tmp482 = einsum(tmp481, (0, 1, 2, 3), t2.abab, (4, 5, 6, 1), (4, 0, 5, 6, 2, 3)) - del tmp481 - tmp439 = einsum(t2.bbbb, (0, 1, 2, 3), tmp148, (4, 5, 3, 6), (5, 4, 0, 1, 2, 6)) - tmp475 = einsum(tmp173, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (0, 2, 4, 5, 6, 3)) - tmp420 = einsum(t3.babbab, (0, 1, 2, 3, 4, 5), tmp256, (4, 6), (1, 0, 2, 6, 3, 5)) - tmp453 = einsum(t2.abab, (0, 1, 2, 3), tmp21, (4, 5, 1, 6), (0, 4, 5, 2, 3, 6)) - tmp436 = einsum(t2.bbbb, (0, 1, 2, 3), tmp435, (4, 1, 5, 6), (4, 5, 0, 6, 2, 3)) * -1 - del tmp435 - tmp428 = einsum(tmp138, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (0, 4, 2, 3, 5, 6)) * -1 - tmp428 += einsum(t1.aa, (0, 1), tmp427, (2, 0, 3, 4, 5, 6), (2, 4, 3, 5, 1, 6)) * 2 - del tmp427 - tmp448 = np.copy(v.aabb.ovvv) - tmp448 += np.transpose(tmp129, (0, 1, 3, 2)) * -1 - del tmp129 - tmp479 = np.copy(np.transpose(tmp376, (0, 1, 3, 2))) - tmp479 += einsum(tmp478, (0, 1, 2, 3), t1.aa, (1, 4), (0, 4, 3, 2)) * -1 - del tmp478 - tmp443 = einsum(tmp55, (0, 1, 2, 3), t2.abab, (4, 5, 1, 6), (4, 5, 0, 2, 6, 3)) - tmp447 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 5, 1, 6), (4, 5, 2, 0, 6, 3)) - tmp433 = einsum(t2.bbbb, (0, 1, 2, 3), tmp329, (4, 1, 5, 6), (4, 0, 5, 6, 2, 3)) - tmp417 = einsum(v.aabb.oooo, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (0, 4, 2, 3, 5, 6)) * -1 - tmp417 += einsum(t1.aa, (0, 1), tmp416, (0, 2, 3, 4, 5, 6), (2, 4, 3, 5, 1, 6)) * 2 - del tmp416 - tmp469 = einsum(t2.abab, (0, 1, 2, 3), tmp199, (4, 5, 1, 6), (0, 4, 5, 2, 3, 6)) - tmp411 = einsum(f.bb.oo, (0, 1), t3.babbab, (2, 3, 1, 4, 5, 6), (3, 0, 2, 5, 4, 6)) - tmp415 = einsum(f.aa.oo, (0, 1), t3.babbab, (2, 1, 3, 4, 5, 6), (0, 2, 3, 5, 4, 6)) - tmp451 = einsum(tmp334, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (0, 4, 2, 5, 3, 6)) - tmp440 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (0, 4, 2, 5, 6, 3)) - tmp505 = einsum(tmp504, (0, 1, 2, 3, 4, 5), t1.aa, (1, 6), (0, 2, 3, 6, 4, 5)) - del tmp504 - tmp498 = einsum(tmp497, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 6), (0, 1, 4, 3, 5, 6)) * -1 - del tmp497 - tmp421 = einsum(tmp323, (0, 1), t3.babbab, (2, 3, 0, 4, 5, 6), (3, 1, 2, 5, 4, 6)) - tmp463 = einsum(tmp462, (0, 1, 2, 3, 4, 5), t1.bb, (2, 6), (0, 1, 3, 4, 6, 5)) - del tmp462 - tmp414 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.oooo, (4, 5, 6, 1), (0, 4, 5, 6, 2, 3)) - tmp414 += np.transpose(tmp413, (0, 1, 3, 2, 4, 5)) * -1 - del tmp413 - tmp487 = np.copy(np.transpose(tmp150, (0, 2, 1, 3))) * -1 - tmp487 += np.transpose(tmp486, (0, 2, 1, 3)) - tmp450 = einsum(t2.bbbb, (0, 1, 2, 3), tmp328, (4, 5, 1, 6), (4, 0, 5, 6, 2, 3)) - tmp474 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.oovv, (4, 5, 6, 3), (4, 5, 0, 1, 2, 6)) - tmp449 = einsum(t2.abab, (0, 1, 2, 3), tmp176, (4, 1, 5, 6), (0, 5, 4, 2, 6, 3)) - tmp467 = einsum(tmp466, (0, 1, 2, 3, 4, 5), t1.bb, (2, 6), (0, 1, 3, 4, 6, 5)) - del tmp466 - tmp458 = einsum(tmp364, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 6), (0, 2, 4, 3, 5, 6)) * -1 - tmp477 = np.copy(np.transpose(tmp150, (0, 2, 1, 3))) - tmp477 += tmp476 * -1 - del tmp476 - tmp501 = einsum(tmp500, (0, 1, 2, 3, 4, 5), t1.bb, (3, 6), (0, 1, 2, 4, 6, 5)) - del tmp500 - tmp442 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 6), (0, 4, 2, 1, 5, 6)) - tmp506 = einsum(t2.bbbb, (0, 1, 2, 3), tmp169, (4, 5, 6, 3), (4, 5, 0, 1, 2, 6)) - tmp429 = einsum(t2.abab, (0, 1, 2, 3), tmp135, (4, 0, 5, 6), (4, 5, 1, 6, 2, 3)) - tmp429 += tmp423 - del tmp423 - tmp493 = einsum(tmp391, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 6), (0, 1, 4, 3, 5, 6)) - tmp438 = einsum(tmp437, (0, 1, 2, 3, 4, 5), t1.aa, (1, 6), (0, 2, 3, 6, 4, 5)) - del tmp437 - tmp494 = np.copy(tmp174) * -1 - tmp494 += tmp399 - tmp489 = np.copy(np.transpose(tmp150, (0, 2, 1, 3))) - tmp489 += np.transpose(tmp486, (0, 2, 1, 3)) * -1 - del tmp486 - tmp426 = einsum(tmp259, (0, 1), t3.babbab, (2, 0, 3, 4, 5, 6), (1, 2, 3, 5, 4, 6)) - tmp499 = np.copy(tmp174) - tmp499 += tmp399 * -1 - del tmp399 - tmp468 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 5, 6, 3), (0, 4, 5, 2, 1, 6)) - tmp340 = einsum(tmp339, (0, 1, 2, 3), t2.aaaa, (4, 5, 6, 2), (4, 5, 1, 0, 6, 3)) - del tmp339 - tmp401 = einsum(tmp400, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 6), (0, 4, 2, 5, 6, 3)) * -1 - del tmp400 - tmp375 = einsum(t2.abab, (0, 1, 2, 3), tmp136, (4, 5, 1, 6), (4, 0, 5, 2, 6, 3)) - tmp405 = einsum(t2.aaaa, (0, 1, 2, 3), tmp140, (4, 5, 3, 6), (0, 1, 4, 5, 2, 6)) - tmp318 = einsum(tmp317, (0, 1), t3.abaaba, (2, 3, 4, 5, 0, 6), (2, 4, 3, 5, 6, 1)) - tmp388 = np.copy(np.transpose(tmp376, (0, 1, 3, 2))) * -1 - tmp388 += np.transpose(tmp387, (0, 1, 3, 2)) - tmp402 = np.copy(tmp149) - tmp402 += tmp395 * -1 - tmp367 = einsum(tmp366, (0, 1, 2, 3, 4, 5), t1.aa, (1, 6), (0, 2, 3, 6, 4, 5)) - del tmp366 - tmp385 = einsum(t1.aa, (0, 1), tmp384, (2, 0, 3, 4, 5, 6), (2, 3, 4, 5, 1, 6)) * -1 - del tmp384 - tmp361 = einsum(tmp360, (0, 1, 2, 3, 4, 5), t1.aa, (1, 6), (0, 2, 3, 6, 4, 5)) - del tmp360 - tmp371 = einsum(t1.aa, (0, 1), tmp370, (2, 3, 0, 4, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp370 - tmp324 = einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), tmp323, (1, 6), (0, 2, 6, 3, 5, 4)) - del tmp323 - tmp319 = einsum(tmp259, (0, 1), t3.abaaba, (2, 3, 0, 4, 5, 6), (1, 2, 3, 4, 6, 5)) - tmp404 = einsum(t1.aa, (0, 1), tmp403, (2, 3, 0, 4, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp403 - tmp349 = einsum(t2.aaaa, (0, 1, 2, 3), tmp334, (4, 1, 5, 6), (0, 4, 5, 2, 3, 6)) - del tmp334 - tmp346 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (4, 5, 6, 3), (0, 4, 1, 2, 5, 6)) - tmp380 = np.copy(np.transpose(tmp150, (0, 2, 1, 3))) - tmp380 += einsum(tmp379, (0, 1, 2, 3), t1.bb, (1, 4), (0, 3, 2, 4)) * -1 - del tmp379 - tmp398 = einsum(t2.abab, (0, 1, 2, 3), tmp112, (4, 5, 0, 6), (4, 5, 1, 2, 6, 3)) - tmp326 = einsum(tmp135, (0, 1, 2, 3), t2.abab, (4, 3, 5, 6), (4, 0, 1, 2, 5, 6)) * -1 - tmp326 += einsum(tmp325, (0, 1, 2, 3, 4, 5), t1.bb, (4, 6), (0, 1, 2, 3, 5, 6)) * -2 - del tmp325 - tmp396 = np.copy(tmp149) * -1 - tmp396 += tmp395 - tmp358 = einsum(tmp357, (0, 1, 2, 3, 4, 5), t1.aa, (1, 6), (0, 2, 3, 6, 4, 5)) - del tmp357 - tmp311 = einsum(v.aaaa.oooo, (0, 1, 2, 3), t2.abab, (3, 4, 5, 6), (0, 1, 2, 4, 5, 6)) - tmp311 += np.transpose(tmp310, (0, 2, 1, 3, 4, 5)) * -1 - tmp383 = einsum(t2.abab, (0, 1, 2, 3), tmp382, (4, 2, 5, 6), (4, 0, 1, 5, 6, 3)) - del tmp382 - tmp336 = einsum(tmp335, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 6), (1, 4, 2, 5, 6, 3)) * -1 - del tmp335 - tmp338 = einsum(tmp337, (0, 1, 2, 3, 4, 5), t1.bb, (3, 6), (0, 1, 2, 4, 5, 6)) - del tmp337 - tmp390 = np.copy(np.transpose(tmp376, (0, 1, 3, 2))) - tmp390 += np.transpose(tmp387, (0, 1, 3, 2)) * -1 - del tmp387 - tmp330 = np.copy(np.transpose(tmp328, (0, 2, 1, 3))) - tmp330 += tmp329 * -1 - tmp327 = einsum(t2.abab, (0, 1, 2, 3), tmp138, (4, 5, 6, 1), (4, 0, 5, 6, 2, 3)) - tmp327 += tmp321 - tmp386 = np.copy(np.transpose(tmp376, (0, 1, 3, 2))) - tmp386 += np.transpose(tmp377, (0, 1, 3, 2)) * -1 - tmp348 = einsum(tmp244, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (2, 0, 4, 3, 5, 6)) - tmp351 = einsum(t2.abab, (0, 1, 2, 3), tmp22, (4, 5, 1, 6), (0, 4, 5, 2, 6, 3)) - tmp312 = einsum(f.bb.oo, (0, 1), t3.abaaba, (2, 1, 3, 4, 5, 6), (2, 3, 0, 4, 6, 5)) - tmp352 = einsum(t2.abab, (0, 1, 2, 3), tmp2, (4, 5, 0, 6), (4, 5, 1, 2, 6, 3)) - tmp347 = np.copy(np.transpose(v.aabb.vvov, (2, 0, 1, 3))) - tmp347 += np.transpose(tmp54, (0, 2, 1, 3)) * -1 - del tmp54 - tmp406 = einsum(t2.abab, (0, 1, 2, 3), tmp149, (4, 5, 1, 6), (4, 0, 5, 2, 6, 3)) - tmp363 = np.copy(np.transpose(tmp136, (0, 2, 1, 3))) * -1 - tmp363 += np.transpose(tmp362, (0, 2, 1, 3)) - tmp332 = einsum(t2.aaaa, (0, 1, 2, 3), tmp331, (1, 4, 5, 6), (0, 4, 5, 2, 3, 6)) - del tmp331 - tmp409 = einsum(t2.aaaa, (0, 1, 2, 3), tmp141, (4, 5, 6, 3), (0, 1, 4, 5, 2, 6)) - tmp392 = einsum(t2.abab, (0, 1, 2, 3), tmp391, (4, 5, 1, 6), (0, 4, 5, 6, 2, 3)) - del tmp391 - tmp350 = einsum(tmp328, (0, 1, 2, 3), t2.abab, (4, 2, 5, 6), (4, 0, 1, 3, 5, 6)) - del tmp328 - tmp345 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.abab, (4, 5, 3, 6), (4, 0, 5, 1, 2, 6)) - tmp342 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 5, 6), (4, 5, 1, 2, 6, 3)) - tmp315 = einsum(f.aa.ov, (0, 1), t3.abaaba, (2, 3, 4, 5, 6, 1), (0, 2, 4, 3, 5, 6)) * 2 - tmp315 += np.transpose(tmp310, (1, 2, 0, 3, 4, 5)) - del tmp310 - tmp369 = einsum(t2.abab, (0, 1, 2, 3), tmp66, (4, 5, 0, 6), (4, 5, 1, 2, 6, 3)) - tmp408 = einsum(t1.bb, (0, 1), tmp407, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 6, 1)) - del tmp407 - tmp397 = einsum(tmp108, (0, 1, 2, 3), t2.abab, (2, 4, 5, 6), (1, 0, 4, 3, 5, 6)) - tmp365 = einsum(tmp1, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 6), (0, 4, 2, 5, 6, 3)) - tmp356 = einsum(tmp355, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 6), (1, 4, 2, 5, 6, 3)) * -1 - tmp389 = np.copy(np.transpose(tmp150, (0, 2, 1, 3))) - tmp389 += einsum(t1.aa, (0, 1), tmp140, (0, 2, 3, 4), (2, 3, 1, 4)) * -1 - tmp353 = einsum(tmp288, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (0, 2, 4, 3, 5, 6)) - tmp344 = einsum(t2.abab, (0, 1, 2, 3), tmp130, (4, 5, 3, 6), (0, 4, 1, 2, 5, 6)) - tmp374 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.vvoo, (4, 3, 5, 6), (0, 1, 5, 6, 2, 4)) - tmp373 = einsum(t1.bb, (0, 1), tmp372, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 6, 1)) - del tmp372 - tmp314 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.oooo, (4, 5, 6, 1), (0, 4, 5, 6, 2, 3)) * -1 - tmp314 += einsum(t1.bb, (0, 1), tmp313, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 6, 1)) * -2 - del tmp313 - tmp343 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ooov, (4, 1, 5, 6), (0, 4, 5, 2, 3, 6)) - tmp378 = np.copy(np.transpose(tmp376, (0, 1, 3, 2))) - del tmp376 - tmp378 += tmp377 * -1 - del tmp377 - tmp410 = einsum(tmp395, (0, 1, 2, 3), t2.abab, (4, 2, 5, 6), (0, 4, 1, 3, 5, 6)) - del tmp395 - tmp341 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (4, 3, 5, 6), (4, 0, 2, 5, 1, 6)) - tmp308 = einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), f.aa.oo, (6, 2), (6, 0, 1, 3, 5, 4)) - tmp333 = einsum(tmp329, (0, 1, 2, 3), t2.abab, (4, 1, 5, 6), (0, 4, 2, 3, 5, 6)) - del tmp329 - tmp322 = np.copy(tmp321) - del tmp321 - tmp322 += einsum(t2.abab, (0, 1, 2, 3), tmp290, (4, 5, 6, 0), (4, 6, 5, 1, 2, 3)) - tmp368 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (4, 3, 5, 6), (0, 1, 4, 5, 2, 6)) - tmp394 = einsum(tmp393, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 6), (0, 4, 2, 5, 6, 3)) - del tmp393 - tmp285 = einsum(tmp284, (0, 1, 2, 3), t2.aaaa, (4, 5, 6, 2), (0, 4, 5, 1, 3, 6)) * -1 - tmp277 = einsum(t1.aa, (0, 1), tmp276, (2, 3, 0, 4, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp276 - tmp258 = einsum(f.aa.vv, (0, 1), t3.aaaaaa, (2, 3, 4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - tmp272 = einsum(t2.aaaa, (0, 1, 2, 3), tmp271, (1, 4, 5, 6), (4, 5, 0, 6, 2, 3)) * -2 - del tmp271 - tmp269 = einsum(t2.aaaa, (0, 1, 2, 3), tmp268, (4, 5, 1, 6), (4, 5, 0, 6, 2, 3)) * -1 - tmp255 = einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), tmp254, (5, 6), (0, 1, 2, 6, 3, 4)) * 3 - tmp300 = einsum(t1.aa, (0, 1), tmp299, (2, 0, 3, 4, 5, 6), (2, 4, 3, 6, 5, 1)) * -1 - del tmp299 - tmp286 = einsum(tmp2, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 6), (0, 4, 1, 5, 6, 3)) - tmp263 = einsum(t1.aa, (0, 1), tmp262, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp262 - tmp291 = np.copy(np.transpose(tmp66, (0, 2, 1, 3))) - tmp291 += einsum(t1.aa, (0, 1), tmp290, (2, 3, 4, 0), (2, 4, 3, 1)) - del tmp290 - tmp302 = einsum(t1.aa, (0, 1), tmp301, (2, 3, 4, 0), (2, 4, 3, 1)) - del tmp301 - tmp257 = einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), tmp256, (5, 6), (0, 1, 2, 6, 3, 4)) - tmp303 = einsum(tmp108, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 6), (1, 0, 4, 3, 5, 6)) - tmp279 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 6, 3), (4, 5, 0, 6, 1, 2)) - tmp245 = einsum(tmp244, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 6), (4, 2, 0, 3, 5, 6)) - del tmp244 - tmp298 = einsum(tmp110, (0, 1, 2, 3), t2.aaaa, (4, 5, 6, 2), (0, 4, 5, 6, 3, 1)) - tmp289 = einsum(t2.aaaa, (0, 1, 2, 3), tmp288, (4, 1, 5, 6), (4, 5, 0, 6, 2, 3)) * -1 - del tmp288 - tmp266 = einsum(t2.aaaa, (0, 1, 2, 3), tmp265, (4, 1, 5, 6), (4, 5, 0, 6, 2, 3)) * -1 - del tmp265 - tmp243 = einsum(f.aa.oo, (0, 1), t3.aaaaaa, (2, 3, 1, 4, 5, 6), (0, 2, 3, 4, 5, 6)) - tmp281 = einsum(tmp280, (0, 1, 2, 3), t2.aaaa, (4, 5, 6, 2), (0, 4, 5, 1, 3, 6)) * -2 - del tmp280 - tmp297 = einsum(tmp66, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 6), (0, 4, 1, 5, 6, 3)) - tmp307 = einsum(t1.aa, (0, 1), tmp306, (2, 0, 3, 4, 5, 6), (2, 4, 3, 6, 5, 1)) * -2 - del tmp306 - tmp283 = einsum(tmp282, (0, 1, 2, 3), t2.aaaa, (4, 5, 6, 3), (0, 4, 5, 1, 2, 6)) * -1 - tmp274 = einsum(t2.aaaa, (0, 1, 2, 3), tmp273, (1, 4, 5, 6), (4, 5, 0, 6, 2, 3)) * -1 - tmp304 = einsum(t2.aaaa, (0, 1, 2, 3), tmp112, (4, 5, 1, 6), (4, 5, 0, 2, 3, 6)) - tmp275 = einsum(tmp270, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 6), (2, 1, 4, 3, 5, 6)) * -1 - tmp296 = einsum(t1.aa, (0, 1), tmp295, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp295 - tmp278 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 1, 5, 6), (0, 4, 5, 2, 3, 6)) - tmp260 = einsum(tmp259, (0, 1), t3.aaaaaa, (2, 3, 0, 4, 5, 6), (1, 2, 3, 4, 5, 6)) - del tmp259 - tmp252 = einsum(t1.aa, (0, 1), tmp251, (2, 0, 3, 4, 5, 6), (2, 3, 4, 5, 6, 1)) - del tmp251 - tmp248 = einsum(t1.aa, (0, 1), tmp247, (2, 3, 0, 4, 5, 6), (2, 3, 4, 1, 5, 6)) - del tmp247 - tmp294 = einsum(t2.aaaa, (0, 1, 2, 3), tmp293, (4, 5, 1, 6), (4, 5, 0, 6, 2, 3)) * -1 - del tmp293 - tmp240 = einsum(t2.bbbb, (0, 1, 2, 3), tmp239, (4, 5, 1, 0), (5, 4, 2, 3)) - del tmp239 - tmp225 = np.copy(v.bbbb.oovv) - tmp225 += einsum(tmp100, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 2), (4, 1, 5, 3)) * -2 - tmp225 += einsum(tmp224, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) * -1 - del tmp224 - tmp182 = einsum(t2.bbbb, (0, 1, 2, 3), tmp181, (1, 4), (0, 4, 2, 3)) * -1 - del tmp181 - tmp218 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 4, 3)) - tmp202 = einsum(tmp201, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 4, 3)) - del tmp201 - tmp186 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp236 = einsum(tmp235, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - del tmp235 - tmp198 = einsum(t2.bbbb, (0, 1, 2, 3), tmp197, (4, 5, 0, 1), (4, 5, 2, 3)) - del tmp197 - tmp188 = einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), tmp187, (2, 4, 5, 6), (0, 1, 6, 3)) * -6 - tmp124 = np.copy(tmp122) * 0.5 - tmp124 += tmp123 - tmp177 = einsum(tmp176, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 4, 3)) - del tmp176 - tmp195 = einsum(tmp22, (0, 1, 2, 3), t3.babbab, (4, 0, 2, 5, 3, 6), (1, 4, 5, 6)) - tmp238 = einsum(t1.bb, (0, 1), tmp237, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp237 - tmp223 = np.copy(tmp144) - tmp223 += einsum(tmp91, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp175 = einsum(v.bbbb.oooo, (0, 1, 2, 3), t2.bbbb, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp234 = einsum(tmp233, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) - del tmp233 - tmp179 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t3.babbab, (4, 0, 3, 5, 1, 6), (4, 2, 5, 6)) - tmp200 = einsum(t1.bb, (0, 1), tmp199, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp199 - tmp178 = einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), v.bbbb.ooov, (6, 1, 2, 5), (0, 6, 3, 4)) - tmp242 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp189 = einsum(t3.babbab, (0, 1, 2, 3, 4, 5), tmp130, (1, 4, 5, 6), (0, 2, 3, 6)) * -2 - tmp226 = np.copy(tmp144) - tmp226 += einsum(t2.abab, (0, 1, 2, 3), tmp7, (0, 4, 2, 5), (4, 1, 5, 3)) - tmp208 = einsum(t1.bb, (0, 1), tmp190, (2, 1, 3, 4), (0, 2, 4, 3)) * -1 - del tmp190 - tmp208 += einsum(tmp207, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 4, 3)) * -1 - del tmp207 - tmp216 = einsum(t2.bbbb, (0, 1, 2, 3), tmp215, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp215 - tmp193 = np.copy(f.bb.vv) * -1 - tmp193 += np.transpose(tmp131, (1, 0)) * -1 - tmp193 += np.transpose(tmp122, (1, 0)) - del tmp122 - tmp193 += np.transpose(tmp123, (1, 0)) * 2 - del tmp123 - tmp193 += tmp191 * -1 - tmp193 += np.transpose(tmp192, (1, 0)) - tmp194 = np.copy(f.bb.vv) * -1 - tmp194 += np.transpose(tmp131, (1, 0)) * -1 - tmp194 += tmp191 * -1 - del tmp191 - tmp194 += np.transpose(tmp192, (1, 0)) - del tmp192 - tmp185 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp32 = np.copy(f.bb.oo) - tmp32 += np.transpose(tmp29, (1, 0)) - del tmp29 - tmp32 += np.transpose(tmp31, (1, 0)) * -1 - del tmp31 - tmp241 = np.copy(v.bbbb.vvvv) * -1 - tmp241 += einsum(tmp187, (0, 1, 2, 3), t1.bb, (0, 4), (1, 4, 3, 2)) - del tmp187 - tmp196 = einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), tmp21, (6, 2, 1, 5), (6, 0, 3, 4)) - tmp222 = np.copy(v.bbbb.oovv) - tmp222 += einsum(t2.bbbb, (0, 1, 2, 3), tmp96, (1, 4, 3, 5), (0, 4, 2, 5)) * -2 - tmp222 += np.transpose(tmp221, (0, 1, 3, 2)) * -1 - del tmp221 - tmp217 = einsum(t2.abab, (0, 1, 2, 3), tmp168, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp228 = einsum(t1.bb, (0, 1), tmp227, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp227 - tmp183 = einsum(tmp16, (0, 1), t3.bbbbbb, (2, 3, 0, 4, 5, 1), (2, 3, 4, 5)) * 3 - tmp230 = einsum(t2.bbbb, (0, 1, 2, 3), tmp229, (1, 4, 5, 3), (4, 0, 5, 2)) - del tmp229 - tmp219 = einsum(t2.abab, (0, 1, 2, 3), tmp125, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp210 = einsum(tmp209, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp209 - tmp184 = np.copy(f.aa.ov) - tmp184 += tmp0 - tmp184 += einsum(tmp91, (0, 1, 2, 3), t1.aa, (0, 2), (1, 3)) * -1 - tmp232 = einsum(t2.bbbb, (0, 1, 2, 3), tmp231, (4, 5, 1, 0), (5, 4, 2, 3)) - del tmp231 - tmp204 = einsum(t2.bbbb, (0, 1, 2, 3), tmp203, (4, 1), (4, 0, 2, 3)) * -1 - del tmp203 - tmp126 = np.copy(np.transpose(v.aaaa.ovvv, (0, 2, 3, 1))) - tmp126 += tmp51 - del tmp51 - tmp3 = np.copy(t2.abab) - tmp3 += einsum(t1.bb, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - tmp171 = np.copy(np.transpose(tmp169, (0, 1, 3, 2))) - del tmp169 - tmp171 += np.transpose(tmp170, (0, 1, 3, 2)) * -1 - del tmp170 - tmp158 = np.copy(v.bbbb.oovv) - tmp158 += einsum(tmp157, (0, 1, 2, 3), t1.bb, (0, 4), (2, 1, 3, 4)) - del tmp157 - tmp159 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp120 = np.copy(t2.abab) - tmp120 += einsum(t1.bb, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) * 2 - tmp146 = np.copy(np.transpose(v.aabb.vvoo, (2, 3, 0, 1))) * -1 - tmp146 += np.transpose(tmp145, (1, 0, 3, 2)) - del tmp145 - tmp146 += einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (2, 4, 1, 5)) - tmp128 = np.copy(np.transpose(v.bbbb.ovvv, (0, 2, 3, 1))) - tmp128 += tmp127 - del tmp127 - tmp172 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp161 = np.copy(v.aabb.vvvv) - tmp161 += einsum(tmp160, (0, 1, 2, 3), t1.bb, (0, 4), (2, 1, 3, 4)) * -1 - del tmp160 - tmp155 = np.copy(tmp95) * -1 - tmp155 += tmp154 * 2 - tmp155 += einsum(t2.abab, (0, 1, 2, 3), tmp46, (1, 4, 3, 5), (0, 4, 2, 5)) * -1 - del tmp46 - tmp151 = np.copy(np.transpose(v.aabb.vvov, (2, 0, 1, 3))) - tmp151 += np.transpose(tmp150, (0, 2, 1, 3)) - del tmp150 - tmp133 = np.copy(f.bb.vv) - tmp133 += np.transpose(tmp131, (1, 0)) - del tmp131 - tmp133 += einsum(tmp132, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) * -1 - del tmp132 - tmp133 += einsum(tmp48, (0, 1), t1.bb, (0, 2), (1, 2)) * -1 - tmp156 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 3, 5)) - tmp153 = np.copy(v.aaaa.oovv) - tmp153 += np.transpose(tmp49, (1, 0, 3, 2)) * -1 - tmp153 += einsum(t2.aaaa, (0, 1, 2, 3), tmp91, (1, 4, 3, 5), (4, 0, 5, 2)) * 2 - tmp153 += einsum(tmp37, (0, 1, 2, 3), t1.aa, (0, 4), (2, 1, 3, 4)) - del tmp37 - tmp27 = np.copy(np.transpose(tmp24, (1, 0))) - del tmp24 - tmp27 += np.transpose(tmp25, (1, 0)) * 2 - del tmp25 - tmp27 += np.transpose(tmp26, (1, 0)) - del tmp26 - tmp167 = np.copy(np.transpose(tmp165, (0, 1, 3, 2))) * -1 - del tmp165 - tmp167 += einsum(tmp166, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) - del tmp166 - tmp61 = np.copy(f.aa.vv) * -1 - tmp61 += np.transpose(tmp57, (1, 0)) * -1 - tmp61 += np.transpose(tmp42, (1, 0)) * 2 - tmp61 += np.transpose(tmp43, (1, 0)) - tmp61 += tmp59 * -1 - tmp61 += np.transpose(tmp60, (1, 0)) - tmp137 = einsum(tmp1, (0, 1, 2, 3), t3.babbab, (4, 1, 2, 5, 6, 3), (0, 4, 6, 5)) - tmp143 = np.copy(np.transpose(tmp141, (0, 1, 3, 2))) - del tmp141 - tmp143 += np.transpose(tmp142, (0, 1, 3, 2)) * -1 - del tmp142 - tmp134 = einsum(t3.babbab, (0, 1, 2, 3, 4, 5), tmp21, (6, 0, 2, 5), (1, 6, 4, 3)) * -1 - tmp119 = einsum(t3.babbab, (0, 1, 2, 3, 4, 5), v.bbbb.ooov, (6, 2, 0, 5), (1, 6, 4, 3)) * -1 - tmp11 = np.copy(np.transpose(tmp5, (1, 0))) * 2 - del tmp5 - tmp11 += np.transpose(tmp6, (1, 0)) - del tmp6 - tmp11 += np.transpose(tmp10, (1, 0)) - del tmp10 - tmp121 = einsum(v.aabb.ooov, (0, 1, 2, 3), t3.babbab, (4, 1, 2, 5, 6, 3), (0, 4, 6, 5)) - tmp163 = np.copy(tmp162) * -1 - del tmp162 - tmp163 += np.transpose(tmp84, (0, 1, 3, 2)) - del tmp84 - tmp89 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp94 = np.copy(v.aaaa.oovv) - tmp94 += einsum(t2.aaaa, (0, 1, 2, 3), tmp91, (1, 4, 5, 3), (0, 4, 2, 5)) * -2 - del tmp91 - tmp94 += tmp93 * -1 - del tmp93 - tmp67 = einsum(tmp66, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp66 - tmp65 = einsum(tmp64, (0, 1, 2, 3), t2.aaaa, (3, 2, 4, 5), (0, 1, 4, 5)) * -1 - del tmp64 - tmp34 = einsum(v.aabb.ooov, (0, 1, 2, 3), t3.abaaba, (4, 2, 1, 5, 3, 6), (4, 0, 5, 6)) - tmp36 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.oooo, (4, 1, 5, 0), (4, 5, 2, 3)) * -1 - tmp72 = einsum(t2.aaaa, (0, 1, 2, 3), tmp71, (4, 1), (0, 4, 2, 3)) * -1 - del tmp71 - tmp99 = np.copy(v.aaaa.oovv) * 0.5 - tmp99 += einsum(tmp7, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 5, 2)) * -1 - del tmp7 - tmp99 += einsum(tmp98, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -0.5 - del tmp98 - tmp62 = np.copy(f.aa.vv) * -1 - tmp62 += np.transpose(tmp57, (1, 0)) * -1 - del tmp57 - tmp62 += tmp59 * -1 - del tmp59 - tmp62 += np.transpose(tmp60, (1, 0)) - del tmp60 - tmp68 = einsum(tmp1, (0, 1, 2, 3), t3.abaaba, (4, 2, 1, 5, 3, 6), (0, 4, 5, 6)) - tmp35 = np.copy(t2.aaaa) - tmp35 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) * 2 - tmp50 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp105 = einsum(t2.aaaa, (0, 1, 2, 3), tmp104, (1, 4, 5, 3), (0, 4, 2, 5)) - del tmp104 - tmp53 = einsum(tmp52, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 0, 6, 2, 1), (4, 5, 6, 3)) * -6 - del tmp52 - tmp63 = einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), tmp2, (6, 1, 2, 5), (6, 0, 3, 4)) * -1 - tmp113 = einsum(tmp112, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp112 - tmp101 = np.copy(tmp95) - tmp101 += einsum(t2.abab, (0, 1, 2, 3), tmp100, (1, 4, 3, 5), (0, 4, 2, 5)) * -1 - del tmp100 - tmp70 = einsum(tmp69, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp69 - tmp41 = einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), tmp9, (2, 5), (0, 1, 3, 4)) * 3 - tmp109 = einsum(tmp108, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp108 - tmp107 = einsum(tmp106, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 5), (1, 0, 4, 5)) * -1 - del tmp106 - tmp90 = einsum(t2.aaaa, (0, 1, 2, 3), tmp49, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp80 = einsum(t2.abab, (0, 1, 2, 3), tmp79, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp79 - tmp97 = np.copy(tmp95) - tmp97 += einsum(t2.abab, (0, 1, 2, 3), tmp96, (1, 4, 3, 5), (0, 4, 2, 5)) * -1 - del tmp96 - tmp44 = np.copy(tmp42) * 2 - del tmp42 - tmp44 += tmp43 - del tmp43 - tmp20 = np.copy(f.aa.oo) - tmp20 += np.transpose(tmp17, (1, 0)) - del tmp17 - tmp20 += np.transpose(tmp19, (1, 0)) * -1 - del tmp19 - tmp86 = einsum(t2.aaaa, (0, 1, 2, 3), tmp85, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp85 - tmp115 = einsum(t2.aaaa, (0, 1, 2, 3), tmp114, (4, 5, 1, 0), (5, 4, 2, 3)) - del tmp114 - tmp111 = einsum(t1.aa, (0, 1), tmp110, (2, 3, 1, 4), (0, 2, 3, 4)) - del tmp110 - tmp33 = einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), v.aaaa.ooov, (6, 2, 1, 5), (0, 6, 3, 4)) * -1 - tmp103 = einsum(tmp102, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp102 - tmp76 = einsum(t1.aa, (0, 1), tmp58, (2, 1, 3, 4), (0, 2, 4, 3)) * -1 - del tmp58 - tmp76 += einsum(tmp75, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - del tmp75 - tmp118 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp88 = einsum(tmp87, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp40 = einsum(t2.aaaa, (0, 1, 2, 3), tmp39, (1, 4), (0, 4, 2, 3)) * -1 - tmp117 = np.copy(v.aaaa.vvvv) - tmp117 += einsum(tmp116, (0, 1, 2, 3), t1.aa, (0, 4), (3, 4, 2, 1)) - del tmp116 - tmp56 = einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), tmp55, (1, 5, 6, 4), (0, 2, 3, 6)) * -2 - tmp45 = einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * 2 - tmp45 += t2.aaaa * -1 - tmp28 = np.copy(f.bb.vv) - tmp28 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 1), (2, 3)) - tmp23 = np.copy(t2.bbbb) * 2 - tmp23 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - tmp12 = np.copy(f.aa.vv) - tmp12 += einsum(t1.aa, (0, 1), v.aaaa.ovvv, (0, 2, 3, 1), (2, 3)) * -1 - tmp4 = np.copy(t2.aaaa) * 2 - tmp4 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - t3new.bbbbbb = np.copy(np.transpose(tmp508, (1, 0, 2, 5, 4, 3))) * -2 - t3new.bbbbbb += np.transpose(tmp509, (1, 2, 0, 4, 5, 3)) * -6 - t3new.bbbbbb += np.transpose(tmp512, (0, 1, 2, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp512, (0, 1, 2, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp508, (1, 2, 0, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp509, (1, 0, 2, 4, 5, 3)) * 6 - t3new.bbbbbb += np.transpose(tmp512, (0, 2, 1, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp512, (0, 2, 1, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp509, (0, 2, 1, 4, 5, 3)) * 6 - del tmp509 - t3new.bbbbbb += np.transpose(tmp512, (2, 1, 0, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp512, (2, 1, 0, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp516, (2, 1, 0, 4, 3, 5)) * 2 - del tmp516 - t3new.bbbbbb += np.transpose(tmp517, (1, 2, 0, 3, 4, 5)) * 2 - del tmp517 - t3new.bbbbbb += np.transpose(tmp518, (1, 2, 0, 4, 3, 5)) * -6 - del tmp518 - t3new.bbbbbb += np.transpose(tmp519, (0, 1, 2, 5, 4, 3)) * -6 - del tmp519 - t3new.bbbbbb += np.transpose(tmp520, (1, 2, 0, 4, 5, 3)) * -6 - t3new.bbbbbb += np.transpose(tmp523, (1, 2, 0, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp523, (1, 2, 0, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp526, (1, 2, 0, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp520, (1, 0, 2, 4, 5, 3)) * 6 - t3new.bbbbbb += np.transpose(tmp523, (1, 0, 2, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp523, (1, 0, 2, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp526, (1, 0, 2, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp520, (0, 2, 1, 4, 5, 3)) * 6 - del tmp520 - t3new.bbbbbb += np.transpose(tmp523, (0, 2, 1, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp523, (0, 2, 1, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp527, (0, 1, 2, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp529, (2, 0, 1, 3, 5, 4)) * -1 - t3new.bbbbbb += np.transpose(tmp530, (2, 0, 1, 3, 5, 4)) * -1 - t3new.bbbbbb += np.transpose(tmp530, (0, 2, 1, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp530, (2, 0, 1, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp530, (0, 2, 1, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp529, (0, 1, 2, 3, 5, 4)) * -1 - del tmp529 - t3new.bbbbbb += np.transpose(tmp530, (0, 1, 2, 3, 5, 4)) * -1 - t3new.bbbbbb += np.transpose(tmp530, (0, 1, 2, 5, 3, 4)) * 2 - del tmp530 - t3new.bbbbbb += np.transpose(tmp531, (2, 1, 0, 5, 4, 3)) * 4 - t3new.bbbbbb += np.transpose(tmp533, (2, 1, 0, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp512, (2, 1, 0, 3, 4, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp512, (2, 1, 0, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp533, (2, 1, 0, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp531, (0, 2, 1, 5, 4, 3)) * 4 - t3new.bbbbbb += np.transpose(tmp533, (0, 2, 1, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp512, (0, 2, 1, 3, 4, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp512, (0, 2, 1, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp533, (0, 2, 1, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp531, (0, 1, 2, 5, 4, 3)) * -4 - del tmp531 - t3new.bbbbbb += np.transpose(tmp533, (0, 1, 2, 5, 3, 4)) * -2 - t3new.bbbbbb += tmp512 * -2 - t3new.bbbbbb += np.transpose(tmp512, (0, 1, 2, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp533, (0, 1, 2, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp534, (0, 1, 2, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp534, (0, 2, 1, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp534, (1, 0, 2, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp534, (2, 0, 1, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp534, (0, 1, 2, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp534, (0, 2, 1, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp534, (1, 0, 2, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp534, (2, 0, 1, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp534, (1, 2, 0, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp534, (2, 1, 0, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp534, (1, 2, 0, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp534, (2, 1, 0, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp534, (0, 1, 2, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp534, (0, 2, 1, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp534, (1, 0, 2, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp534, (2, 0, 1, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp534, (1, 2, 0, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp534, (2, 1, 0, 4, 3, 5)) * -2 - del tmp534 - t3new.bbbbbb += np.transpose(tmp535, (0, 1, 2, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp537, (2, 1, 0, 3, 4, 5)) * -1 - t3new.bbbbbb += np.transpose(tmp535, (0, 2, 1, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp538, (2, 0, 1, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp535, (0, 1, 2, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp539, (2, 1, 0, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp535, (0, 2, 1, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp538, (2, 0, 1, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp535, (2, 1, 0, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp537, (0, 2, 1, 3, 4, 5)) * -1 - del tmp537 - t3new.bbbbbb += np.transpose(tmp535, (2, 1, 0, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp539, (0, 2, 1, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp535, (0, 1, 2, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp539, (2, 1, 0, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp535, (0, 2, 1, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp538, (2, 0, 1, 5, 4, 3)) * -2 - del tmp538 - t3new.bbbbbb += np.transpose(tmp535, (2, 1, 0, 3, 5, 4)) * -2 - del tmp535 - t3new.bbbbbb += np.transpose(tmp539, (0, 2, 1, 5, 3, 4)) * -2 - del tmp539 - t3new.bbbbbb += np.transpose(tmp508, (0, 1, 2, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp508, (1, 0, 2, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp508, (0, 1, 2, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp508, (1, 0, 2, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp508, (0, 2, 1, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp508, (0, 1, 2, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp508, (2, 0, 1, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp508, (1, 2, 0, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp508, (1, 2, 0, 5, 3, 4)) * -2 - del tmp508 - t3new.bbbbbb += np.transpose(tmp540, (1, 0, 2, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp541, (2, 0, 1, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp540, (0, 1, 2, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp541, (0, 2, 1, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp540, (1, 0, 2, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp541, (2, 0, 1, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp540, (0, 1, 2, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp541, (0, 2, 1, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp533, (0, 1, 2, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp512, (0, 1, 2, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp512, (0, 1, 2, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp533, (0, 2, 1, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp512, (0, 2, 1, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp512, (0, 2, 1, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp540, (1, 2, 0, 5, 4, 3)) * -2 - t3new.bbbbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp542, (4, 5, 1, 6), (0, 5, 4, 6, 2, 3)) * -1 - del tmp542 - t3new.bbbbbb += np.transpose(tmp546, (2, 1, 0, 3, 5, 4)) * -1 - t3new.bbbbbb += np.transpose(tmp540, (0, 2, 1, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp541, (0, 1, 2, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp540, (1, 2, 0, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp546, (2, 1, 0, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp540, (0, 2, 1, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp541, (0, 1, 2, 5, 3, 4)) * -2 - del tmp541 - t3new.bbbbbb += np.transpose(tmp540, (2, 1, 0, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp546, (1, 2, 0, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp540, (2, 0, 1, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp546, (1, 0, 2, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp540, (2, 1, 0, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp546, (1, 2, 0, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp540, (2, 0, 1, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp546, (1, 0, 2, 5, 3, 4)) * 2 - del tmp546 - t3new.bbbbbb += np.transpose(tmp533, (2, 1, 0, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp512, (2, 1, 0, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp512, (2, 1, 0, 4, 5, 3)) * 2 - del tmp512 - t3new.bbbbbb += np.transpose(tmp548, (0, 1, 2, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp548, (0, 2, 1, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp533, (0, 1, 2, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp533, (0, 2, 1, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp548, (2, 1, 0, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp533, (2, 1, 0, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp540, (1, 0, 2, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp549, (1, 0, 2, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp540, (0, 1, 2, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp549, (0, 1, 2, 4, 3, 5)) * 2 - t3new.bbbbbb += tmp548 * 2 - t3new.bbbbbb += tmp533 * -2 - t3new.bbbbbb += np.transpose(tmp548, (0, 2, 1, 3, 4, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp533, (0, 2, 1, 3, 4, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp548, (0, 1, 2, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp533, (0, 1, 2, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp548, (0, 2, 1, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp533, (0, 2, 1, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp540, (1, 2, 0, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp549, (1, 2, 0, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp540, (0, 2, 1, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp549, (0, 2, 1, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp540, (2, 1, 0, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp549, (2, 1, 0, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp540, (2, 0, 1, 4, 3, 5)) * -2 - del tmp540 - t3new.bbbbbb += np.transpose(tmp549, (2, 0, 1, 4, 3, 5)) * 2 - del tmp549 - t3new.bbbbbb += np.transpose(tmp548, (2, 1, 0, 3, 4, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp533, (2, 1, 0, 3, 4, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp548, (2, 1, 0, 4, 3, 5)) * 2 - del tmp548 - t3new.bbbbbb += np.transpose(tmp533, (2, 1, 0, 4, 3, 5)) * -2 - del tmp533 - t3new.bbbbbb += np.transpose(tmp523, (1, 2, 0, 3, 4, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp523, (1, 2, 0, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp550, (1, 2, 0, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp550, (1, 2, 0, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp552, (1, 2, 0, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp523, (1, 0, 2, 3, 4, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp523, (1, 0, 2, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp550, (1, 0, 2, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp550, (1, 0, 2, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp552, (1, 0, 2, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp523, (1, 2, 0, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp523, (1, 2, 0, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp550, (1, 2, 0, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp550, (1, 2, 0, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp552, (1, 2, 0, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp523, (1, 0, 2, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp523, (1, 0, 2, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp550, (1, 0, 2, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp550, (1, 0, 2, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp552, (1, 0, 2, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp523, (0, 2, 1, 3, 4, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp523, (0, 2, 1, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp550, (0, 2, 1, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp550, (0, 2, 1, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp552, (0, 2, 1, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp523, (0, 2, 1, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp523, (0, 2, 1, 4, 5, 3)) * 2 - del tmp523 - t3new.bbbbbb += np.transpose(tmp550, (0, 2, 1, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp550, (0, 2, 1, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp552, (0, 2, 1, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp550, (1, 2, 0, 3, 4, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp550, (1, 2, 0, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp552, (1, 2, 0, 3, 4, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp550, (1, 0, 2, 3, 4, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp550, (1, 0, 2, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp552, (1, 0, 2, 3, 4, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp550, (0, 2, 1, 3, 4, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp550, (0, 2, 1, 3, 5, 4)) * -2 - del tmp550 - t3new.bbbbbb += np.transpose(tmp552, (0, 2, 1, 3, 4, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp527, (2, 0, 1, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp527, (0, 2, 1, 5, 4, 3)) * 2 - del tmp527 - t3new.bbbbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp554, (4, 5, 1, 6), (0, 5, 4, 2, 3, 6)) - del tmp554 - t3new.bbbbbb += np.transpose(tmp526, (2, 1, 0, 5, 4, 3)) - del tmp526 - t3new.bbbbbb += np.transpose(tmp555, (2, 0, 1, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp555, (2, 1, 0, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp556, (2, 0, 1, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp556, (2, 1, 0, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp555, (0, 2, 1, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp555, (1, 2, 0, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp556, (0, 2, 1, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp556, (1, 2, 0, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp555, (2, 0, 1, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp555, (2, 1, 0, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp556, (2, 0, 1, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp556, (2, 1, 0, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp555, (0, 2, 1, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp555, (1, 2, 0, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp556, (0, 2, 1, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp556, (1, 2, 0, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp555, (0, 1, 2, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp555, (1, 0, 2, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp556, (0, 1, 2, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp556, (1, 0, 2, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp555, (0, 1, 2, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp555, (1, 0, 2, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp556, (0, 1, 2, 4, 5, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp556, (1, 0, 2, 4, 5, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp560, (1, 2, 0, 5, 4, 3)) - t3new.bbbbbb += np.transpose(tmp552, (1, 0, 2, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp560, (0, 2, 1, 5, 4, 3)) * -1 - del tmp560 - t3new.bbbbbb += np.transpose(tmp556, (2, 0, 1, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp556, (2, 1, 0, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp556, (0, 2, 1, 4, 3, 5)) * -2 - t3new.bbbbbb += np.transpose(tmp556, (1, 2, 0, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp552, (1, 2, 0, 5, 3, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp552, (1, 0, 2, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp552, (1, 2, 0, 3, 5, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp552, (1, 0, 2, 3, 5, 4)) * -2 - t3new.bbbbbb += np.transpose(tmp556, (0, 1, 2, 4, 3, 5)) * 2 - t3new.bbbbbb += np.transpose(tmp556, (1, 0, 2, 4, 3, 5)) * -2 - del tmp556 - t3new.bbbbbb += np.transpose(tmp552, (0, 2, 1, 5, 3, 4)) * 2 - t3new.bbbbbb += np.transpose(tmp552, (0, 2, 1, 3, 5, 4)) * -2 - del tmp552 - t3new.bbbbbb += np.transpose(tmp555, (2, 0, 1, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp555, (2, 1, 0, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp555, (0, 2, 1, 5, 4, 3)) * -2 - t3new.bbbbbb += np.transpose(tmp555, (1, 2, 0, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp555, (0, 1, 2, 5, 4, 3)) * 2 - t3new.bbbbbb += np.transpose(tmp555, (1, 0, 2, 5, 4, 3)) * -2 - del tmp555 - t3new.babbab = np.copy(np.transpose(tmp411, (2, 0, 1, 5, 3, 4))) * 2 - t3new.babbab += einsum(tmp414, (0, 1, 2, 3, 4, 5), t1.bb, (2, 6), (1, 0, 3, 5, 4, 6)) * -1 - del tmp414 - t3new.babbab += np.transpose(tmp415, (1, 0, 2, 5, 3, 4)) * 2 - del tmp415 - t3new.babbab += einsum(tmp417, (0, 1, 2, 3, 4, 5), t1.bb, (3, 6), (2, 0, 1, 5, 4, 6)) - del tmp417 - t3new.babbab += np.transpose(tmp411, (1, 0, 2, 5, 3, 4)) * -2 - del tmp411 - t3new.babbab += einsum(tmp418, (0, 1, 2, 3, 4, 5), t1.bb, (1, 6), (2, 0, 3, 5, 4, 6)) * -1 - del tmp418 - t3new.babbab += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), tmp419, (5, 6), (0, 1, 2, 6, 4, 3)) * -1 - del tmp419 - t3new.babbab += einsum(tmp317, (0, 1), t3.babbab, (2, 3, 4, 5, 6, 0), (2, 3, 4, 1, 6, 5)) * -1 - del tmp317 - t3new.babbab += np.transpose(tmp420, (2, 0, 1, 5, 3, 4)) * 2 - del tmp420 - t3new.babbab += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), f.bb.vv, (6, 5), (0, 1, 2, 3, 4, 6)) * 2 - t3new.babbab += np.transpose(tmp421, (2, 0, 1, 5, 3, 4)) * 2 - t3new.babbab += einsum(tmp425, (0, 1, 2, 3, 4, 5), t1.bb, (3, 6), (2, 0, 1, 5, 4, 6)) - del tmp425 - t3new.babbab += np.transpose(tmp426, (1, 0, 2, 5, 3, 4)) * 2 - del tmp426 - t3new.babbab += einsum(t1.bb, (0, 1), tmp428, (2, 3, 4, 0, 5, 6), (4, 2, 3, 6, 5, 1)) - del tmp428 - t3new.babbab += np.transpose(tmp421, (1, 0, 2, 5, 3, 4)) * -2 - del tmp421 - t3new.babbab += einsum(t1.bb, (0, 1), tmp429, (2, 3, 4, 0, 5, 6), (3, 2, 4, 6, 5, 1)) * -1 - del tmp429 - t3new.babbab += einsum(tmp430, (0, 1, 2, 3), t2.abab, (0, 4, 5, 6), (4, 1, 2, 3, 5, 6)) * -1 - del tmp430 - t3new.babbab += einsum(t2.abab, (0, 1, 2, 3), tmp432, (1, 4, 5, 6), (4, 0, 5, 6, 2, 3)) - del tmp432 - t3new.babbab += np.transpose(tmp433, (1, 0, 2, 5, 3, 4)) * 2 - del tmp433 - t3new.babbab += np.transpose(tmp434, (1, 0, 2, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp436, (1, 0, 2, 5, 3, 4)) * -2 - del tmp436 - t3new.babbab += np.transpose(tmp434, (2, 0, 1, 5, 3, 4)) * -1 - t3new.babbab += np.transpose(tmp438, (2, 0, 1, 4, 3, 5)) - t3new.babbab += einsum(t2.abab, (0, 1, 2, 3), tmp431, (1, 4, 5, 6), (5, 0, 4, 3, 2, 6)) * -2 - del tmp431 - t3new.babbab += einsum(t1.aa, (0, 1), tmp439, (0, 2, 3, 4, 5, 6), (3, 2, 4, 6, 1, 5)) * 2 - del tmp439 - t3new.babbab += np.transpose(tmp434, (1, 0, 2, 5, 3, 4)) - del tmp434 - t3new.babbab += np.transpose(tmp438, (1, 0, 2, 4, 3, 5)) * -1 - del tmp438 - t3new.babbab += np.transpose(tmp440, (1, 0, 2, 5, 3, 4)) - t3new.babbab += np.transpose(tmp441, (1, 0, 2, 5, 3, 4)) - t3new.babbab += np.transpose(tmp441, (2, 0, 1, 5, 3, 4)) * -1 - t3new.babbab += np.transpose(tmp442, (1, 0, 2, 5, 3, 4)) * 2 - t3new.babbab += np.transpose(tmp440, (2, 0, 1, 5, 3, 4)) * -1 - t3new.babbab += np.transpose(tmp442, (2, 0, 1, 5, 3, 4)) * -2 - del tmp442 - t3new.babbab += np.transpose(tmp440, (1, 0, 2, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp441, (1, 0, 2, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp441, (2, 0, 1, 4, 3, 5)) - del tmp441 - t3new.babbab += np.transpose(tmp440, (2, 0, 1, 4, 3, 5)) - del tmp440 - t3new.babbab += np.transpose(tmp443, (1, 0, 2, 5, 3, 4)) * -1 - t3new.babbab += einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 5, 6, 3), (4, 0, 5, 2, 1, 6)) * -2 - t3new.babbab += np.transpose(tmp444, (1, 0, 2, 5, 3, 4)) - t3new.babbab += einsum(tmp445, (0, 1, 2, 3), t2.abab, (4, 5, 6, 3), (5, 4, 0, 2, 6, 1)) - del tmp445 - t3new.babbab += np.transpose(tmp443, (2, 0, 1, 5, 3, 4)) - del tmp443 - t3new.babbab += np.transpose(tmp444, (2, 0, 1, 5, 3, 4)) * -1 - del tmp444 - t3new.babbab += einsum(tmp446, (0, 1, 2, 3), t2.abab, (4, 5, 6, 2), (0, 4, 5, 1, 6, 3)) - del tmp446 - t3new.babbab += np.transpose(tmp447, (1, 0, 2, 4, 3, 5)) - t3new.babbab += einsum(tmp448, (0, 1, 2, 3), t2.bbbb, (4, 5, 6, 2), (4, 0, 5, 6, 1, 3)) * 2 - del tmp448 - t3new.babbab += np.transpose(tmp447, (2, 0, 1, 4, 3, 5)) * -1 - del tmp447 - t3new.babbab += np.transpose(tmp449, (1, 0, 2, 4, 3, 5)) - t3new.babbab += np.transpose(tmp450, (1, 0, 2, 5, 3, 4)) * -2 - del tmp450 - t3new.babbab += np.transpose(tmp451, (1, 0, 2, 5, 3, 4)) - t3new.babbab += np.transpose(tmp449, (2, 0, 1, 5, 3, 4)) - del tmp449 - t3new.babbab += np.transpose(tmp451, (2, 0, 1, 4, 3, 5)) - del tmp451 - t3new.babbab += np.transpose(tmp452, (1, 0, 2, 5, 3, 4)) - t3new.babbab += np.transpose(tmp453, (1, 0, 2, 5, 3, 4)) - t3new.babbab += np.transpose(tmp457, (1, 0, 2, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp458, (2, 0, 1, 5, 3, 4)) * -2 - t3new.babbab += np.transpose(tmp460, (1, 0, 2, 5, 3, 4)) * -1 - t3new.babbab += np.transpose(tmp463, (1, 0, 2, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp463, (1, 0, 2, 5, 3, 4)) - t3new.babbab += einsum(tmp464, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (4, 0, 2, 3, 5, 6)) * -1 - del tmp464 - t3new.babbab += einsum(tmp355, (0, 1, 2, 3), t2.abab, (0, 4, 5, 6), (2, 1, 4, 3, 5, 6)) * -1 - del tmp355 - t3new.babbab += np.transpose(tmp465, (2, 0, 1, 5, 3, 4)) * 2 - t3new.babbab += np.transpose(tmp465, (1, 0, 2, 5, 3, 4)) * -2 - del tmp465 - t3new.babbab += np.transpose(tmp453, (2, 0, 1, 5, 3, 4)) * -1 - t3new.babbab += np.transpose(tmp457, (2, 0, 1, 4, 3, 5)) - del tmp457 - t3new.babbab += np.transpose(tmp452, (2, 0, 1, 5, 3, 4)) * -1 - t3new.babbab += np.transpose(tmp458, (1, 0, 2, 5, 3, 4)) * 2 - del tmp458 - t3new.babbab += np.transpose(tmp460, (2, 0, 1, 5, 3, 4)) - t3new.babbab += np.transpose(tmp463, (2, 0, 1, 4, 3, 5)) - t3new.babbab += np.transpose(tmp463, (2, 0, 1, 5, 3, 4)) * -1 - del tmp463 - t3new.babbab += np.transpose(tmp467, (1, 0, 2, 4, 3, 5)) - t3new.babbab += einsum(tmp468, (0, 1, 2, 3, 4, 5), t1.bb, (3, 6), (1, 0, 2, 6, 4, 5)) * 2 - del tmp468 - t3new.babbab += np.transpose(tmp467, (1, 0, 2, 5, 3, 4)) * -1 - t3new.babbab += np.transpose(tmp467, (2, 0, 1, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp467, (2, 0, 1, 5, 3, 4)) - del tmp467 - t3new.babbab += np.transpose(tmp452, (1, 0, 2, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp453, (1, 0, 2, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp469, (1, 0, 2, 4, 3, 5)) - t3new.babbab += np.transpose(tmp471, (1, 0, 2, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp460, (1, 0, 2, 4, 3, 5)) - t3new.babbab += np.transpose(tmp473, (1, 0, 2, 4, 3, 5)) * -1 - t3new.babbab += einsum(t1.aa, (0, 1), tmp474, (0, 2, 3, 4, 5, 6), (3, 2, 4, 5, 1, 6)) * -2 - del tmp474 - t3new.babbab += np.transpose(tmp475, (2, 0, 1, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp475, (1, 0, 2, 4, 3, 5)) - del tmp475 - t3new.babbab += np.transpose(tmp453, (2, 0, 1, 4, 3, 5)) - del tmp453 - t3new.babbab += np.transpose(tmp469, (2, 0, 1, 4, 3, 5)) * -1 - del tmp469 - t3new.babbab += np.transpose(tmp452, (2, 0, 1, 4, 3, 5)) - del tmp452 - t3new.babbab += np.transpose(tmp471, (2, 0, 1, 4, 3, 5)) - del tmp471 - t3new.babbab += np.transpose(tmp460, (2, 0, 1, 4, 3, 5)) * -1 - del tmp460 - t3new.babbab += np.transpose(tmp473, (2, 0, 1, 4, 3, 5)) - del tmp473 - t3new.babbab += einsum(t2.abab, (0, 1, 2, 3), tmp477, (4, 5, 2, 6), (1, 0, 4, 6, 5, 3)) * -1 - del tmp477 - t3new.babbab += einsum(t2.bbbb, (0, 1, 2, 3), tmp479, (4, 5, 3, 6), (0, 4, 1, 6, 5, 2)) * -2 - del tmp479 - t3new.babbab += np.transpose(tmp482, (2, 0, 1, 5, 3, 4)) * -1 - t3new.babbab += np.transpose(tmp482, (2, 0, 1, 4, 3, 5)) - t3new.babbab += np.transpose(tmp484, (2, 0, 1, 4, 3, 5)) * -1 - t3new.babbab += einsum(t2.abab, (0, 1, 2, 3), tmp485, (4, 2, 5, 6), (4, 0, 1, 6, 5, 3)) - del tmp485 - t3new.babbab += np.transpose(tmp482, (1, 0, 2, 5, 3, 4)) - t3new.babbab += np.transpose(tmp482, (1, 0, 2, 4, 3, 5)) * -1 - del tmp482 - t3new.babbab += np.transpose(tmp484, (1, 0, 2, 4, 3, 5)) - t3new.babbab += einsum(tmp487, (0, 1, 2, 3), t2.abab, (4, 5, 1, 6), (5, 4, 0, 6, 2, 3)) * -1 - del tmp487 - t3new.babbab += einsum(t2.bbbb, (0, 1, 2, 3), tmp488, (4, 5, 3, 6), (0, 4, 1, 2, 5, 6)) * 2 - del tmp488 - t3new.babbab += einsum(tmp489, (0, 1, 2, 3), t2.abab, (4, 5, 1, 6), (0, 4, 5, 6, 2, 3)) * -1 - del tmp489 - t3new.babbab += np.transpose(tmp490, (1, 0, 2, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp490, (1, 0, 2, 5, 3, 4)) - t3new.babbab += einsum(t2.abab, (0, 1, 2, 3), tmp492, (4, 5, 1, 6), (4, 0, 5, 3, 2, 6)) * -1 - del tmp492 - t3new.babbab += np.transpose(tmp493, (2, 0, 1, 5, 3, 4)) * -2 - t3new.babbab += np.transpose(tmp493, (1, 0, 2, 5, 3, 4)) * 2 - del tmp493 - t3new.babbab += einsum(tmp354, (0, 1, 2, 3), t2.abab, (0, 4, 5, 6), (4, 1, 2, 6, 5, 3)) - del tmp354 - t3new.babbab += np.transpose(tmp490, (2, 0, 1, 4, 3, 5)) - del tmp490 - t3new.babbab += einsum(tmp494, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (4, 0, 2, 3, 5, 6)) * -1 - del tmp494 - t3new.babbab += np.transpose(tmp495, (1, 0, 2, 4, 3, 5)) - t3new.babbab += np.transpose(tmp495, (2, 0, 1, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp496, (1, 0, 2, 5, 3, 4)) - t3new.babbab += np.transpose(tmp496, (2, 0, 1, 5, 3, 4)) * -1 - t3new.babbab += np.transpose(tmp498, (2, 0, 1, 5, 3, 4)) * -2 - t3new.babbab += einsum(tmp499, (0, 1, 2, 3), t2.abab, (1, 4, 5, 6), (2, 0, 4, 3, 5, 6)) * -1 - del tmp499 - t3new.babbab += np.transpose(tmp498, (1, 0, 2, 5, 3, 4)) * 2 - del tmp498 - t3new.babbab += np.transpose(tmp501, (2, 0, 1, 4, 3, 5)) - t3new.babbab += einsum(tmp502, (0, 1, 2, 3, 4, 5), t1.bb, (3, 6), (1, 0, 2, 6, 4, 5)) * 2 - del tmp502 - t3new.babbab += np.transpose(tmp501, (1, 0, 2, 4, 3, 5)) * -1 - del tmp501 - t3new.babbab += np.transpose(tmp503, (2, 0, 1, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp496, (1, 0, 2, 4, 3, 5)) * -1 - t3new.babbab += np.transpose(tmp496, (2, 0, 1, 4, 3, 5)) - del tmp496 - t3new.babbab += np.transpose(tmp484, (2, 0, 1, 5, 3, 4)) - t3new.babbab += np.transpose(tmp505, (2, 0, 1, 4, 3, 5)) * -1 - t3new.babbab += einsum(tmp506, (0, 1, 2, 3, 4, 5), t1.aa, (1, 6), (2, 0, 3, 4, 6, 5)) * -2 - del tmp506 - t3new.babbab += np.transpose(tmp503, (1, 0, 2, 4, 3, 5)) - del tmp503 - t3new.babbab += np.transpose(tmp484, (1, 0, 2, 5, 3, 4)) * -1 - del tmp484 - t3new.babbab += np.transpose(tmp505, (1, 0, 2, 4, 3, 5)) - del tmp505 - t3new.babbab += np.transpose(tmp507, (2, 0, 1, 5, 3, 4)) - t3new.babbab += np.transpose(tmp495, (1, 0, 2, 5, 3, 4)) * -1 - t3new.babbab += np.transpose(tmp495, (2, 0, 1, 5, 3, 4)) - del tmp495 - t3new.babbab += np.transpose(tmp507, (1, 0, 2, 5, 3, 4)) * -1 - del tmp507 - t3new.abaaba = np.copy(np.transpose(tmp308, (1, 2, 0, 4, 5, 3))) * 2 - t3new.abaaba += einsum(t1.aa, (0, 1), tmp311, (2, 0, 3, 4, 5, 6), (2, 4, 3, 5, 6, 1)) * -1 - del tmp311 - t3new.abaaba += np.transpose(tmp312, (0, 2, 1, 4, 5, 3)) * 2 - del tmp312 - t3new.abaaba += einsum(tmp314, (0, 1, 2, 3, 4, 5), t1.aa, (2, 6), (1, 3, 0, 4, 5, 6)) - del tmp314 - t3new.abaaba += np.transpose(tmp308, (0, 2, 1, 4, 5, 3)) * -2 - del tmp308 - t3new.abaaba += einsum(t1.aa, (0, 1), tmp315, (0, 2, 3, 4, 5, 6), (2, 4, 3, 5, 6, 1)) * -1 - del tmp315 - t3new.abaaba += einsum(tmp254, (0, 1), t3.abaaba, (2, 3, 4, 5, 6, 0), (2, 3, 4, 1, 6, 5)) * -1 - del tmp254 - t3new.abaaba += einsum(tmp256, (0, 1), t3.abaaba, (2, 3, 4, 5, 6, 0), (2, 3, 4, 1, 6, 5)) * -1 - del tmp256 - t3new.abaaba += np.transpose(tmp318, (1, 2, 0, 4, 5, 3)) * 2 - del tmp318 - t3new.abaaba += einsum(f.aa.vv, (0, 1), t3.abaaba, (2, 3, 4, 5, 6, 1), (2, 3, 4, 5, 6, 0)) * 2 - t3new.abaaba += np.transpose(tmp319, (1, 2, 0, 4, 5, 3)) * 2 - t3new.abaaba += einsum(tmp322, (0, 1, 2, 3, 4, 5), t1.aa, (2, 6), (1, 3, 0, 4, 5, 6)) - del tmp322 - t3new.abaaba += np.transpose(tmp324, (0, 2, 1, 4, 5, 3)) * 2 - del tmp324 - t3new.abaaba += einsum(tmp326, (0, 1, 2, 3, 4, 5), t1.aa, (2, 6), (1, 3, 0, 4, 5, 6)) - del tmp326 - t3new.abaaba += np.transpose(tmp319, (0, 2, 1, 4, 5, 3)) * -2 - del tmp319 - t3new.abaaba += einsum(t1.aa, (0, 1), tmp327, (2, 3, 0, 4, 5, 6), (2, 4, 3, 5, 6, 1)) * -1 - del tmp327 - t3new.abaaba += einsum(tmp330, (0, 1, 2, 3), t2.abab, (4, 1, 5, 6), (4, 2, 0, 3, 6, 5)) * -1 - del tmp330 - t3new.abaaba += einsum(tmp273, (0, 1, 2, 3), t2.abab, (0, 4, 5, 6), (1, 4, 2, 3, 6, 5)) - del tmp273 - t3new.abaaba += np.transpose(tmp332, (0, 2, 1, 4, 5, 3)) * 2 - del tmp332 - t3new.abaaba += np.transpose(tmp333, (0, 2, 1, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp336, (0, 2, 1, 4, 5, 3)) * -2 - del tmp336 - t3new.abaaba += np.transpose(tmp338, (1, 2, 0, 3, 5, 4)) - t3new.abaaba += np.transpose(tmp333, (1, 2, 0, 4, 5, 3)) * -1 - t3new.abaaba += einsum(t2.abab, (0, 1, 2, 3), tmp270, (0, 4, 5, 6), (5, 1, 4, 2, 3, 6)) * -2 - del tmp270 - t3new.abaaba += einsum(tmp340, (0, 1, 2, 3, 4, 5), t1.bb, (2, 6), (0, 3, 1, 5, 6, 4)) * 2 - del tmp340 - t3new.abaaba += np.transpose(tmp338, (0, 2, 1, 3, 5, 4)) * -1 - del tmp338 - t3new.abaaba += np.transpose(tmp333, (0, 2, 1, 4, 5, 3)) - del tmp333 - t3new.abaaba += np.transpose(tmp341, (0, 2, 1, 4, 5, 3)) - t3new.abaaba += np.transpose(tmp342, (0, 2, 1, 4, 5, 3)) - t3new.abaaba += np.transpose(tmp342, (1, 2, 0, 4, 5, 3)) * -1 - t3new.abaaba += np.transpose(tmp343, (0, 2, 1, 4, 5, 3)) * 2 - t3new.abaaba += np.transpose(tmp341, (1, 2, 0, 4, 5, 3)) * -1 - t3new.abaaba += np.transpose(tmp343, (1, 2, 0, 4, 5, 3)) * -2 - del tmp343 - t3new.abaaba += np.transpose(tmp341, (0, 2, 1, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp342, (0, 2, 1, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp342, (1, 2, 0, 3, 5, 4)) - del tmp342 - t3new.abaaba += np.transpose(tmp341, (1, 2, 0, 3, 5, 4)) - del tmp341 - t3new.abaaba += np.transpose(tmp344, (0, 2, 1, 4, 5, 3)) * -1 - t3new.abaaba += einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.vvov, (4, 3, 5, 6), (0, 5, 1, 4, 6, 2)) * -2 - t3new.abaaba += np.transpose(tmp345, (0, 2, 1, 4, 5, 3)) - t3new.abaaba += einsum(tmp282, (0, 1, 2, 3), t2.abab, (4, 5, 3, 6), (4, 5, 0, 2, 6, 1)) - del tmp282 - t3new.abaaba += np.transpose(tmp344, (1, 2, 0, 4, 5, 3)) - del tmp344 - t3new.abaaba += np.transpose(tmp345, (1, 2, 0, 4, 5, 3)) * -1 - del tmp345 - t3new.abaaba += einsum(tmp284, (0, 1, 2, 3), t2.abab, (4, 5, 2, 6), (0, 5, 4, 1, 6, 3)) - del tmp284 - t3new.abaaba += np.transpose(tmp346, (0, 2, 1, 3, 5, 4)) - t3new.abaaba += einsum(tmp347, (0, 1, 2, 3), t2.aaaa, (4, 5, 6, 1), (4, 0, 5, 6, 3, 2)) * 2 - del tmp347 - t3new.abaaba += np.transpose(tmp346, (1, 2, 0, 3, 5, 4)) * -1 - del tmp346 - t3new.abaaba += np.transpose(tmp348, (0, 2, 1, 3, 5, 4)) - t3new.abaaba += np.transpose(tmp349, (0, 2, 1, 4, 5, 3)) * -2 - del tmp349 - t3new.abaaba += np.transpose(tmp350, (0, 2, 1, 4, 5, 3)) - t3new.abaaba += np.transpose(tmp348, (1, 2, 0, 4, 5, 3)) - del tmp348 - t3new.abaaba += np.transpose(tmp350, (1, 2, 0, 3, 5, 4)) - del tmp350 - t3new.abaaba += np.transpose(tmp351, (0, 2, 1, 4, 5, 3)) - t3new.abaaba += np.transpose(tmp352, (0, 2, 1, 4, 5, 3)) - t3new.abaaba += np.transpose(tmp353, (0, 2, 1, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp356, (1, 2, 0, 4, 5, 3)) * -2 - t3new.abaaba += np.transpose(tmp358, (0, 2, 1, 4, 5, 3)) * -1 - t3new.abaaba += np.transpose(tmp361, (0, 2, 1, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp361, (0, 2, 1, 4, 5, 3)) - t3new.abaaba += einsum(t2.abab, (0, 1, 2, 3), tmp363, (4, 5, 1, 6), (0, 5, 4, 6, 3, 2)) * -1 - del tmp363 - t3new.abaaba += einsum(tmp364, (0, 1, 2, 3), t2.abab, (4, 1, 5, 6), (0, 2, 4, 3, 6, 5)) * -1 - del tmp364 - t3new.abaaba += np.transpose(tmp365, (1, 2, 0, 4, 5, 3)) * 2 - t3new.abaaba += np.transpose(tmp365, (0, 2, 1, 4, 5, 3)) * -2 - del tmp365 - t3new.abaaba += np.transpose(tmp352, (1, 2, 0, 4, 5, 3)) * -1 - t3new.abaaba += np.transpose(tmp353, (1, 2, 0, 3, 5, 4)) - del tmp353 - t3new.abaaba += np.transpose(tmp351, (1, 2, 0, 4, 5, 3)) * -1 - t3new.abaaba += np.transpose(tmp356, (0, 2, 1, 4, 5, 3)) * 2 - del tmp356 - t3new.abaaba += np.transpose(tmp358, (1, 2, 0, 4, 5, 3)) - t3new.abaaba += np.transpose(tmp361, (1, 2, 0, 3, 5, 4)) - t3new.abaaba += np.transpose(tmp361, (1, 2, 0, 4, 5, 3)) * -1 - del tmp361 - t3new.abaaba += np.transpose(tmp367, (0, 2, 1, 3, 5, 4)) - t3new.abaaba += einsum(tmp368, (0, 1, 2, 3, 4, 5), t1.aa, (2, 6), (0, 3, 1, 6, 5, 4)) * 2 - del tmp368 - t3new.abaaba += np.transpose(tmp367, (0, 2, 1, 4, 5, 3)) * -1 - t3new.abaaba += np.transpose(tmp367, (1, 2, 0, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp367, (1, 2, 0, 4, 5, 3)) - del tmp367 - t3new.abaaba += np.transpose(tmp351, (0, 2, 1, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp352, (0, 2, 1, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp369, (0, 2, 1, 3, 5, 4)) - t3new.abaaba += np.transpose(tmp371, (0, 2, 1, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp358, (0, 2, 1, 3, 5, 4)) - t3new.abaaba += np.transpose(tmp373, (0, 2, 1, 3, 5, 4)) * -1 - t3new.abaaba += einsum(tmp374, (0, 1, 2, 3, 4, 5), t1.bb, (2, 6), (0, 3, 1, 4, 6, 5)) * -2 - del tmp374 - t3new.abaaba += np.transpose(tmp375, (1, 2, 0, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp375, (0, 2, 1, 3, 5, 4)) - del tmp375 - t3new.abaaba += np.transpose(tmp352, (1, 2, 0, 3, 5, 4)) - del tmp352 - t3new.abaaba += np.transpose(tmp369, (1, 2, 0, 3, 5, 4)) * -1 - del tmp369 - t3new.abaaba += np.transpose(tmp351, (1, 2, 0, 3, 5, 4)) - del tmp351 - t3new.abaaba += np.transpose(tmp371, (1, 2, 0, 3, 5, 4)) - del tmp371 - t3new.abaaba += np.transpose(tmp358, (1, 2, 0, 3, 5, 4)) * -1 - del tmp358 - t3new.abaaba += np.transpose(tmp373, (1, 2, 0, 3, 5, 4)) - del tmp373 - t3new.abaaba += einsum(tmp378, (0, 1, 2, 3), t2.abab, (4, 5, 6, 3), (4, 5, 0, 1, 2, 6)) * -1 - del tmp378 - t3new.abaaba += einsum(tmp380, (0, 1, 2, 3), t2.aaaa, (4, 5, 6, 1), (4, 0, 5, 2, 3, 6)) * -2 - del tmp380 - t3new.abaaba += np.transpose(tmp383, (1, 2, 0, 4, 5, 3)) * -1 - t3new.abaaba += np.transpose(tmp383, (1, 2, 0, 3, 5, 4)) - t3new.abaaba += np.transpose(tmp385, (1, 2, 0, 3, 5, 4)) * -1 - t3new.abaaba += einsum(tmp386, (0, 1, 2, 3), t2.abab, (4, 5, 6, 2), (0, 5, 4, 1, 3, 6)) - del tmp386 - t3new.abaaba += np.transpose(tmp383, (0, 2, 1, 4, 5, 3)) - t3new.abaaba += np.transpose(tmp383, (0, 2, 1, 3, 5, 4)) * -1 - del tmp383 - t3new.abaaba += np.transpose(tmp385, (0, 2, 1, 3, 5, 4)) - t3new.abaaba += einsum(t2.abab, (0, 1, 2, 3), tmp388, (4, 5, 3, 6), (0, 1, 4, 2, 6, 5)) * -1 - del tmp388 - t3new.abaaba += einsum(tmp389, (0, 1, 2, 3), t2.aaaa, (4, 5, 6, 1), (4, 0, 5, 6, 3, 2)) * 2 - del tmp389 - t3new.abaaba += einsum(tmp390, (0, 1, 2, 3), t2.abab, (4, 5, 6, 2), (0, 5, 4, 6, 3, 1)) * -1 - del tmp390 - t3new.abaaba += np.transpose(tmp392, (0, 2, 1, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp392, (0, 2, 1, 4, 5, 3)) - t3new.abaaba += einsum(t2.abab, (0, 1, 2, 3), tmp268, (4, 5, 0, 6), (4, 1, 5, 2, 3, 6)) * -1 - del tmp268 - t3new.abaaba += np.transpose(tmp394, (1, 2, 0, 4, 5, 3)) * -2 - t3new.abaaba += np.transpose(tmp394, (0, 2, 1, 4, 5, 3)) * 2 - del tmp394 - t3new.abaaba += einsum(t2.abab, (0, 1, 2, 3), tmp362, (4, 1, 5, 6), (0, 5, 4, 2, 3, 6)) - del tmp362 - t3new.abaaba += np.transpose(tmp392, (1, 2, 0, 3, 5, 4)) - del tmp392 - t3new.abaaba += einsum(tmp396, (0, 1, 2, 3), t2.abab, (4, 2, 5, 6), (4, 1, 0, 3, 6, 5)) * -1 - del tmp396 - t3new.abaaba += np.transpose(tmp397, (0, 2, 1, 3, 5, 4)) - t3new.abaaba += np.transpose(tmp397, (1, 2, 0, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp398, (0, 2, 1, 4, 5, 3)) - t3new.abaaba += np.transpose(tmp398, (1, 2, 0, 4, 5, 3)) * -1 - t3new.abaaba += np.transpose(tmp401, (1, 2, 0, 4, 5, 3)) * -2 - t3new.abaaba += einsum(t2.abab, (0, 1, 2, 3), tmp402, (4, 5, 1, 6), (4, 5, 0, 6, 3, 2)) * -1 - del tmp402 - t3new.abaaba += np.transpose(tmp401, (0, 2, 1, 4, 5, 3)) * 2 - del tmp401 - t3new.abaaba += np.transpose(tmp404, (1, 2, 0, 3, 5, 4)) - t3new.abaaba += einsum(t1.aa, (0, 1), tmp405, (2, 3, 0, 4, 5, 6), (2, 4, 3, 1, 6, 5)) * 2 - del tmp405 - t3new.abaaba += np.transpose(tmp404, (0, 2, 1, 3, 5, 4)) * -1 - del tmp404 - t3new.abaaba += np.transpose(tmp406, (1, 2, 0, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp398, (0, 2, 1, 3, 5, 4)) * -1 - t3new.abaaba += np.transpose(tmp398, (1, 2, 0, 3, 5, 4)) - del tmp398 - t3new.abaaba += np.transpose(tmp385, (1, 2, 0, 4, 5, 3)) - t3new.abaaba += np.transpose(tmp408, (1, 2, 0, 3, 5, 4)) * -1 - t3new.abaaba += einsum(tmp409, (0, 1, 2, 3, 4, 5), t1.bb, (3, 6), (0, 2, 1, 4, 6, 5)) * -2 - del tmp409 - t3new.abaaba += np.transpose(tmp406, (0, 2, 1, 3, 5, 4)) - del tmp406 - t3new.abaaba += np.transpose(tmp385, (0, 2, 1, 4, 5, 3)) * -1 - del tmp385 - t3new.abaaba += np.transpose(tmp408, (0, 2, 1, 3, 5, 4)) - del tmp408 - t3new.abaaba += np.transpose(tmp410, (1, 2, 0, 4, 5, 3)) - t3new.abaaba += np.transpose(tmp397, (0, 2, 1, 4, 5, 3)) * -1 - t3new.abaaba += np.transpose(tmp397, (1, 2, 0, 4, 5, 3)) - del tmp397 - t3new.abaaba += np.transpose(tmp410, (0, 2, 1, 4, 5, 3)) * -1 - del tmp410 - t3new.aaaaaa = np.copy(np.transpose(tmp243, (1, 2, 0, 4, 5, 3))) * -6 - t3new.aaaaaa += np.transpose(tmp245, (1, 0, 2, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp248, (0, 1, 2, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp248, (0, 1, 2, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp243, (1, 0, 2, 4, 5, 3)) * 6 - t3new.aaaaaa += np.transpose(tmp245, (1, 2, 0, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp248, (0, 2, 1, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp248, (0, 2, 1, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp243, (0, 2, 1, 4, 5, 3)) * 6 - del tmp243 - t3new.aaaaaa += np.transpose(tmp248, (2, 1, 0, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp248, (2, 1, 0, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp252, (2, 1, 0, 4, 3, 5)) * 2 - del tmp252 - t3new.aaaaaa += np.transpose(tmp255, (1, 2, 0, 3, 4, 5)) * 2 - del tmp255 - t3new.aaaaaa += np.transpose(tmp257, (1, 2, 0, 4, 3, 5)) * -6 - del tmp257 - t3new.aaaaaa += np.transpose(tmp258, (0, 1, 2, 5, 4, 3)) * -6 - del tmp258 - t3new.aaaaaa += np.transpose(tmp260, (1, 2, 0, 4, 5, 3)) * -6 - t3new.aaaaaa += np.transpose(tmp263, (1, 2, 0, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp263, (1, 2, 0, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp266, (1, 2, 0, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp260, (1, 0, 2, 4, 5, 3)) * 6 - t3new.aaaaaa += np.transpose(tmp263, (1, 0, 2, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp263, (1, 0, 2, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp266, (1, 0, 2, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp260, (0, 2, 1, 4, 5, 3)) * 6 - del tmp260 - t3new.aaaaaa += np.transpose(tmp263, (0, 2, 1, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp263, (0, 2, 1, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp269, (0, 1, 2, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp272, (2, 0, 1, 3, 5, 4)) * -1 - t3new.aaaaaa += np.transpose(tmp274, (2, 0, 1, 3, 5, 4)) * -1 - t3new.aaaaaa += np.transpose(tmp274, (0, 2, 1, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp274, (2, 0, 1, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp274, (0, 2, 1, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp272, (0, 1, 2, 3, 5, 4)) * -1 - del tmp272 - t3new.aaaaaa += np.transpose(tmp274, (0, 1, 2, 3, 5, 4)) * -1 - t3new.aaaaaa += np.transpose(tmp274, (0, 1, 2, 5, 3, 4)) * 2 - del tmp274 - t3new.aaaaaa += np.transpose(tmp275, (2, 1, 0, 5, 4, 3)) * 4 - t3new.aaaaaa += np.transpose(tmp277, (2, 1, 0, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp248, (2, 1, 0, 3, 4, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp248, (2, 1, 0, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp277, (2, 1, 0, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp275, (0, 2, 1, 5, 4, 3)) * 4 - t3new.aaaaaa += np.transpose(tmp277, (0, 2, 1, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp248, (0, 2, 1, 3, 4, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp248, (0, 2, 1, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp277, (0, 2, 1, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp275, (0, 1, 2, 5, 4, 3)) * -4 - del tmp275 - t3new.aaaaaa += np.transpose(tmp277, (0, 1, 2, 5, 3, 4)) * -2 - t3new.aaaaaa += tmp248 * -2 - t3new.aaaaaa += np.transpose(tmp248, (0, 1, 2, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp277, (0, 1, 2, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp278, (0, 1, 2, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp278, (0, 2, 1, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp278, (1, 0, 2, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp278, (2, 0, 1, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp278, (0, 1, 2, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp278, (0, 2, 1, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp278, (1, 0, 2, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp278, (2, 0, 1, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp278, (1, 2, 0, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp278, (2, 1, 0, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp278, (1, 2, 0, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp278, (2, 1, 0, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp278, (0, 1, 2, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp278, (0, 2, 1, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp278, (1, 0, 2, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp278, (2, 0, 1, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp278, (1, 2, 0, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp278, (2, 1, 0, 4, 3, 5)) * -2 - del tmp278 - t3new.aaaaaa += np.transpose(tmp279, (0, 1, 2, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp281, (2, 1, 0, 3, 4, 5)) * -1 - t3new.aaaaaa += np.transpose(tmp279, (0, 2, 1, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp283, (2, 0, 1, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp279, (0, 1, 2, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp285, (2, 1, 0, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp279, (0, 2, 1, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp283, (2, 0, 1, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp279, (2, 1, 0, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp281, (0, 2, 1, 3, 4, 5)) * -1 - del tmp281 - t3new.aaaaaa += np.transpose(tmp279, (2, 1, 0, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp285, (0, 2, 1, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp279, (0, 1, 2, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp285, (2, 1, 0, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp279, (0, 2, 1, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp283, (2, 0, 1, 5, 4, 3)) * -2 - del tmp283 - t3new.aaaaaa += np.transpose(tmp279, (2, 1, 0, 3, 5, 4)) * -2 - del tmp279 - t3new.aaaaaa += np.transpose(tmp285, (0, 2, 1, 5, 3, 4)) * -2 - del tmp285 - t3new.aaaaaa += np.transpose(tmp245, (0, 1, 2, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp245, (1, 0, 2, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp245, (0, 1, 2, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp245, (1, 0, 2, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp245, (0, 2, 1, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp245, (0, 1, 2, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp245, (2, 0, 1, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp245, (1, 2, 0, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp245, (1, 2, 0, 5, 3, 4)) * -2 - del tmp245 - t3new.aaaaaa += np.transpose(tmp286, (1, 0, 2, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp289, (2, 0, 1, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp286, (0, 1, 2, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp289, (0, 2, 1, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp286, (1, 0, 2, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp289, (2, 0, 1, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp286, (0, 1, 2, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp289, (0, 2, 1, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp277, (0, 1, 2, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp248, (0, 1, 2, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp248, (0, 1, 2, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp277, (0, 2, 1, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp248, (0, 2, 1, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp248, (0, 2, 1, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp286, (1, 2, 0, 5, 4, 3)) * -2 - t3new.aaaaaa += einsum(tmp291, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 6), (4, 1, 0, 3, 5, 6)) * -1 - del tmp291 - t3new.aaaaaa += np.transpose(tmp294, (2, 1, 0, 3, 5, 4)) * -1 - t3new.aaaaaa += np.transpose(tmp286, (0, 2, 1, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp289, (0, 1, 2, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp286, (1, 2, 0, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp294, (2, 1, 0, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp286, (0, 2, 1, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp289, (0, 1, 2, 5, 3, 4)) * -2 - del tmp289 - t3new.aaaaaa += np.transpose(tmp286, (2, 1, 0, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp294, (1, 2, 0, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp286, (2, 0, 1, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp294, (1, 0, 2, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp286, (2, 1, 0, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp294, (1, 2, 0, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp286, (2, 0, 1, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp294, (1, 0, 2, 5, 3, 4)) * 2 - del tmp294 - t3new.aaaaaa += np.transpose(tmp277, (2, 1, 0, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp248, (2, 1, 0, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp248, (2, 1, 0, 4, 5, 3)) * 2 - del tmp248 - t3new.aaaaaa += np.transpose(tmp296, (0, 1, 2, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp296, (0, 2, 1, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp277, (0, 1, 2, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp277, (0, 2, 1, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp296, (2, 1, 0, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp277, (2, 1, 0, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp286, (1, 0, 2, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp297, (1, 0, 2, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp286, (0, 1, 2, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp297, (0, 1, 2, 4, 3, 5)) * 2 - t3new.aaaaaa += tmp296 * 2 - t3new.aaaaaa += tmp277 * -2 - t3new.aaaaaa += np.transpose(tmp296, (0, 2, 1, 3, 4, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp277, (0, 2, 1, 3, 4, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp296, (0, 1, 2, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp277, (0, 1, 2, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp296, (0, 2, 1, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp277, (0, 2, 1, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp286, (1, 2, 0, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp297, (1, 2, 0, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp286, (0, 2, 1, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp297, (0, 2, 1, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp286, (2, 1, 0, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp297, (2, 1, 0, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp286, (2, 0, 1, 4, 3, 5)) * -2 - del tmp286 - t3new.aaaaaa += np.transpose(tmp297, (2, 0, 1, 4, 3, 5)) * 2 - del tmp297 - t3new.aaaaaa += np.transpose(tmp296, (2, 1, 0, 3, 4, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp277, (2, 1, 0, 3, 4, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp296, (2, 1, 0, 4, 3, 5)) * 2 - del tmp296 - t3new.aaaaaa += np.transpose(tmp277, (2, 1, 0, 4, 3, 5)) * -2 - del tmp277 - t3new.aaaaaa += np.transpose(tmp263, (1, 2, 0, 3, 4, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp263, (1, 2, 0, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp298, (1, 2, 0, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp298, (1, 2, 0, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp300, (1, 2, 0, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp263, (1, 0, 2, 3, 4, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp263, (1, 0, 2, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp298, (1, 0, 2, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp298, (1, 0, 2, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp300, (1, 0, 2, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp263, (1, 2, 0, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp263, (1, 2, 0, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp298, (1, 2, 0, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp298, (1, 2, 0, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp300, (1, 2, 0, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp263, (1, 0, 2, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp263, (1, 0, 2, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp298, (1, 0, 2, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp298, (1, 0, 2, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp300, (1, 0, 2, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp263, (0, 2, 1, 3, 4, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp263, (0, 2, 1, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp298, (0, 2, 1, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp298, (0, 2, 1, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp300, (0, 2, 1, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp263, (0, 2, 1, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp263, (0, 2, 1, 4, 5, 3)) * 2 - del tmp263 - t3new.aaaaaa += np.transpose(tmp298, (0, 2, 1, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp298, (0, 2, 1, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp300, (0, 2, 1, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp298, (1, 2, 0, 3, 4, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp298, (1, 2, 0, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp300, (1, 2, 0, 3, 4, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp298, (1, 0, 2, 3, 4, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp298, (1, 0, 2, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp300, (1, 0, 2, 3, 4, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp298, (0, 2, 1, 3, 4, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp298, (0, 2, 1, 3, 5, 4)) * -2 - del tmp298 - t3new.aaaaaa += np.transpose(tmp300, (0, 2, 1, 3, 4, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp269, (2, 0, 1, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp269, (0, 2, 1, 5, 4, 3)) * 2 - del tmp269 - t3new.aaaaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp302, (4, 5, 1, 6), (0, 5, 4, 2, 3, 6)) - del tmp302 - t3new.aaaaaa += np.transpose(tmp266, (2, 1, 0, 5, 4, 3)) - del tmp266 - t3new.aaaaaa += np.transpose(tmp303, (2, 0, 1, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp303, (2, 1, 0, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp304, (2, 0, 1, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp304, (2, 1, 0, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp303, (0, 2, 1, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp303, (1, 2, 0, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp304, (0, 2, 1, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp304, (1, 2, 0, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp303, (2, 0, 1, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp303, (2, 1, 0, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp304, (2, 0, 1, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp304, (2, 1, 0, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp303, (0, 2, 1, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp303, (1, 2, 0, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp304, (0, 2, 1, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp304, (1, 2, 0, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp303, (0, 1, 2, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp303, (1, 0, 2, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp304, (0, 1, 2, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp304, (1, 0, 2, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp303, (0, 1, 2, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp303, (1, 0, 2, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp304, (0, 1, 2, 4, 5, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp304, (1, 0, 2, 4, 5, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp307, (1, 2, 0, 5, 4, 3)) - t3new.aaaaaa += np.transpose(tmp300, (1, 0, 2, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp307, (0, 2, 1, 5, 4, 3)) * -1 - del tmp307 - t3new.aaaaaa += np.transpose(tmp304, (2, 0, 1, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp304, (2, 1, 0, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp304, (0, 2, 1, 4, 3, 5)) * -2 - t3new.aaaaaa += np.transpose(tmp304, (1, 2, 0, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp300, (1, 2, 0, 5, 3, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp300, (1, 0, 2, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp300, (1, 2, 0, 3, 5, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp300, (1, 0, 2, 3, 5, 4)) * -2 - t3new.aaaaaa += np.transpose(tmp304, (0, 1, 2, 4, 3, 5)) * 2 - t3new.aaaaaa += np.transpose(tmp304, (1, 0, 2, 4, 3, 5)) * -2 - del tmp304 - t3new.aaaaaa += np.transpose(tmp300, (0, 2, 1, 5, 3, 4)) * 2 - t3new.aaaaaa += np.transpose(tmp300, (0, 2, 1, 3, 5, 4)) * -2 - del tmp300 - t3new.aaaaaa += np.transpose(tmp303, (2, 0, 1, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp303, (2, 1, 0, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp303, (0, 2, 1, 5, 4, 3)) * -2 - t3new.aaaaaa += np.transpose(tmp303, (1, 2, 0, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp303, (0, 1, 2, 5, 4, 3)) * 2 - t3new.aaaaaa += np.transpose(tmp303, (1, 0, 2, 5, 4, 3)) * -2 - del tmp303 - t2new.bbbb = np.copy(np.transpose(tmp175, (1, 0, 3, 2))) * 2 - del tmp175 - t2new.bbbb += tmp177 - t2new.bbbb += np.transpose(tmp178, (0, 1, 3, 2)) * 6 - t2new.bbbb += np.transpose(tmp179, (0, 1, 3, 2)) * 2 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp32, (1, 4), (0, 4, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp182, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp177, (0, 1, 3, 2)) * -1 - del tmp177 - t2new.bbbb += np.transpose(tmp178, (1, 0, 3, 2)) * -6 - del tmp178 - t2new.bbbb += np.transpose(tmp179, (1, 0, 3, 2)) * -2 - del tmp179 - t2new.bbbb += tmp183 * 2 - del tmp183 - t2new.bbbb += einsum(tmp9, (0, 1), t3.babbab, (2, 0, 3, 4, 1, 5), (2, 3, 4, 5)) - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp124, (4, 3), (0, 1, 2, 4)) * -4 - t2new.bbbb += np.transpose(tmp182, (1, 0, 3, 2)) * 2 - del tmp182 - t2new.bbbb += einsum(tmp184, (0, 1), t3.babbab, (2, 0, 3, 4, 1, 5), (2, 3, 4, 5)) - del tmp184 - t2new.bbbb += np.transpose(tmp185, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp186, (1, 0, 3, 2)) - t2new.bbbb += tmp188 * -1 - t2new.bbbb += np.transpose(tmp189, (1, 0, 3, 2)) * -1 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp193, (3, 4), (0, 1, 4, 2)) * 2 - del tmp193 - t2new.bbbb += np.transpose(tmp185, (1, 0, 2, 3)) * -2 - t2new.bbbb += np.transpose(tmp186, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp188, (0, 1, 3, 2)) - del tmp188 - t2new.bbbb += np.transpose(tmp189, (1, 0, 2, 3)) - del tmp189 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp194, (3, 4), (0, 1, 2, 4)) * -2 - del tmp194 - t2new.bbbb += np.transpose(tmp195, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp196, (1, 0, 3, 2)) * 6 - t2new.bbbb += np.transpose(tmp198, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp200, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp202, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp202, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp204, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp200, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp195, (0, 1, 3, 2)) * -2 - del tmp195 - t2new.bbbb += np.transpose(tmp196, (0, 1, 3, 2)) * -6 - del tmp196 - t2new.bbbb += np.transpose(tmp198, (0, 1, 3, 2)) * 2 - del tmp198 - t2new.bbbb += np.transpose(tmp200, (0, 1, 3, 2)) * -1 - t2new.bbbb += tmp202 * -1 - t2new.bbbb += np.transpose(tmp202, (0, 1, 3, 2)) - del tmp202 - t2new.bbbb += np.transpose(tmp204, (0, 1, 3, 2)) * 2 - del tmp204 - t2new.bbbb += tmp200 - del tmp200 - t2new.bbbb += np.transpose(tmp205, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp206, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp208, (4, 1, 5, 3), (0, 4, 5, 2)) * 2 - del tmp208 - t2new.bbbb += np.transpose(tmp210, (1, 0, 2, 3)) - t2new.bbbb += tmp205 * -1 - t2new.bbbb += np.transpose(tmp206, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 3, 1)) * -1 - t2new.bbbb += tmp216 * -2 - t2new.bbbb += np.transpose(tmp217, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp218, (0, 1, 3, 2)) - t2new.bbbb += tmp219 * 2 - t2new.bbbb += np.transpose(tmp219, (1, 0, 3, 2)) * 2 - t2new.bbbb += einsum(tmp222, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * -2 - del tmp222 - t2new.bbbb += einsum(tmp223, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) * -1 - del tmp223 - t2new.bbbb += np.transpose(tmp218, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp219, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp219, (1, 0, 2, 3)) * -2 - del tmp219 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp225, (4, 1, 5, 3), (0, 4, 5, 2)) * 2 - del tmp225 - t2new.bbbb += einsum(t2.abab, (0, 1, 2, 3), tmp226, (0, 4, 2, 5), (1, 4, 5, 3)) - del tmp226 - t2new.bbbb += tmp218 * -1 - t2new.bbbb += np.transpose(tmp228, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp230, (0, 1, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp218, (1, 0, 2, 3)) - del tmp218 - t2new.bbbb += np.transpose(tmp228, (0, 1, 3, 2)) * -1 - del tmp228 - t2new.bbbb += np.transpose(tmp230, (1, 0, 3, 2)) * -2 - del tmp230 - t2new.bbbb += np.transpose(tmp232, (0, 1, 3, 2)) * -2 - del tmp232 - t2new.bbbb += np.transpose(tmp205, (0, 1, 3, 2)) - t2new.bbbb += tmp234 - t2new.bbbb += np.transpose(tmp234, (0, 1, 3, 2)) * -1 - del tmp234 - t2new.bbbb += tmp236 - t2new.bbbb += np.transpose(tmp236, (0, 1, 3, 2)) * -1 - del tmp236 - t2new.bbbb += np.transpose(tmp238, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp238, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp240, (0, 1, 3, 2)) * -2 - del tmp240 - t2new.bbbb += np.transpose(tmp205, (1, 0, 3, 2)) * -1 - del tmp205 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp241, (2, 4, 5, 3), (0, 1, 5, 4)) * 2 - del tmp241 - t2new.bbbb += np.transpose(tmp186, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp185, (0, 1, 3, 2)) * -2 - t2new.bbbb += tmp186 - del tmp186 - t2new.bbbb += tmp185 * 2 - del tmp185 - t2new.bbbb += np.transpose(tmp206, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp216, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp210, (1, 0, 3, 2)) * -1 - del tmp210 - t2new.bbbb += tmp206 * -1 - del tmp206 - t2new.bbbb += np.transpose(tmp216, (0, 1, 3, 2)) * 2 - del tmp216 - t2new.bbbb += np.transpose(tmp217, (1, 0, 2, 3)) * -1 - del tmp217 - t2new.bbbb += einsum(t1.bb, (0, 1), tmp242, (2, 3, 0, 4), (2, 3, 1, 4)) * -2 - del tmp242 - t2new.bbbb += tmp238 * -1 - t2new.bbbb += np.transpose(tmp238, (1, 0, 2, 3)) - del tmp238 - t2new.abab = einsum(v.aabb.ovoo, (0, 1, 2, 3), t3.abaaba, (4, 3, 0, 5, 6, 1), (4, 2, 5, 6)) * -2 - t2new.abab += tmp119 * -2 - del tmp119 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp32, (1, 4), (0, 4, 2, 3)) * -1 - t2new.abab += einsum(v.aabb.oooo, (0, 1, 2, 3), tmp120, (1, 3, 4, 5), (0, 2, 4, 5)) * 0.5 - del tmp120 - t2new.abab += tmp121 * -2 - del tmp121 - t2new.abab += einsum(v.aaaa.ooov, (0, 1, 2, 3), t3.abaaba, (1, 4, 2, 5, 6, 3), (0, 4, 5, 6)) * -2 - t2new.abab += einsum(v.aabb.oooo, (0, 1, 2, 3), t2.abab, (1, 3, 4, 5), (0, 2, 4, 5)) * 0.5 - t2new.abab += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), tmp16, (2, 5), (1, 0, 4, 3)) - t2new.abab += einsum(tmp9, (0, 1), t3.abaaba, (2, 3, 0, 4, 5, 1), (2, 3, 4, 5)) * 2 - t2new.abab += einsum(tmp124, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 4, 0)) * -2 - del tmp124 - t2new.abab += einsum(tmp39, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -1 - del tmp39 - t2new.abab += tmp125 * 2 - del tmp125 - t2new.abab += einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - t2new.abab += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), tmp126, (2, 6, 5, 3), (0, 1, 6, 4)) * -2 - del tmp126 - t2new.abab += einsum(tmp55, (0, 1, 2, 3), t3.babbab, (4, 5, 0, 6, 1, 3), (5, 4, 2, 6)) * 2 - del tmp55 - t2new.abab += einsum(tmp61, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1 - t2new.abab += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), tmp128, (2, 6, 3, 5), (1, 0, 4, 6)) * 2 - del tmp128 - t2new.abab += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), tmp130, (2, 5, 4, 6), (0, 1, 3, 6)) * 2 - del tmp130 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp133, (3, 4), (0, 1, 2, 4)) - del tmp133 - t2new.abab += einsum(tmp48, (0, 1), t3.babbab, (2, 3, 0, 4, 5, 1), (3, 2, 5, 4)) - t2new.abab += tmp134 * -2 - del tmp134 - t2new.abab += einsum(tmp22, (0, 1, 2, 3), t3.abaaba, (4, 2, 0, 5, 6, 3), (4, 1, 5, 6)) * -2 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp27, (1, 4), (0, 4, 2, 3)) * -1 - t2new.abab += einsum(tmp3, (0, 1, 2, 3), tmp135, (0, 4, 5, 1), (4, 5, 2, 3)) - del tmp135 - t2new.abab += einsum(tmp2, (0, 1, 2, 3), t3.abaaba, (2, 4, 1, 5, 6, 3), (0, 4, 5, 6)) * -2 - t2new.abab += einsum(t1.bb, (0, 1), tmp136, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - del tmp136 - t2new.abab += tmp137 * -2 - del tmp137 - t2new.abab += einsum(tmp11, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -1 - t2new.abab += einsum(tmp3, (0, 1, 2, 3), tmp138, (4, 0, 1, 5), (4, 5, 2, 3)) - del tmp138 - t2new.abab += tmp139 * -1 - del tmp139 - t2new.abab += tmp140 - del tmp140 - t2new.abab += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - t2new.abab += einsum(tmp143, (0, 1, 2, 3), t2.abab, (4, 1, 2, 5), (4, 0, 3, 5)) * -1 - del tmp143 - t2new.abab += tmp144 * -1 - del tmp144 - t2new.abab += einsum(tmp146, (0, 1, 2, 3), t2.abab, (4, 0, 2, 5), (4, 1, 3, 5)) - del tmp146 - t2new.abab += tmp95 * -1 - del tmp95 - t2new.abab += einsum(tmp148, (0, 1, 2, 3), t2.abab, (0, 4, 5, 2), (1, 4, 5, 3)) * -1 - del tmp148 - t2new.abab += einsum(t1.bb, (0, 1), tmp149, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - del tmp149 - t2new.abab += einsum(tmp151, (0, 1, 2, 3), t1.aa, (4, 1), (4, 0, 2, 3)) - del tmp151 - t2new.abab += einsum(tmp3, (0, 1, 2, 3), tmp152, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp152 - t2new.abab += einsum(tmp153, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) * -1 - del tmp153 - t2new.abab += einsum(tmp155, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp155 - t2new.abab += tmp154 * 2 - del tmp154 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - t2new.abab += einsum(t1.bb, (0, 1), tmp156, (2, 3, 0, 4), (2, 3, 4, 1)) * -2 - del tmp156 - t2new.abab += einsum(tmp158, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) * -1 - del tmp158 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp159, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp159 - t2new.abab += einsum(tmp161, (0, 1, 2, 3), t2.abab, (4, 5, 0, 2), (4, 5, 1, 3)) - del tmp161 - t2new.abab += einsum(tmp163, (0, 1, 2, 3), t2.abab, (1, 4, 2, 5), (0, 4, 3, 5)) - del tmp163 - t2new.abab += einsum(tmp87, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp87 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp167, (4, 1, 3, 5), (0, 4, 2, 5)) - del tmp167 - t2new.abab += einsum(t2.aaaa, (0, 1, 2, 3), tmp168, (1, 4, 3, 5), (0, 4, 2, 5)) * 2 - del tmp168 - t2new.abab += tmp78 * -1 - del tmp78 - t2new.abab += einsum(tmp171, (0, 1, 2, 3), t2.abab, (1, 4, 5, 2), (0, 4, 5, 3)) * -1 - del tmp171 - t2new.abab += einsum(tmp172, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - del tmp172 - t2new.abab += einsum(tmp173, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - del tmp173 - t2new.abab += einsum(t1.aa, (0, 1), tmp174, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp174 - t2new.aaaa = np.copy(np.transpose(tmp33, (0, 1, 3, 2))) * 6 - t2new.aaaa += np.transpose(tmp34, (0, 1, 3, 2)) * 2 - t2new.aaaa += einsum(tmp20, (0, 1), t2.aaaa, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - t2new.aaaa += einsum(tmp35, (0, 1, 2, 3), v.aaaa.oooo, (4, 1, 5, 0), (4, 5, 3, 2)) * 0.5 - del tmp35 - t2new.aaaa += np.transpose(tmp36, (1, 0, 3, 2)) - del tmp36 - t2new.aaaa += np.transpose(tmp40, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp33, (1, 0, 3, 2)) * -6 - del tmp33 - t2new.aaaa += np.transpose(tmp34, (1, 0, 3, 2)) * -2 - del tmp34 - t2new.aaaa += einsum(tmp16, (0, 1), t3.abaaba, (2, 0, 3, 4, 1, 5), (2, 3, 4, 5)) - t2new.aaaa += tmp41 * 2 - del tmp41 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp44, (4, 3), (0, 1, 2, 4)) * -2 - del tmp44 - t2new.aaaa += np.transpose(tmp40, (1, 0, 3, 2)) * 2 - del tmp40 - t2new.aaaa += einsum(v.aaaa.oooo, (0, 1, 2, 3), tmp45, (3, 1, 4, 5), (0, 2, 5, 4)) * -0.5 - del tmp45 - t2new.aaaa += einsum(tmp48, (0, 1), t3.abaaba, (2, 0, 3, 4, 1, 5), (2, 3, 4, 5)) - del tmp48 - t2new.aaaa += np.transpose(tmp49, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp50, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp53, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp56, (1, 0, 3, 2)) * -1 - t2new.aaaa += einsum(tmp61, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 1, 4)) * 2 - del tmp61 - t2new.aaaa += np.transpose(tmp49, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp50, (1, 0, 2, 3)) * -2 - t2new.aaaa += tmp53 * -1 - del tmp53 - t2new.aaaa += np.transpose(tmp56, (1, 0, 2, 3)) - del tmp56 - t2new.aaaa += einsum(tmp62, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 4, 1)) * -2 - del tmp62 - t2new.aaaa += np.transpose(tmp63, (1, 0, 3, 2)) * 6 - t2new.aaaa += np.transpose(tmp65, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp67, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp68, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp70, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(tmp70, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp72, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp67, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp63, (0, 1, 3, 2)) * -6 - del tmp63 - t2new.aaaa += np.transpose(tmp65, (0, 1, 3, 2)) * 2 - del tmp65 - t2new.aaaa += np.transpose(tmp67, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp68, (0, 1, 3, 2)) * -2 - del tmp68 - t2new.aaaa += tmp70 * -1 - t2new.aaaa += np.transpose(tmp70, (0, 1, 3, 2)) - del tmp70 - t2new.aaaa += np.transpose(tmp72, (1, 0, 3, 2)) * 2 - del tmp72 - t2new.aaaa += tmp67 - del tmp67 - t2new.aaaa += np.transpose(tmp73, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - t2new.aaaa += np.transpose(tmp74, (1, 0, 2, 3)) - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp76, (4, 1, 5, 3), (0, 4, 5, 2)) * 2 - del tmp76 - t2new.aaaa += np.transpose(tmp80, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp73, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 3, 1)) * -1 - t2new.aaaa += tmp74 * -1 - t2new.aaaa += np.transpose(tmp86, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp88, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp89, (0, 1, 3, 2)) - t2new.aaaa += tmp90 * 2 - t2new.aaaa += np.transpose(tmp90, (1, 0, 3, 2)) * 2 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp94, (4, 1, 5, 3), (4, 0, 5, 2)) * -2 - del tmp94 - t2new.aaaa += einsum(t2.abab, (0, 1, 2, 3), tmp97, (4, 1, 5, 3), (4, 0, 5, 2)) * -1 - del tmp97 - t2new.aaaa += np.transpose(tmp89, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp90, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp90, (1, 0, 2, 3)) * -2 - del tmp90 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp99, (4, 1, 5, 3), (0, 4, 5, 2)) * 4 - del tmp99 - t2new.aaaa += einsum(tmp101, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 2, 5)) - del tmp101 - t2new.aaaa += tmp89 * -1 - t2new.aaaa += np.transpose(tmp103, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp105, (1, 0, 2, 3)) * 2 - t2new.aaaa += np.transpose(tmp89, (1, 0, 2, 3)) - del tmp89 - t2new.aaaa += np.transpose(tmp103, (0, 1, 3, 2)) * -1 - del tmp103 - t2new.aaaa += tmp105 * -2 - del tmp105 - t2new.aaaa += np.transpose(tmp107, (0, 1, 3, 2)) * -2 - del tmp107 - t2new.aaaa += np.transpose(tmp74, (0, 1, 3, 2)) - t2new.aaaa += tmp109 - t2new.aaaa += np.transpose(tmp109, (0, 1, 3, 2)) * -1 - del tmp109 - t2new.aaaa += tmp111 - t2new.aaaa += np.transpose(tmp111, (0, 1, 3, 2)) * -1 - del tmp111 - t2new.aaaa += np.transpose(tmp113, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp113, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp115, (0, 1, 3, 2)) * -2 - del tmp115 - t2new.aaaa += np.transpose(tmp74, (1, 0, 3, 2)) * -1 - del tmp74 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp117, (2, 4, 5, 3), (0, 1, 5, 4)) * -2 - del tmp117 - t2new.aaaa += np.transpose(tmp49, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp50, (0, 1, 3, 2)) * -2 - t2new.aaaa += tmp49 - del tmp49 - t2new.aaaa += tmp50 * 2 - del tmp50 - t2new.aaaa += np.transpose(tmp73, (1, 0, 2, 3)) - t2new.aaaa += tmp86 * -2 - t2new.aaaa += tmp80 * -1 - del tmp80 - t2new.aaaa += tmp73 * -1 - del tmp73 - t2new.aaaa += np.transpose(tmp86, (1, 0, 2, 3)) * 2 - del tmp86 - t2new.aaaa += np.transpose(tmp88, (1, 0, 2, 3)) * -1 - del tmp88 - t2new.aaaa += einsum(tmp118, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) * -2 - del tmp118 - t2new.aaaa += tmp113 * -1 - t2new.aaaa += np.transpose(tmp113, (1, 0, 2, 3)) - del tmp113 - t1new.bb = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 0, 1), (2, 3)) - t1new.bb += einsum(tmp21, (0, 1, 2, 3), t2.bbbb, (1, 2, 4, 3), (0, 4)) * 2 - del tmp21 - t1new.bb += f.bb.ov - t1new.bb += tmp13 - del tmp13 - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), tmp22, (0, 4, 1, 2), (4, 3)) * -1 - del tmp22 - t1new.bb += einsum(v.bbbb.ovvv, (0, 1, 2, 3), tmp23, (0, 4, 3, 1), (4, 2)) * -1 - del tmp23 - t1new.bb += einsum(v.aabb.ovvv, (0, 1, 2, 3), tmp3, (0, 4, 1, 3), (4, 2)) - t1new.bb += einsum(t1.bb, (0, 1), tmp27, (0, 2), (2, 1)) * -1 - del tmp27 - t1new.bb += einsum(tmp28, (0, 1), t1.bb, (2, 0), (2, 1)) - del tmp28 - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (0, 2, 4, 1), (4, 3)) * -1 - t1new.bb += einsum(t1.bb, (0, 1), v.bbbb.oovv, (2, 0, 3, 1), (2, 3)) * -1 - t1new.bb += einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), v.bbbb.ovov, (1, 5, 2, 4), (0, 3)) * -3 - t1new.bb += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.abaaba, (0, 4, 2, 3, 5, 1), (4, 5)) * -1 - t1new.bb += einsum(v.bbbb.ooov, (0, 1, 2, 3), t2.bbbb, (2, 1, 4, 3), (0, 4)) * 2 - t1new.bb += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), v.aabb.ovov, (1, 4, 2, 5), (0, 3)) * 2 - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), tmp9, (0, 2), (1, 3)) - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp16, (1, 3), (0, 2)) * 2 - t1new.bb += einsum(t1.bb, (0, 1), tmp32, (0, 2), (2, 1)) * -1 - del tmp32 - t1new.aa = np.copy(tmp0) - del tmp0 - t1new.aa += einsum(tmp1, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) * -1 - del tmp1 - t1new.aa += einsum(tmp2, (0, 1, 2, 3), t2.aaaa, (2, 1, 4, 3), (0, 4)) * -2 - del tmp2 - t1new.aa += f.aa.ov - t1new.aa += einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - t1new.aa += einsum(tmp3, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - del tmp3 - t1new.aa += einsum(tmp4, (0, 1, 2, 3), v.aaaa.ovvv, (0, 2, 4, 3), (1, 4)) - del tmp4 - t1new.aa += einsum(tmp11, (0, 1), t1.aa, (0, 2), (1, 2)) * -1 - del tmp11 - t1new.aa += einsum(tmp12, (0, 1), t1.aa, (2, 0), (2, 1)) - del tmp12 - t1new.aa += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), v.aabb.ovov, (2, 5, 1, 4), (0, 3)) * 2 - t1new.aa += einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) * -1 - t1new.aa += einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), v.aaaa.ovov, (1, 5, 2, 4), (0, 3)) * -3 - t1new.aa += einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) * -2 - t1new.aa += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), v.bbbb.ovov, (0, 3, 2, 5), (1, 4)) - t1new.aa += einsum(v.aaaa.oovv, (0, 1, 2, 3), t1.aa, (1, 3), (0, 2)) * -1 - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), tmp16, (1, 3), (0, 2)) - del tmp16 - t1new.aa += einsum(tmp9, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) * 2 - del tmp9 - t1new.aa += einsum(tmp20, (0, 1), t1.aa, (0, 2), (1, 2)) * -1 - del tmp20 - - return {f"t1new": t1new, f"t2new": t2new, f"t3new": t3new} - diff --git a/ebcc/codegen/UCCD.py b/ebcc/codegen/UCCD.py deleted file mode 100644 index b9d142e1..00000000 --- a/ebcc/codegen/UCCD.py +++ /dev/null @@ -1,2788 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:18:30.727919 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:18:31.257437. - - Parameters - ---------- - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - e_cc = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 3, 1), ()) * -1 - e_cc += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 3), ()) - e_cc += einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 3, 1), ()) * -1 - - return e_cc - -def update_amps(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:18:44.278899. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t2new = Namespace() - tmp13 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp13 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp9 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp9 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp35 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 1, 3), (4, 0)) - tmp34 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp44 = einsum(t2.bbbb, (0, 1, 2, 3), tmp13, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp10 = einsum(t2.aaaa, (0, 1, 2, 3), tmp9, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp19 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp20 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp36 = np.copy(tmp34) - del tmp34 - tmp36 += tmp35 * 2 - del tmp35 - tmp50 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp24 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp25 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 4, 1, 3), (2, 4)) - tmp45 = np.copy(v.bbbb.oovv) - tmp45 += tmp44 * -2 - del tmp44 - tmp27 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp47 = einsum(t2.abab, (0, 1, 2, 3), tmp9, (0, 4, 5, 2), (4, 1, 5, 3)) - tmp2 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 4, 1), (4, 3)) * -1 - tmp3 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp31 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 5, 3)) - tmp14 = einsum(tmp13, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) - del tmp13 - tmp6 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp17 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp11 = np.copy(v.aaaa.oovv) - tmp11 += tmp10 * -2 - del tmp10 - tmp21 = np.copy(tmp19) * 2 - tmp21 += tmp20 - tmp40 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp41 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp52 = einsum(tmp36, (0, 1), t2.bbbb, (2, 1, 3, 4), (2, 0, 3, 4)) * -1 - tmp51 = einsum(tmp50, (0, 1, 2, 3), t2.bbbb, (3, 2, 4, 5), (1, 0, 4, 5)) - del tmp50 - tmp49 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp26 = np.copy(tmp24) * 0.5 - tmp26 += tmp25 - tmp46 = einsum(t2.bbbb, (0, 1, 2, 3), tmp45, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp45 - tmp38 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.oo, (4, 1), (4, 0, 2, 3)) - tmp43 = einsum(t2.abab, (0, 1, 2, 3), tmp27, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp42 = np.copy(f.bb.vv) * -1 - tmp42 += tmp24 - del tmp24 - tmp42 += tmp25 * 2 - del tmp25 - tmp39 = einsum(v.bbbb.oooo, (0, 1, 2, 3), t2.bbbb, (3, 1, 4, 5), (0, 2, 4, 5)) * -1 - tmp48 = einsum(tmp47, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp47 - tmp28 = np.copy(f.aa.vv) * -1 - tmp28 += np.transpose(tmp2, (1, 0)) * 2 - tmp28 += np.transpose(tmp3, (1, 0)) - tmp33 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp29 = np.copy(np.transpose(v.aabb.vvoo, (2, 3, 0, 1))) - tmp29 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (5, 1, 4, 2)) * -1 - tmp32 = np.copy(tmp31) * 2 - tmp32 += tmp14 * -1 - tmp30 = np.copy(v.aaaa.oovv) - tmp30 += np.transpose(tmp6, (1, 0, 3, 2)) * -1 - tmp30 += einsum(tmp9, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (1, 4, 3, 5)) * 2 - del tmp9 - tmp23 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.oooo, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp37 = np.copy(tmp19) - del tmp19 - tmp37 += tmp20 * 0.5 - del tmp20 - tmp5 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp18 = einsum(t2.aaaa, (0, 1, 2, 3), tmp17, (4, 5, 1, 0), (5, 4, 2, 3)) - del tmp17 - tmp15 = einsum(tmp14, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) * -1 - del tmp14 - tmp4 = np.copy(tmp2) - tmp4 += tmp3 * 0.5 - tmp12 = einsum(tmp11, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp11 - tmp1 = einsum(v.aaaa.oooo, (0, 1, 2, 3), t2.aaaa, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp16 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp0 = einsum(f.aa.oo, (0, 1), t2.aaaa, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp7 = np.copy(f.aa.vv) * -1 - tmp7 += tmp2 * 2 - del tmp2 - tmp7 += tmp3 - del tmp3 - tmp8 = einsum(t2.aaaa, (0, 1, 2, 3), tmp6, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp22 = einsum(tmp21, (0, 1), t2.aaaa, (2, 1, 3, 4), (0, 2, 3, 4)) * -1 - del tmp21 - t2new.bbbb = np.copy(np.transpose(tmp38, (1, 0, 3, 2))) * 2 - t2new.bbbb += np.transpose(tmp39, (1, 0, 3, 2)) * 2 - del tmp39 - t2new.bbbb += np.transpose(tmp38, (0, 1, 3, 2)) * -2 - del tmp38 - t2new.bbbb += einsum(tmp26, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 4, 0)) * -4 - t2new.bbbb += np.transpose(tmp40, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp41, (1, 0, 3, 2)) * 2 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp42, (4, 3), (0, 1, 4, 2)) * 2 - del tmp42 - t2new.bbbb += np.transpose(tmp40, (1, 0, 2, 3)) * -1 - t2new.bbbb += einsum(f.bb.vv, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 4, 0)) * 2 - t2new.bbbb += np.transpose(tmp41, (1, 0, 2, 3)) * -2 - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 3, 1)) * -1 - t2new.bbbb += np.transpose(tmp40, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp41, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp43, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp43, (1, 0, 2, 3)) * -2 - t2new.bbbb += np.transpose(tmp46, (0, 1, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp48, (1, 0, 2, 3)) * -1 - t2new.bbbb += tmp43 * 2 - t2new.bbbb += np.transpose(tmp43, (1, 0, 3, 2)) * 2 - del tmp43 - t2new.bbbb += np.transpose(tmp46, (1, 0, 3, 2)) * -2 - del tmp46 - t2new.bbbb += tmp48 - del tmp48 - t2new.bbbb += tmp40 - del tmp40 - t2new.bbbb += tmp41 * 2 - del tmp41 - t2new.bbbb += tmp49 * -2 - t2new.bbbb += np.transpose(tmp49, (1, 0, 2, 3)) * 2 - del tmp49 - t2new.bbbb += einsum(v.bbbb.vvvv, (0, 1, 2, 3), t2.bbbb, (4, 5, 3, 1), (4, 5, 0, 2)) * -2 - t2new.bbbb += np.transpose(tmp51, (0, 1, 3, 2)) * -2 - del tmp51 - t2new.bbbb += np.transpose(tmp52, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp52, (1, 0, 3, 2)) * 2 - del tmp52 - t2new.abab = einsum(f.bb.oo, (0, 1), t2.abab, (2, 1, 3, 4), (2, 0, 3, 4)) * -1 - t2new.abab += tmp23 - del tmp23 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), f.aa.oo, (4, 0), (4, 1, 2, 3)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp26, (4, 3), (0, 1, 2, 4)) * -2 - del tmp26 - t2new.abab += tmp27 * 2 - del tmp27 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 0, 2), (4, 1, 5, 3)) - t2new.abab += einsum(tmp28, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1 - del tmp28 - t2new.abab += einsum(f.bb.vv, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 4, 0)) - t2new.abab += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp29, (1, 4, 2, 5), (0, 4, 5, 3)) * -1 - del tmp29 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp30, (0, 4, 2, 5), (4, 1, 5, 3)) * -1 - del tmp30 - t2new.abab += einsum(t2.bbbb, (0, 1, 2, 3), tmp32, (4, 1, 5, 3), (4, 0, 5, 2)) * 2 - del tmp32 - t2new.abab += tmp31 * 2 - del tmp31 - t2new.abab += einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - t2new.abab += einsum(v.bbbb.oovv, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), v.aabb.oovv, (4, 0, 5, 3), (4, 1, 2, 5)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvvv, (4, 2, 5, 3), (0, 1, 4, 5)) - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp33, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp33 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp36, (4, 1), (0, 4, 2, 3)) * -1 - del tmp36 - t2new.abab += einsum(tmp37, (0, 1), t2.abab, (1, 2, 3, 4), (0, 2, 3, 4)) * -2 - del tmp37 - t2new.aaaa = np.copy(np.transpose(tmp0, (1, 0, 3, 2))) * 2 - t2new.aaaa += np.transpose(tmp1, (1, 0, 3, 2)) * 2 - del tmp1 - t2new.aaaa += np.transpose(tmp0, (0, 1, 3, 2)) * -2 - del tmp0 - t2new.aaaa += einsum(tmp4, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 4, 0)) * -4 - del tmp4 - t2new.aaaa += np.transpose(tmp5, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp6, (1, 0, 3, 2)) - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp7, (4, 3), (0, 1, 4, 2)) * 2 - del tmp7 - t2new.aaaa += np.transpose(tmp5, (1, 0, 2, 3)) * -2 - t2new.aaaa += einsum(f.aa.vv, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 4, 0)) * 2 - t2new.aaaa += np.transpose(tmp6, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 3, 1)) * -1 - t2new.aaaa += np.transpose(tmp5, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp6, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp8, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp8, (1, 0, 2, 3)) * -2 - t2new.aaaa += np.transpose(tmp12, (0, 1, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp15, (1, 0, 2, 3)) * -1 - t2new.aaaa += tmp8 * 2 - t2new.aaaa += np.transpose(tmp8, (1, 0, 3, 2)) * 2 - del tmp8 - t2new.aaaa += np.transpose(tmp12, (1, 0, 3, 2)) * -2 - del tmp12 - t2new.aaaa += np.transpose(tmp15, (1, 0, 3, 2)) - del tmp15 - t2new.aaaa += tmp5 * 2 - del tmp5 - t2new.aaaa += tmp6 - del tmp6 - t2new.aaaa += tmp16 * -2 - t2new.aaaa += np.transpose(tmp16, (1, 0, 2, 3)) * 2 - del tmp16 - t2new.aaaa += einsum(v.aaaa.vvvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (4, 5, 0, 2)) * 2 - t2new.aaaa += np.transpose(tmp18, (0, 1, 3, 2)) * -2 - del tmp18 - t2new.aaaa += np.transpose(tmp22, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp22, (0, 1, 3, 2)) * 2 - del tmp22 - - return {f"t2new": t2new} - -def update_lams(f=None, l2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:19:07.584968. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - l2 : Namespace of arrays - L2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - l2new : Namespace of arrays - Updated L2 residuals. - """ - - l2new = Namespace() - tmp38 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 0, 1), (4, 2)) - tmp37 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - tmp47 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 1), (4, 3)) * -1 - tmp46 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp77 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 5), (3, 4, 1, 5)) - tmp78 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp54 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp53 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp58 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp59 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp51 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp50 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp41 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp40 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp19 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 4, 3), (4, 1)) - tmp20 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp7 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 0, 2), (4, 1, 5, 3)) - tmp8 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp5 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp4 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp31 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 1), (4, 0)) - tmp32 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp27 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp28 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp0 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) - tmp1 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - tmp39 = np.copy(tmp37) - del tmp37 - tmp39 += tmp38 * 2 - del tmp38 - tmp48 = np.copy(f.bb.vv) * -1 - tmp48 += tmp46 - del tmp46 - tmp48 += tmp47 * 2 - del tmp47 - tmp79 = np.copy(tmp77) - del tmp77 - tmp79 += tmp78 * 4 - del tmp78 - tmp55 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp55 += tmp53 * 2 - del tmp53 - tmp55 += tmp54 - del tmp54 - tmp71 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp60 = np.copy(tmp58) * 0.5 - tmp60 += tmp59 - tmp65 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 1, 3))) - tmp65 += v.bbbb.oovv * -1 - tmp65 += tmp50 - tmp65 += tmp51 * 2 - tmp68 = np.copy(f.bb.oo) - tmp68 += tmp40 - tmp68 += tmp41 * 2 - tmp81 = np.copy(tmp58) - del tmp58 - tmp81 += tmp59 * 2 - del tmp59 - tmp52 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 1, 3))) - tmp52 += v.bbbb.oovv * -1 - tmp52 += tmp50 - del tmp50 - tmp52 += tmp51 * 2 - del tmp51 - tmp12 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp11 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 1, 3), (0, 4)) - tmp44 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 4, 5), (4, 0, 5, 1)) - tmp21 = np.copy(f.aa.vv) * -1 - tmp21 += tmp19 * 2 - del tmp19 - tmp21 += tmp20 - del tmp20 - tmp17 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp9 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp9 += tmp7 - del tmp7 - tmp9 += tmp8 * 2 - del tmp8 - tmp25 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) - tmp25 += v.aaaa.oovv * -1 - tmp25 += tmp4 * 2 - tmp25 += tmp5 - tmp35 = np.copy(tmp31) - tmp35 += tmp32 * 0.5 - tmp33 = np.copy(tmp31) * 2 - del tmp31 - tmp33 += tmp32 - del tmp32 - tmp29 = np.copy(tmp27) * 4 - del tmp27 - tmp29 += tmp28 - del tmp28 - tmp2 = np.copy(tmp0) * 2 - tmp2 += tmp1 - tmp75 = einsum(tmp39, (0, 1), v.bbbb.ovov, (2, 3, 4, 1), (2, 4, 0, 3)) - tmp64 = einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp39, (4, 1), (0, 2, 4, 3)) - tmp73 = einsum(tmp48, (0, 1), l2.bbbb, (2, 0, 3, 4), (3, 4, 2, 1)) * -1 - tmp80 = einsum(tmp79, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - del tmp79 - tmp74 = np.copy(v.bbbb.oooo) - tmp74 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 2, 5, 3), (0, 4, 5, 1)) - tmp67 = einsum(tmp55, (0, 1, 2, 3), l2.abab, (2, 4, 0, 5), (1, 5, 3, 4)) - tmp72 = einsum(tmp71, (0, 1, 2, 3), v.bbbb.ovov, (3, 4, 2, 5), (1, 0, 5, 4)) * -1 - del tmp71 - tmp83 = einsum(tmp60, (0, 1), v.bbbb.ovov, (2, 3, 1, 4), (0, 2, 4, 3)) * 2 - tmp70 = einsum(l2.bbbb, (0, 1, 2, 3), v.bbbb.vvvv, (4, 0, 5, 1), (2, 3, 4, 5)) - tmp66 = einsum(tmp65, (0, 1, 2, 3), l2.bbbb, (4, 2, 5, 0), (5, 1, 4, 3)) * 2 - del tmp65 - tmp69 = einsum(l2.bbbb, (0, 1, 2, 3), tmp68, (3, 4), (2, 4, 0, 1)) * -2 - del tmp68 - tmp82 = einsum(tmp81, (0, 1), v.bbbb.ovov, (2, 3, 1, 4), (0, 2, 4, 3)) - del tmp81 - tmp76 = einsum(tmp52, (0, 1, 2, 3), l2.bbbb, (4, 2, 5, 0), (5, 1, 4, 3)) - tmp15 = np.copy(f.aa.oo) - tmp15 += tmp11 * 2 - tmp15 += tmp12 - tmp57 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp62 = einsum(l2.abab, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 0), (4, 3, 5, 1)) - tmp62 += einsum(l2.bbbb, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (4, 2, 5, 0)) - tmp45 = einsum(tmp44, (0, 1, 2, 3), v.aabb.ovov, (1, 4, 3, 5), (0, 2, 4, 5)) - del tmp44 - tmp49 = np.copy(v.aabb.oooo) - tmp49 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp43 = einsum(v.aabb.vvvv, (0, 1, 2, 3), l2.abab, (1, 3, 4, 5), (4, 5, 0, 2)) - tmp61 = np.copy(tmp0) - del tmp0 - tmp61 += tmp1 * 0.5 - del tmp1 - tmp63 = einsum(t2.abab, (0, 1, 2, 3), l2.aaaa, (4, 2, 5, 0), (5, 1, 4, 3)) - tmp63 += einsum(t2.bbbb, (0, 1, 2, 3), l2.abab, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp42 = np.copy(f.bb.oo) * 0.5 - tmp42 += tmp40 * 0.5 - del tmp40 - tmp42 += tmp41 - del tmp41 - tmp14 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) - tmp14 += v.aaaa.oovv * -1 - tmp14 += tmp4 * 2 - tmp14 += tmp5 - tmp56 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (1, 5, 2, 4)) - tmp22 = einsum(tmp21, (0, 1), l2.aaaa, (2, 0, 3, 4), (3, 4, 1, 2)) * -1 - tmp6 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) * 0.5 - tmp6 += v.aaaa.oovv * -0.5 - tmp6 += tmp4 - del tmp4 - tmp6 += tmp5 * 0.5 - del tmp5 - tmp13 = np.copy(f.aa.oo) * 0.5 - tmp13 += tmp11 - del tmp11 - tmp13 += tmp12 * 0.5 - del tmp12 - tmp18 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp17, (4, 5, 2, 0), (5, 4, 3, 1)) * -1 - del tmp17 - tmp10 = einsum(tmp9, (0, 1, 2, 3), l2.abab, (4, 3, 5, 1), (0, 5, 2, 4)) - tmp26 = einsum(l2.aaaa, (0, 1, 2, 3), tmp25, (3, 4, 1, 5), (4, 2, 5, 0)) - del tmp25 - tmp36 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp35, (4, 2), (0, 4, 3, 1)) * 2 - tmp16 = einsum(v.aaaa.vvvv, (0, 1, 2, 3), l2.aaaa, (3, 1, 4, 5), (4, 5, 0, 2)) * -1 - tmp34 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp33, (4, 2), (0, 4, 3, 1)) - del tmp33 - tmp30 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp29, (4, 2, 5, 1), (0, 4, 3, 5)) - del tmp29 - tmp24 = einsum(tmp2, (0, 1), v.aaaa.ovov, (2, 3, 4, 1), (2, 4, 3, 0)) - tmp3 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp2, (4, 1), (0, 2, 3, 4)) - del tmp2 - tmp23 = np.copy(v.aaaa.oooo) - tmp23 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 5, 2), (0, 4, 1, 5)) * -1 - l2new.bbbb = np.copy(np.transpose(v.bbbb.ovov, (1, 3, 0, 2))) - l2new.bbbb += np.transpose(tmp64, (3, 2, 1, 0)) * -1 - l2new.bbbb += np.transpose(v.bbbb.ovov, (3, 1, 0, 2)) * -1 - l2new.bbbb += np.transpose(tmp64, (2, 3, 1, 0)) - del tmp64 - l2new.bbbb += np.transpose(tmp66, (3, 2, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp67, (2, 3, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp69, (3, 2, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp66, (3, 2, 1, 0)) - del tmp66 - l2new.bbbb += np.transpose(tmp67, (2, 3, 0, 1)) - l2new.bbbb += np.transpose(tmp69, (3, 2, 1, 0)) - del tmp69 - l2new.bbbb += np.transpose(tmp70, (3, 2, 1, 0)) * 2 - del tmp70 - l2new.bbbb += np.transpose(tmp72, (3, 2, 1, 0)) * 2 - del tmp72 - l2new.bbbb += np.transpose(tmp73, (3, 2, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp73, (2, 3, 1, 0)) * -2 - del tmp73 - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp74, (2, 4, 5, 3), (0, 1, 5, 4)) * -2 - del tmp74 - l2new.bbbb += np.transpose(tmp75, (3, 2, 1, 0)) - l2new.bbbb += np.transpose(tmp76, (2, 3, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp67, (3, 2, 1, 0)) - l2new.bbbb += np.transpose(tmp76, (2, 3, 1, 0)) * -2 - del tmp76 - l2new.bbbb += np.transpose(tmp67, (3, 2, 0, 1)) * -1 - del tmp67 - l2new.bbbb += np.transpose(tmp80, (3, 2, 0, 1)) - l2new.bbbb += np.transpose(tmp82, (2, 3, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp80, (2, 3, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp82, (3, 2, 0, 1)) - del tmp82 - l2new.bbbb += np.transpose(tmp80, (3, 2, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp83, (2, 3, 1, 0)) - l2new.bbbb += np.transpose(tmp80, (2, 3, 1, 0)) - del tmp80 - l2new.bbbb += np.transpose(tmp83, (3, 2, 1, 0)) * -1 - del tmp83 - l2new.bbbb += np.transpose(tmp75, (2, 3, 1, 0)) * -1 - del tmp75 - l2new.abab = np.copy(np.transpose(v.aabb.ovov, (1, 3, 0, 2))) - l2new.abab += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp39, (4, 3), (1, 4, 0, 2)) * -1 - del tmp39 - l2new.abab += einsum(v.aabb.vvoo, (0, 1, 2, 3), l2.abab, (1, 4, 5, 3), (0, 4, 5, 2)) * -1 - l2new.abab += einsum(tmp42, (0, 1), l2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -2 - del tmp42 - l2new.abab += einsum(tmp14, (0, 1, 2, 3), l2.abab, (2, 4, 0, 5), (3, 4, 1, 5)) - l2new.abab += einsum(l2.bbbb, (0, 1, 2, 3), tmp9, (4, 3, 5, 1), (5, 0, 4, 2)) * 2 - del tmp9 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp15, (2, 4), (0, 1, 4, 3)) * -1 - l2new.abab += np.transpose(tmp43, (2, 3, 0, 1)) - del tmp43 - l2new.abab += np.transpose(tmp45, (2, 3, 0, 1)) - del tmp45 - l2new.abab += einsum(tmp21, (0, 1), l2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -1 - del tmp21 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp48, (1, 4), (0, 4, 2, 3)) * -1 - del tmp48 - l2new.abab += einsum(tmp49, (0, 1, 2, 3), l2.abab, (4, 5, 0, 2), (4, 5, 1, 3)) - del tmp49 - l2new.abab += einsum(tmp52, (0, 1, 2, 3), l2.abab, (4, 2, 5, 0), (4, 3, 5, 1)) - del tmp52 - l2new.abab += einsum(l2.aaaa, (0, 1, 2, 3), tmp55, (3, 4, 1, 5), (0, 5, 2, 4)) * 2 - del tmp55 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), v.aabb.oovv, (4, 2, 5, 1), (0, 5, 4, 3)) * -1 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp56, (3, 4, 0, 5), (5, 1, 2, 4)) - del tmp56 - l2new.abab += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp35, (4, 0), (1, 3, 4, 2)) * -2 - del tmp35 - l2new.abab += einsum(tmp57, (0, 1, 2, 3), l2.abab, (4, 2, 0, 5), (4, 3, 1, 5)) - del tmp57 - l2new.abab += einsum(tmp60, (0, 1), v.aabb.ovov, (2, 3, 1, 4), (3, 4, 2, 0)) * -2 - del tmp60 - l2new.abab += einsum(tmp61, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 4, 2, 3)) * -2 - del tmp61 - l2new.abab += einsum(tmp62, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 0, 5), (5, 3, 4, 1)) * -2 - del tmp62 - l2new.abab += einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp63, (4, 2, 5, 1), (5, 3, 4, 0)) * -2 - del tmp63 - l2new.aaaa = np.copy(np.transpose(v.aaaa.ovov, (1, 3, 0, 2))) - l2new.aaaa += np.transpose(tmp3, (2, 3, 1, 0)) * -1 - l2new.aaaa += np.transpose(v.aaaa.ovov, (3, 1, 0, 2)) * -1 - l2new.aaaa += np.transpose(tmp3, (3, 2, 1, 0)) - del tmp3 - l2new.aaaa += einsum(l2.aaaa, (0, 1, 2, 3), tmp6, (3, 4, 1, 5), (5, 0, 2, 4)) * -4 - del tmp6 - l2new.aaaa += np.transpose(tmp10, (2, 3, 1, 0)) * -1 - l2new.aaaa += einsum(l2.aaaa, (0, 1, 2, 3), tmp13, (3, 4), (0, 1, 2, 4)) * -4 - del tmp13 - l2new.aaaa += einsum(l2.aaaa, (0, 1, 2, 3), tmp14, (3, 4, 1, 5), (5, 0, 4, 2)) * 2 - del tmp14 - l2new.aaaa += np.transpose(tmp10, (2, 3, 0, 1)) - l2new.aaaa += einsum(tmp15, (0, 1), l2.aaaa, (2, 3, 4, 0), (2, 3, 1, 4)) * 2 - del tmp15 - l2new.aaaa += np.transpose(tmp16, (3, 2, 1, 0)) * 2 - del tmp16 - l2new.aaaa += np.transpose(tmp18, (3, 2, 1, 0)) * 2 - del tmp18 - l2new.aaaa += np.transpose(tmp22, (2, 3, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp22, (3, 2, 1, 0)) * -2 - del tmp22 - l2new.aaaa += einsum(tmp23, (0, 1, 2, 3), l2.aaaa, (4, 5, 0, 2), (4, 5, 1, 3)) * 2 - del tmp23 - l2new.aaaa += np.transpose(tmp24, (2, 3, 1, 0)) - l2new.aaaa += np.transpose(tmp26, (3, 2, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp10, (3, 2, 1, 0)) - l2new.aaaa += np.transpose(tmp26, (3, 2, 0, 1)) * -2 - del tmp26 - l2new.aaaa += np.transpose(tmp10, (3, 2, 0, 1)) * -1 - del tmp10 - l2new.aaaa += np.transpose(tmp30, (2, 3, 1, 0)) - l2new.aaaa += np.transpose(tmp34, (2, 3, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp30, (3, 2, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp34, (3, 2, 1, 0)) - del tmp34 - l2new.aaaa += np.transpose(tmp30, (2, 3, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp36, (2, 3, 0, 1)) - l2new.aaaa += np.transpose(tmp30, (3, 2, 0, 1)) - del tmp30 - l2new.aaaa += np.transpose(tmp36, (3, 2, 0, 1)) * -1 - del tmp36 - l2new.aaaa += np.transpose(tmp24, (3, 2, 1, 0)) * -1 - del tmp24 - - return {f"l2new": l2new} - -def make_rdm1_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:19:08.557834. - - Parameters - ---------- - l2 : Namespace of arrays - L2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm1 : Namespace of arrays - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - rdm1.aa = Namespace() - rdm1.bb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - rdm1.bb.vv = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - rdm1.bb.vv += einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 0, 1), (4, 2)) * 2 - rdm1.aa.vv = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) * 2 - rdm1.aa.vv += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - rdm1.bb.oo = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 0, 4), (1, 4)) * -1 - rdm1.bb.oo += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 0, 1), (4, 2)) * -2 - rdm1.bb.oo += delta.bb.oo - rdm1.aa.oo = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 1), (0, 4)) * -2 - rdm1.aa.oo += delta.aa.oo - del delta - rdm1.aa.oo += einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 4, 1), (0, 4)) * -1 - rdm1.aa.ov = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm1.aa.vo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm1.bb.ov = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm1.bb.vo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]]) - rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]]) - - return rdm1 - -def make_rdm2_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:19:23.605919. - - Parameters - ---------- - l2 : Namespace of arrays - L2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm2 : Namespace of arrays - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - rdm2.aaaa = Namespace() - rdm2.abab = Namespace() - rdm2.bbbb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - tmp5 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp6 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 0, 1), (2, 4)) - tmp0 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 1), (4, 0)) - tmp1 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp27 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 0, 1), (4, 2)) - tmp26 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - tmp14 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 0, 1), (4, 2)) - tmp15 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - tmp34 = einsum(t2.bbbb, (0, 1, 2, 3), l2.abab, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp11 = np.copy(tmp5) - tmp11 += tmp6 * 2 - tmp13 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp31 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp33 = einsum(t2.abab, (0, 1, 2, 3), l2.aaaa, (4, 2, 5, 0), (5, 1, 4, 3)) - tmp30 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 5), (3, 4, 1, 5)) - tmp4 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp23 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp21 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp8 = np.copy(tmp0) * 2 - tmp8 += tmp1 - tmp19 = einsum(l2.bbbb, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (4, 2, 5, 0)) - tmp43 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 5), (0, 1, 4, 5)) - tmp42 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 5), (0, 1, 4, 5)) - tmp41 = np.copy(tmp26) - tmp41 += tmp27 * 2 - tmp25 = np.copy(tmp14) * 2 - tmp25 += tmp15 - tmp28 = np.copy(tmp26) * 0.5 - del tmp26 - tmp28 += tmp27 - del tmp27 - tmp16 = np.copy(tmp14) - del tmp14 - tmp16 += tmp15 * 0.5 - del tmp15 - tmp29 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 5, 1), (5, 0, 4, 3)) - tmp40 = einsum(t2.abab, (0, 1, 2, 3), tmp34, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp36 = einsum(tmp11, (0, 1), t2.bbbb, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - tmp37 = einsum(tmp13, (0, 1, 2, 3), t2.bbbb, (1, 0, 4, 5), (3, 2, 4, 5)) - tmp38 = einsum(t2.bbbb, (0, 1, 2, 3), tmp31, (1, 4, 3, 5), (0, 4, 2, 5)) - tmp39 = einsum(tmp33, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp32 = np.copy(tmp30) - tmp32 += tmp31 * 4 - tmp3 = np.copy(tmp0) - tmp3 += tmp1 * 0.5 - tmp35 = np.copy(tmp33) - tmp35 += tmp34 - tmp9 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 4, 5), (4, 0, 5, 1)) - tmp18 = einsum(t2.aaaa, (0, 1, 2, 3), tmp4, (1, 0, 4, 5), (5, 4, 2, 3)) - tmp24 = einsum(t2.aaaa, (0, 1, 2, 3), tmp23, (1, 4, 3, 5), (0, 4, 2, 5)) - tmp22 = einsum(tmp21, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (4, 1, 5, 3)) - tmp17 = einsum(tmp8, (0, 1), t2.aaaa, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - tmp20 = einsum(tmp19, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp10 = np.copy(delta.bb.oo) * -1 - tmp10 += tmp5 - tmp10 += tmp6 * 2 - tmp12 = np.copy(tmp5) * 0.5 - tmp12 += tmp6 - tmp7 = np.copy(delta.bb.oo) * -0.5 - tmp7 += tmp5 * 0.5 - del tmp5 - tmp7 += tmp6 - del tmp6 - tmp2 = np.copy(delta.aa.oo) * -1 - tmp2 += tmp0 * 2 - del tmp0 - tmp2 += tmp1 - del tmp1 - rdm2.bbbb.vvvv = np.copy(np.transpose(tmp43, (1, 0, 3, 2))) * 2 - del tmp43 - rdm2.abab.vvvv = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (4, 5, 0, 1), (4, 5, 2, 3)) - rdm2.aaaa.vvvv = np.copy(np.transpose(tmp42, (1, 0, 3, 2))) * 2 - del tmp42 - rdm2.bbbb.vvoo = np.copy(l2.bbbb) * 2 - rdm2.abab.vvoo = np.copy(l2.abab) - rdm2.aaaa.vvoo = np.copy(l2.aaaa) * 2 - rdm2.bbbb.vovo = einsum(tmp41, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.vovo += np.transpose(tmp30, (2, 1, 3, 0)) * -1 - rdm2.bbbb.vovo += np.transpose(tmp31, (2, 1, 3, 0)) * -4 - rdm2.abab.vovo = einsum(tmp25, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2.abab.vovo += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 5, 1), (0, 4, 5, 3)) * -1 - rdm2.aaaa.vovo = einsum(delta.aa.oo, (0, 1), tmp25, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.vovo += np.transpose(tmp21, (2, 1, 3, 0)) * -4 - rdm2.aaaa.vovo += np.transpose(tmp23, (2, 1, 3, 0)) * -1 - rdm2.bbbb.voov = einsum(tmp28, (0, 1), delta.bb.oo, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.bbbb.voov += np.transpose(tmp30, (2, 1, 0, 3)) - rdm2.bbbb.voov += np.transpose(tmp31, (2, 1, 0, 3)) * 4 - rdm2.abab.voov = np.copy(np.transpose(tmp33, (2, 1, 0, 3))) * 2 - del tmp33 - rdm2.abab.voov += np.transpose(tmp34, (2, 1, 0, 3)) * 2 - del tmp34 - rdm2.aaaa.voov = einsum(delta.aa.oo, (0, 1), tmp16, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.aaaa.voov += np.transpose(tmp21, (2, 1, 0, 3)) * 4 - rdm2.aaaa.voov += np.transpose(tmp23, (2, 1, 0, 3)) - rdm2.bbbb.ovvo = einsum(tmp41, (0, 1), delta.bb.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.ovvo += np.transpose(tmp30, (1, 2, 3, 0)) - rdm2.bbbb.ovvo += np.transpose(tmp31, (1, 2, 3, 0)) * 4 - rdm2.abab.ovvo = einsum(l2.abab, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 0), (4, 1, 5, 3)) * 2 - rdm2.abab.ovvo += np.transpose(tmp19, (0, 3, 2, 1)) * 2 - del tmp19 - rdm2.aaaa.ovvo = einsum(delta.aa.oo, (0, 1), tmp25, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.ovvo += np.transpose(tmp21, (1, 2, 3, 0)) * 4 - rdm2.aaaa.ovvo += np.transpose(tmp23, (1, 2, 3, 0)) - rdm2.bbbb.ovov = einsum(tmp28, (0, 1), delta.bb.oo, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.bbbb.ovov += np.transpose(tmp30, (1, 2, 0, 3)) * -1 - del tmp30 - rdm2.bbbb.ovov += np.transpose(tmp31, (1, 2, 0, 3)) * -4 - del tmp31 - rdm2.abab.ovov = einsum(delta.aa.oo, (0, 1), tmp28, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.abab.ovov += np.transpose(tmp29, (1, 2, 0, 3)) * -1 - rdm2.aaaa.ovov = einsum(delta.aa.oo, (0, 1), tmp16, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.aaaa.ovov += np.transpose(tmp21, (1, 2, 0, 3)) * -4 - del tmp21 - rdm2.aaaa.ovov += np.transpose(tmp23, (1, 2, 0, 3)) * -1 - del tmp23 - rdm2.bbbb.oovv = np.copy(t2.bbbb) * 2 - rdm2.bbbb.oovv += einsum(tmp28, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 4, 1)) * -4 - rdm2.bbbb.oovv += np.transpose(tmp36, (1, 0, 3, 2)) * 2 - rdm2.bbbb.oovv += np.transpose(tmp36, (0, 1, 3, 2)) * -2 - del tmp36 - rdm2.bbbb.oovv += np.transpose(tmp37, (0, 1, 3, 2)) * -2 - del tmp37 - rdm2.bbbb.oovv += np.transpose(tmp38, (0, 1, 3, 2)) * -8 - rdm2.bbbb.oovv += np.transpose(tmp39, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp40, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp40, (1, 0, 2, 3)) * -2 - rdm2.bbbb.oovv += tmp38 * 8 - del tmp38 - rdm2.bbbb.oovv += np.transpose(tmp39, (1, 0, 3, 2)) * 2 - del tmp39 - rdm2.bbbb.oovv += tmp40 * 2 - rdm2.bbbb.oovv += np.transpose(tmp40, (1, 0, 3, 2)) * 2 - del tmp40 - rdm2.bbbb.oovv += einsum(t2.bbbb, (0, 1, 2, 3), tmp41, (3, 4), (0, 1, 4, 2)) * 2 - del tmp41 - rdm2.abab.oovv = np.copy(t2.abab) - rdm2.abab.oovv += einsum(tmp28, (0, 1), t2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -2 - del tmp28 - rdm2.abab.oovv += einsum(tmp3, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -2 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp11, (1, 4), (0, 4, 2, 3)) * -1 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp9, (0, 4, 1, 5), (4, 5, 2, 3)) - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp29, (0, 4, 3, 5), (4, 1, 2, 5)) - del tmp29 - rdm2.abab.oovv += einsum(tmp32, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) - del tmp32 - rdm2.abab.oovv += einsum(t2.aaaa, (0, 1, 2, 3), tmp35, (1, 4, 3, 5), (0, 4, 2, 5)) * 4 - del tmp35 - rdm2.abab.oovv += einsum(tmp16, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -2 - rdm2.aaaa.oovv = np.copy(t2.aaaa) * 2 - rdm2.aaaa.oovv += einsum(tmp16, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 4, 1)) * -4 - del tmp16 - rdm2.aaaa.oovv += np.transpose(tmp17, (1, 0, 3, 2)) * 2 - rdm2.aaaa.oovv += np.transpose(tmp17, (0, 1, 3, 2)) * -2 - del tmp17 - rdm2.aaaa.oovv += np.transpose(tmp18, (0, 1, 3, 2)) * -2 - del tmp18 - rdm2.aaaa.oovv += np.transpose(tmp20, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp22, (0, 1, 3, 2)) * -8 - rdm2.aaaa.oovv += np.transpose(tmp24, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp24, (1, 0, 2, 3)) * -2 - rdm2.aaaa.oovv += tmp20 * 2 - del tmp20 - rdm2.aaaa.oovv += tmp22 * 8 - del tmp22 - rdm2.aaaa.oovv += tmp24 * 2 - rdm2.aaaa.oovv += np.transpose(tmp24, (1, 0, 3, 2)) * 2 - del tmp24 - rdm2.aaaa.oovv += einsum(tmp25, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 1, 4)) * 2 - del tmp25 - rdm2.bbbb.oooo = einsum(delta.bb.oo, (0, 1), tmp7, (2, 3), (0, 3, 1, 2)) * -2 - rdm2.bbbb.oooo += einsum(tmp10, (0, 1), delta.bb.oo, (2, 3), (1, 2, 3, 0)) - del tmp10 - rdm2.bbbb.oooo += einsum(delta.bb.oo, (0, 1), tmp11, (2, 3), (3, 0, 2, 1)) * -1 - del tmp11 - rdm2.bbbb.oooo += einsum(tmp12, (0, 1), delta.bb.oo, (2, 3), (2, 1, 0, 3)) * 2 - del tmp12 - rdm2.bbbb.oooo += np.transpose(tmp13, (3, 2, 1, 0)) * 2 - del tmp13 - rdm2.abab.oooo = einsum(delta.aa.oo, (0, 1), tmp7, (2, 3), (0, 3, 1, 2)) * -2 - del tmp7 - rdm2.abab.oooo += einsum(delta.bb.oo, (0, 1), tmp8, (2, 3), (3, 0, 2, 1)) * -1 - del tmp8 - rdm2.abab.oooo += np.transpose(tmp9, (1, 3, 0, 2)) - del tmp9 - rdm2.aaaa.oooo = einsum(tmp2, (0, 1), delta.aa.oo, (2, 3), (2, 1, 3, 0)) * -1 - rdm2.aaaa.oooo += einsum(tmp2, (0, 1), delta.aa.oo, (2, 3), (1, 2, 3, 0)) - del tmp2 - rdm2.aaaa.oooo += einsum(tmp3, (0, 1), delta.aa.oo, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.aaaa.oooo += einsum(tmp3, (0, 1), delta.aa.oo, (2, 3), (2, 1, 0, 3)) * 2 - del delta, tmp3 - rdm2.aaaa.oooo += np.transpose(tmp4, (3, 2, 1, 0)) * 2 - del tmp4 - rdm2.aaaa.ooov = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm2.aaaa.oovo = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm2.aaaa.ovoo = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[0])) - rdm2.aaaa.vooo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[0])) - rdm2.aaaa.ovvv = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[-1])) - rdm2.aaaa.vovv = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[-1])) - rdm2.aaaa.vvov = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm2.aaaa.vvvo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm2.abab.ooov = np.zeros((t2.aaaa.shape[0], t2.bbbb.shape[0], t2.aaaa.shape[0], t2.bbbb.shape[-1])) - rdm2.abab.oovo = np.zeros((t2.aaaa.shape[0], t2.bbbb.shape[0], t2.aaaa.shape[-1], t2.bbbb.shape[0])) - rdm2.abab.ovoo = np.zeros((t2.aaaa.shape[0], t2.bbbb.shape[-1], t2.aaaa.shape[0], t2.bbbb.shape[0])) - rdm2.abab.vooo = np.zeros((t2.aaaa.shape[-1], t2.bbbb.shape[0], t2.aaaa.shape[0], t2.bbbb.shape[0])) - rdm2.abab.ovvv = np.zeros((t2.aaaa.shape[0], t2.bbbb.shape[-1], t2.aaaa.shape[-1], t2.bbbb.shape[-1])) - rdm2.abab.vovv = np.zeros((t2.aaaa.shape[-1], t2.bbbb.shape[0], t2.aaaa.shape[-1], t2.bbbb.shape[-1])) - rdm2.abab.vvov = np.zeros((t2.aaaa.shape[-1], t2.bbbb.shape[-1], t2.aaaa.shape[0], t2.bbbb.shape[-1])) - rdm2.abab.vvvo = np.zeros((t2.aaaa.shape[-1], t2.bbbb.shape[-1], t2.aaaa.shape[-1], t2.bbbb.shape[0])) - rdm2.bbbb.ooov = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm2.bbbb.oovo = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm2.bbbb.ovoo = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[0])) - rdm2.bbbb.vooo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[0])) - rdm2.bbbb.ovvv = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[-1])) - rdm2.bbbb.vovv = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[-1])) - rdm2.bbbb.vvov = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm2.bbbb.vvvo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv) - rdm2.abab = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv) - rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv) - rdm2 = Namespace( - aaaa=np.transpose(rdm2.aaaa, (0, 2, 1, 3)), - aabb=np.transpose(rdm2.abab, (0, 2, 1, 3)), - bbbb=np.transpose(rdm2.bbbb, (0, 2, 1, 3)), - ) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:20:17.907683. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp10 : array - tmp100 : array - tmp102 : array - tmp104 : array - tmp106 : array - tmp108 : array - tmp110 : array - tmp111 : array - tmp112 : array - tmp113 : array - tmp114 : array - tmp115 : array - tmp117 : array - tmp119 : array - tmp12 : array - tmp126 : array - tmp127 : array - tmp131 : array - tmp133 : array - tmp137 : array - tmp139 : array - tmp141 : array - tmp151 : array - tmp17 : array - tmp18 : array - tmp19 : array - tmp21 : array - tmp24 : array - tmp25 : array - tmp27 : array - tmp28 : array - tmp29 : array - tmp3 : array - tmp31 : array - tmp33 : array - tmp35 : array - tmp37 : array - tmp39 : array - tmp41 : array - tmp43 : array - tmp45 : array - tmp47 : array - tmp49 : array - tmp5 : array - tmp51 : array - tmp62 : array - tmp64 : array - tmp67 : array - tmp68 : array - tmp69 : array - tmp76 : array - tmp77 : array - tmp80 : array - tmp90 : array - tmp93 : array - tmp94 : array - tmp96 : array - tmp97 : array - tmp98 : array - """ - - tmp151 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (4, 3), (4, 0, 1, 2)) - tmp141 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (0, 2, 4, 5), (1, 4, 5, 3)) - tmp139 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp137 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp133 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp131 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp127 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 3), (1, 4)) - tmp126 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 2), (0, 4)) * -1 - tmp119 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp117 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp115 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 1), (4, 3)) * -1 - tmp114 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (4, 3, 1, 5), (4, 0, 2, 5)) - tmp113 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) - tmp112 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 0, 3), (4, 2)) * -1 - tmp111 = einsum(f.aa.ov, (0, 1), t2.abab, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp110 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp108 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp106 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp104 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp102 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp100 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 1, 5), (0, 4, 3, 5)) - tmp98 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ooov, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp97 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 1, 4, 5)) - tmp96 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.abab, (1, 4, 3, 5), (0, 2, 4, 5)) - tmp94 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp93 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp90 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp80 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (1, 5, 2, 4)) - tmp77 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp76 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (4, 3), (0, 4, 1, 2)) - tmp69 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 3, 5)) - tmp68 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp67 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp64 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp62 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 5, 2, 0)) - tmp51 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (4, 3), (4, 0, 1, 2)) - tmp49 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 5, 3)) - tmp47 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp45 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp43 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp41 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp39 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp37 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp35 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 4, 3), (4, 1)) - tmp33 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp31 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp29 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp28 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp27 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) - tmp25 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp24 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp21 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp19 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp18 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 3), (4, 0)) - tmp17 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 3, 1), (4, 2)) * -1 - tmp12 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp10 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp5 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp3 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 1, 3), (4, 0)) - - return {f"tmp10": tmp10, f"tmp100": tmp100, f"tmp102": tmp102, f"tmp104": tmp104, f"tmp106": tmp106, f"tmp108": tmp108, f"tmp110": tmp110, f"tmp111": tmp111, f"tmp112": tmp112, f"tmp113": tmp113, f"tmp114": tmp114, f"tmp115": tmp115, f"tmp117": tmp117, f"tmp119": tmp119, f"tmp12": tmp12, f"tmp126": tmp126, f"tmp127": tmp127, f"tmp131": tmp131, f"tmp133": tmp133, f"tmp137": tmp137, f"tmp139": tmp139, f"tmp141": tmp141, f"tmp151": tmp151, f"tmp17": tmp17, f"tmp18": tmp18, f"tmp19": tmp19, f"tmp21": tmp21, f"tmp24": tmp24, f"tmp25": tmp25, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp31": tmp31, f"tmp33": tmp33, f"tmp35": tmp35, f"tmp37": tmp37, f"tmp39": tmp39, f"tmp41": tmp41, f"tmp43": tmp43, f"tmp45": tmp45, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp51": tmp51, f"tmp62": tmp62, f"tmp64": tmp64, f"tmp67": tmp67, f"tmp68": tmp68, f"tmp69": tmp69, f"tmp76": tmp76, f"tmp77": tmp77, f"tmp80": tmp80, f"tmp90": tmp90, f"tmp93": tmp93, f"tmp94": tmp94, f"tmp96": tmp96, f"tmp97": tmp97, f"tmp98": tmp98} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:20:17.985850. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp50 = np.copy(ints.tmp137) - del ints.tmp137 - tmp50 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) * 0.5 - tmp48 = np.copy(ints.tmp10) * 2 - tmp48 += ints.tmp12 - tmp46 = np.copy(ints.tmp106) - tmp46 += ints.tmp110 * 0.5 - tmp58 = np.copy(ints.tmp141) - del ints.tmp141 - tmp58 += ints.tmp139 * 2 - del ints.tmp139 - tmp56 = np.copy(ints.tmp102) - tmp56 += ints.tmp108 * 2 - tmp7 = np.copy(ints.tmp33) - del ints.tmp33 - tmp7 += ints.tmp31 * 2 - del ints.tmp31 - tmp17 = np.copy(ints.tmp29) - del ints.tmp29 - tmp17 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) * 0.5 - tmp11 = np.copy(ints.tmp41) - tmp11 += ints.tmp47 * 0.5 - tmp15 = np.copy(ints.tmp3) * 2 - tmp15 += ints.tmp5 - tmp13 = np.copy(ints.tmp45) - tmp13 += ints.tmp49 * 2 - tmp44 = einsum(r2.aba, (0, 1, 2), v.aabb.ovov, (0, 2, 3, 4), (1, 3, 4)) - tmp51 = einsum(r1.b, (0,), tmp50, (1, 2, 0, 3), (1, 2, 3)) * 2 - del tmp50 - tmp45 = einsum(r2.bbb, (0, 1, 2), v.bbbb.oovv, (3, 1, 4, 2), (0, 3, 4)) - tmp49 = einsum(tmp48, (0, 1), r2.bbb, (2, 1, 3), (2, 0, 3)) * -2 - del tmp48 - tmp43 = einsum(r2.aba, (0, 1, 2), ints.tmp100, (0, 3, 2, 4), (3, 1, 4)) - tmp47 = einsum(r2.bbb, (0, 1, 2), tmp46, (3, 1, 4, 2), (0, 3, 4)) * -4 - del tmp46 - tmp31 = einsum(r2.aba, (0, 1, 2), v.aabb.ovov, (0, 2, 1, 3), (3,)) - tmp32 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (0, 3, 1, 2), (3,)) - tmp55 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 4, 1, 2), (0, 3, 4)) - tmp59 = einsum(r1.b, (0,), tmp58, (1, 2, 0, 3), (1, 2, 3)) - del tmp58 - tmp53 = einsum(r2.bbb, (0, 1, 2), f.bb.oo, (3, 1), (3, 0, 2)) - tmp57 = einsum(r2.aba, (0, 1, 2), tmp56, (0, 3, 2, 4), (1, 3, 4)) - del tmp56 - tmp54 = einsum(ints.tmp104, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (0, 4, 2)) - tmp23 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (2, 0, 3), (1,)) * -1 - tmp22 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (0, 2, 1), (3,)) * -1 - tmp5 = einsum(r2.bab, (0, 1, 2), ints.tmp43, (3, 0, 4, 2), (3, 1, 4)) * -1 - tmp6 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (2, 4, 3), (4, 0, 1)) * -1 - tmp4 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (4, 2, 3), (4, 0, 1)) - tmp2 = einsum(f.aa.oo, (0, 1), r2.aaa, (2, 1, 3), (0, 2, 3)) - tmp3 = einsum(r2.aaa, (0, 1, 2), ints.tmp39, (3, 1, 4, 2), (3, 0, 4)) - tmp8 = einsum(r1.a, (0,), tmp7, (1, 2, 0, 3), (1, 2, 3)) - del tmp7 - tmp18 = einsum(r1.a, (0,), tmp17, (1, 2, 0, 3), (1, 2, 3)) * 2 - del tmp17 - tmp10 = einsum(v.aaaa.oovv, (0, 1, 2, 3), r2.aaa, (4, 1, 3), (4, 0, 2)) - tmp12 = einsum(r2.aaa, (0, 1, 2), tmp11, (3, 1, 4, 2), (0, 3, 4)) * -4 - del tmp11 - tmp16 = einsum(tmp15, (0, 1), r2.aaa, (2, 1, 3), (2, 0, 3)) * -2 - del tmp15 - tmp14 = einsum(tmp13, (0, 1, 2, 3), r2.bab, (1, 4, 3), (4, 0, 2)) * -1 - del tmp13 - tmp52 = np.copy(tmp43) - del tmp43 - tmp52 += tmp44 - del tmp44 - tmp52 += tmp45 * 2 - del tmp45 - tmp52 += np.transpose(tmp47, (1, 0, 2)) * -1 - del tmp47 - tmp52 += np.transpose(tmp49, (1, 0, 2)) - del tmp49 - tmp52 += tmp51 - del tmp51 - tmp33 = np.copy(tmp31) * -0.5 - del tmp31 - tmp33 += tmp32 - del tmp32 - tmp62 = np.copy(ints.tmp131) - del ints.tmp131 - tmp62 += np.transpose(ints.tmp151, (1, 2, 0, 3)) * -1 - del ints.tmp151 - tmp61 = np.copy(ints.tmp133) - del ints.tmp133 - tmp61 += np.transpose(v.bbbb.oooo, (0, 2, 1, 3)) - tmp42 = np.copy(f.bb.ov) - tmp42 += ints.tmp127 - del ints.tmp127 - tmp42 += ints.tmp93 - del ints.tmp93 - tmp42 += ints.tmp94 * 2 - del ints.tmp94 - tmp42 += ints.tmp112 * -2 - del ints.tmp112 - tmp42 += ints.tmp113 * -1 - del ints.tmp113 - tmp42 += ints.tmp126 * -2 - del ints.tmp126 - tmp60 = np.copy(tmp53) * 2 - del tmp53 - tmp60 += tmp54 * 4 - del tmp54 - tmp60 += tmp55 * 2 - del tmp55 - tmp60 += np.transpose(tmp57, (1, 0, 2)) - del tmp57 - tmp60 += tmp59 - del tmp59 - tmp39 = np.copy(np.transpose(ints.tmp115, (1, 0))) * 2 - del ints.tmp115 - tmp39 += np.transpose(ints.tmp117, (1, 0)) - del ints.tmp117 - tmp39 += f.bb.vv * -1 - tmp40 = np.copy(tmp22) * 2 - tmp40 += tmp23 - tmp41 = np.copy(ints.tmp111) - del ints.tmp111 - tmp41 += np.transpose(ints.tmp90, (1, 0, 2, 3)) - del ints.tmp90 - tmp41 += np.transpose(ints.tmp97, (1, 0, 2, 3)) - del ints.tmp97 - tmp41 += np.transpose(ints.tmp98, (1, 0, 2, 3)) * 2 - del ints.tmp98 - tmp41 += v.aabb.ooov - tmp41 += np.transpose(ints.tmp114, (1, 0, 2, 3)) * -1 - del ints.tmp114 - tmp41 += np.transpose(ints.tmp96, (1, 0, 2, 3)) * -1 - del ints.tmp96 - tmp36 = np.copy(ints.tmp102) - del ints.tmp102 - tmp36 += ints.tmp108 * 2 - del ints.tmp108 - tmp36 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp36 += ints.tmp100 * -1 - del ints.tmp100 - tmp37 = np.copy(ints.tmp119) - del ints.tmp119 - tmp37 += v.aabb.oovv * -1 - tmp1 = np.copy(f.bb.oo) - tmp1 += np.transpose(ints.tmp10, (1, 0)) * 2 - del ints.tmp10 - tmp1 += np.transpose(ints.tmp12, (1, 0)) - del ints.tmp12 - tmp38 = np.copy(ints.tmp64) - tmp38 += v.aabb.oooo - tmp0 = np.copy(f.aa.oo) - tmp0 += np.transpose(ints.tmp3, (1, 0)) * 2 - del ints.tmp3 - tmp0 += np.transpose(ints.tmp5, (1, 0)) - del ints.tmp5 - tmp35 = np.copy(ints.tmp106) * 2 - del ints.tmp106 - tmp35 += ints.tmp110 - del ints.tmp110 - tmp35 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp35 += ints.tmp104 * -2 - del ints.tmp104 - tmp35 += v.bbbb.oovv * -1 - tmp34 = np.copy(ints.tmp62) - del ints.tmp62 - tmp34 += ints.tmp68 - del ints.tmp68 - tmp34 += ints.tmp69 * 2 - del ints.tmp69 - tmp34 += np.transpose(ints.tmp76, (0, 2, 1, 3)) - del ints.tmp76 - tmp34 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp34 += ints.tmp67 * -1 - del ints.tmp67 - tmp34 += ints.tmp77 * -1 - del ints.tmp77 - tmp21 = np.copy(np.transpose(ints.tmp35, (1, 0))) * 2 - del ints.tmp35 - tmp21 += np.transpose(ints.tmp37, (1, 0)) - del ints.tmp37 - tmp21 += f.aa.vv * -1 - tmp28 = np.copy(ints.tmp45) - del ints.tmp45 - tmp28 += ints.tmp49 * 2 - del ints.tmp49 - tmp28 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp28 += ints.tmp43 * -1 - del ints.tmp43 - tmp27 = np.copy(ints.tmp41) * 2 - del ints.tmp41 - tmp27 += ints.tmp47 - del ints.tmp47 - tmp27 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp27 += ints.tmp39 * -2 - del ints.tmp39 - tmp27 += v.aaaa.oovv * -1 - tmp26 = np.copy(f.aa.ov) - tmp26 += ints.tmp18 - del ints.tmp18 - tmp26 += ints.tmp24 * 2 - del ints.tmp24 - tmp26 += ints.tmp25 - del ints.tmp25 - tmp26 += ints.tmp17 * -2 - del ints.tmp17 - tmp26 += ints.tmp27 * -2 - del ints.tmp27 - tmp26 += ints.tmp28 * -1 - del ints.tmp28 - tmp30 = np.copy(ints.tmp64) - del ints.tmp64 - tmp30 += v.aabb.oooo - tmp29 = np.copy(ints.tmp80) - del ints.tmp80 - tmp29 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) * -1 - tmp20 = np.copy(ints.tmp21) - del ints.tmp21 - tmp20 += np.transpose(v.aaaa.oooo, (0, 2, 3, 1)) * -1 - tmp9 = np.copy(tmp2) * 2 - del tmp2 - tmp9 += tmp3 * 4 - del tmp3 - tmp9 += tmp4 * 2 - del tmp4 - tmp9 += tmp5 - del tmp5 - tmp9 += tmp6 - del tmp6 - tmp9 += tmp8 - del tmp8 - tmp25 = np.copy(ints.tmp19) - del ints.tmp19 - tmp25 += np.transpose(ints.tmp51, (1, 2, 0, 3)) * -1 - del ints.tmp51 - tmp24 = np.copy(tmp22) - del tmp22 - tmp24 += tmp23 * 0.5 - del tmp23 - tmp19 = np.copy(tmp10) * 2 - del tmp10 - tmp19 += np.transpose(tmp12, (1, 0, 2)) * -1 - del tmp12 - tmp19 += np.transpose(tmp14, (1, 0, 2)) - del tmp14 - tmp19 += np.transpose(tmp16, (1, 0, 2)) - del tmp16 - tmp19 += tmp18 - del tmp18 - r2new.bbb = np.copy(tmp52) * -1 - r2new.bbb += np.transpose(tmp52, (1, 0, 2)) - del tmp52 - r2new.bbb += tmp60 - r2new.bbb += np.transpose(tmp60, (1, 0, 2)) * -1 - del tmp60 - r2new.bbb += einsum(tmp61, (0, 1, 2, 3), r2.bbb, (3, 2, 4), (0, 1, 4)) * -2 - del tmp61 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp39, (2, 3), (0, 1, 3)) * -2 - r2new.bbb += einsum(tmp33, (0,), t2.bbbb, (1, 2, 3, 0), (1, 2, 3)) * 4 - r2new.bbb += einsum(r1.b, (0,), tmp62, (1, 2, 0, 3), (2, 1, 3)) * 2 - del tmp62 - r2new.bbb += einsum(tmp42, (0, 1), r1.b, (2,), (2, 0, 1)) - r2new.bbb += einsum(tmp42, (0, 1), r1.b, (2,), (0, 2, 1)) * -1 - r2new.bab = einsum(r2.bab, (0, 1, 2), tmp35, (3, 0, 4, 2), (3, 1, 4)) - del tmp35 - r2new.bab += einsum(tmp36, (0, 1, 2, 3), r2.aaa, (4, 0, 2), (1, 4, 3)) * -2 - del tmp36 - r2new.bab += einsum(tmp37, (0, 1, 2, 3), r2.bab, (4, 1, 3), (4, 0, 2)) - del tmp37 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp38, (3, 1, 4, 0), (4, 3, 2)) - del tmp38 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp39, (2, 3), (0, 1, 3)) * -1 - del tmp39 - r2new.bab += einsum(tmp40, (0,), t2.abab, (1, 2, 0, 3), (2, 1, 3)) - del tmp40 - r2new.bab += einsum(r1.a, (0,), tmp41, (0, 1, 2, 3), (2, 1, 3)) - del tmp41 - r2new.bab += einsum(tmp1, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -1 - r2new.bab += einsum(tmp0, (0, 1), r2.bab, (2, 0, 3), (2, 1, 3)) * -1 - r2new.bab += einsum(tmp42, (0, 1), r1.a, (2,), (0, 2, 1)) * -1 - del tmp42 - r2new.aba = einsum(tmp27, (0, 1, 2, 3), r2.aba, (1, 4, 3), (0, 4, 2)) - del tmp27 - r2new.aba += einsum(tmp28, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (0, 4, 2)) * -2 - del tmp28 - r2new.aba += einsum(tmp29, (0, 1, 2, 3), r2.aba, (4, 1, 3), (4, 0, 2)) - del tmp29 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp30, (3, 0, 4, 1), (3, 4, 2)) - del tmp30 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp21, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(tmp33, (0,), t2.abab, (1, 2, 3, 0), (1, 2, 3)) * 2 - del tmp33 - r2new.aba += einsum(r1.b, (0,), tmp34, (1, 2, 0, 3), (1, 2, 3)) - del tmp34 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp1, (1, 3), (0, 3, 2)) * -1 - r2new.aba += einsum(tmp0, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - r2new.aba += einsum(tmp26, (0, 1), r1.b, (2,), (0, 2, 1)) * -1 - r2new.aaa = np.copy(tmp9) - r2new.aaa += np.transpose(tmp9, (1, 0, 2)) * -1 - del tmp9 - r2new.aaa += tmp19 * -1 - r2new.aaa += np.transpose(tmp19, (1, 0, 2)) - del tmp19 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp20, (3, 4, 1, 0), (3, 4, 2)) * -2 - del tmp20 - r2new.aaa += einsum(tmp21, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp21 - r2new.aaa += einsum(tmp24, (0,), t2.aaaa, (1, 2, 3, 0), (1, 2, 3)) * 4 - del tmp24 - r2new.aaa += einsum(r1.a, (0,), tmp25, (1, 2, 0, 3), (2, 1, 3)) * 2 - del tmp25 - r2new.aaa += einsum(tmp26, (0, 1), r1.a, (2,), (2, 0, 1)) - r2new.aaa += einsum(tmp26, (0, 1), r1.a, (2,), (0, 2, 1)) * -1 - del tmp26 - r1new.b = einsum(r2.aba, (0, 1, 2), f.aa.ov, (0, 2), (1,)) * -1 - r1new.b += einsum(r2.aba, (0, 1, 2), v.aabb.ovoo, (0, 2, 3, 1), (3,)) - r1new.b += einsum(r2.bbb, (0, 1, 2), f.bb.ov, (1, 2), (0,)) * 2 - r1new.b += einsum(v.bbbb.ooov, (0, 1, 2, 3), r2.bbb, (2, 1, 3), (0,)) * 2 - r1new.b += einsum(r1.b, (0,), tmp1, (0, 1), (1,)) * -1 - del tmp1 - r1new.a = einsum(v.aabb.ooov, (0, 1, 2, 3), r2.bab, (2, 1, 3), (0,)) - r1new.a += einsum(f.bb.ov, (0, 1), r2.bab, (0, 2, 1), (2,)) * -1 - r1new.a += einsum(r2.aaa, (0, 1, 2), v.aaaa.ooov, (3, 1, 0, 2), (3,)) * 2 - r1new.a += einsum(f.aa.ov, (0, 1), r2.aaa, (2, 0, 1), (2,)) * 2 - r1new.a += einsum(tmp0, (0, 1), r1.a, (0,), (1,)) * -1 - del tmp0 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:21:12.705101. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp10 : array - tmp101 : array - tmp102 : array - tmp103 : array - tmp105 : array - tmp107 : array - tmp108 : array - tmp109 : array - tmp110 : array - tmp111 : array - tmp115 : array - tmp117 : array - tmp119 : array - tmp12 : array - tmp121 : array - tmp123 : array - tmp125 : array - tmp126 : array - tmp127 : array - tmp131 : array - tmp133 : array - tmp135 : array - tmp14 : array - tmp148 : array - tmp15 : array - tmp19 : array - tmp21 : array - tmp23 : array - tmp27 : array - tmp29 : array - tmp3 : array - tmp31 : array - tmp33 : array - tmp35 : array - tmp37 : array - tmp43 : array - tmp44 : array - tmp45 : array - tmp5 : array - tmp55 : array - tmp56 : array - tmp57 : array - tmp59 : array - tmp62 : array - tmp65 : array - tmp67 : array - tmp78 : array - tmp79 : array - tmp80 : array - tmp90 : array - tmp93 : array - tmp94 : array - """ - - tmp148 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 0, 5), (4, 2, 3, 5)) * -1 - tmp135 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 5, 2, 3)) - tmp133 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp131 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp127 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) - tmp126 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 0, 3), (4, 2)) * -1 - tmp125 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp123 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp121 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp119 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp117 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp115 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 1, 5), (0, 4, 3, 5)) - tmp111 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp110 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (4, 1, 2, 5)) - tmp109 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 3, 5)) - tmp108 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp107 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp105 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp103 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp102 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 3), (1, 4)) - tmp101 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 2), (0, 4)) * -1 - tmp94 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 4, 5), (2, 4, 1, 5)) - tmp93 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (1, 5, 2, 4)) - tmp90 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 4, 5, 3), (1, 2, 4, 5)) - tmp80 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp79 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.abab, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp78 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.abab, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp67 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp65 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp62 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp59 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp57 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 1, 3), (4, 0)) - tmp56 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 3), (4, 0)) - tmp55 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 1, 3), (4, 2)) - tmp45 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp44 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp43 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) - tmp37 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 5, 3)) - tmp35 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp33 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp31 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp29 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp27 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp23 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 5, 0, 1)) - tmp21 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp19 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp15 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp14 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp12 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp10 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 4, 1, 3), (2, 4)) - tmp5 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp3 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 4, 1), (4, 3)) * -1 - - return {f"tmp10": tmp10, f"tmp101": tmp101, f"tmp102": tmp102, f"tmp103": tmp103, f"tmp105": tmp105, f"tmp107": tmp107, f"tmp108": tmp108, f"tmp109": tmp109, f"tmp110": tmp110, f"tmp111": tmp111, f"tmp115": tmp115, f"tmp117": tmp117, f"tmp119": tmp119, f"tmp12": tmp12, f"tmp121": tmp121, f"tmp123": tmp123, f"tmp125": tmp125, f"tmp126": tmp126, f"tmp127": tmp127, f"tmp131": tmp131, f"tmp133": tmp133, f"tmp135": tmp135, f"tmp14": tmp14, f"tmp148": tmp148, f"tmp15": tmp15, f"tmp19": tmp19, f"tmp21": tmp21, f"tmp23": tmp23, f"tmp27": tmp27, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp31": tmp31, f"tmp33": tmp33, f"tmp35": tmp35, f"tmp37": tmp37, f"tmp43": tmp43, f"tmp44": tmp44, f"tmp45": tmp45, f"tmp5": tmp5, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp62": tmp62, f"tmp65": tmp65, f"tmp67": tmp67, f"tmp78": tmp78, f"tmp79": tmp79, f"tmp80": tmp80, f"tmp90": tmp90, f"tmp93": tmp93, f"tmp94": tmp94} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:21:12.778715. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp50 = np.copy(ints.tmp131) - del ints.tmp131 - tmp50 += ints.tmp135 * 0.5 - del ints.tmp135 - tmp50 += v.bbbb.ovvv * 0.5 - tmp39 = np.copy(np.transpose(ints.tmp10, (1, 0))) - tmp39 += np.transpose(ints.tmp12, (1, 0)) * 0.5 - tmp39 += f.bb.vv * -0.5 - tmp47 = np.copy(ints.tmp121) * 2 - tmp47 += ints.tmp125 - tmp56 = np.copy(ints.tmp117) - tmp56 += ints.tmp123 * 2 - tmp4 = np.copy(ints.tmp29) * 2 - tmp4 += ints.tmp35 - tmp10 = np.copy(ints.tmp19) - del ints.tmp19 - tmp10 += ints.tmp23 * 0.5 - del ints.tmp23 - tmp10 += v.aaaa.ovvv * 0.5 - tmp6 = np.copy(ints.tmp33) * 0.5 - tmp6 += ints.tmp37 - tmp8 = np.copy(np.transpose(ints.tmp3, (1, 0))) - tmp8 += np.transpose(ints.tmp5, (1, 0)) * 0.5 - tmp8 += f.aa.vv * -0.5 - tmp31 = einsum(r2.aba, (0, 1, 2), v.aabb.ovov, (2, 0, 3, 1), (3,)) - tmp32 = einsum(v.bbbb.ovov, (0, 1, 2, 3), r2.bbb, (3, 1, 2), (0,)) * -1 - tmp30 = einsum(r1.b, (0,), f.bb.ov, (1, 0), (1,)) - tmp44 = einsum(r2.aba, (0, 1, 2), ints.tmp115, (2, 3, 0, 4), (3, 4, 1)) - tmp51 = einsum(r1.b, (0,), tmp50, (1, 2, 3, 0), (1, 2, 3)) * 2 - del tmp50 - tmp45 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.aba, (1, 4, 0), (2, 4, 3)) - tmp46 = einsum(r2.bbb, (0, 1, 2), v.bbbb.oovv, (3, 2, 4, 1), (3, 0, 4)) - tmp49 = einsum(tmp39, (0, 1), r2.bbb, (2, 0, 3), (3, 2, 1)) * -4 - tmp48 = einsum(r2.bbb, (0, 1, 2), tmp47, (3, 2, 4, 1), (3, 0, 4)) * -2 - del tmp47 - tmp55 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 4, 2, 1), (3, 0, 4)) - tmp54 = einsum(ints.tmp119, (0, 1, 2, 3), r2.bbb, (4, 3, 1), (0, 2, 4)) - tmp53 = einsum(r1.b, (0,), ints.tmp133, (1, 2, 0, 3), (1, 2, 3)) - del ints.tmp133 - tmp57 = einsum(tmp56, (0, 1, 2, 3), r2.aba, (2, 4, 0), (1, 4, 3)) - del tmp56 - tmp19 = einsum(f.aa.ov, (0, 1), r1.a, (1,), (0,)) - tmp21 = einsum(r2.bab, (0, 1, 2), v.aabb.ovov, (3, 1, 2, 0), (3,)) * -1 - tmp20 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (1, 3, 2), (0,)) - tmp5 = einsum(tmp4, (0, 1, 2, 3), r2.aaa, (4, 3, 1), (0, 4, 2)) * -2 - del tmp4 - tmp3 = einsum(r2.aaa, (0, 1, 2), v.aaaa.oovv, (3, 2, 4, 1), (3, 0, 4)) - tmp11 = einsum(tmp10, (0, 1, 2, 3), r1.a, (3,), (0, 1, 2)) * 2 - del tmp10 - tmp7 = einsum(r2.bab, (0, 1, 2), tmp6, (3, 2, 4, 0), (3, 1, 4)) * -2 - del tmp6 - tmp9 = einsum(tmp8, (0, 1), r2.aaa, (2, 0, 3), (3, 2, 1)) * -4 - del tmp8 - tmp13 = einsum(ints.tmp21, (0, 1, 2, 3), r1.a, (2,), (0, 1, 3)) - del ints.tmp21 - tmp15 = einsum(r2.aaa, (0, 1, 2), v.aaaa.ovov, (3, 4, 2, 1), (3, 0, 4)) - tmp17 = einsum(r2.bab, (0, 1, 2), v.aabb.ovov, (3, 4, 2, 0), (3, 1, 4)) * -1 - tmp16 = einsum(ints.tmp31, (0, 1, 2, 3), r2.bab, (3, 4, 1), (0, 2, 4)) * -1 - tmp14 = einsum(r2.aaa, (0, 1, 2), ints.tmp27, (3, 2, 4, 1), (3, 4, 0)) - tmp41 = np.copy(f.bb.oo) - tmp41 += np.transpose(ints.tmp103, (1, 0)) * 2 - del ints.tmp103 - tmp41 += np.transpose(ints.tmp105, (1, 0)) - del ints.tmp105 - tmp59 = np.copy(tmp30) * 0.5 - tmp59 += tmp31 * -0.5 - tmp59 += tmp32 - tmp52 = np.copy(tmp44) - del tmp44 - tmp52 += tmp45 - del tmp45 - tmp52 += tmp46 * 2 - del tmp46 - tmp52 += np.transpose(tmp48, (0, 2, 1)) * -1 - del tmp48 - tmp52 += np.transpose(tmp49, (0, 2, 1)) - del tmp49 - tmp52 += tmp51 - del tmp51 - tmp58 = np.copy(tmp53) * 2 - del tmp53 - tmp58 += tmp54 * 4 - del tmp54 - tmp58 += tmp55 * 2 - del tmp55 - tmp58 += np.transpose(tmp57, (0, 2, 1)) - del tmp57 - tmp43 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 0, 4, 1), (2, 3, 4)) - tmp42 = np.copy(f.bb.ov) - tmp42 += ints.tmp102 - del ints.tmp102 - tmp42 += ints.tmp107 - del ints.tmp107 - tmp42 += ints.tmp108 * 2 - del ints.tmp108 - tmp42 += ints.tmp101 * -2 - del ints.tmp101 - tmp42 += ints.tmp126 * -2 - del ints.tmp126 - tmp42 += ints.tmp127 * -1 - del ints.tmp127 - tmp34 = einsum(r2.bab, (0, 1, 2), v.aabb.ovov, (3, 1, 4, 0), (3, 2, 4)) * -1 - tmp36 = np.copy(ints.tmp117) - del ints.tmp117 - tmp36 += ints.tmp123 * 2 - del ints.tmp123 - tmp36 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp36 += ints.tmp115 * -1 - del ints.tmp115 - tmp40 = np.copy(tmp19) - tmp40 += tmp20 * 2 - tmp40 += tmp21 - tmp37 = np.copy(ints.tmp93) - del ints.tmp93 - tmp37 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) * -1 - tmp38 = np.copy(ints.tmp109) - del ints.tmp109 - tmp38 += ints.tmp111 * 2 - del ints.tmp111 - tmp38 += ints.tmp94 - del ints.tmp94 - tmp38 += np.transpose(v.aabb.vvov, (2, 0, 1, 3)) - tmp38 += np.transpose(ints.tmp110, (0, 2, 1, 3)) * -1 - del ints.tmp110 - tmp38 += ints.tmp90 * -1 - del ints.tmp90 - tmp0 = np.copy(np.transpose(ints.tmp3, (1, 0))) * 2 - del ints.tmp3 - tmp0 += np.transpose(ints.tmp5, (1, 0)) - del ints.tmp5 - tmp0 += f.aa.vv * -1 - tmp35 = np.copy(ints.tmp121) * 2 - del ints.tmp121 - tmp35 += ints.tmp125 - del ints.tmp125 - tmp35 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp35 += ints.tmp119 * -2 - del ints.tmp119 - tmp35 += v.bbbb.oovv * -1 - tmp24 = np.copy(f.aa.ov) - tmp24 += ints.tmp14 * 2 - del ints.tmp14 - tmp24 += ints.tmp15 - del ints.tmp15 - tmp24 += ints.tmp56 - del ints.tmp56 - tmp24 += ints.tmp43 * -2 - del ints.tmp43 - tmp24 += ints.tmp44 * -1 - del ints.tmp44 - tmp24 += ints.tmp55 * -2 - del ints.tmp55 - tmp28 = np.copy(ints.tmp65) - del ints.tmp65 - tmp28 += v.aabb.oovv * -1 - tmp27 = np.copy(ints.tmp33) - del ints.tmp33 - tmp27 += ints.tmp37 * 2 - del ints.tmp37 - tmp27 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp27 += ints.tmp31 * -1 - del ints.tmp31 - tmp33 = np.copy(tmp30) - del tmp30 - tmp33 += tmp31 * -1 - del tmp31 - tmp33 += tmp32 * 2 - del tmp32 - tmp26 = np.copy(ints.tmp29) * 2 - del ints.tmp29 - tmp26 += ints.tmp35 - del ints.tmp35 - tmp26 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp26 += ints.tmp27 * -2 - del ints.tmp27 - tmp26 += v.aaaa.oovv * -1 - tmp1 = np.copy(np.transpose(ints.tmp10, (1, 0))) * 2 - del ints.tmp10 - tmp1 += np.transpose(ints.tmp12, (1, 0)) - del ints.tmp12 - tmp1 += f.bb.vv * -1 - tmp25 = einsum(r2.aba, (0, 1, 2), v.aabb.ovov, (3, 0, 4, 1), (2, 3, 4)) - tmp29 = np.copy(ints.tmp67) - del ints.tmp67 - tmp29 += ints.tmp78 - del ints.tmp78 - tmp29 += ints.tmp80 * 2 - del ints.tmp80 - tmp29 += v.aabb.ovvv - tmp29 += ints.tmp62 * -1 - del ints.tmp62 - tmp29 += np.transpose(ints.tmp79, (0, 1, 3, 2)) * -1 - del ints.tmp79 - tmp23 = np.copy(f.aa.oo) - tmp23 += np.transpose(ints.tmp57, (1, 0)) * 2 - del ints.tmp57 - tmp23 += np.transpose(ints.tmp59, (1, 0)) - del ints.tmp59 - tmp22 = np.copy(tmp19) * 0.5 - del tmp19 - tmp22 += tmp20 - del tmp20 - tmp22 += tmp21 * 0.5 - del tmp21 - tmp2 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (1, 3, 4), (4, 0, 2)) - tmp12 = np.copy(tmp3) * 2 - del tmp3 - tmp12 += np.transpose(tmp5, (0, 2, 1)) * -1 - del tmp5 - tmp12 += np.transpose(tmp7, (0, 2, 1)) - del tmp7 - tmp12 += np.transpose(tmp9, (0, 2, 1)) - del tmp9 - tmp12 += tmp11 - del tmp11 - tmp18 = np.copy(tmp13) * 2 - del tmp13 - tmp18 += tmp14 * 4 - del tmp14 - tmp18 += tmp15 * 2 - del tmp15 - tmp18 += tmp16 - del tmp16 - tmp18 += tmp17 - del tmp17 - r2new.bbb = einsum(r2.bbb, (0, 1, 2), v.bbbb.vvvv, (3, 1, 4, 0), (3, 4, 2)) * -2 - r2new.bbb += einsum(tmp43, (0, 1, 2), t2.bbbb, (2, 1, 3, 4), (3, 4, 0)) * -2 - del tmp43 - r2new.bbb += einsum(r1.b, (0,), ints.tmp148, (1, 2, 3, 0), (3, 2, 1)) * 2 - del ints.tmp148 - r2new.bbb += np.transpose(tmp52, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp52, (2, 1, 0)) - del tmp52 - r2new.bbb += np.transpose(tmp58, (1, 2, 0)) - r2new.bbb += np.transpose(tmp58, (2, 1, 0)) * -1 - del tmp58 - r2new.bbb += einsum(tmp59, (0,), t2.bbbb, (1, 0, 2, 3), (2, 3, 1)) * 4 - del tmp59 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp41, (2, 3), (0, 1, 3)) * -2 - r2new.bbb += einsum(tmp42, (0, 1), r1.b, (2,), (2, 1, 0)) - r2new.bbb += einsum(r1.b, (0,), tmp42, (1, 2), (2, 0, 1)) * -1 - r2new.bab = einsum(r2.bab, (0, 1, 2), v.aabb.vvvv, (3, 1, 4, 0), (4, 3, 2)) - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp34, (0, 4, 1), (3, 2, 4)) * -1 - del tmp34 - r2new.bab += einsum(tmp35, (0, 1, 2, 3), r2.bab, (3, 4, 1), (2, 4, 0)) - del tmp35 - r2new.bab += einsum(r2.aaa, (0, 1, 2), tmp36, (2, 3, 1, 4), (4, 0, 3)) * -2 - del tmp36 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp37, (3, 2, 4, 1), (0, 4, 3)) - del tmp37 - r2new.bab += einsum(tmp38, (0, 1, 2, 3), r1.a, (2,), (3, 1, 0)) * -1 - del tmp38 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp0, (1, 3), (0, 3, 2)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp39, (0, 3), (3, 1, 2)) * -2 - del tmp39 - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp40, (0,), (3, 2, 1)) - del tmp40 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp41, (2, 3), (0, 1, 3)) * -1 - del tmp41 - r2new.bab += einsum(tmp42, (0, 1), r1.a, (2,), (1, 2, 0)) * -1 - del tmp42 - r2new.aba = einsum(r2.aba, (0, 1, 2), v.aabb.vvvv, (3, 0, 4, 1), (3, 4, 2)) - r2new.aba += einsum(tmp25, (0, 1, 2), t2.abab, (1, 2, 3, 4), (3, 4, 0)) - del tmp25 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp26, (3, 2, 4, 0), (4, 1, 3)) - del tmp26 - r2new.aba += einsum(r2.bbb, (0, 1, 2), tmp27, (3, 2, 4, 1), (4, 0, 3)) * -2 - del tmp27 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp28, (3, 2, 4, 1), (0, 4, 3)) - del tmp28 - r2new.aba += einsum(r1.b, (0,), tmp29, (1, 2, 3, 0), (2, 3, 1)) * -1 - del tmp29 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp1, (1, 3), (0, 3, 2)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp0, (0, 3), (3, 1, 2)) * -1 - r2new.aba += einsum(tmp33, (0,), t2.abab, (1, 0, 2, 3), (2, 3, 1)) - del tmp33 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp23, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(tmp24, (0, 1), r1.b, (2,), (1, 2, 0)) * -1 - r2new.aaa = einsum(ints.tmp45, (0, 1, 2, 3), r1.a, (3,), (2, 1, 0)) * 2 - del ints.tmp45 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), v.aaaa.vvvv, (3, 1, 4, 0), (3, 4, 2)) * -2 - r2new.aaa += einsum(tmp2, (0, 1, 2), t2.aaaa, (2, 1, 3, 4), (3, 4, 0)) * -2 - del tmp2 - r2new.aaa += np.transpose(tmp12, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp12, (2, 1, 0)) - del tmp12 - r2new.aaa += np.transpose(tmp18, (1, 2, 0)) - r2new.aaa += np.transpose(tmp18, (2, 1, 0)) * -1 - del tmp18 - r2new.aaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp22, (1,), (2, 3, 0)) * 4 - del tmp22 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp23, (2, 3), (0, 1, 3)) * -2 - del tmp23 - r2new.aaa += einsum(tmp24, (0, 1), r1.a, (2,), (2, 1, 0)) - r2new.aaa += einsum(tmp24, (0, 1), r1.a, (2,), (1, 2, 0)) * -1 - del tmp24 - r1new.b = einsum(f.aa.ov, (0, 1), r2.aba, (1, 2, 0), (2,)) * -1 - r1new.b += einsum(f.bb.ov, (0, 1), r2.bbb, (2, 1, 0), (2,)) * 2 - r1new.b += einsum(r2.aba, (0, 1, 2), v.aabb.ovvv, (2, 0, 3, 1), (3,)) * -1 - r1new.b += einsum(r2.bbb, (0, 1, 2), v.bbbb.ovvv, (2, 0, 3, 1), (3,)) * -2 - r1new.b += einsum(r1.b, (0,), tmp1, (0, 1), (1,)) * -1 - del tmp1 - r1new.a = einsum(r2.aaa, (0, 1, 2), v.aaaa.ovvv, (2, 1, 3, 0), (3,)) * 2 - r1new.a += einsum(r2.bab, (0, 1, 2), f.bb.ov, (2, 0), (1,)) * -1 - r1new.a += einsum(f.aa.ov, (0, 1), r2.aaa, (2, 1, 0), (2,)) * 2 - r1new.a += einsum(r2.bab, (0, 1, 2), v.aabb.vvov, (3, 1, 2, 0), (3,)) * -1 - r1new.a += einsum(r1.a, (0,), tmp0, (0, 1), (1,)) * -1 - del tmp0 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:22:07.852007. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp110 : array - tmp113 : array - tmp115 : array - tmp132 : array - tmp136 : array - tmp138 : array - tmp14 : array - tmp140 : array - tmp142 : array - tmp144 : array - tmp146 : array - tmp148 : array - tmp157 : array - tmp159 : array - tmp16 : array - tmp161 : array - tmp178 : array - tmp18 : array - tmp20 : array - tmp22 : array - tmp24 : array - tmp26 : array - tmp28 : array - tmp29 : array - tmp3 : array - tmp31 : array - tmp32 : array - tmp33 : array - tmp35 : array - tmp37 : array - tmp39 : array - tmp4 : array - tmp41 : array - tmp43 : array - tmp45 : array - tmp47 : array - tmp53 : array - tmp55 : array - tmp59 : array - tmp6 : array - tmp61 : array - tmp67 : array - tmp68 : array - tmp70 : array - tmp71 : array - tmp73 : array - tmp74 : array - tmp76 : array - tmp8 : array - tmp82 : array - tmp84 : array - tmp89 : array - tmp91 : array - tmp93 : array - tmp95 : array - tmp97 : array - tmp99 : array - """ - - tmp178 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp161 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp159 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp157 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 1), (4, 3)) * -1 - tmp148 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp146 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp144 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp142 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp140 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp138 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp136 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (1, 5, 2, 4)) - tmp132 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp115 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp113 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 4, 3), (4, 1)) - tmp110 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp99 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp97 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp95 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 0, 2), (4, 1, 5, 3)) - tmp93 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp91 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 0, 5), (4, 1, 5, 3)) - tmp89 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp84 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 5, 2, 0)) - tmp82 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp76 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (0, 2, 4, 5), (1, 4, 5, 3)) - tmp74 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 2, 3, 5)) - tmp73 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp71 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp70 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp68 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp67 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp61 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp59 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp55 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (4, 3), (4, 0, 1, 2)) - tmp53 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (4, 3), (0, 4, 1, 2)) - tmp47 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp45 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp43 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 3), (4, 0)) - tmp41 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp39 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 2), (0, 4)) * -1 - tmp37 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 3, 1), (4, 2)) * -1 - tmp35 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp33 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp32 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (4, 3, 1, 5), (4, 0, 2, 5)) - tmp31 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 1, 4, 5)) - tmp29 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp28 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.abab, (1, 4, 3, 5), (0, 2, 4, 5)) - tmp26 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp24 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp22 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (0, 2, 4, 1), (4, 3)) - tmp20 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 0, 3), (4, 2)) * -1 - tmp18 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 1, 3), (4, 2)) - tmp16 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp14 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 1, 3), (0, 4)) - tmp10 = einsum(f.aa.ov, (0, 1), t2.abab, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp8 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (4, 3), (4, 0, 1, 2)) - tmp6 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp4 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp3 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp1 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp110": tmp110, f"tmp113": tmp113, f"tmp115": tmp115, f"tmp132": tmp132, f"tmp136": tmp136, f"tmp138": tmp138, f"tmp14": tmp14, f"tmp140": tmp140, f"tmp142": tmp142, f"tmp144": tmp144, f"tmp146": tmp146, f"tmp148": tmp148, f"tmp157": tmp157, f"tmp159": tmp159, f"tmp16": tmp16, f"tmp161": tmp161, f"tmp178": tmp178, f"tmp18": tmp18, f"tmp20": tmp20, f"tmp22": tmp22, f"tmp24": tmp24, f"tmp26": tmp26, f"tmp28": tmp28, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp31": tmp31, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp35": tmp35, f"tmp37": tmp37, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp43": tmp43, f"tmp45": tmp45, f"tmp47": tmp47, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp59": tmp59, f"tmp6": tmp6, f"tmp61": tmp61, f"tmp67": tmp67, f"tmp68": tmp68, f"tmp70": tmp70, f"tmp71": tmp71, f"tmp73": tmp73, f"tmp74": tmp74, f"tmp76": tmp76, f"tmp8": tmp8, f"tmp82": tmp82, f"tmp84": tmp84, f"tmp89": tmp89, f"tmp91": tmp91, f"tmp93": tmp93, f"tmp95": tmp95, f"tmp97": tmp97, f"tmp99": tmp99} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:22:07.929124. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp35 = einsum(r2.aba, (0, 1, 2), t2.abab, (0, 1, 2, 3), (3,)) - tmp36 = einsum(r2.bbb, (0, 1, 2), t2.bbbb, (0, 1, 3, 2), (3,)) - tmp57 = np.copy(ints.tmp142) - tmp57 += ints.tmp146 * 2 - tmp51 = np.copy(ints.tmp59) * 2 - tmp51 += ints.tmp61 - tmp48 = np.copy(ints.tmp144) - tmp48 += ints.tmp148 * 0.5 - tmp37 = np.copy(tmp35) * -0.5 - del tmp35 - tmp37 += tmp36 - del tmp36 - tmp26 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (1, 0, 3), (2,)) * -1 - tmp12 = einsum(r2.aaa, (0, 1, 2), t2.aaaa, (0, 1, 3, 2), (3,)) - tmp14 = np.copy(ints.tmp93) - tmp14 += ints.tmp97 * 0.5 - tmp16 = np.copy(ints.tmp95) - tmp16 += ints.tmp99 * 2 - tmp18 = np.copy(ints.tmp14) * 2 - tmp18 += ints.tmp16 - tmp55 = einsum(ints.tmp140, (0, 1, 2, 3), r2.bbb, (4, 0, 2), (1, 4, 3)) - tmp54 = einsum(r2.bbb, (0, 1, 2), f.bb.oo, (3, 1), (3, 0, 2)) - tmp56 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 4, 1, 2), (0, 3, 4)) - tmp58 = einsum(r2.aba, (0, 1, 2), tmp57, (0, 3, 2, 4), (1, 3, 4)) - del tmp57 - tmp44 = einsum(r1.b, (0,), v.bbbb.ooov, (1, 0, 2, 3), (1, 2, 3)) - tmp52 = einsum(tmp51, (0, 1), r2.bbb, (2, 0, 3), (2, 1, 3)) * -2 - del tmp51 - tmp45 = einsum(r2.aba, (0, 1, 2), ints.tmp138, (0, 3, 2, 4), (3, 1, 4)) - tmp49 = einsum(r2.bbb, (0, 1, 2), tmp48, (1, 3, 2, 4), (0, 3, 4)) * -4 - del tmp48 - tmp46 = einsum(r2.aba, (0, 1, 2), v.aabb.ovov, (0, 2, 3, 4), (1, 3, 4)) - tmp47 = einsum(r2.bbb, (0, 1, 2), v.bbbb.oovv, (3, 1, 4, 2), (0, 3, 4)) - tmp50 = einsum(tmp37, (0,), v.bbbb.ovov, (1, 0, 2, 3), (1, 2, 3)) * 2 - tmp21 = einsum(f.aa.oo, (0, 1), r2.aaa, (2, 1, 3), (0, 2, 3)) - tmp22 = einsum(r2.aaa, (0, 1, 2), ints.tmp89, (1, 3, 2, 4), (3, 0, 4)) - tmp27 = einsum(tmp26, (0,), v.aaaa.ovov, (1, 2, 3, 0), (1, 3, 2)) - tmp25 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (2, 4, 3), (4, 0, 1)) * -1 - tmp24 = einsum(ints.tmp91, (0, 1, 2, 3), r2.bab, (1, 4, 3), (0, 4, 2)) * -1 - tmp23 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (4, 2, 3), (4, 0, 1)) - tmp13 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp12, (3,), (0, 2, 1)) * -1 - tmp10 = einsum(v.aaaa.ooov, (0, 1, 2, 3), r1.a, (1,), (0, 2, 3)) - tmp15 = einsum(r2.aaa, (0, 1, 2), tmp14, (1, 3, 2, 4), (0, 3, 4)) * -4 - del tmp14 - tmp17 = einsum(tmp16, (0, 1, 2, 3), r2.bab, (1, 4, 3), (4, 0, 2)) * -1 - del tmp16 - tmp11 = einsum(v.aaaa.oovv, (0, 1, 2, 3), r2.aaa, (4, 1, 3), (4, 0, 2)) - tmp19 = einsum(tmp18, (0, 1), r2.aaa, (2, 0, 3), (2, 1, 3)) * -2 - del tmp18 - tmp59 = np.copy(tmp54) * 2 - del tmp54 - tmp59 += tmp55 * 4 - del tmp55 - tmp59 += tmp56 * 2 - del tmp56 - tmp59 += np.transpose(tmp58, (1, 0, 2)) - del tmp58 - tmp53 = einsum(r1.b, (0,), f.bb.ov, (1, 2), (1, 0, 2)) - tmp53 += tmp44 - del tmp44 - tmp53 += tmp45 - del tmp45 - tmp53 += tmp46 - del tmp46 - tmp53 += tmp47 * 2 - del tmp47 - tmp53 += np.transpose(tmp49, (1, 0, 2)) * -1 - del tmp49 - tmp53 += np.transpose(tmp50, (1, 0, 2)) * -1 - del tmp50 - tmp53 += np.transpose(tmp52, (1, 0, 2)) - del tmp52 - tmp42 = np.copy(ints.tmp157) * 2 - del ints.tmp157 - tmp42 += ints.tmp159 - del ints.tmp159 - tmp42 += f.bb.vv * -1 - tmp60 = np.copy(ints.tmp178) - del ints.tmp178 - tmp60 += np.transpose(v.bbbb.oooo, (0, 2, 1, 3)) - tmp40 = np.copy(ints.tmp161) - del ints.tmp161 - tmp40 += v.aabb.oovv * -1 - tmp41 = np.copy(ints.tmp132) - tmp41 += v.aabb.oooo - tmp4 = np.copy(f.aa.oo) - tmp4 += ints.tmp14 * 2 - del ints.tmp14 - tmp4 += ints.tmp16 - del ints.tmp16 - tmp38 = np.copy(ints.tmp144) * 2 - del ints.tmp144 - tmp38 += ints.tmp148 - del ints.tmp148 - tmp38 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp38 += ints.tmp140 * -2 - del ints.tmp140 - tmp38 += v.bbbb.oovv * -1 - tmp43 = np.copy(tmp12) * 2 - del tmp12 - tmp43 += tmp26 - del tmp26 - tmp9 = np.copy(f.bb.oo) - tmp9 += ints.tmp59 * 2 - del ints.tmp59 - tmp9 += ints.tmp61 - del ints.tmp61 - tmp39 = np.copy(ints.tmp142) - del ints.tmp142 - tmp39 += ints.tmp146 * 2 - del ints.tmp146 - tmp39 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp39 += ints.tmp138 * -1 - del ints.tmp138 - tmp32 = np.copy(ints.tmp95) - del ints.tmp95 - tmp32 += ints.tmp99 * 2 - del ints.tmp99 - tmp32 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp32 += ints.tmp91 * -1 - del ints.tmp91 - tmp34 = np.copy(ints.tmp132) - del ints.tmp132 - tmp34 += v.aabb.oooo - tmp31 = np.copy(ints.tmp93) * 2 - del ints.tmp93 - tmp31 += ints.tmp97 - del ints.tmp97 - tmp31 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp31 += ints.tmp89 * -2 - del ints.tmp89 - tmp31 += v.aaaa.oovv * -1 - tmp33 = np.copy(ints.tmp136) - del ints.tmp136 - tmp33 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) * -1 - tmp30 = np.copy(ints.tmp113) * 2 - del ints.tmp113 - tmp30 += ints.tmp115 - del ints.tmp115 - tmp30 += f.aa.vv * -1 - tmp28 = np.copy(tmp21) * 2 - del tmp21 - tmp28 += tmp22 * 4 - del tmp22 - tmp28 += tmp23 * 2 - del tmp23 - tmp28 += tmp24 - del tmp24 - tmp28 += tmp25 - del tmp25 - tmp28 += tmp27 - del tmp27 - tmp20 = einsum(f.aa.ov, (0, 1), r1.a, (2,), (0, 2, 1)) - tmp20 += tmp10 - del tmp10 - tmp20 += tmp11 * 2 - del tmp11 - tmp20 += tmp13 * 2 - del tmp13 - tmp20 += np.transpose(tmp15, (1, 0, 2)) * -1 - del tmp15 - tmp20 += np.transpose(tmp17, (1, 0, 2)) - del tmp17 - tmp20 += np.transpose(tmp19, (1, 0, 2)) - del tmp19 - tmp29 = np.copy(ints.tmp110) - del ints.tmp110 - tmp29 += np.transpose(v.aaaa.oooo, (0, 2, 3, 1)) * -1 - tmp5 = np.copy(ints.tmp53) - del ints.tmp53 - tmp5 += ints.tmp70 - del ints.tmp70 - tmp5 += ints.tmp74 * 2 - del ints.tmp74 - tmp5 += np.transpose(ints.tmp84, (0, 2, 1, 3)) - del ints.tmp84 - tmp5 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp5 += np.transpose(ints.tmp67, (0, 2, 1, 3)) * -1 - del ints.tmp67 - tmp5 += np.transpose(ints.tmp73, (0, 2, 1, 3)) * -1 - del ints.tmp73 - tmp6 = np.copy(ints.tmp55) - del ints.tmp55 - tmp6 += np.transpose(ints.tmp71, (1, 0, 2, 3)) * 2 - del ints.tmp71 - tmp6 += np.transpose(ints.tmp76, (1, 0, 2, 3)) - del ints.tmp76 - tmp6 += np.transpose(ints.tmp68, (2, 0, 1, 3)) * -2 - del ints.tmp68 - tmp6 += np.transpose(ints.tmp82, (2, 0, 1, 3)) * -1 - del ints.tmp82 - tmp6 += v.bbbb.ooov * -1 - tmp7 = np.copy(f.aa.ov) * 0.5 - tmp7 += ints.tmp1 - tmp7 += ints.tmp43 * 0.5 - tmp7 += ints.tmp4 * 0.5 - tmp7 += ints.tmp18 * -1 - tmp7 += ints.tmp24 * -0.5 - tmp7 += ints.tmp37 * -1 - tmp8 = np.copy(f.bb.ov) - tmp8 += ints.tmp3 - tmp8 += ints.tmp41 - tmp8 += ints.tmp6 * 2 - tmp8 += ints.tmp20 * -2 - tmp8 += ints.tmp22 * -1 - tmp8 += ints.tmp39 * -2 - tmp3 = np.copy(f.aa.ov) - tmp3 += ints.tmp1 * 2 - del ints.tmp1 - tmp3 += ints.tmp43 - del ints.tmp43 - tmp3 += ints.tmp4 - del ints.tmp4 - tmp3 += ints.tmp18 * -2 - del ints.tmp18 - tmp3 += ints.tmp24 * -1 - del ints.tmp24 - tmp3 += ints.tmp37 * -2 - del ints.tmp37 - tmp2 = np.copy(f.bb.ov) * 0.5 - tmp2 += ints.tmp3 * 0.5 - del ints.tmp3 - tmp2 += ints.tmp41 * 0.5 - del ints.tmp41 - tmp2 += ints.tmp6 - del ints.tmp6 - tmp2 += ints.tmp20 * -1 - del ints.tmp20 - tmp2 += ints.tmp22 * -0.5 - del ints.tmp22 - tmp2 += ints.tmp39 * -1 - del ints.tmp39 - tmp1 = np.copy(ints.tmp26) * 2 - del ints.tmp26 - tmp1 += ints.tmp45 - del ints.tmp45 - tmp1 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) - tmp1 += np.transpose(ints.tmp29, (0, 2, 1, 3)) * -2 - del ints.tmp29 - tmp1 += np.transpose(ints.tmp33, (0, 2, 1, 3)) * -1 - del ints.tmp33 - tmp1 += np.transpose(ints.tmp8, (1, 2, 0, 3)) * -1 - del ints.tmp8 - tmp0 = np.copy(ints.tmp10) - del ints.tmp10 - tmp0 += ints.tmp31 - del ints.tmp31 - tmp0 += ints.tmp35 * 2 - del ints.tmp35 - tmp0 += np.transpose(ints.tmp47, (1, 0, 2, 3)) - del ints.tmp47 - tmp0 += v.aabb.ooov - tmp0 += np.transpose(ints.tmp28, (1, 0, 2, 3)) * -1 - del ints.tmp28 - tmp0 += np.transpose(ints.tmp32, (1, 0, 2, 3)) * -1 - del ints.tmp32 - r2new.bbb = np.copy(tmp53) * -1 - r2new.bbb += np.transpose(tmp53, (1, 0, 2)) - del tmp53 - r2new.bbb += tmp59 - r2new.bbb += np.transpose(tmp59, (1, 0, 2)) * -1 - del tmp59 - r2new.bbb += einsum(tmp60, (0, 1, 2, 3), r2.bbb, (1, 0, 4), (2, 3, 4)) * -2 - del tmp60 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp42, (2, 3), (0, 1, 3)) * -2 - r2new.bab = einsum(r1.a, (0,), f.bb.ov, (1, 2), (1, 0, 2)) * -1 - r2new.bab += einsum(v.aabb.ooov, (0, 1, 2, 3), r1.a, (1,), (2, 0, 3)) - r2new.bab += einsum(tmp38, (0, 1, 2, 3), r2.bab, (0, 4, 2), (1, 4, 3)) - del tmp38 - r2new.bab += einsum(r2.aaa, (0, 1, 2), tmp39, (1, 3, 2, 4), (3, 0, 4)) * -2 - del tmp39 - r2new.bab += einsum(tmp40, (0, 1, 2, 3), r2.bab, (4, 0, 2), (4, 1, 3)) - del tmp40 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp41, (1, 3, 0, 4), (4, 3, 2)) - del tmp41 - r2new.bab += einsum(tmp42, (0, 1), r2.bab, (2, 3, 0), (2, 3, 1)) * -1 - del tmp42 - r2new.bab += einsum(tmp43, (0,), v.aabb.ovov, (1, 0, 2, 3), (2, 1, 3)) - del tmp43 - r2new.bab += einsum(tmp9, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp4, (1, 3), (0, 3, 2)) * -1 - r2new.aba = einsum(r1.b, (0,), v.aabb.ovoo, (1, 2, 3, 0), (1, 3, 2)) - r2new.aba += einsum(f.aa.ov, (0, 1), r1.b, (2,), (0, 2, 1)) * -1 - r2new.aba += einsum(tmp31, (0, 1, 2, 3), r2.aba, (0, 4, 2), (1, 4, 3)) - del tmp31 - r2new.aba += einsum(tmp32, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (0, 4, 2)) * -2 - del tmp32 - r2new.aba += einsum(tmp33, (0, 1, 2, 3), r2.aba, (4, 0, 2), (4, 1, 3)) - del tmp33 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp34, (0, 3, 1, 4), (3, 4, 2)) - del tmp34 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp30, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(tmp37, (0,), v.aabb.ovov, (1, 2, 3, 0), (1, 3, 2)) * 2 - del tmp37 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp9, (1, 3), (0, 3, 2)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp4, (0, 3), (3, 1, 2)) * -1 - r2new.aaa = np.copy(tmp20) * -1 - r2new.aaa += np.transpose(tmp20, (1, 0, 2)) - del tmp20 - r2new.aaa += tmp28 - r2new.aaa += np.transpose(tmp28, (1, 0, 2)) * -1 - del tmp28 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp29, (1, 0, 3, 4), (3, 4, 2)) * -2 - del tmp29 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp30, (2, 3), (0, 1, 3)) * -2 - del tmp30 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp5, (0, 3, 1, 2), (3,)) - del tmp5 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp6, (3, 0, 1, 2), (3,)) * 2 - del tmp6 - r1new.b += einsum(tmp7, (0, 1), r2.aba, (0, 2, 1), (2,)) * -2 - del tmp7 - r1new.b += einsum(tmp8, (0, 1), r2.bbb, (2, 0, 1), (2,)) * 2 - del tmp8 - r1new.b += einsum(r1.b, (0,), tmp9, (0, 1), (1,)) * -1 - del tmp9 - r1new.a = einsum(tmp0, (0, 1, 2, 3), r2.bab, (2, 1, 3), (0,)) - del tmp0 - r1new.a += einsum(tmp1, (0, 1, 2, 3), r2.aaa, (0, 1, 3), (2,)) * -2 - del tmp1 - r1new.a += einsum(tmp2, (0, 1), r2.bab, (0, 2, 1), (2,)) * -2 - del tmp2 - r1new.a += einsum(tmp3, (0, 1), r2.aaa, (2, 0, 1), (2,)) * 2 - del tmp3 - r1new.a += einsum(r1.a, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:03.783640. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp101 : array - tmp103 : array - tmp105 : array - tmp132 : array - tmp134 : array - tmp136 : array - tmp138 : array - tmp14 : array - tmp140 : array - tmp142 : array - tmp144 : array - tmp146 : array - tmp148 : array - tmp158 : array - tmp16 : array - tmp18 : array - tmp20 : array - tmp22 : array - tmp24 : array - tmp26 : array - tmp28 : array - tmp3 : array - tmp30 : array - tmp32 : array - tmp34 : array - tmp36 : array - tmp38 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp43 : array - tmp44 : array - tmp46 : array - tmp48 : array - tmp59 : array - tmp6 : array - tmp61 : array - tmp67 : array - tmp69 : array - tmp75 : array - tmp76 : array - tmp78 : array - tmp79 : array - tmp81 : array - tmp83 : array - tmp85 : array - tmp91 : array - tmp93 : array - tmp95 : array - tmp97 : array - tmp99 : array - """ - - tmp158 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (1, 5, 2, 4)) - tmp148 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp146 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp144 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp142 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp140 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp138 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp136 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp134 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp132 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp105 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp103 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp101 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 0, 2), (4, 1, 5, 3)) - tmp99 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp97 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 0, 5), (4, 1, 5, 3)) - tmp95 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp93 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp91 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 1, 3), (0, 4)) - tmp85 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp83 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 5, 2, 3)) - tmp81 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp79 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp78 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.abab, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp76 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp75 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.abab, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp69 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp67 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 0, 5), (4, 2, 3, 5)) * -1 - tmp61 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp59 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 4, 1, 3), (2, 4)) - tmp48 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (4, 5, 1, 2)) - tmp46 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp44 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 5, 0, 1)) - tmp43 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (4, 1, 2, 5)) - tmp41 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp40 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 3, 5)) - tmp38 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp36 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 3), (4, 0)) - tmp34 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp32 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 2), (0, 4)) * -1 - tmp30 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 1, 3), (4, 2)) - tmp28 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 4, 5), (2, 4, 1, 5)) - tmp26 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp24 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp22 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (0, 2, 4, 1), (4, 3)) - tmp20 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 0, 3), (4, 2)) * -1 - tmp18 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 1, 3), (4, 2)) - tmp16 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp14 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 4, 1), (4, 3)) * -1 - tmp6 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp4 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp3 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp1 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - - return {f"tmp1": tmp1, f"tmp101": tmp101, f"tmp103": tmp103, f"tmp105": tmp105, f"tmp132": tmp132, f"tmp134": tmp134, f"tmp136": tmp136, f"tmp138": tmp138, f"tmp14": tmp14, f"tmp140": tmp140, f"tmp142": tmp142, f"tmp144": tmp144, f"tmp146": tmp146, f"tmp148": tmp148, f"tmp158": tmp158, f"tmp16": tmp16, f"tmp18": tmp18, f"tmp20": tmp20, f"tmp22": tmp22, f"tmp24": tmp24, f"tmp26": tmp26, f"tmp28": tmp28, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp32": tmp32, f"tmp34": tmp34, f"tmp36": tmp36, f"tmp38": tmp38, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp43": tmp43, f"tmp44": tmp44, f"tmp46": tmp46, f"tmp48": tmp48, f"tmp59": tmp59, f"tmp6": tmp6, f"tmp61": tmp61, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp75": tmp75, f"tmp76": tmp76, f"tmp78": tmp78, f"tmp79": tmp79, f"tmp81": tmp81, f"tmp83": tmp83, f"tmp85": tmp85, f"tmp91": tmp91, f"tmp93": tmp93, f"tmp95": tmp95, f"tmp97": tmp97, f"tmp99": tmp99} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:23:03.856510. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp12 = einsum(t2.bbbb, (0, 1, 2, 3), r2.bbb, (2, 3, 1), (0,)) - tmp11 = einsum(t2.abab, (0, 1, 2, 3), r2.aba, (2, 3, 0), (1,)) - tmp51 = np.copy(tmp11) * -0.5 - tmp51 += tmp12 - tmp48 = np.copy(ints.tmp144) * 2 - tmp48 += ints.tmp148 - tmp40 = np.copy(ints.tmp59) - tmp40 += ints.tmp61 * 0.5 - tmp40 += f.bb.vv * -0.5 - tmp56 = np.copy(ints.tmp142) - tmp56 += ints.tmp146 * 2 - tmp20 = np.copy(ints.tmp101) * 0.5 - tmp20 += ints.tmp105 - tmp5 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (2, 3, 1), (0,)) - tmp18 = np.copy(ints.tmp103) * 0.5 - tmp18 += ints.tmp99 - tmp22 = np.copy(ints.tmp14) - tmp22 += ints.tmp16 * 0.5 - tmp22 += f.aa.vv * -0.5 - tmp6 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (3, 2, 1), (0,)) * -1 - tmp44 = einsum(r1.b, (0,), v.bbbb.ovvv, (1, 2, 3, 0), (1, 2, 3)) - tmp52 = einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp51, (2,), (0, 3, 1)) * 2 - del tmp51 - tmp45 = einsum(r2.aba, (0, 1, 2), ints.tmp138, (2, 3, 0, 4), (3, 4, 1)) - tmp49 = einsum(r2.bbb, (0, 1, 2), tmp48, (2, 3, 1, 4), (3, 0, 4)) * -2 - del tmp48 - tmp46 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.aba, (1, 4, 0), (2, 4, 3)) - tmp47 = einsum(r2.bbb, (0, 1, 2), v.bbbb.oovv, (3, 2, 4, 1), (3, 0, 4)) - tmp50 = einsum(tmp40, (0, 1), r2.bbb, (2, 0, 3), (3, 2, 1)) * -4 - tmp55 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 4, 2, 1), (3, 0, 4)) - tmp54 = einsum(ints.tmp140, (0, 1, 2, 3), r2.bbb, (4, 2, 0), (1, 3, 4)) - tmp57 = einsum(tmp56, (0, 1, 2, 3), r2.aba, (2, 4, 0), (1, 4, 3)) - del tmp56 - tmp21 = einsum(r2.bab, (0, 1, 2), tmp20, (3, 2, 4, 0), (3, 1, 4)) * -2 - del tmp20 - tmp15 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), r1.a, (3,), (0, 1, 2)) - tmp17 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp5, (2,), (0, 1, 3)) * -1 - tmp16 = einsum(r2.aaa, (0, 1, 2), v.aaaa.oovv, (3, 2, 4, 1), (3, 0, 4)) - tmp19 = einsum(tmp18, (0, 1, 2, 3), r2.aaa, (4, 2, 0), (1, 4, 3)) * -4 - del tmp18 - tmp23 = einsum(tmp22, (0, 1), r2.aaa, (2, 0, 3), (3, 2, 1)) * -4 - del tmp22 - tmp28 = einsum(r2.bab, (0, 1, 2), v.aabb.ovov, (3, 4, 2, 0), (3, 1, 4)) * -1 - tmp27 = einsum(r2.bab, (0, 1, 2), ints.tmp97, (3, 2, 4, 0), (3, 4, 1)) * -1 - tmp26 = einsum(r2.aaa, (0, 1, 2), v.aaaa.ovov, (3, 4, 2, 1), (3, 0, 4)) - tmp25 = einsum(r2.aaa, (0, 1, 2), ints.tmp95, (2, 3, 1, 4), (3, 4, 0)) - tmp29 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp6, (2,), (0, 1, 3)) - tmp41 = np.copy(f.bb.oo) - tmp41 += ints.tmp134 * 2 - del ints.tmp134 - tmp41 += ints.tmp136 - del ints.tmp136 - tmp53 = einsum(r1.b, (0,), f.bb.ov, (1, 2), (1, 2, 0)) - tmp53 += tmp44 - del tmp44 - tmp53 += tmp45 - del tmp45 - tmp53 += tmp46 - del tmp46 - tmp53 += tmp47 * 2 - del tmp47 - tmp53 += np.transpose(tmp49, (0, 2, 1)) * -1 - del tmp49 - tmp53 += np.transpose(tmp50, (0, 2, 1)) - del tmp50 - tmp53 += np.transpose(tmp52, (0, 2, 1)) * -1 - del tmp52 - tmp58 = np.copy(tmp54) * 4 - del tmp54 - tmp58 += tmp55 * 2 - del tmp55 - tmp58 += np.transpose(tmp57, (0, 2, 1)) - del tmp57 - tmp43 = einsum(r2.bbb, (0, 1, 2), t2.bbbb, (3, 4, 0, 1), (2, 3, 4)) - tmp36 = einsum(r2.bab, (0, 1, 2), t2.abab, (3, 4, 1, 0), (3, 2, 4)) * -1 - tmp4 = np.copy(ints.tmp14) * 2 - del ints.tmp14 - tmp4 += ints.tmp16 - del ints.tmp16 - tmp4 += f.aa.vv * -1 - tmp37 = np.copy(ints.tmp144) * 2 - del ints.tmp144 - tmp37 += ints.tmp148 - del ints.tmp148 - tmp37 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp37 += ints.tmp140 * -2 - del ints.tmp140 - tmp37 += v.bbbb.oovv * -1 - tmp38 = np.copy(ints.tmp142) - del ints.tmp142 - tmp38 += ints.tmp146 * 2 - del ints.tmp146 - tmp38 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp38 += ints.tmp138 * -1 - del ints.tmp138 - tmp42 = np.copy(tmp5) * 2 - tmp42 += tmp6 - tmp39 = np.copy(ints.tmp158) - del ints.tmp158 - tmp39 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) * -1 - tmp32 = einsum(r2.aba, (0, 1, 2), t2.abab, (3, 4, 0, 1), (2, 3, 4)) - tmp34 = np.copy(ints.tmp101) - del ints.tmp101 - tmp34 += ints.tmp105 * 2 - del ints.tmp105 - tmp34 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp34 += ints.tmp97 * -1 - del ints.tmp97 - tmp31 = np.copy(f.aa.oo) - tmp31 += ints.tmp91 * 2 - del ints.tmp91 - tmp31 += ints.tmp93 - del ints.tmp93 - tmp13 = np.copy(tmp11) * -1 - del tmp11 - tmp13 += tmp12 * 2 - del tmp12 - tmp33 = np.copy(ints.tmp103) - del ints.tmp103 - tmp33 += ints.tmp99 * 2 - del ints.tmp99 - tmp33 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp33 += ints.tmp95 * -2 - del ints.tmp95 - tmp33 += v.aaaa.oovv * -1 - tmp35 = np.copy(ints.tmp132) - del ints.tmp132 - tmp35 += v.aabb.oovv * -1 - tmp10 = np.copy(ints.tmp59) * 2 - del ints.tmp59 - tmp10 += ints.tmp61 - del ints.tmp61 - tmp10 += f.bb.vv * -1 - tmp24 = einsum(f.aa.ov, (0, 1), r1.a, (2,), (0, 1, 2)) - tmp24 += tmp15 - del tmp15 - tmp24 += tmp16 * 2 - del tmp16 - tmp24 += tmp17 * 2 - del tmp17 - tmp24 += np.transpose(tmp19, (0, 2, 1)) * -1 - del tmp19 - tmp24 += np.transpose(tmp21, (0, 2, 1)) - del tmp21 - tmp24 += np.transpose(tmp23, (0, 2, 1)) - del tmp23 - tmp30 = np.copy(tmp25) * 4 - del tmp25 - tmp30 += tmp26 * 2 - del tmp26 - tmp30 += tmp27 - del tmp27 - tmp30 += tmp28 - del tmp28 - tmp30 += tmp29 - del tmp29 - tmp14 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (2, 3, 4), (4, 0, 1)) - tmp3 = np.copy(f.aa.ov) * 0.5 - tmp3 += ints.tmp1 - del ints.tmp1 - tmp3 += ints.tmp36 * 0.5 - del ints.tmp36 - tmp3 += ints.tmp4 * 0.5 - del ints.tmp4 - tmp3 += ints.tmp18 * -1 - del ints.tmp18 - tmp3 += ints.tmp24 * -0.5 - del ints.tmp24 - tmp3 += ints.tmp30 * -1 - del ints.tmp30 - tmp2 = np.copy(f.bb.ov) * 0.5 - tmp2 += ints.tmp34 * 0.5 - del ints.tmp34 - tmp2 += ints.tmp3 * 0.5 - del ints.tmp3 - tmp2 += ints.tmp6 - del ints.tmp6 - tmp2 += ints.tmp20 * -1 - del ints.tmp20 - tmp2 += ints.tmp22 * -0.5 - del ints.tmp22 - tmp2 += ints.tmp32 * -1 - del ints.tmp32 - tmp9 = np.copy(ints.tmp67) * 0.5 - del ints.tmp67 - tmp9 += np.transpose(ints.tmp76, (0, 1, 3, 2)) - del ints.tmp76 - tmp9 += np.transpose(ints.tmp83, (0, 1, 3, 2)) * 0.5 - del ints.tmp83 - tmp9 += v.bbbb.ovvv * 0.5 - tmp9 += np.transpose(ints.tmp79, (0, 1, 3, 2)) * -1 - del ints.tmp79 - tmp8 = np.copy(ints.tmp69) - del ints.tmp69 - tmp8 += np.transpose(ints.tmp75, (0, 1, 3, 2)) - del ints.tmp75 - tmp8 += np.transpose(ints.tmp81, (0, 1, 3, 2)) * 2 - del ints.tmp81 - tmp8 += v.aabb.ovvv - tmp8 += np.transpose(ints.tmp78, (0, 1, 3, 2)) * -1 - del ints.tmp78 - tmp8 += ints.tmp85 * -1 - del ints.tmp85 - tmp1 = np.copy(ints.tmp26) * 0.5 - del ints.tmp26 - tmp1 += np.transpose(ints.tmp38, (0, 1, 3, 2)) - del ints.tmp38 - tmp1 += np.transpose(ints.tmp44, (0, 1, 3, 2)) * 0.5 - del ints.tmp44 - tmp1 += v.aaaa.ovvv * 0.5 - tmp1 += np.transpose(ints.tmp41, (0, 1, 3, 2)) * -1 - del ints.tmp41 - tmp0 = np.copy(ints.tmp28) - del ints.tmp28 - tmp0 += np.transpose(ints.tmp40, (0, 2, 1, 3)) - del ints.tmp40 - tmp0 += np.transpose(ints.tmp46, (0, 2, 1, 3)) * 2 - del ints.tmp46 - tmp0 += np.transpose(v.aabb.vvov, (2, 0, 1, 3)) - tmp0 += np.transpose(ints.tmp43, (0, 2, 1, 3)) * -1 - del ints.tmp43 - tmp0 += ints.tmp48 * -1 - del ints.tmp48 - tmp7 = np.copy(tmp5) - del tmp5 - tmp7 += tmp6 * 0.5 - del tmp6 - r2new.bbb = einsum(r2.bbb, (0, 1, 2), v.bbbb.vvvv, (3, 1, 4, 0), (3, 4, 2)) * -2 - r2new.bbb += einsum(tmp43, (0, 1, 2), v.bbbb.ovov, (2, 3, 1, 4), (3, 4, 0)) * -2 - del tmp43 - r2new.bbb += np.transpose(tmp53, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp53, (2, 1, 0)) - del tmp53 - r2new.bbb += np.transpose(tmp58, (1, 2, 0)) - r2new.bbb += np.transpose(tmp58, (2, 1, 0)) * -1 - del tmp58 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp41, (2, 3), (0, 1, 3)) * -2 - r2new.bab = einsum(f.bb.ov, (0, 1), r1.a, (2,), (1, 2, 0)) * -1 - r2new.bab += einsum(r1.a, (0,), v.aabb.vvov, (1, 0, 2, 3), (3, 1, 2)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), v.aabb.vvvv, (3, 1, 4, 0), (4, 3, 2)) - r2new.bab += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp36, (0, 4, 2), (3, 1, 4)) * -1 - del tmp36 - r2new.bab += einsum(tmp37, (0, 1, 2, 3), r2.bab, (2, 4, 0), (3, 4, 1)) - del tmp37 - r2new.bab += einsum(tmp38, (0, 1, 2, 3), r2.aaa, (4, 2, 0), (3, 4, 1)) * -2 - del tmp38 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp39, (2, 3, 1, 4), (0, 4, 3)) - del tmp39 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp4, (1, 3), (0, 3, 2)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp40, (0, 3), (3, 1, 2)) * -2 - del tmp40 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp41, (2, 3), (0, 1, 3)) * -1 - del tmp41 - r2new.bab += einsum(tmp42, (0,), v.aabb.ovov, (0, 1, 2, 3), (3, 1, 2)) - del tmp42 - r2new.aba = einsum(f.aa.ov, (0, 1), r1.b, (2,), (1, 2, 0)) * -1 - r2new.aba += einsum(r1.b, (0,), v.aabb.ovvv, (1, 2, 3, 0), (2, 3, 1)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), v.aabb.vvvv, (3, 0, 4, 1), (3, 4, 2)) - r2new.aba += einsum(tmp32, (0, 1, 2), v.aabb.ovov, (1, 3, 2, 4), (3, 4, 0)) - del tmp32 - r2new.aba += einsum(tmp33, (0, 1, 2, 3), r2.aba, (2, 4, 0), (3, 4, 1)) - del tmp33 - r2new.aba += einsum(r2.bbb, (0, 1, 2), tmp34, (3, 2, 4, 1), (4, 0, 3)) * -2 - del tmp34 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp35, (2, 3, 1, 4), (0, 4, 3)) - del tmp35 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp10, (1, 3), (0, 3, 2)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp4, (0, 3), (3, 1, 2)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp31, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(tmp13, (0,), v.aabb.ovov, (1, 2, 0, 3), (2, 3, 1)) - r2new.aaa = einsum(r2.aaa, (0, 1, 2), v.aaaa.vvvv, (3, 1, 4, 0), (3, 4, 2)) * -2 - r2new.aaa += einsum(tmp14, (0, 1, 2), v.aaaa.ovov, (2, 3, 1, 4), (3, 4, 0)) * -2 - del tmp14 - r2new.aaa += np.transpose(tmp24, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp24, (2, 1, 0)) - del tmp24 - r2new.aaa += np.transpose(tmp30, (1, 2, 0)) - r2new.aaa += np.transpose(tmp30, (2, 1, 0)) * -1 - del tmp30 - r2new.aaa += einsum(tmp31, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp31 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp8, (2, 0, 1, 3), (3,)) * -1 - del tmp8 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp9, (2, 1, 0, 3), (3,)) * 4 - del tmp9 - r1new.b += einsum(tmp3, (0, 1), r2.aba, (1, 2, 0), (2,)) * -2 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp2, (2, 1), (0,)) * 4 - r1new.b += einsum(r1.b, (0,), tmp10, (0, 1), (1,)) * -1 - del tmp10 - r1new.b += einsum(tmp13, (0,), f.bb.ov, (0, 1), (1,)) * -1 - del tmp13 - r1new.a = einsum(tmp0, (0, 1, 2, 3), r2.bab, (3, 1, 0), (2,)) * -1 - del tmp0 - r1new.a += einsum(tmp1, (0, 1, 2, 3), r2.aaa, (1, 2, 0), (3,)) * -4 - del tmp1 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp2, (2, 0), (1,)) * -2 - del tmp2 - r1new.a += einsum(tmp3, (0, 1), r2.aaa, (2, 1, 0), (2,)) * 4 - del tmp3 - r1new.a += einsum(tmp4, (0, 1), r1.a, (0,), (1,)) * -1 - del tmp4 - r1new.a += einsum(tmp7, (0,), f.aa.ov, (0, 1), (1,)) * -2 - del tmp7 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/UCCSD.py b/ebcc/codegen/UCCSD.py deleted file mode 100644 index 5095c612..00000000 --- a/ebcc/codegen/UCCSD.py +++ /dev/null @@ -1,6566 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:36:36.850065 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:36:38.137258. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp0 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp2 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) * -1 - tmp2 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp1 = np.copy(f.bb.ov) * 2 - tmp1 += einsum(v.aabb.ovov, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) * 2 - tmp1 += einsum(tmp0, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) * -1 - del tmp0 - tmp3 = np.copy(f.aa.ov) - tmp3 += einsum(t1.aa, (0, 1), tmp2, (0, 2, 3, 1), (2, 3)) * -0.5 - del tmp2 - e_cc = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 1, 3), ()) - e_cc += einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 3, 1), ()) * -1 - e_cc += einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 3), ()) - e_cc += einsum(tmp1, (0, 1), t1.bb, (0, 1), ()) * 0.5 - del tmp1 - e_cc += einsum(tmp3, (0, 1), t1.aa, (0, 1), ()) - del tmp3 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:37:34.726865. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t1new : Namespace of arrays - Updated T1 residuals. - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - tmp14 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp14 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp7 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) * -1 - tmp7 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp117 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp117 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp13 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp15 = einsum(tmp14, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) - tmp22 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp1 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 2, 1)) - tmp8 = einsum(t1.aa, (0, 1), tmp7, (0, 2, 3, 1), (2, 3)) - tmp2 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp21 = einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp118 = einsum(tmp117, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) - tmp197 = np.copy(v.bbbb.ooov) - tmp197 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) * -1 - tmp16 = np.copy(f.bb.ov) - tmp16 += tmp13 - tmp16 += tmp15 * -1 - del tmp15 - tmp184 = np.copy(tmp22) - tmp184 += np.transpose(tmp22, (0, 2, 1, 3)) * -1 - tmp149 = np.copy(v.bbbb.ovvv) * -1 - tmp149 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) - tmp141 = np.copy(v.bbbb.ooov) - tmp141 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) * -1 - tmp0 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp71 = np.copy(v.aaaa.ovvv) - tmp71 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) * -1 - tmp73 = np.copy(tmp1) * -1 - tmp73 += np.transpose(tmp1, (0, 2, 1, 3)) - tmp82 = np.copy(v.aaaa.ooov) * -1 - tmp82 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) - tmp34 = np.copy(v.aaaa.ooov) - tmp34 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) * -1 - tmp9 = np.copy(f.aa.ov) - tmp9 += tmp2 - tmp9 += tmp8 * -1 - del tmp8 - tmp127 = einsum(t1.bb, (0, 1), tmp21, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp128 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - tmp29 = np.copy(v.bbbb.ooov) - tmp29 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) * -1 - tmp178 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp171 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp119 = np.copy(f.bb.ov) - tmp119 += tmp13 - tmp119 += tmp118 * -1 - del tmp118 - tmp201 = einsum(t1.bb, (0, 1), tmp22, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp198 = einsum(t1.bb, (0, 1), tmp197, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp197 - tmp24 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp122 = einsum(t1.bb, (0, 1), tmp16, (2, 1), (0, 2)) - tmp25 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp185 = einsum(t1.bb, (0, 1), tmp184, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp184 - tmp183 = einsum(t1.bb, (0, 1), tmp149, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp28 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp159 = einsum(t1.bb, (0, 1), tmp141, (0, 2, 3, 1), (2, 3)) - tmp45 = np.copy(v.aaaa.ovvv) - tmp45 += np.transpose(v.aaaa.ovvv, (0, 2, 3, 1)) * -1 - tmp97 = einsum(tmp1, (0, 1, 2, 3), t1.aa, (4, 3), (0, 4, 2, 1)) - tmp53 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp68 = einsum(t1.aa, (0, 1), tmp0, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp67 = einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (0, 3, 2, 4)) - tmp72 = einsum(tmp71, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 1, 3)) - del tmp71 - tmp74 = einsum(t1.aa, (0, 1), tmp73, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp73 - tmp50 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) * -1 - tmp50 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp83 = einsum(t1.aa, (0, 1), tmp82, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp82 - tmp62 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp17 = einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 1), (2, 3)) - tmp35 = einsum(t1.aa, (0, 1), tmp34, (0, 2, 3, 1), (2, 3)) - tmp6 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 3), (4, 0)) - tmp5 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 1, 3), (4, 0)) - tmp59 = einsum(tmp9, (0, 1), t1.aa, (2, 1), (2, 0)) * 0.5 - tmp18 = np.copy(v.aaaa.ooov) - tmp18 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) * -1 - tmp131 = einsum(t1.bb, (0, 1), v.aabb.ovoo, (2, 3, 4, 0), (2, 4, 3, 1)) - tmp181 = np.copy(tmp128) * -1 - tmp181 += tmp127 - tmp114 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp30 = einsum(t1.bb, (0, 1), tmp29, (0, 2, 3, 1), (2, 3)) - tmp205 = einsum(tmp178, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) - tmp211 = np.copy(v.bbbb.ovvv) - tmp211 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 4), (0, 3, 4, 1)) - tmp195 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 3, 5)) - tmp173 = einsum(t1.bb, (0, 1), tmp171, (2, 3, 4, 0), (2, 4, 3, 1)) - tmp120 = einsum(t1.bb, (0, 1), tmp119, (0, 2), (1, 2)) - del tmp119 - tmp115 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp203 = einsum(t1.bb, (0, 1), tmp201, (2, 3, 0, 4), (3, 2, 4, 1)) - tmp112 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 3), (4, 1)) - tmp111 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp207 = einsum(v.bbbb.vvvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp152 = np.copy(tmp128) - tmp152 += tmp127 * -1 - tmp199 = np.copy(v.bbbb.oovv) - tmp199 += np.transpose(tmp198, (1, 0, 2, 3)) * -1 - del tmp198 - tmp175 = np.copy(tmp24) - tmp175 += tmp25 * 2 - tmp175 += tmp122 - tmp186 = np.copy(np.transpose(tmp183, (0, 1, 3, 2))) * -1 - del tmp183 - tmp186 += tmp185 * -1 - del tmp185 - tmp179 = np.copy(tmp22) - tmp179 += np.transpose(tmp22, (0, 2, 1, 3)) * -1 - tmp166 = np.copy(v.bbbb.ovvv) * -1 - tmp166 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) - tmp160 = np.copy(f.bb.oo) - tmp160 += np.transpose(tmp28, (1, 0)) - tmp160 += np.transpose(tmp159, (1, 0)) * -1 - del tmp159 - tmp169 = einsum(t1.bb, (0, 1), v.bbbb.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp209 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp116 = np.copy(v.bbbb.ovvv) * -1 - tmp116 += np.transpose(v.bbbb.ovvv, (0, 2, 3, 1)) - tmp46 = einsum(tmp45, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - del tmp45 - tmp39 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (4, 1)) - tmp38 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 4, 1, 3), (2, 4)) - tmp44 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp47 = einsum(t1.aa, (0, 1), tmp9, (0, 2), (1, 2)) - tmp129 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 2, 0, 1)) - tmp144 = np.copy(np.transpose(v.aabb.vvov, (2, 0, 1, 3))) - tmp144 += einsum(v.aabb.ovov, (0, 1, 2, 3), t1.aa, (0, 4), (2, 4, 1, 3)) * -1 - tmp138 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp85 = einsum(t1.aa, (0, 1), v.aabb.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp147 = np.copy(tmp1) - tmp147 += np.transpose(tmp1, (0, 2, 1, 3)) * -1 - tmp146 = np.copy(v.aaaa.ovvv) * -1 - tmp146 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) - tmp42 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp81 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp81 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp10 = einsum(tmp9, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp150 = np.copy(tmp22) * -1 - tmp150 += np.transpose(tmp22, (0, 2, 1, 3)) - tmp107 = np.copy(v.aaaa.ovvv) - tmp107 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 4), (0, 3, 1, 4)) - tmp101 = einsum(t1.aa, (0, 1), tmp97, (2, 3, 0, 4), (3, 2, 4, 1)) - tmp64 = np.copy(v.aaaa.ovvv) - tmp64 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) * -1 - tmp65 = np.copy(tmp1) * -1 - tmp65 += np.transpose(tmp1, (0, 2, 1, 3)) - tmp57 = einsum(t1.aa, (0, 1), tmp53, (2, 3, 4, 0), (2, 4, 3, 1)) - tmp69 = np.copy(tmp67) * -1 - tmp69 += tmp68 - tmp75 = np.copy(np.transpose(tmp72, (0, 1, 3, 2))) * -1 - del tmp72 - tmp75 += tmp74 * -1 - del tmp74 - tmp103 = einsum(t1.aa, (0, 1), v.aaaa.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp91 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) * -1 - tmp91 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp51 = np.copy(f.aa.ov) - tmp51 += tmp2 - tmp51 += einsum(tmp50, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) * -1 - tmp49 = np.copy(v.aaaa.ovvv) - tmp49 += np.transpose(v.aaaa.ovvv, (0, 2, 3, 1)) * -1 - tmp95 = np.copy(v.aaaa.oovv) - tmp95 += np.transpose(tmp83, (1, 0, 2, 3)) * -1 - tmp88 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp88 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp89 = np.copy(v.aaaa.ooov) * -1 - tmp89 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) - tmp105 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp77 = np.copy(tmp67) - del tmp67 - tmp77 += tmp68 * -1 - tmp99 = einsum(t1.aa, (0, 1), tmp62, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp36 = np.copy(f.aa.oo) - tmp36 += np.transpose(tmp17, (1, 0)) - tmp36 += np.transpose(tmp35, (1, 0)) * -1 - del tmp35 - tmp93 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp60 = np.copy(tmp5) - tmp60 += tmp6 * 0.5 - tmp60 += tmp59 - del tmp59 - tmp19 = einsum(tmp18, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) - del tmp18 - tmp86 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) * -1 - tmp86 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp55 = einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp192 = np.copy(tmp131) - tmp192 += einsum(tmp50, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 4, 2, 5)) - del tmp50 - tmp182 = einsum(tmp181, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (4, 1, 5, 3)) - del tmp181 - tmp164 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp190 = einsum(tmp114, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (4, 1, 5, 3)) - tmp31 = np.copy(f.bb.oo) - tmp31 += np.transpose(tmp28, (1, 0)) - del tmp28 - tmp31 += np.transpose(tmp30, (1, 0)) * -1 - del tmp30 - tmp165 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp206 = einsum(t1.bb, (0, 1), tmp205, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp205 - tmp158 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.oooo, (4, 1, 5, 0), (4, 5, 2, 3)) * -1 - tmp212 = np.copy(v.bbbb.vvvv) * -1 - tmp212 += einsum(tmp211, (0, 1, 2, 3), t1.bb, (0, 4), (3, 2, 1, 4)) - del tmp211 - tmp177 = einsum(t1.bb, (0, 1), tmp22, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp213 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp196 = einsum(t1.bb, (0, 1), tmp195, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp195 - tmp157 = np.copy(t2.bbbb) - tmp157 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * 2 - tmp174 = einsum(t1.bb, (0, 1), tmp173, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp173 - tmp168 = np.copy(f.bb.vv) * -1 - tmp168 += np.transpose(tmp115, (1, 0)) * -1 - tmp168 += einsum(tmp149, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) * -1 - tmp168 += np.transpose(tmp120, (1, 0)) - tmp204 = einsum(t1.bb, (0, 1), tmp203, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp203 - tmp172 = einsum(t2.bbbb, (0, 1, 2, 3), tmp171, (4, 5, 1, 0), (4, 5, 2, 3)) * -1 - del tmp171 - tmp162 = np.copy(tmp111) * 0.5 - tmp162 += tmp112 - tmp208 = einsum(tmp207, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) - del tmp207 - tmp202 = einsum(t2.bbbb, (0, 1, 2, 3), tmp201, (4, 5, 0, 1), (5, 4, 2, 3)) * -1 - del tmp201 - tmp188 = einsum(tmp152, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (4, 1, 5, 3)) - tmp200 = einsum(t2.bbbb, (0, 1, 2, 3), tmp199, (1, 4, 5, 3), (0, 4, 2, 5)) - del tmp199 - tmp176 = einsum(t2.bbbb, (0, 1, 2, 3), tmp175, (4, 1), (0, 4, 2, 3)) * -1 - del tmp175 - tmp187 = einsum(t2.bbbb, (0, 1, 2, 3), tmp186, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp186 - tmp180 = einsum(tmp166, (0, 1, 2, 3), t1.bb, (4, 1), (4, 0, 3, 2)) * -1 - tmp180 += einsum(t1.bb, (0, 1), tmp179, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp179 - tmp167 = np.copy(f.bb.vv) * -1 - tmp167 += np.transpose(tmp115, (1, 0)) * -1 - tmp167 += np.transpose(tmp111, (1, 0)) - tmp167 += np.transpose(tmp112, (1, 0)) * 2 - tmp167 += einsum(tmp166, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) * -1 - del tmp166 - tmp167 += einsum(tmp16, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp193 = np.copy(v.bbbb.oovv) - tmp193 += einsum(t2.bbbb, (0, 1, 2, 3), tmp14, (1, 4, 5, 3), (0, 4, 2, 5)) * -2 - del tmp14 - tmp193 += einsum(t1.bb, (0, 1), tmp29, (2, 3, 0, 4), (3, 2, 1, 4)) * -1 - del tmp29 - tmp161 = einsum(tmp160, (0, 1), t2.bbbb, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - del tmp160 - tmp191 = np.copy(v.bbbb.oovv) - tmp191 += einsum(t2.bbbb, (0, 1, 2, 3), tmp117, (1, 4, 5, 3), (0, 4, 2, 5)) * -2 - tmp191 += einsum(t1.bb, (0, 1), tmp141, (2, 3, 0, 4), (3, 2, 1, 4)) * -1 - tmp170 = einsum(t1.bb, (0, 1), tmp169, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp169 - tmp210 = einsum(t2.bbbb, (0, 1, 2, 3), tmp209, (4, 5, 1, 0), (5, 4, 2, 3)) - del tmp209 - tmp189 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp163 = einsum(t1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * 2 - tmp163 += t2.bbbb * -1 - tmp194 = np.copy(tmp131) - tmp194 += einsum(tmp7, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 4, 2, 5)) - del tmp7 - tmp121 = np.copy(f.bb.vv) - tmp121 += np.transpose(tmp115, (1, 0)) - del tmp115 - tmp121 += einsum(tmp116, (0, 1, 2, 3), t1.bb, (0, 1), (3, 2)) * -1 - del tmp116 - tmp121 += np.transpose(tmp120, (1, 0)) * -1 - del tmp120 - tmp135 = np.copy(np.transpose(v.aabb.vvov, (2, 0, 1, 3))) - tmp135 += einsum(v.aabb.vvvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp140 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovoo, (1, 3, 4, 5), (0, 4, 5, 2)) - tmp3 = np.copy(t2.abab) - tmp3 += einsum(t1.aa, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - tmp48 = np.copy(f.aa.vv) * -1 - tmp48 += np.transpose(tmp44, (1, 0)) * -1 - tmp48 += np.transpose(tmp38, (1, 0)) * 2 - tmp48 += np.transpose(tmp39, (1, 0)) - tmp48 += np.transpose(tmp46, (1, 0)) * -1 - del tmp46 - tmp48 += np.transpose(tmp47, (1, 0)) - del tmp47 - tmp126 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp134 = einsum(t1.aa, (0, 1), tmp129, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp145 = np.copy(v.aabb.vvvv) - tmp145 += einsum(tmp144, (0, 1, 2, 3), t1.bb, (0, 4), (2, 1, 3, 4)) * -1 - del tmp144 - tmp124 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp125 = einsum(t1.aa, (0, 1), v.aabb.vvoo, (2, 1, 3, 4), (0, 3, 4, 2)) - tmp142 = np.copy(v.bbbb.oovv) - tmp142 += einsum(t1.bb, (0, 1), tmp141, (0, 2, 3, 4), (3, 2, 4, 1)) - del tmp141 - tmp143 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp154 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp136 = einsum(tmp21, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp132 = np.copy(np.transpose(v.aabb.vvoo, (2, 3, 0, 1))) * -1 - tmp132 += einsum(t1.aa, (0, 1), v.aabb.ovoo, (0, 2, 3, 4), (3, 4, 2, 1)) - tmp132 += einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (2, 4, 1, 5)) - tmp110 = np.copy(t2.abab) - tmp110 += einsum(t1.aa, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * 2 - tmp139 = np.copy(tmp85) * -1 - tmp139 += tmp138 * 2 - tmp139 += einsum(tmp117, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) * -1 - del tmp117 - tmp123 = np.copy(np.transpose(tmp24, (1, 0))) - tmp123 += np.transpose(tmp25, (1, 0)) * 2 - tmp123 += np.transpose(tmp122, (1, 0)) - del tmp122 - tmp113 = np.copy(tmp111) - del tmp111 - tmp113 += tmp112 * 2 - del tmp112 - tmp155 = einsum(v.aabb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp148 = einsum(tmp146, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 1, 3)) * -1 - del tmp146 - tmp148 += einsum(t1.aa, (0, 1), tmp147, (2, 0, 3, 4), (2, 3, 4, 1)) - del tmp147 - tmp137 = np.copy(v.aaaa.oovv) - tmp137 += np.transpose(tmp42, (1, 0, 3, 2)) * -1 - tmp137 += einsum(tmp81, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (1, 4, 3, 5)) * 2 - tmp137 += einsum(t1.aa, (0, 1), tmp34, (0, 2, 3, 4), (3, 2, 4, 1)) - del tmp34 - tmp11 = np.copy(np.transpose(tmp5, (1, 0))) * 2 - del tmp5 - tmp11 += np.transpose(tmp6, (1, 0)) - del tmp6 - tmp11 += np.transpose(tmp10, (1, 0)) - del tmp10 - tmp151 = einsum(tmp149, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) * -1 - del tmp149 - tmp151 += einsum(t1.bb, (0, 1), tmp150, (2, 3, 0, 4), (2, 3, 4, 1)) - del tmp150 - tmp156 = einsum(tmp128, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 1, 3)) - tmp130 = np.copy(np.transpose(tmp129, (0, 1, 3, 2))) - del tmp129 - tmp130 += einsum(t1.aa, (0, 1), tmp21, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - tmp153 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp153 += einsum(t1.bb, (0, 1), tmp0, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - tmp133 = np.copy(v.aabb.oovv) - tmp133 += einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) * -1 - tmp41 = einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * 2 - tmp41 += t2.aaaa * -1 - tmp33 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.oooo, (4, 1, 5, 0), (4, 5, 2, 3)) * -1 - tmp108 = np.copy(v.aaaa.vvvv) - tmp108 += einsum(tmp107, (0, 1, 2, 3), t1.aa, (0, 4), (1, 3, 2, 4)) - del tmp107 - tmp80 = einsum(t2.aaaa, (0, 1, 2, 3), tmp42, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp102 = einsum(tmp101, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp101 - tmp66 = einsum(tmp64, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 3, 1)) * -1 - del tmp64 - tmp66 += einsum(tmp65, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) * -1 - del tmp65 - tmp58 = einsum(tmp57, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp57 - tmp70 = einsum(tmp69, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp69 - tmp76 = einsum(tmp75, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp75 - tmp104 = einsum(tmp103, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 1, 3)) - del tmp103 - tmp92 = np.copy(tmp85) - tmp92 += einsum(tmp91, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) * -1 - del tmp91 - tmp40 = np.copy(tmp38) * 2 - del tmp38 - tmp40 += tmp39 - del tmp39 - tmp54 = einsum(t2.aaaa, (0, 1, 2, 3), tmp53, (4, 5, 1, 0), (4, 5, 2, 3)) * -1 - del tmp53 - tmp52 = np.copy(f.aa.vv) * -1 - tmp52 += np.transpose(tmp44, (1, 0)) * -1 - del tmp44 - tmp52 += einsum(tmp49, (0, 1, 2, 3), t1.aa, (0, 1), (3, 2)) * -1 - del tmp49 - tmp52 += einsum(t1.aa, (0, 1), tmp51, (0, 2), (2, 1)) - del tmp51 - tmp96 = einsum(tmp95, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 5, 2)) - del tmp95 - tmp109 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp90 = np.copy(v.aaaa.oovv) - tmp90 += einsum(tmp88, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 5, 2)) * -2 - del tmp88 - tmp90 += einsum(tmp89, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -1 - del tmp89 - tmp98 = einsum(t2.aaaa, (0, 1, 2, 3), tmp97, (4, 5, 0, 1), (5, 4, 2, 3)) * -1 - del tmp97 - tmp106 = einsum(t2.aaaa, (0, 1, 2, 3), tmp105, (4, 5, 1, 0), (5, 4, 2, 3)) - del tmp105 - tmp84 = np.copy(v.aaaa.oovv) - tmp84 += einsum(tmp81, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 5, 2)) * -2 - del tmp81 - tmp84 += tmp83 * -1 - del tmp83 - tmp78 = einsum(tmp77, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp100 = einsum(tmp99, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp99 - tmp37 = einsum(t2.aaaa, (0, 1, 2, 3), tmp36, (1, 4), (0, 4, 2, 3)) * -1 - tmp94 = einsum(tmp93, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp93 - tmp32 = np.copy(t2.aaaa) - tmp32 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) * 2 - tmp79 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp43 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp63 = einsum(t1.aa, (0, 1), tmp1, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp61 = einsum(t2.aaaa, (0, 1, 2, 3), tmp60, (4, 1), (0, 4, 2, 3)) * -2 - del tmp60 - tmp20 = np.copy(f.aa.oo) - tmp20 += np.transpose(tmp17, (1, 0)) - del tmp17 - tmp20 += np.transpose(tmp19, (1, 0)) * -1 - del tmp19 - tmp87 = np.copy(tmp85) - tmp87 += einsum(tmp86, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) * -1 - del tmp86 - tmp56 = einsum(t1.aa, (0, 1), tmp55, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp55 - tmp26 = np.copy(np.transpose(tmp24, (1, 0))) * 0.5 - del tmp24 - tmp26 += np.transpose(tmp25, (1, 0)) - del tmp25 - tmp26 += einsum(t1.bb, (0, 1), tmp16, (2, 1), (2, 0)) * 0.5 - tmp23 = np.copy(t2.bbbb) * 2 - tmp23 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - tmp27 = np.copy(f.bb.vv) - tmp27 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 3), (1, 2)) * -1 - tmp4 = np.copy(t2.aaaa) * 2 - tmp4 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - tmp12 = np.copy(f.aa.vv) - tmp12 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - t2new.bbbb = einsum(t2.bbbb, (0, 1, 2, 3), tmp31, (1, 4), (0, 4, 2, 3)) * -1 - t2new.bbbb += einsum(v.bbbb.oooo, (0, 1, 2, 3), tmp157, (3, 1, 4, 5), (0, 2, 5, 4)) * 0.5 - del tmp157 - t2new.bbbb += np.transpose(tmp158, (1, 0, 3, 2)) - del tmp158 - t2new.bbbb += np.transpose(tmp161, (0, 1, 3, 2)) * -1 - t2new.bbbb += einsum(tmp162, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 4, 0)) * -4 - del tmp162 - t2new.bbbb += np.transpose(tmp161, (1, 0, 3, 2)) * 2 - del tmp161 - t2new.bbbb += einsum(v.bbbb.oooo, (0, 1, 2, 3), tmp163, (3, 1, 4, 5), (0, 2, 5, 4)) * -0.5 - del tmp163 - t2new.bbbb += np.transpose(tmp164, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp165, (1, 0, 3, 2)) - t2new.bbbb += einsum(tmp167, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 1, 4)) * 2 - del tmp167 - t2new.bbbb += np.transpose(tmp164, (1, 0, 2, 3)) * -2 - t2new.bbbb += np.transpose(tmp165, (1, 0, 2, 3)) * -1 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp168, (3, 4), (0, 1, 2, 4)) * -2 - del tmp168 - t2new.bbbb += np.transpose(tmp170, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp172, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp174, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp174, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp176, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp170, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp170, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp172, (0, 1, 3, 2)) * 2 - del tmp172 - t2new.bbbb += tmp174 * -1 - t2new.bbbb += np.transpose(tmp174, (0, 1, 3, 2)) - del tmp174 - t2new.bbbb += np.transpose(tmp176, (1, 0, 3, 2)) * 2 - del tmp176 - t2new.bbbb += tmp170 - del tmp170 - t2new.bbbb += np.transpose(tmp177, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp178, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - t2new.bbbb += einsum(tmp180, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (4, 0, 2, 5)) * 2 - del tmp180 - t2new.bbbb += np.transpose(tmp182, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp177, (0, 1, 3, 2)) - t2new.bbbb += tmp178 * -1 - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 3, 1)) * -1 - t2new.bbbb += np.transpose(tmp187, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp188, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp189, (0, 1, 3, 2)) - t2new.bbbb += tmp190 * 2 - t2new.bbbb += np.transpose(tmp190, (1, 0, 3, 2)) * 2 - t2new.bbbb += einsum(tmp191, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * -2 - del tmp191 - t2new.bbbb += einsum(tmp192, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) * -1 - del tmp192 - t2new.bbbb += np.transpose(tmp189, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp190, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp190, (1, 0, 2, 3)) * -2 - del tmp190 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp193, (4, 1, 5, 3), (0, 4, 5, 2)) * 2 - del tmp193 - t2new.bbbb += einsum(tmp194, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (4, 1, 3, 5)) - del tmp194 - t2new.bbbb += np.transpose(tmp196, (1, 0, 3, 2)) - t2new.bbbb += tmp189 * -1 - t2new.bbbb += np.transpose(tmp200, (1, 0, 2, 3)) * 2 - t2new.bbbb += np.transpose(tmp196, (0, 1, 3, 2)) * -1 - del tmp196 - t2new.bbbb += np.transpose(tmp189, (1, 0, 2, 3)) - del tmp189 - t2new.bbbb += tmp200 * -2 - del tmp200 - t2new.bbbb += np.transpose(tmp202, (0, 1, 3, 2)) * -2 - del tmp202 - t2new.bbbb += np.transpose(tmp178, (0, 1, 3, 2)) - t2new.bbbb += tmp204 - t2new.bbbb += np.transpose(tmp204, (0, 1, 3, 2)) * -1 - del tmp204 - t2new.bbbb += np.transpose(tmp206, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp206, (1, 0, 3, 2)) * -1 - t2new.bbbb += tmp208 - t2new.bbbb += np.transpose(tmp208, (0, 1, 3, 2)) * -1 - del tmp208 - t2new.bbbb += np.transpose(tmp210, (0, 1, 3, 2)) * -2 - del tmp210 - t2new.bbbb += np.transpose(tmp178, (1, 0, 3, 2)) * -1 - del tmp178 - t2new.bbbb += einsum(tmp212, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 2), (4, 5, 1, 3)) * -2 - del tmp212 - t2new.bbbb += np.transpose(tmp164, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp165, (0, 1, 3, 2)) * -1 - t2new.bbbb += tmp164 * 2 - del tmp164 - t2new.bbbb += tmp165 - del tmp165 - t2new.bbbb += np.transpose(tmp177, (1, 0, 2, 3)) - t2new.bbbb += tmp187 * -2 - t2new.bbbb += tmp182 * -1 - del tmp182 - t2new.bbbb += tmp177 * -1 - del tmp177 - t2new.bbbb += np.transpose(tmp187, (1, 0, 2, 3)) * 2 - del tmp187 - t2new.bbbb += np.transpose(tmp188, (1, 0, 2, 3)) * -1 - del tmp188 - t2new.bbbb += einsum(t1.bb, (0, 1), tmp213, (2, 3, 0, 4), (2, 3, 1, 4)) * -2 - del tmp213 - t2new.bbbb += tmp206 * -1 - t2new.bbbb += np.transpose(tmp206, (1, 0, 2, 3)) - del tmp206 - t2new.abab = einsum(tmp31, (0, 1), t2.abab, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - t2new.abab += einsum(tmp110, (0, 1, 2, 3), v.aabb.oooo, (4, 0, 5, 1), (4, 5, 2, 3)) * 0.5 - del tmp110 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), v.aabb.oooo, (4, 0, 5, 1), (4, 5, 2, 3)) * 0.5 - t2new.abab += einsum(tmp113, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 4, 0)) * -1 - del tmp113 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp36, (0, 4), (4, 1, 2, 3)) * -1 - del tmp36 - t2new.abab += tmp114 * 2 - del tmp114 - t2new.abab += einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - t2new.abab += einsum(tmp48, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1 - t2new.abab += einsum(tmp121, (0, 1), t2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) - del tmp121 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp123, (1, 4), (0, 4, 2, 3)) * -1 - del tmp123 - t2new.abab += einsum(tmp124, (0, 1, 2, 3), tmp3, (0, 3, 4, 5), (1, 2, 4, 5)) - del tmp124 - t2new.abab += einsum(t1.bb, (0, 1), tmp125, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - del tmp125 - t2new.abab += einsum(tmp11, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -1 - t2new.abab += einsum(tmp126, (0, 1, 2, 3), tmp3, (1, 2, 4, 5), (0, 3, 4, 5)) - del tmp126 - t2new.abab += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - t2new.abab += tmp127 * -1 - del tmp127 - t2new.abab += tmp128 - del tmp128 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp130, (4, 1, 2, 5), (0, 4, 5, 3)) * -1 - del tmp130 - t2new.abab += tmp131 * -1 - del tmp131 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp132, (1, 4, 2, 5), (0, 4, 5, 3)) - del tmp132 - t2new.abab += tmp85 * -1 - del tmp85 - t2new.abab += einsum(tmp133, (0, 1, 2, 3), t2.abab, (0, 4, 5, 2), (1, 4, 5, 3)) * -1 - del tmp133 - t2new.abab += einsum(t1.bb, (0, 1), tmp134, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - del tmp134 - t2new.abab += einsum(t1.aa, (0, 1), tmp135, (2, 1, 3, 4), (0, 2, 3, 4)) - del tmp135 - t2new.abab += einsum(tmp136, (0, 1, 2, 3), tmp3, (1, 3, 4, 5), (0, 2, 4, 5)) - del tmp136 - t2new.abab += einsum(tmp137, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) * -1 - del tmp137 - t2new.abab += einsum(tmp139, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp139 - t2new.abab += einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - t2new.abab += tmp138 * 2 - del tmp138 - t2new.abab += einsum(t1.bb, (0, 1), tmp140, (2, 3, 0, 4), (2, 3, 4, 1)) * -2 - del tmp140 - t2new.abab += einsum(tmp142, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) * -1 - del tmp142 - t2new.abab += einsum(tmp143, (0, 1, 2, 3), t2.abab, (1, 3, 4, 5), (0, 2, 4, 5)) - del tmp143 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp145, (2, 4, 3, 5), (0, 1, 4, 5)) - del tmp145 - t2new.abab += einsum(tmp148, (0, 1, 2, 3), t2.abab, (1, 4, 2, 5), (0, 4, 3, 5)) - del tmp148 - t2new.abab += einsum(t2.bbbb, (0, 1, 2, 3), tmp77, (4, 1, 5, 3), (4, 0, 5, 2)) * 2 - del tmp77 - t2new.abab += einsum(tmp151, (0, 1, 2, 3), t2.abab, (4, 1, 5, 2), (4, 0, 5, 3)) - del tmp151 - t2new.abab += einsum(tmp152, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (4, 1, 5, 3)) * 2 - del tmp152 - t2new.abab += tmp68 * -1 - del tmp68 - t2new.abab += einsum(tmp153, (0, 1, 2, 3), t2.abab, (1, 4, 5, 2), (0, 4, 5, 3)) * -1 - del tmp153 - t2new.abab += einsum(t1.aa, (0, 1), tmp154, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp154 - t2new.abab += einsum(t1.aa, (0, 1), tmp155, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp155 - t2new.abab += einsum(t1.aa, (0, 1), tmp156, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp156 - t2new.aaaa = einsum(t2.aaaa, (0, 1, 2, 3), tmp20, (1, 4), (0, 4, 2, 3)) * -1 - t2new.aaaa += einsum(tmp32, (0, 1, 2, 3), v.aaaa.oooo, (4, 1, 5, 0), (4, 5, 3, 2)) * 0.5 - del tmp32 - t2new.aaaa += np.transpose(tmp33, (1, 0, 3, 2)) - del tmp33 - t2new.aaaa += np.transpose(tmp37, (0, 1, 3, 2)) * -1 - t2new.aaaa += einsum(tmp40, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 4, 0)) * -2 - del tmp40 - t2new.aaaa += np.transpose(tmp37, (1, 0, 3, 2)) * 2 - del tmp37 - t2new.aaaa += einsum(v.aaaa.oooo, (0, 1, 2, 3), tmp41, (3, 1, 4, 5), (0, 2, 5, 4)) * -0.5 - del tmp41 - t2new.aaaa += np.transpose(tmp42, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp43, (1, 0, 3, 2)) * 2 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp48, (3, 4), (0, 1, 4, 2)) * 2 - del tmp48 - t2new.aaaa += np.transpose(tmp42, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp43, (1, 0, 2, 3)) * -2 - t2new.aaaa += einsum(tmp52, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 4, 1)) * -2 - del tmp52 - t2new.aaaa += np.transpose(tmp54, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp56, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp58, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(tmp58, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp61, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp56, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp54, (0, 1, 3, 2)) * 2 - del tmp54 - t2new.aaaa += np.transpose(tmp56, (0, 1, 3, 2)) * -1 - t2new.aaaa += tmp58 * -1 - t2new.aaaa += np.transpose(tmp58, (0, 1, 3, 2)) - del tmp58 - t2new.aaaa += np.transpose(tmp61, (1, 0, 3, 2)) * 2 - del tmp61 - t2new.aaaa += tmp56 - del tmp56 - t2new.aaaa += np.transpose(tmp62, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - t2new.aaaa += np.transpose(tmp63, (1, 0, 3, 2)) * -1 - t2new.aaaa += einsum(tmp66, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 2, 5)) * 2 - del tmp66 - t2new.aaaa += np.transpose(tmp70, (0, 1, 3, 2)) - t2new.aaaa += tmp62 * -1 - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 3, 1)) * -1 - t2new.aaaa += np.transpose(tmp63, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp76, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp78, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp79, (0, 1, 3, 2)) - t2new.aaaa += tmp80 * 2 - t2new.aaaa += np.transpose(tmp80, (1, 0, 3, 2)) * 2 - t2new.aaaa += einsum(tmp84, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (0, 4, 2, 5)) * -2 - del tmp84 - t2new.aaaa += einsum(tmp87, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - del tmp87 - t2new.aaaa += np.transpose(tmp79, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp80, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp80, (1, 0, 2, 3)) * -2 - del tmp80 - t2new.aaaa += einsum(tmp90, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 2, 5)) * 2 - del tmp90 - t2new.aaaa += einsum(t2.abab, (0, 1, 2, 3), tmp92, (4, 1, 5, 3), (0, 4, 5, 2)) - del tmp92 - t2new.aaaa += tmp79 * -1 - t2new.aaaa += np.transpose(tmp94, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp96, (1, 0, 2, 3)) * 2 - t2new.aaaa += np.transpose(tmp79, (1, 0, 2, 3)) - del tmp79 - t2new.aaaa += np.transpose(tmp94, (0, 1, 3, 2)) * -1 - del tmp94 - t2new.aaaa += tmp96 * -2 - del tmp96 - t2new.aaaa += np.transpose(tmp62, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp98, (0, 1, 3, 2)) * -2 - del tmp98 - t2new.aaaa += np.transpose(tmp100, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp100, (1, 0, 3, 2)) * -1 - t2new.aaaa += tmp102 - t2new.aaaa += np.transpose(tmp102, (0, 1, 3, 2)) * -1 - del tmp102 - t2new.aaaa += tmp104 - t2new.aaaa += np.transpose(tmp104, (0, 1, 3, 2)) * -1 - del tmp104 - t2new.aaaa += np.transpose(tmp62, (1, 0, 3, 2)) * -1 - del tmp62 - t2new.aaaa += np.transpose(tmp106, (0, 1, 3, 2)) * -2 - del tmp106 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp108, (2, 4, 3, 5), (0, 1, 4, 5)) * 2 - del tmp108 - t2new.aaaa += np.transpose(tmp42, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp43, (0, 1, 3, 2)) * -2 - t2new.aaaa += tmp42 - del tmp42 - t2new.aaaa += tmp43 * 2 - del tmp43 - t2new.aaaa += np.transpose(tmp63, (1, 0, 2, 3)) - t2new.aaaa += tmp76 * -2 - t2new.aaaa += tmp70 * -1 - del tmp70 - t2new.aaaa += tmp63 * -1 - del tmp63 - t2new.aaaa += np.transpose(tmp76, (1, 0, 2, 3)) * 2 - del tmp76 - t2new.aaaa += np.transpose(tmp78, (1, 0, 2, 3)) * -1 - del tmp78 - t2new.aaaa += einsum(tmp109, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) * -2 - del tmp109 - t2new.aaaa += tmp100 * -1 - t2new.aaaa += np.transpose(tmp100, (1, 0, 2, 3)) - del tmp100 - t1new.bb = einsum(tmp21, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) * -1 - del tmp21 - t1new.bb += f.bb.ov - t1new.bb += tmp13 - del tmp13 - t1new.bb += einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp22, (4, 1, 0, 3), (4, 2)) * -2 - del tmp22 - t1new.bb += einsum(tmp3, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 3), (1, 4)) - t1new.bb += einsum(v.bbbb.ovvv, (0, 1, 2, 3), tmp23, (0, 4, 1, 3), (4, 2)) - del tmp23 - t1new.bb += einsum(t1.bb, (0, 1), tmp26, (0, 2), (2, 1)) * -2 - del tmp26 - t1new.bb += einsum(t1.bb, (0, 1), tmp27, (1, 2), (0, 2)) - del tmp27 - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 3), (4, 2)) * -2 - t1new.bb += einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) * -1 - t1new.bb += einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) * -1 - t1new.bb += einsum(tmp9, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp16, (1, 3), (0, 2)) * 2 - t1new.bb += einsum(t1.bb, (0, 1), tmp31, (0, 2), (2, 1)) * -1 - del tmp31 - t1new.aa = einsum(t2.abab, (0, 1, 2, 3), tmp0, (4, 0, 1, 3), (4, 2)) * -1 - del tmp0 - t1new.aa += einsum(tmp1, (0, 1, 2, 3), t2.aaaa, (2, 1, 4, 3), (0, 4)) * -2 - del tmp1 - t1new.aa += tmp2 - del tmp2 - t1new.aa += f.aa.ov - t1new.aa += einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 0, 1), (2, 3)) - t1new.aa += einsum(tmp3, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - del tmp3 - t1new.aa += einsum(v.aaaa.ovvv, (0, 1, 2, 3), tmp4, (0, 4, 3, 1), (4, 2)) * -1 - del tmp4 - t1new.aa += einsum(tmp11, (0, 1), t1.aa, (0, 2), (1, 2)) * -1 - del tmp11 - t1new.aa += einsum(t1.aa, (0, 1), tmp12, (1, 2), (0, 2)) - del tmp12 - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 1, 3), (4, 2)) * -2 - t1new.aa += einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 0, 3, 1), (2, 3)) * -1 - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 3), (4, 2)) * -1 - t1new.aa += einsum(tmp16, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - del tmp16 - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), tmp9, (1, 3), (0, 2)) * 2 - del tmp9 - t1new.aa += einsum(t1.aa, (0, 1), tmp20, (0, 2), (2, 1)) * -1 - del tmp20 - - return {f"t1new": t1new, f"t2new": t2new} - -def update_lams(f=None, l1=None, l2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:39:42.275145. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - l1new : Namespace of arrays - Updated L1 residuals. - l2new : Namespace of arrays - Updated L2 residuals. - """ - - l1new = Namespace() - l2new = Namespace() - tmp98 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp98 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp7 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) * -1 - tmp7 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp97 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp99 = einsum(tmp98, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) - del tmp98 - tmp8 = einsum(t1.aa, (0, 1), tmp7, (0, 2, 3, 1), (2, 3)) - del tmp7 - tmp6 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp2 = einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp100 = np.copy(f.bb.ov) - tmp100 += tmp97 - tmp100 += tmp99 * -1 - del tmp99 - tmp117 = np.copy(v.bbbb.ooov) - tmp117 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) * -1 - tmp111 = np.copy(v.bbbb.ovvv) * -1 - tmp111 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) - tmp52 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp196 = np.copy(v.bbbb.ovvv) - tmp196 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) * -1 - tmp212 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp212 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp50 = einsum(t1.bb, (0, 1), l2.abab, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp31 = np.copy(v.aaaa.ovvv) - tmp31 += np.transpose(v.aaaa.ovvv, (0, 2, 3, 1)) * -1 - tmp38 = einsum(l2.aaaa, (0, 1, 2, 3), t1.aa, (4, 1), (2, 3, 4, 0)) - tmp180 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) * -1 - tmp180 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp164 = np.copy(v.aaaa.ovvv) * -1 - tmp164 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) - tmp63 = np.copy(v.aaaa.ooov) * -1 - tmp63 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) - tmp9 = np.copy(f.aa.ov) - tmp9 += tmp6 - tmp9 += tmp8 * -1 - del tmp8 - tmp14 = np.copy(np.transpose(v.aabb.ovoo, (0, 2, 3, 1))) - tmp14 += tmp2 - tmp95 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp55 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp56 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 0, 1), (2, 4)) - tmp54 = einsum(t1.bb, (0, 1), l1.bb, (1, 2), (2, 0)) - tmp0 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 2, 1)) - tmp43 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (2, 4)) - tmp42 = einsum(l1.aa, (0, 1), t1.aa, (2, 0), (1, 2)) - tmp44 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp115 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp114 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp116 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 3, 1), (4, 0)) * -1 - tmp119 = einsum(tmp100, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp118 = einsum(t1.bb, (0, 1), tmp117, (0, 2, 3, 1), (2, 3)) - del tmp117 - tmp125 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 5), (3, 4, 1, 5)) - tmp126 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp142 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp210 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 4, 1, 3), (2, 4)) - tmp245 = einsum(t1.bb, (0, 1), tmp111, (0, 2, 1, 3), (2, 3)) - tmp209 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp137 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp135 = einsum(t1.bb, (0, 1), tmp52, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp33 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - tmp34 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) - tmp197 = einsum(t1.bb, (0, 1), tmp196, (2, 1, 3, 4), (2, 0, 3, 4)) - del tmp196 - tmp195 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp194 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp201 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp199 = einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (0, 3, 2, 4)) - tmp200 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp213 = einsum(tmp212, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) - del tmp212 - tmp77 = einsum(t1.aa, (0, 1), tmp50, (2, 3, 4, 1), (2, 0, 3, 4)) - tmp76 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 5, 0, 1), (2, 4, 3, 5)) - tmp28 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) - tmp29 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - tmp176 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (4, 1)) - tmp177 = einsum(tmp31, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp91 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp175 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 4, 1, 3), (2, 4)) - tmp83 = einsum(t1.aa, (0, 1), tmp38, (2, 3, 4, 1), (3, 2, 4, 0)) - tmp86 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp181 = einsum(t1.aa, (0, 1), tmp180, (0, 2, 3, 1), (2, 3)) - del tmp180 - tmp10 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - tmp158 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp159 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp156 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp155 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp165 = einsum(tmp164, (0, 1, 2, 3), t1.aa, (4, 2), (0, 4, 1, 3)) - del tmp164 - tmp62 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 3), (4, 0)) - tmp61 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 1, 3), (4, 0)) - tmp64 = einsum(tmp63, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - del tmp63 - tmp60 = einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 1), (2, 3)) - tmp65 = einsum(tmp9, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp73 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp74 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp101 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 2, 0, 1)) - tmp13 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp12 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp15 = einsum(tmp14, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp4 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp107 = einsum(t1.bb, (0, 1), tmp95, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp108 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp106 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp40 = einsum(l2.abab, (0, 1, 2, 3), t1.aa, (4, 0), (2, 4, 3, 1)) - tmp57 = np.copy(tmp54) - tmp57 += tmp55 - tmp57 += tmp56 * 2 - tmp24 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp23 = einsum(t1.aa, (0, 1), tmp0, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp22 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp20 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp45 = np.copy(tmp42) * 0.5 - tmp45 += tmp43 - tmp45 += tmp44 * 0.5 - tmp120 = np.copy(f.bb.oo) - tmp120 += np.transpose(tmp114, (1, 0)) - del tmp114 - tmp120 += tmp115 - del tmp115 - tmp120 += tmp116 * 2 - del tmp116 - tmp120 += tmp118 * -1 - del tmp118 - tmp120 += tmp119 - del tmp119 - tmp228 = np.copy(np.transpose(v.bbbb.ooov, (0, 2, 1, 3))) - tmp228 += tmp95 - tmp255 = np.copy(tmp125) - tmp255 += tmp126 * 4 - tmp203 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp246 = np.copy(f.bb.vv) * -1 - tmp246 += np.transpose(tmp142, (1, 0)) * -1 - tmp246 += np.transpose(tmp209, (1, 0)) - tmp246 += np.transpose(tmp210, (1, 0)) * 2 - tmp246 += tmp245 * -1 - del tmp245 - tmp243 = np.copy(np.transpose(tmp137, (1, 0, 3, 2))) - tmp243 += np.transpose(tmp135, (0, 1, 3, 2)) * -1 - tmp225 = np.copy(tmp33) - tmp225 += tmp34 * 2 - tmp198 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 1, 3))) - tmp198 += v.bbbb.oovv * -1 - tmp198 += tmp194 - tmp198 += tmp195 * 2 - tmp198 += np.transpose(tmp197, (1, 0, 3, 2)) * -1 - del tmp197 - tmp202 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp202 += tmp199 - tmp202 += tmp200 * 2 - tmp202 += tmp201 - tmp221 = np.copy(tmp54) * 0.5 - del tmp54 - tmp221 += tmp55 * 0.5 - del tmp55 - tmp221 += tmp56 - del tmp56 - tmp214 = np.copy(f.bb.ov) - tmp214 += tmp97 - tmp214 += tmp213 * -1 - del tmp213 - tmp143 = np.copy(v.bbbb.ovvv) - tmp143 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) * -1 - tmp70 = einsum(t2.bbbb, (0, 1, 2, 3), l2.abab, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp69 = einsum(l2.aaaa, (0, 1, 2, 3), t2.abab, (3, 4, 1, 5), (2, 4, 0, 5)) - tmp78 = np.copy(tmp76) - tmp78 += tmp77 - tmp72 = np.copy(v.aaaa.ovvv) - tmp72 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) * -1 - tmp123 = einsum(t2.abab, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 1), (0, 5, 2, 4)) - tmp122 = einsum(l2.abab, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 0), (4, 3, 5, 1)) - tmp162 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 0, 1), (2, 3)) - tmp3 = np.copy(np.transpose(v.aabb.ovoo, (0, 2, 3, 1))) - tmp3 += np.transpose(tmp2, (0, 2, 1, 3)) - tmp94 = np.copy(tmp42) - del tmp42 - tmp94 += tmp43 * 2 - del tmp43 - tmp94 += tmp44 - del tmp44 - tmp145 = np.copy(tmp28) - tmp145 += tmp29 * 0.5 - tmp178 = np.copy(f.aa.vv) * -1 - tmp178 += np.transpose(tmp91, (1, 0)) * -1 - tmp178 += np.transpose(tmp175, (1, 0)) * 2 - tmp178 += np.transpose(tmp176, (1, 0)) - tmp178 += np.transpose(tmp177, (1, 0)) * -1 - del tmp177 - tmp92 = np.copy(v.aaaa.ovvv) * -1 - tmp92 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) - tmp173 = np.copy(np.transpose(tmp86, (1, 0, 3, 2))) - tmp173 += np.transpose(tmp83, (0, 1, 3, 2)) * -1 - tmp182 = np.copy(f.aa.ov) - tmp182 += tmp6 - tmp182 += tmp181 * -1 - del tmp181 - tmp148 = np.copy(np.transpose(v.aaaa.ooov, (0, 2, 1, 3))) - tmp148 += tmp0 - tmp168 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp168 += tmp10 - tmp168 += tmp158 - tmp168 += tmp159 * 2 - tmp166 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) - tmp166 += v.aaaa.oovv * -1 - tmp166 += tmp155 * 2 - tmp166 += tmp156 - tmp166 += np.transpose(tmp165, (1, 0, 3, 2)) * -1 - del tmp165 - tmp66 = np.copy(f.aa.oo) - tmp66 += np.transpose(tmp60, (1, 0)) - del tmp60 - tmp66 += tmp61 * 2 - del tmp61 - tmp66 += tmp62 - del tmp62 - tmp66 += np.transpose(tmp64, (1, 0)) * -1 - del tmp64 - tmp66 += tmp65 - del tmp65 - tmp75 = np.copy(tmp73) * 4 - del tmp73 - tmp75 += tmp74 - del tmp74 - tmp51 = einsum(tmp50, (0, 1, 2, 3), t2.abab, (0, 1, 3, 4), (2, 4)) - tmp49 = einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) - tmp53 = einsum(tmp52, (0, 1, 2, 3), t2.bbbb, (1, 0, 4, 3), (2, 4)) - tmp48 = einsum(l1.aa, (0, 1), t2.abab, (1, 2, 0, 3), (2, 3)) - tmp27 = einsum(l1.aa, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp102 = np.copy(np.transpose(v.aabb.vvoo, (2, 3, 0, 1))) - tmp102 += np.transpose(tmp101, (1, 0, 3, 2)) - tmp96 = np.copy(v.bbbb.ooov) * -1 - tmp96 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) - tmp96 += np.transpose(tmp95, (1, 0, 2, 3)) - tmp96 += np.transpose(tmp95, (2, 0, 1, 3)) * -1 - tmp16 = np.copy(v.aabb.oooo) - tmp16 += np.transpose(tmp12, (1, 0, 3, 2)) - tmp16 += np.transpose(tmp13, (1, 0, 3, 2)) - tmp16 += np.transpose(tmp15, (1, 0, 3, 2)) - del tmp15 - tmp5 = np.copy(v.aabb.ooov) - tmp5 += np.transpose(tmp4, (1, 0, 2, 3)) - tmp32 = einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp133 = einsum(t2.abab, (0, 1, 2, 3), tmp50, (0, 4, 5, 2), (4, 5, 1, 3)) - tmp134 = einsum(t2.bbbb, (0, 1, 2, 3), tmp52, (4, 1, 5, 3), (4, 5, 0, 2)) * -1 - tmp105 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 1, 3))) - tmp105 += v.bbbb.oovv * -1 - tmp105 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp104 = np.copy(v.bbbb.ooov) * -1 - tmp104 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) - tmp104 += tmp95 - tmp104 += np.transpose(tmp95, (0, 2, 1, 3)) * -1 - tmp109 = np.copy(v.bbbb.oooo) - tmp109 += np.transpose(tmp106, (3, 1, 2, 0)) - tmp109 += np.transpose(tmp107, (3, 1, 2, 0)) - tmp109 += np.transpose(tmp108, (2, 1, 3, 0)) - tmp109 += np.transpose(tmp108, (3, 2, 1, 0)) * -1 - tmp37 = einsum(l1.bb, (0, 1), t2.abab, (2, 1, 3, 0), (2, 3)) - tmp41 = einsum(tmp40, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (1, 4)) - tmp39 = einsum(t2.aaaa, (0, 1, 2, 3), tmp38, (1, 0, 4, 3), (4, 2)) - tmp36 = einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) - tmp58 = einsum(t1.bb, (0, 1), tmp57, (0, 2), (2, 1)) - tmp82 = einsum(tmp38, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (0, 2, 4, 5)) * -1 - tmp84 = einsum(tmp40, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp25 = np.copy(v.aaaa.oooo) - tmp25 += np.transpose(tmp22, (3, 1, 2, 0)) - tmp25 += np.transpose(tmp23, (3, 1, 2, 0)) - tmp25 += np.transpose(tmp24, (2, 1, 3, 0)) - tmp25 += np.transpose(tmp24, (3, 2, 1, 0)) * -1 - tmp21 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) - tmp21 += v.aaaa.oovv * -1 - tmp21 += np.transpose(tmp20, (0, 1, 3, 2)) - tmp18 = np.copy(v.aaaa.ooov) * -1 - tmp18 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) - tmp18 += tmp0 - tmp18 += np.transpose(tmp0, (0, 2, 1, 3)) * -1 - tmp19 = np.copy(v.aabb.ooov) - tmp19 += tmp4 - tmp46 = einsum(tmp45, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp11 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp11 += tmp10 - tmp1 = np.copy(v.aaaa.ooov) * -1 - tmp1 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) - tmp1 += np.transpose(tmp0, (1, 0, 2, 3)) - tmp1 += np.transpose(tmp0, (2, 0, 1, 3)) * -1 - tmp241 = einsum(v.bbbb.vvvv, (0, 1, 2, 3), l2.bbbb, (3, 1, 4, 5), (4, 5, 0, 2)) * -1 - tmp234 = einsum(tmp40, (0, 1, 2, 3), v.aabb.ooov, (1, 0, 4, 5), (2, 4, 3, 5)) - tmp249 = einsum(tmp108, (0, 1, 2, 3), l2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - del tmp108 - tmp223 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 1), (0, 3)) - tmp236 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp236 += tmp199 - del tmp199 - tmp236 += tmp200 * 2 - del tmp200 - tmp236 += tmp201 - del tmp201 - tmp231 = einsum(tmp95, (0, 1, 2, 3), tmp52, (0, 4, 2, 5), (4, 1, 5, 3)) * -1 - tmp237 = einsum(tmp120, (0, 1), l2.bbbb, (2, 3, 4, 0), (4, 1, 2, 3)) * -2 - tmp229 = einsum(l1.bb, (0, 1), tmp228, (1, 2, 3, 4), (2, 3, 4, 0)) - del tmp228 - tmp233 = einsum(tmp40, (0, 1, 2, 3), tmp4, (0, 1, 4, 5), (2, 4, 3, 5)) - tmp256 = einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp255, (4, 2, 5, 1), (4, 0, 5, 3)) - del tmp255 - tmp238 = np.copy(f.bb.ov) - tmp238 += tmp97 - tmp238 += tmp203 - tmp204 = np.copy(f.bb.ov) - tmp204 += tmp97 - del tmp97 - tmp204 += tmp203 - del tmp203 - tmp247 = einsum(l2.bbbb, (0, 1, 2, 3), tmp246, (4, 1), (2, 3, 4, 0)) * -1 - del tmp246 - tmp244 = einsum(tmp243, (0, 1, 2, 3), v.bbbb.ovov, (2, 4, 3, 5), (0, 1, 4, 5)) * 0.5 - del tmp243 - tmp226 = einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp225, (4, 1), (0, 2, 4, 3)) - tmp251 = einsum(tmp225, (0, 1), v.bbbb.ovov, (2, 3, 4, 1), (2, 4, 0, 3)) - del tmp225 - tmp239 = einsum(l2.bbbb, (0, 1, 2, 3), tmp198, (3, 4, 1, 5), (4, 2, 5, 0)) - tmp240 = einsum(tmp202, (0, 1, 2, 3), l2.abab, (2, 4, 0, 5), (1, 5, 3, 4)) - tmp253 = einsum(tmp52, (0, 1, 2, 3), tmp95, (1, 2, 4, 5), (0, 4, 3, 5)) - tmp258 = einsum(tmp221, (0, 1), v.bbbb.ovov, (2, 3, 1, 4), (0, 2, 4, 3)) * 2 - tmp230 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), l1.bb, (3, 4), (4, 0, 1, 2)) - tmp242 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), tmp52, (4, 5, 0, 3), (5, 4, 1, 2)) - tmp248 = einsum(tmp214, (0, 1), tmp52, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp232 = einsum(v.bbbb.ovoo, (0, 1, 2, 3), tmp52, (3, 4, 2, 5), (4, 0, 5, 1)) * -1 - tmp254 = einsum(v.bbbb.ooov, (0, 1, 2, 3), tmp52, (1, 4, 2, 5), (4, 0, 5, 3)) * -1 - tmp235 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 1, 3))) - tmp235 += v.bbbb.oovv * -1 - tmp235 += tmp194 - del tmp194 - tmp235 += tmp195 * 2 - del tmp195 - tmp235 += einsum(tmp143, (0, 1, 2, 3), t1.bb, (4, 1), (4, 0, 3, 2)) * -1 - tmp227 = np.copy(v.bbbb.ooov) - tmp227 += np.transpose(tmp95, (0, 2, 1, 3)) - tmp252 = np.copy(v.bbbb.ooov) - tmp252 += np.transpose(tmp95, (0, 2, 1, 3)) - tmp250 = np.copy(v.bbbb.oooo) * -1 - tmp250 += np.transpose(tmp106, (1, 3, 0, 2)) * -1 - del tmp106 - tmp250 += np.transpose(tmp107, (0, 3, 1, 2)) - del tmp107 - tmp257 = einsum(tmp57, (0, 1), v.bbbb.ovov, (2, 3, 1, 4), (2, 0, 4, 3)) - tmp218 = np.copy(v.aabb.oovv) - tmp218 += einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp216 = np.copy(v.aabb.ooov) - tmp216 += tmp4 - tmp206 = einsum(l2.abab, (0, 1, 2, 3), v.aabb.vvvv, (4, 0, 5, 1), (2, 3, 4, 5)) - tmp224 = np.copy(tmp69) - tmp224 += tmp70 - tmp219 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (4, 2, 5, 1)) - tmp205 = np.copy(np.transpose(v.aabb.vvoo, (2, 3, 0, 1))) - tmp205 += np.transpose(tmp101, (0, 1, 3, 2)) - del tmp101 - tmp207 = einsum(v.aabb.ovov, (0, 1, 2, 3), tmp78, (4, 0, 5, 2), (4, 5, 1, 3)) * 0.5 - tmp208 = np.copy(f.aa.vv) * -1 - tmp208 += np.transpose(tmp91, (1, 0)) * -1 - tmp208 += tmp175 * 2 - del tmp175 - tmp208 += tmp176 - del tmp176 - tmp208 += einsum(tmp72, (0, 1, 2, 3), t1.aa, (0, 1), (3, 2)) * -1 - tmp222 = np.copy(tmp122) - tmp222 += tmp123 - tmp193 = np.copy(tmp33) * 0.5 - tmp193 += tmp34 - tmp211 = np.copy(f.bb.vv) * -0.5 - tmp211 += np.transpose(tmp142, (1, 0)) * -0.5 - tmp211 += tmp209 * 0.5 - del tmp209 - tmp211 += tmp210 - del tmp210 - tmp211 += einsum(tmp111, (0, 1, 2, 3), t1.bb, (0, 2), (3, 1)) * -0.5 - tmp170 = np.copy(f.aa.ov) - tmp170 += tmp162 - tmp170 += tmp6 - tmp217 = np.copy(v.aabb.oooo) - tmp217 += np.transpose(tmp12, (1, 0, 2, 3)) - del tmp12 - tmp217 += tmp13 - del tmp13 - tmp217 += einsum(tmp3, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 2, 1)) - tmp189 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 1, 0, 3), (2, 3)) - tmp220 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp215 = np.copy(tmp28) * 2 - tmp215 += tmp29 - tmp192 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp94, (4, 2), (0, 4, 3, 1)) - tmp186 = einsum(tmp145, (0, 1), v.aaaa.ovov, (2, 3, 4, 1), (2, 4, 0, 3)) * 2 - tmp146 = einsum(tmp145, (0, 1), v.aaaa.ovov, (2, 1, 3, 4), (2, 3, 0, 4)) * 2 - del tmp145 - tmp184 = einsum(l2.aaaa, (0, 1, 2, 3), tmp24, (2, 3, 4, 5), (4, 5, 0, 1)) - del tmp24 - tmp171 = einsum(l2.aaaa, (0, 1, 2, 3), v.aaaa.vvvv, (4, 0, 5, 1), (2, 3, 4, 5)) - tmp185 = np.copy(v.aaaa.oooo) * -1 - tmp185 += np.transpose(tmp22, (1, 3, 0, 2)) * -1 - del tmp22 - tmp185 += np.transpose(tmp23, (0, 3, 1, 2)) - del tmp23 - tmp190 = einsum(tmp0, (0, 1, 2, 3), tmp38, (4, 0, 1, 5), (4, 2, 5, 3)) - tmp179 = einsum(l2.aaaa, (0, 1, 2, 3), tmp178, (4, 1), (2, 3, 4, 0)) * -1 - del tmp178 - tmp150 = einsum(l1.aa, (0, 1), v.aaaa.ovvv, (2, 3, 4, 0), (1, 2, 3, 4)) - tmp152 = einsum(tmp50, (0, 1, 2, 3), v.aabb.ovoo, (4, 5, 2, 1), (0, 4, 3, 5)) - tmp157 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) - tmp157 += v.aaaa.oovv * -1 - tmp157 += tmp155 * 2 - del tmp155 - tmp157 += tmp156 - del tmp156 - tmp157 += einsum(tmp92, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 3, 1)) * -1 - tmp174 = einsum(tmp173, (0, 1, 2, 3), v.aaaa.ovov, (2, 4, 3, 5), (0, 1, 4, 5)) * 0.5 - del tmp173 - tmp160 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp160 += tmp10 - del tmp10 - tmp160 += tmp158 - del tmp158 - tmp160 += tmp159 * 2 - del tmp159 - tmp183 = einsum(tmp38, (0, 1, 2, 3), tmp182, (2, 4), (0, 1, 4, 3)) - tmp154 = einsum(tmp38, (0, 1, 2, 3), v.aaaa.ovoo, (4, 5, 2, 0), (1, 4, 3, 5)) * -1 - tmp172 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), tmp38, (4, 5, 0, 3), (5, 4, 1, 2)) - tmp188 = einsum(tmp38, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 2, 5), (1, 4, 3, 5)) * -1 - tmp149 = einsum(l1.aa, (0, 1), tmp148, (1, 2, 3, 4), (2, 3, 4, 0)) - del tmp148 - tmp151 = einsum(tmp2, (0, 1, 2, 3), tmp50, (4, 1, 2, 5), (4, 0, 5, 3)) - tmp187 = np.copy(v.aaaa.ooov) - tmp187 += np.transpose(tmp0, (0, 2, 1, 3)) - tmp169 = einsum(l2.abab, (0, 1, 2, 3), tmp168, (4, 3, 5, 1), (4, 2, 5, 0)) - tmp167 = einsum(l2.aaaa, (0, 1, 2, 3), tmp166, (3, 4, 1, 5), (4, 2, 5, 0)) - tmp147 = np.copy(v.aaaa.ooov) - tmp147 += np.transpose(tmp0, (0, 2, 1, 3)) - tmp161 = einsum(tmp66, (0, 1), l2.aaaa, (2, 3, 4, 0), (4, 1, 2, 3)) * -2 - tmp191 = einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp75, (4, 2, 5, 1), (0, 4, 3, 5)) - tmp153 = einsum(tmp0, (0, 1, 2, 3), tmp38, (0, 4, 2, 5), (4, 1, 5, 3)) * -1 - tmp163 = np.copy(f.aa.ov) - tmp163 += tmp162 - del tmp162 - tmp163 += tmp6 - del tmp6 - tmp121 = einsum(t1.aa, (0, 1), v.aabb.vvvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp128 = einsum(l1.bb, (0, 1), t2.abab, (2, 3, 4, 0), (2, 1, 3, 4)) - tmp128 += tmp50 - tmp128 += einsum(t2.aaaa, (0, 1, 2, 3), tmp50, (1, 4, 5, 3), (0, 4, 5, 2)) * 2 - tmp128 += einsum(tmp40, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (1, 2, 4, 5)) * -1 - tmp128 += einsum(tmp52, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 2, 5)) * -2 - tmp128 += einsum(t1.aa, (0, 1), tmp78, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - tmp141 = np.copy(t1.bb) * -0.5 - tmp141 += tmp48 * -0.5 - tmp141 += tmp49 * -1 - tmp141 += tmp51 * 0.5 - tmp141 += tmp53 - tmp141 += einsum(t1.bb, (0, 1), tmp57, (0, 2), (2, 1)) * 0.5 - tmp112 = np.copy(tmp27) * 0.5 - tmp112 += tmp28 - tmp112 += tmp29 * 0.5 - tmp140 = np.copy(tmp76) - tmp140 += np.transpose(tmp77, (1, 0, 2, 3)) - tmp124 = np.copy(np.transpose(l2.abab, (2, 3, 0, 1))) - tmp124 += tmp122 * 2 - del tmp122 - tmp124 += einsum(tmp40, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -1 - tmp124 += tmp123 * 2 - del tmp123 - tmp103 = np.copy(np.transpose(v.aabb.ovoo, (0, 2, 3, 1))) - tmp103 += tmp2 - tmp103 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 5, 3), (0, 1, 5, 4)) - tmp103 += einsum(tmp96, (0, 1, 2, 3), t2.abab, (4, 0, 5, 3), (4, 1, 2, 5)) - del tmp96 - tmp103 += einsum(tmp3, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 2, 1, 5)) * 2 - tmp103 += einsum(tmp5, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (1, 4, 2, 5)) * -1 - tmp103 += einsum(tmp100, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp103 += einsum(tmp102, (0, 1, 2, 3), t1.aa, (4, 2), (4, 1, 0, 3)) - del tmp102 - tmp103 += einsum(t1.aa, (0, 1), tmp16, (0, 2, 3, 4), (2, 4, 3, 1)) * -1 - tmp144 = np.copy(f.bb.vv) - tmp144 += np.transpose(tmp142, (1, 0)) - del tmp142 - tmp144 += einsum(tmp143, (0, 1, 2, 3), t1.bb, (0, 2), (3, 1)) * -1 - del tmp143 - tmp35 = np.copy(tmp32) - del tmp32 - tmp35 += tmp33 - del tmp33 - tmp35 += tmp34 * 2 - del tmp34 - tmp136 = einsum(t2.bbbb, (0, 1, 2, 3), l1.bb, (3, 4), (4, 0, 1, 2)) * 0.5 - tmp136 += np.transpose(tmp52, (1, 0, 2, 3)) * 0.5 - tmp136 += np.transpose(tmp133, (0, 2, 1, 3)) * 0.25 - tmp136 += np.transpose(tmp134, (0, 2, 1, 3)) - tmp136 += einsum(t1.bb, (0, 1), tmp135, (0, 2, 3, 4), (2, 3, 4, 1)) * -0.5 - tmp132 = einsum(t1.bb, (0, 1), tmp52, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp110 = np.copy(np.transpose(v.bbbb.ooov, (0, 2, 1, 3))) * 0.5 - tmp110 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 5, 1, 3), (0, 4, 5, 2)) * -0.5 - tmp110 += einsum(tmp104, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (2, 4, 0, 5)) - del tmp104 - tmp110 += einsum(tmp14, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (2, 4, 1, 5)) * 0.5 - tmp110 += einsum(tmp100, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) * 0.5 - tmp110 += einsum(t1.bb, (0, 1), tmp105, (2, 3, 4, 1), (3, 2, 0, 4)) * 0.5 - del tmp105 - tmp110 += einsum(tmp109, (0, 1, 2, 3), t1.bb, (0, 4), (2, 1, 3, 4)) * -0.5 - del tmp109 - tmp129 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 5, 1), (3, 4, 0, 5)) - tmp129 += einsum(t1.aa, (0, 1), tmp50, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp139 = np.copy(np.transpose(tmp137, (1, 0, 3, 2))) - tmp139 += np.transpose(tmp135, (2, 1, 0, 3)) - del tmp135 - tmp113 = np.copy(np.transpose(l1.aa, (1, 0))) * -1 - tmp113 += t1.aa * -1 - tmp113 += tmp36 * -2 - tmp113 += tmp37 * -1 - tmp113 += tmp39 * 2 - tmp113 += tmp41 - tmp113 += einsum(tmp45, (0, 1), t1.aa, (0, 2), (1, 2)) * 2 - tmp127 = np.copy(tmp125) - del tmp125 - tmp127 += tmp126 * 4 - del tmp126 - tmp131 = np.copy(v.bbbb.ovvv) * -1 - tmp131 += np.transpose(v.bbbb.ovvv, (0, 2, 3, 1)) - tmp130 = np.copy(v.bbbb.ovvv) - tmp130 += einsum(v.bbbb.vvvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) * -1 - tmp138 = np.copy(tmp133) * 0.25 - del tmp133 - tmp138 += tmp134 - del tmp134 - tmp138 += einsum(tmp137, (0, 1, 2, 3), t1.bb, (1, 4), (0, 3, 2, 4)) * 0.5 - del tmp137 - tmp59 = np.copy(np.transpose(l1.bb, (1, 0))) * -1 - tmp59 += t1.bb * -1 - tmp59 += tmp48 * -1 - del tmp48 - tmp59 += tmp49 * -2 - del tmp49 - tmp59 += tmp51 - del tmp51 - tmp59 += tmp53 * 2 - del tmp53 - tmp59 += tmp58 - del tmp58 - tmp93 = np.copy(f.aa.vv) - tmp93 += np.transpose(tmp91, (1, 0)) - del tmp91 - tmp93 += einsum(tmp92, (0, 1, 2, 3), t1.aa, (0, 1), (3, 2)) * -1 - del tmp92 - tmp80 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 5), (2, 4, 1, 5)) - tmp80 += einsum(tmp40, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - tmp85 = einsum(t2.aaaa, (0, 1, 2, 3), l1.aa, (3, 4), (4, 0, 1, 2)) * 2 - tmp85 += np.transpose(tmp38, (1, 0, 2, 3)) * 2 - tmp85 += np.transpose(tmp82, (0, 2, 1, 3)) * 4 - tmp85 += einsum(t1.aa, (0, 1), tmp83, (0, 2, 3, 4), (2, 3, 4, 1)) * -2 - tmp85 += np.transpose(tmp84, (0, 2, 1, 3)) - tmp71 = np.copy(np.transpose(l2.abab, (2, 3, 0, 1))) - tmp71 += tmp69 * 2 - del tmp69 - tmp71 += tmp70 * 2 - del tmp70 - tmp71 += einsum(t1.bb, (0, 1), tmp50, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - tmp30 = np.copy(tmp27) - del tmp27 - tmp30 += tmp28 * 2 - del tmp28 - tmp30 += tmp29 - del tmp29 - tmp81 = np.copy(np.transpose(l2.aaaa, (2, 3, 0, 1))) * -1 - tmp81 += einsum(tmp38, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 3, 4)) * -1 - tmp26 = np.copy(np.transpose(v.aaaa.ooov, (0, 2, 1, 3))) - tmp26 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 3, 1), (0, 4, 5, 2)) - tmp26 += einsum(t2.aaaa, (0, 1, 2, 3), tmp18, (4, 1, 5, 3), (5, 0, 4, 2)) * 2 - del tmp18 - tmp26 += einsum(t2.abab, (0, 1, 2, 3), tmp19, (4, 5, 1, 3), (5, 0, 4, 2)) - del tmp19 - tmp26 += einsum(t2.aaaa, (0, 1, 2, 3), tmp9, (4, 3), (4, 0, 1, 2)) - tmp26 += einsum(tmp21, (0, 1, 2, 3), t1.aa, (4, 3), (1, 0, 4, 2)) - del tmp21 - tmp26 += einsum(t1.aa, (0, 1), tmp25, (0, 2, 3, 4), (3, 2, 4, 1)) * -1 - del tmp25 - tmp89 = np.copy(tmp76) - del tmp76 - tmp89 += np.transpose(tmp77, (0, 1, 3, 2)) - del tmp77 - tmp90 = np.copy(t1.aa) * -0.5 - tmp90 += tmp36 * -1 - tmp90 += tmp37 * -0.5 - tmp90 += tmp39 - tmp90 += tmp41 * 0.5 - tmp90 += tmp46 - tmp88 = np.copy(np.transpose(tmp86, (1, 0, 3, 2))) - tmp88 += np.transpose(tmp83, (2, 1, 0, 3)) - del tmp83 - tmp17 = np.copy(v.aabb.ooov) - tmp17 += einsum(v.aabb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp17 += einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp17 += einsum(tmp1, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 2, 4, 5)) - del tmp1 - tmp17 += einsum(tmp3, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (4, 0, 2, 5)) * -1 - del tmp3 - tmp17 += einsum(t2.bbbb, (0, 1, 2, 3), tmp5, (4, 5, 1, 3), (5, 4, 0, 2)) * 2 - del tmp5 - tmp17 += einsum(tmp9, (0, 1), t2.abab, (2, 3, 1, 4), (2, 0, 3, 4)) - tmp17 += einsum(t1.aa, (0, 1), tmp11, (2, 3, 1, 4), (0, 2, 3, 4)) - del tmp11 - tmp17 += einsum(t1.bb, (0, 1), tmp16, (2, 3, 0, 4), (3, 2, 4, 1)) * -1 - del tmp16 - tmp47 = np.copy(np.transpose(l1.aa, (1, 0))) * -0.5 - tmp47 += t1.aa * -0.5 - tmp47 += tmp36 * -1 - del tmp36 - tmp47 += tmp37 * -0.5 - del tmp37 - tmp47 += tmp39 - del tmp39 - tmp47 += tmp41 * 0.5 - del tmp41 - tmp47 += tmp46 - del tmp46 - tmp68 = einsum(t1.aa, (0, 1), v.aaaa.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp79 = einsum(l1.aa, (0, 1), t2.abab, (2, 3, 0, 4), (1, 2, 3, 4)) * 0.5 - tmp79 += tmp40 * 0.5 - tmp79 += einsum(tmp38, (0, 1, 2, 3), t2.abab, (1, 4, 3, 5), (0, 2, 4, 5)) * -1 - tmp79 += einsum(tmp40, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp79 += einsum(tmp50, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (0, 4, 2, 5)) * -0.5 - tmp79 += einsum(t1.bb, (0, 1), tmp78, (2, 3, 0, 4), (2, 3, 4, 1)) * -0.5 - del tmp78 - tmp67 = einsum(t1.bb, (0, 1), v.aabb.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp87 = np.copy(tmp82) * 4 - del tmp82 - tmp87 += einsum(t1.aa, (0, 1), tmp86, (2, 0, 3, 4), (2, 4, 3, 1)) * 2 - del tmp86 - tmp87 += tmp84 - del tmp84 - l2new.bbbb = np.copy(np.transpose(v.bbbb.ovov, (1, 3, 0, 2))) - l2new.bbbb += np.transpose(tmp226, (3, 2, 1, 0)) * -1 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp227, (1, 2, 3, 4), (4, 0, 3, 2)) * -1 - del tmp227 - l2new.bbbb += np.transpose(v.bbbb.ovov, (3, 1, 0, 2)) * -1 - l2new.bbbb += np.transpose(tmp226, (2, 3, 1, 0)) - del tmp226 - l2new.bbbb += np.transpose(tmp229, (3, 2, 0, 1)) - l2new.bbbb += np.transpose(tmp230, (2, 3, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp231, (3, 2, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp232, (3, 2, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp233, (3, 2, 0, 1)) - l2new.bbbb += np.transpose(tmp234, (3, 2, 0, 1)) - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp235, (3, 4, 1, 5), (5, 0, 2, 4)) * -2 - del tmp235 - l2new.bbbb += einsum(tmp236, (0, 1, 2, 3), l2.abab, (2, 4, 0, 5), (3, 4, 5, 1)) * -1 - del tmp236 - l2new.bbbb += np.transpose(tmp237, (3, 2, 0, 1)) * -1 - l2new.bbbb += einsum(tmp238, (0, 1), l1.bb, (2, 3), (1, 2, 3, 0)) * -1 - del tmp238 - l2new.bbbb += np.transpose(tmp230, (2, 3, 1, 0)) - l2new.bbbb += np.transpose(tmp231, (3, 2, 1, 0)) * -2 - l2new.bbbb += np.transpose(tmp232, (3, 2, 1, 0)) * -2 - l2new.bbbb += np.transpose(tmp233, (3, 2, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp234, (3, 2, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp239, (2, 3, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp240, (2, 3, 0, 1)) - l2new.bbbb += np.transpose(tmp237, (3, 2, 1, 0)) - del tmp237 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp204, (2, 3), (3, 0, 2, 1)) - l2new.bbbb += np.transpose(tmp230, (3, 2, 0, 1)) - l2new.bbbb += np.transpose(tmp231, (2, 3, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp232, (2, 3, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp233, (2, 3, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp234, (2, 3, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp239, (3, 2, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp240, (3, 2, 1, 0)) - l2new.bbbb += einsum(l1.bb, (0, 1), tmp204, (2, 3), (0, 3, 1, 2)) - l2new.bbbb += np.transpose(tmp230, (3, 2, 1, 0)) * -1 - del tmp230 - l2new.bbbb += np.transpose(tmp231, (2, 3, 1, 0)) * 2 - del tmp231 - l2new.bbbb += np.transpose(tmp232, (2, 3, 1, 0)) * 2 - del tmp232 - l2new.bbbb += np.transpose(tmp233, (2, 3, 1, 0)) - del tmp233 - l2new.bbbb += np.transpose(tmp234, (2, 3, 1, 0)) - del tmp234 - l2new.bbbb += np.transpose(tmp239, (3, 2, 0, 1)) * -2 - del tmp239 - l2new.bbbb += np.transpose(tmp240, (3, 2, 0, 1)) * -1 - del tmp240 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp204, (2, 3), (0, 3, 2, 1)) * -1 - l2new.bbbb += np.transpose(tmp241, (3, 2, 1, 0)) * 2 - del tmp241 - l2new.bbbb += np.transpose(tmp242, (2, 3, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp244, (3, 2, 1, 0)) * 4 - del tmp244 - l2new.bbbb += np.transpose(tmp247, (2, 3, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp248, (2, 3, 1, 0)) * -2 - l2new.bbbb += np.transpose(tmp242, (3, 2, 1, 0)) * -2 - del tmp242 - l2new.bbbb += np.transpose(tmp247, (3, 2, 1, 0)) * -2 - del tmp247 - l2new.bbbb += np.transpose(tmp248, (3, 2, 1, 0)) * 2 - del tmp248 - l2new.bbbb += np.transpose(tmp249, (2, 3, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp249, (2, 3, 1, 0)) * 2 - del tmp249 - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp250, (2, 4, 3, 5), (0, 1, 4, 5)) * -2 - del tmp250 - l2new.bbbb += np.transpose(tmp251, (3, 2, 1, 0)) - l2new.bbbb += einsum(l1.bb, (0, 1), tmp252, (1, 2, 3, 4), (4, 0, 2, 3)) - del tmp252 - l2new.bbbb += np.transpose(tmp251, (2, 3, 1, 0)) * -1 - del tmp251 - l2new.bbbb += np.transpose(tmp229, (3, 2, 1, 0)) * -1 - del tmp229 - l2new.bbbb += np.transpose(tmp253, (3, 2, 0, 1)) * -2 - l2new.bbbb += einsum(tmp223, (0, 1), l1.bb, (2, 3), (1, 2, 3, 0)) - l2new.bbbb += np.transpose(tmp254, (3, 2, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp256, (3, 2, 0, 1)) - l2new.bbbb += np.transpose(tmp257, (2, 3, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp253, (2, 3, 0, 1)) * 2 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp223, (2, 3), (0, 3, 1, 2)) * -1 - l2new.bbbb += np.transpose(tmp254, (2, 3, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp256, (2, 3, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp257, (3, 2, 1, 0)) - del tmp257 - l2new.bbbb += np.transpose(tmp253, (3, 2, 1, 0)) * 2 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp223, (2, 3), (3, 0, 2, 1)) * -1 - l2new.bbbb += np.transpose(tmp254, (3, 2, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp256, (3, 2, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp258, (2, 3, 1, 0)) - l2new.bbbb += np.transpose(tmp253, (2, 3, 1, 0)) * -2 - del tmp253 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp223, (2, 3), (0, 3, 2, 1)) - l2new.bbbb += np.transpose(tmp254, (2, 3, 1, 0)) * -2 - del tmp254 - l2new.bbbb += np.transpose(tmp256, (2, 3, 1, 0)) - del tmp256 - l2new.bbbb += np.transpose(tmp258, (3, 2, 1, 0)) * -1 - del tmp258 - l2new.abab = np.copy(np.transpose(v.aabb.ovov, (1, 3, 0, 2))) - l2new.abab += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp193, (4, 3), (1, 4, 0, 2)) * -2 - del tmp193 - l2new.abab += einsum(tmp14, (0, 1, 2, 3), l1.bb, (4, 1), (3, 4, 0, 2)) * -1 - l2new.abab += einsum(v.aabb.ovvv, (0, 1, 2, 3), l1.bb, (3, 4), (1, 2, 0, 4)) - l2new.abab += einsum(tmp40, (0, 1, 2, 3), v.aaaa.ovoo, (4, 5, 1, 0), (5, 3, 4, 2)) * -1 - l2new.abab += einsum(tmp40, (0, 1, 2, 3), tmp0, (0, 4, 1, 5), (5, 3, 4, 2)) * -1 - l2new.abab += einsum(tmp2, (0, 1, 2, 3), tmp52, (4, 1, 2, 5), (3, 5, 0, 4)) * -2 - del tmp2 - l2new.abab += einsum(tmp52, (0, 1, 2, 3), v.aabb.ovoo, (4, 5, 2, 1), (5, 3, 4, 0)) * -2 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp166, (2, 4, 0, 5), (5, 1, 4, 3)) - del tmp166 - l2new.abab += einsum(l2.bbbb, (0, 1, 2, 3), tmp168, (4, 3, 5, 1), (5, 0, 4, 2)) * 2 - del tmp168 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp66, (2, 4), (0, 1, 4, 3)) * -1 - l2new.abab += einsum(l1.bb, (0, 1), tmp170, (2, 3), (3, 0, 2, 1)) - l2new.abab += einsum(tmp38, (0, 1, 2, 3), v.aabb.ooov, (2, 1, 4, 5), (3, 5, 0, 4)) * -2 - l2new.abab += einsum(tmp4, (0, 1, 2, 3), tmp38, (4, 0, 1, 5), (5, 3, 4, 2)) * -2 - del tmp4 - l2new.abab += einsum(tmp50, (0, 1, 2, 3), tmp95, (1, 4, 2, 5), (3, 5, 0, 4)) * -1 - l2new.abab += einsum(v.aabb.vvov, (0, 1, 2, 3), l1.aa, (1, 4), (0, 3, 4, 2)) - l2new.abab += einsum(tmp50, (0, 1, 2, 3), v.bbbb.ovoo, (4, 5, 2, 1), (3, 5, 0, 4)) * -1 - l2new.abab += einsum(tmp198, (0, 1, 2, 3), l2.abab, (4, 2, 5, 0), (4, 3, 5, 1)) - del tmp198 - l2new.abab += einsum(tmp202, (0, 1, 2, 3), l2.aaaa, (4, 2, 5, 0), (4, 3, 5, 1)) * 2 - del tmp202 - l2new.abab += einsum(l1.aa, (0, 1), tmp204, (2, 3), (0, 3, 1, 2)) - del tmp204 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp205, (3, 4, 0, 5), (5, 1, 2, 4)) * -1 - del tmp205 - l2new.abab += einsum(tmp120, (0, 1), l2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -1 - l2new.abab += np.transpose(tmp206, (2, 3, 0, 1)) - del tmp206 - l2new.abab += einsum(tmp40, (0, 1, 2, 3), v.aabb.ovvv, (1, 4, 5, 3), (4, 5, 0, 2)) * -1 - l2new.abab += np.transpose(tmp207, (2, 3, 0, 1)) * 2 - del tmp207 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp208, (0, 4), (4, 1, 2, 3)) * -1 - del tmp208 - l2new.abab += einsum(tmp182, (0, 1), tmp40, (2, 0, 3, 4), (1, 4, 2, 3)) * -1 - del tmp182 - l2new.abab += einsum(v.aabb.vvov, (0, 1, 2, 3), tmp50, (4, 5, 2, 1), (0, 3, 4, 5)) * -1 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp211, (1, 4), (0, 4, 2, 3)) * -2 - del tmp211 - l2new.abab += einsum(tmp214, (0, 1), tmp50, (2, 3, 0, 4), (4, 1, 2, 3)) * -1 - del tmp214 - l2new.abab += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp215, (4, 1), (4, 3, 0, 2)) * -1 - del tmp215 - l2new.abab += einsum(tmp216, (0, 1, 2, 3), l1.aa, (4, 0), (4, 3, 1, 2)) * -1 - l2new.abab += einsum(tmp217, (0, 1, 2, 3), l2.abab, (4, 5, 0, 2), (4, 5, 1, 3)) - del tmp217 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp218, (2, 4, 1, 5), (0, 5, 4, 3)) * -1 - del tmp218 - l2new.abab += einsum(tmp219, (0, 1, 2, 3), l2.abab, (2, 4, 5, 0), (3, 4, 5, 1)) - del tmp219 - l2new.abab += einsum(tmp14, (0, 1, 2, 3), tmp40, (4, 0, 1, 5), (3, 5, 4, 2)) - del tmp14 - l2new.abab += einsum(tmp94, (0, 1), v.aabb.ovov, (1, 2, 3, 4), (2, 4, 0, 3)) * -1 - l2new.abab += einsum(tmp220, (0, 1, 2, 3), l2.abab, (4, 2, 0, 5), (4, 3, 1, 5)) - del tmp220 - l2new.abab += einsum(tmp216, (0, 1, 2, 3), tmp50, (0, 4, 2, 5), (5, 3, 1, 4)) - del tmp216 - l2new.abab += einsum(tmp221, (0, 1), v.aabb.ovov, (2, 3, 1, 4), (3, 4, 2, 0)) * -2 - del tmp221 - l2new.abab += einsum(tmp40, (0, 1, 2, 3), tmp0, (0, 1, 4, 5), (5, 3, 4, 2)) - del tmp0 - l2new.abab += einsum(tmp40, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 1, 5), (5, 3, 4, 2)) - l2new.abab += einsum(l1.bb, (0, 1), tmp189, (2, 3), (3, 0, 2, 1)) * -1 - l2new.abab += einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp222, (2, 4, 1, 5), (3, 5, 0, 4)) * -2 - del tmp222 - l2new.abab += einsum(tmp50, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 2, 5), (3, 5, 0, 4)) - l2new.abab += einsum(tmp50, (0, 1, 2, 3), tmp95, (1, 2, 4, 5), (3, 5, 0, 4)) - del tmp95 - l2new.abab += einsum(l1.aa, (0, 1), tmp223, (2, 3), (0, 3, 1, 2)) * -1 - del tmp223 - l2new.abab += einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp224, (4, 2, 5, 1), (5, 3, 4, 0)) * -2 - del tmp224 - l2new.aaaa = np.copy(np.transpose(v.aaaa.ovov, (1, 3, 0, 2))) - l2new.aaaa += np.transpose(tmp146, (3, 2, 1, 0)) * -1 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp147, (1, 2, 3, 4), (4, 0, 3, 2)) * -1 - del tmp147 - l2new.aaaa += np.transpose(v.aaaa.ovov, (3, 1, 0, 2)) * -1 - l2new.aaaa += np.transpose(tmp146, (2, 3, 1, 0)) - del tmp146 - l2new.aaaa += np.transpose(tmp149, (3, 2, 0, 1)) - l2new.aaaa += np.transpose(tmp150, (2, 3, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp151, (3, 2, 0, 1)) - l2new.aaaa += np.transpose(tmp152, (3, 2, 0, 1)) - l2new.aaaa += np.transpose(tmp153, (3, 2, 0, 1)) * 2 - l2new.aaaa += np.transpose(tmp154, (3, 2, 0, 1)) * 2 - l2new.aaaa += einsum(l2.aaaa, (0, 1, 2, 3), tmp157, (3, 4, 1, 5), (5, 0, 2, 4)) * -2 - del tmp157 - l2new.aaaa += einsum(l2.abab, (0, 1, 2, 3), tmp160, (4, 3, 5, 1), (5, 0, 2, 4)) * -1 - del tmp160 - l2new.aaaa += np.transpose(tmp161, (3, 2, 0, 1)) * -1 - l2new.aaaa += einsum(tmp163, (0, 1), l1.aa, (2, 3), (1, 2, 3, 0)) * -1 - del tmp163 - l2new.aaaa += np.transpose(tmp150, (2, 3, 1, 0)) - l2new.aaaa += np.transpose(tmp151, (3, 2, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp152, (3, 2, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp153, (3, 2, 1, 0)) * -2 - l2new.aaaa += np.transpose(tmp154, (3, 2, 1, 0)) * -2 - l2new.aaaa += np.transpose(tmp167, (2, 3, 0, 1)) * 2 - l2new.aaaa += np.transpose(tmp169, (2, 3, 0, 1)) - l2new.aaaa += np.transpose(tmp161, (3, 2, 1, 0)) - del tmp161 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp170, (2, 3), (3, 0, 2, 1)) - l2new.aaaa += np.transpose(tmp150, (3, 2, 0, 1)) - l2new.aaaa += np.transpose(tmp151, (2, 3, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp152, (2, 3, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp153, (2, 3, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp154, (2, 3, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp167, (3, 2, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp169, (3, 2, 1, 0)) - l2new.aaaa += einsum(l1.aa, (0, 1), tmp170, (2, 3), (0, 3, 1, 2)) - l2new.aaaa += np.transpose(tmp150, (3, 2, 1, 0)) * -1 - del tmp150 - l2new.aaaa += np.transpose(tmp151, (2, 3, 1, 0)) - del tmp151 - l2new.aaaa += np.transpose(tmp152, (2, 3, 1, 0)) - del tmp152 - l2new.aaaa += np.transpose(tmp153, (2, 3, 1, 0)) * 2 - del tmp153 - l2new.aaaa += np.transpose(tmp154, (2, 3, 1, 0)) * 2 - del tmp154 - l2new.aaaa += np.transpose(tmp167, (3, 2, 0, 1)) * -2 - del tmp167 - l2new.aaaa += np.transpose(tmp169, (3, 2, 0, 1)) * -1 - del tmp169 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp170, (2, 3), (0, 3, 2, 1)) * -1 - del tmp170 - l2new.aaaa += np.transpose(tmp171, (3, 2, 1, 0)) * 2 - del tmp171 - l2new.aaaa += np.transpose(tmp172, (2, 3, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp174, (3, 2, 1, 0)) * 4 - del tmp174 - l2new.aaaa += np.transpose(tmp179, (2, 3, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp183, (2, 3, 1, 0)) * -2 - l2new.aaaa += np.transpose(tmp172, (3, 2, 1, 0)) * -2 - del tmp172 - l2new.aaaa += np.transpose(tmp179, (3, 2, 1, 0)) * -2 - del tmp179 - l2new.aaaa += np.transpose(tmp183, (3, 2, 1, 0)) * 2 - del tmp183 - l2new.aaaa += np.transpose(tmp184, (2, 3, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp184, (2, 3, 1, 0)) * 2 - del tmp184 - l2new.aaaa += einsum(l2.aaaa, (0, 1, 2, 3), tmp185, (2, 4, 3, 5), (0, 1, 4, 5)) * -2 - del tmp185 - l2new.aaaa += np.transpose(tmp186, (3, 2, 1, 0)) - l2new.aaaa += einsum(l1.aa, (0, 1), tmp187, (1, 2, 3, 4), (4, 0, 2, 3)) - del tmp187 - l2new.aaaa += np.transpose(tmp186, (2, 3, 1, 0)) * -1 - del tmp186 - l2new.aaaa += np.transpose(tmp149, (3, 2, 1, 0)) * -1 - del tmp149 - l2new.aaaa += np.transpose(tmp188, (3, 2, 0, 1)) * -2 - l2new.aaaa += einsum(tmp189, (0, 1), l1.aa, (2, 3), (1, 2, 3, 0)) - l2new.aaaa += np.transpose(tmp190, (3, 2, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp191, (2, 3, 1, 0)) - l2new.aaaa += np.transpose(tmp192, (2, 3, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp188, (2, 3, 0, 1)) * 2 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp189, (2, 3), (0, 3, 1, 2)) * -1 - l2new.aaaa += np.transpose(tmp190, (2, 3, 0, 1)) * 2 - l2new.aaaa += np.transpose(tmp191, (3, 2, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp192, (3, 2, 1, 0)) - l2new.aaaa += np.transpose(tmp188, (3, 2, 1, 0)) * 2 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp189, (2, 3), (3, 0, 2, 1)) * -1 - l2new.aaaa += np.transpose(tmp190, (3, 2, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp191, (2, 3, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp192, (2, 3, 0, 1)) - l2new.aaaa += np.transpose(tmp188, (2, 3, 1, 0)) * -2 - del tmp188 - l2new.aaaa += einsum(tmp189, (0, 1), l1.aa, (2, 3), (2, 1, 0, 3)) - del tmp189 - l2new.aaaa += np.transpose(tmp190, (2, 3, 1, 0)) * -2 - del tmp190 - l2new.aaaa += np.transpose(tmp191, (3, 2, 0, 1)) - del tmp191 - l2new.aaaa += np.transpose(tmp192, (3, 2, 0, 1)) * -1 - del tmp192 - l1new.bb = einsum(v.bbbb.oovv, (0, 1, 2, 3), l1.bb, (3, 1), (2, 0)) * -1 - l1new.bb += np.transpose(f.bb.ov, (1, 0)) - l1new.bb += einsum(l2.abab, (0, 1, 2, 3), tmp103, (2, 3, 4, 0), (1, 4)) * -1 - del tmp103 - l1new.bb += einsum(tmp110, (0, 1, 2, 3), l2.bbbb, (4, 3, 1, 2), (4, 0)) * 4 - del tmp110 - l1new.bb += einsum(tmp111, (0, 1, 2, 3), tmp35, (3, 2), (1, 0)) * -1 - l1new.bb += einsum(v.aabb.vvov, (0, 1, 2, 3), tmp112, (1, 0), (3, 2)) * 2 - del tmp112 - l1new.bb += einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp59, (2, 3), (1, 0)) * -1 - l1new.bb += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp113, (0, 1), (3, 2)) * -1 - del tmp113 - l1new.bb += einsum(tmp57, (0, 1), v.bbbb.ovoo, (2, 3, 0, 1), (3, 2)) * -1 - l1new.bb += einsum(tmp45, (0, 1), v.aabb.ooov, (1, 0, 2, 3), (3, 2)) * -2 - l1new.bb += einsum(l1.bb, (0, 1), tmp120, (1, 2), (0, 2)) * -1 - del tmp120 - l1new.bb += einsum(tmp121, (0, 1, 2, 3), l2.abab, (1, 3, 0, 4), (2, 4)) - del tmp121 - l1new.bb += einsum(tmp52, (0, 1, 2, 3), v.bbbb.oovv, (2, 1, 4, 3), (4, 0)) * -2 - del tmp52 - l1new.bb += einsum(tmp40, (0, 1, 2, 3), v.aabb.oovv, (1, 0, 4, 3), (4, 2)) * -1 - del tmp40 - l1new.bb += einsum(v.aabb.ovvv, (0, 1, 2, 3), tmp124, (0, 4, 1, 3), (2, 4)) - del tmp124 - l1new.bb += einsum(tmp111, (0, 1, 2, 3), tmp127, (4, 0, 3, 2), (1, 4)) - del tmp111, tmp127 - l1new.bb += einsum(tmp128, (0, 1, 2, 3), v.aabb.ovov, (0, 3, 2, 4), (4, 1)) * -1 - del tmp128 - l1new.bb += einsum(tmp129, (0, 1, 2, 3), v.aabb.vvov, (2, 3, 1, 4), (4, 0)) * -1 - del tmp129 - l1new.bb += einsum(l2.bbbb, (0, 1, 2, 3), tmp130, (3, 0, 1, 4), (4, 2)) * -2 - del tmp130 - l1new.bb += einsum(tmp132, (0, 1, 2, 3), tmp131, (1, 4, 2, 3), (4, 0)) * -2 - del tmp132, tmp131 - l1new.bb += einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp136, (4, 0, 2, 1), (3, 4)) * -4 - del tmp136 - l1new.bb += einsum(tmp138, (0, 1, 2, 3), v.bbbb.ovov, (1, 3, 2, 4), (4, 0)) * 4 - del tmp138 - l1new.bb += einsum(tmp139, (0, 1, 2, 3), v.bbbb.ooov, (0, 2, 3, 4), (4, 1)) * 2 - del tmp139 - l1new.bb += einsum(v.aabb.ooov, (0, 1, 2, 3), tmp140, (0, 1, 4, 2), (3, 4)) - del tmp140 - l1new.bb += einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp141, (2, 1), (3, 0)) * 2 - del tmp141 - l1new.bb += einsum(tmp57, (0, 1), v.bbbb.ooov, (2, 0, 1, 3), (3, 2)) - l1new.bb += einsum(tmp144, (0, 1), l1.bb, (0, 2), (1, 2)) - del tmp144 - l1new.bb += einsum(tmp100, (0, 1), tmp57, (2, 0), (1, 2)) * -1 - del tmp100 - l1new.aa = einsum(l1.aa, (0, 1), v.aaaa.oovv, (2, 1, 3, 0), (3, 2)) * -1 - l1new.aa += np.transpose(f.aa.ov, (1, 0)) - l1new.aa += einsum(l2.abab, (0, 1, 2, 3), tmp17, (2, 4, 3, 1), (0, 4)) * -1 - del tmp17 - l1new.aa += einsum(tmp26, (0, 1, 2, 3), l2.aaaa, (4, 3, 1, 2), (4, 0)) * 2 - del tmp26 - l1new.aa += einsum(tmp30, (0, 1), tmp31, (2, 1, 0, 3), (3, 2)) * -1 - del tmp31, tmp30 - l1new.aa += einsum(v.aabb.ovvv, (0, 1, 2, 3), tmp35, (3, 2), (1, 0)) - del tmp35 - l1new.aa += einsum(tmp47, (0, 1), v.aaaa.ovov, (2, 3, 0, 1), (3, 2)) * -2 - del tmp47 - l1new.aa += einsum(tmp59, (0, 1), v.aabb.ovov, (2, 3, 0, 1), (3, 2)) * -1 - del tmp59 - l1new.aa += einsum(v.aabb.ovoo, (0, 1, 2, 3), tmp57, (3, 2), (1, 0)) * -1 - del tmp57 - l1new.aa += einsum(tmp45, (0, 1), v.aaaa.ovoo, (2, 3, 1, 0), (3, 2)) * -2 - l1new.aa += einsum(tmp66, (0, 1), l1.aa, (2, 0), (2, 1)) * -1 - del tmp66 - l1new.aa += einsum(v.aabb.vvoo, (0, 1, 2, 3), tmp50, (4, 3, 2, 1), (0, 4)) * -1 - del tmp50 - l1new.aa += einsum(l2.abab, (0, 1, 2, 3), tmp67, (3, 4, 0, 1), (4, 2)) - del tmp67 - l1new.aa += einsum(l2.aaaa, (0, 1, 2, 3), tmp68, (3, 4, 0, 1), (4, 2)) * 2 - del tmp68 - l1new.aa += einsum(v.aaaa.oovv, (0, 1, 2, 3), tmp38, (4, 1, 0, 3), (2, 4)) * -2 - l1new.aa += einsum(tmp20, (0, 1, 2, 3), tmp38, (4, 0, 1, 3), (2, 4)) * 2 - del tmp38, tmp20 - l1new.aa += einsum(v.aabb.vvov, (0, 1, 2, 3), tmp71, (4, 2, 1, 3), (0, 4)) - del tmp71 - l1new.aa += einsum(tmp75, (0, 1, 2, 3), tmp72, (1, 4, 3, 2), (4, 0)) * -1 - del tmp72, tmp75 - l1new.aa += einsum(tmp79, (0, 1, 2, 3), v.aabb.ovov, (1, 4, 2, 3), (4, 0)) * -2 - del tmp79 - l1new.aa += einsum(tmp80, (0, 1, 2, 3), v.aabb.ovvv, (1, 4, 3, 2), (4, 0)) * -1 - del tmp80 - l1new.aa += einsum(v.aaaa.ovvv, (0, 1, 2, 3), tmp81, (4, 0, 3, 1), (2, 4)) * -2 - del tmp81 - l1new.aa += einsum(tmp85, (0, 1, 2, 3), v.aaaa.ovov, (1, 3, 2, 4), (4, 0)) * -1 - del tmp85 - l1new.aa += einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp87, (4, 2, 0, 3), (1, 4)) - del tmp87 - l1new.aa += einsum(v.aaaa.ooov, (0, 1, 2, 3), tmp88, (1, 4, 0, 2), (3, 4)) * 2 - del tmp88 - l1new.aa += einsum(tmp89, (0, 1, 2, 3), v.aabb.ovoo, (1, 4, 3, 2), (4, 0)) - del tmp89 - l1new.aa += einsum(tmp90, (0, 1), v.aaaa.ovov, (2, 1, 0, 3), (3, 2)) * 2 - del tmp90 - l1new.aa += einsum(tmp45, (0, 1), v.aaaa.ooov, (2, 0, 1, 3), (3, 2)) * 2 - del tmp45 - l1new.aa += einsum(tmp93, (0, 1), l1.aa, (0, 2), (1, 2)) - del tmp93 - l1new.aa += einsum(tmp9, (0, 1), tmp94, (2, 0), (1, 2)) * -1 - del tmp9, tmp94 - - return {f"l1new": l1new, f"l2new": l2new} - -def make_rdm1_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:39:45.577279. - - Parameters - ---------- - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm1 : Namespace of arrays - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - rdm1.aa = Namespace() - rdm1.bb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - tmp4 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp3 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp5 = einsum(t1.bb, (0, 1), l1.bb, (1, 2), (2, 0)) - tmp0 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp2 = einsum(l1.aa, (0, 1), t1.aa, (2, 0), (1, 2)) - tmp1 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (2, 4)) - tmp11 = np.copy(tmp5) * 0.5 - tmp11 += tmp3 * 0.5 - tmp11 += tmp4 - tmp10 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp9 = einsum(t1.bb, (0, 1), l2.abab, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp8 = np.copy(tmp2) - tmp8 += tmp1 * 2 - tmp8 += tmp0 - tmp6 = einsum(l2.aaaa, (0, 1, 2, 3), t1.aa, (4, 1), (2, 3, 4, 0)) - tmp7 = einsum(l2.abab, (0, 1, 2, 3), t1.aa, (4, 0), (2, 4, 3, 1)) - rdm1.bb.vv = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - rdm1.bb.vv += einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - rdm1.bb.vv += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) * 2 - rdm1.aa.vv = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) * 2 - rdm1.aa.vv += einsum(l1.aa, (0, 1), t1.aa, (1, 2), (0, 2)) - rdm1.aa.vv += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - rdm1.bb.vo = np.copy(l1.bb) - rdm1.aa.vo = np.copy(l1.aa) - rdm1.bb.ov = einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) * 2 - rdm1.bb.ov += t1.bb - rdm1.bb.ov += einsum(l1.aa, (0, 1), t2.abab, (1, 2, 0, 3), (2, 3)) - rdm1.bb.ov += einsum(tmp9, (0, 1, 2, 3), t2.abab, (0, 1, 3, 4), (2, 4)) * -1 - del tmp9 - rdm1.bb.ov += einsum(t2.bbbb, (0, 1, 2, 3), tmp10, (1, 0, 4, 3), (4, 2)) * -2 - del tmp10 - rdm1.bb.ov += einsum(t1.bb, (0, 1), tmp11, (0, 2), (2, 1)) * -2 - del tmp11 - rdm1.aa.ov = einsum(l1.bb, (0, 1), t2.abab, (2, 1, 3, 0), (2, 3)) - rdm1.aa.ov += t1.aa - rdm1.aa.ov += einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) * 2 - rdm1.aa.ov += einsum(t2.aaaa, (0, 1, 2, 3), tmp6, (1, 0, 4, 3), (4, 2)) * -2 - del tmp6 - rdm1.aa.ov += einsum(tmp7, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (1, 4)) * -1 - del tmp7 - rdm1.aa.ov += einsum(t1.aa, (0, 1), tmp8, (0, 2), (2, 1)) * -1 - del tmp8 - rdm1.bb.oo = np.copy(np.transpose(tmp3, (1, 0))) * -1 - del tmp3 - rdm1.bb.oo += np.transpose(tmp4, (1, 0)) * -2 - del tmp4 - rdm1.bb.oo += delta.bb.oo - rdm1.bb.oo += np.transpose(tmp5, (1, 0)) * -1 - del tmp5 - rdm1.aa.oo = np.copy(np.transpose(tmp0, (1, 0))) * -1 - del tmp0 - rdm1.aa.oo += delta.aa.oo - del delta - rdm1.aa.oo += np.transpose(tmp1, (1, 0)) * -2 - del tmp1 - rdm1.aa.oo += np.transpose(tmp2, (1, 0)) * -1 - del tmp2 - rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]]) - rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]]) - - return rdm1 - -def make_rdm2_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:40:48.674383. - - Parameters - ---------- - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm2 : Namespace of arrays - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - rdm2.aaaa = Namespace() - rdm2.abab = Namespace() - rdm2.bbbb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - tmp10 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp8 = einsum(t1.bb, (0, 1), l1.bb, (1, 2), (2, 0)) - tmp9 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp18 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp13 = einsum(t1.bb, (0, 1), l2.abab, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp2 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp1 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (2, 4)) - tmp0 = einsum(l1.aa, (0, 1), t1.aa, (2, 0), (1, 2)) - tmp6 = einsum(l2.aaaa, (0, 1, 2, 3), t1.aa, (4, 1), (2, 3, 4, 0)) - tmp26 = einsum(l2.abab, (0, 1, 2, 3), t1.aa, (4, 0), (2, 4, 3, 1)) - tmp95 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 5), (3, 4, 1, 5)) - tmp91 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp68 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp70 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp41 = np.copy(tmp8) - tmp41 += tmp9 - tmp41 += tmp10 * 2 - tmp51 = einsum(t2.bbbb, (0, 1, 2, 3), tmp18, (4, 1, 5, 3), (4, 5, 0, 2)) * -1 - tmp52 = einsum(tmp13, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 2, 4, 5)) - tmp17 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp19 = einsum(t1.bb, (0, 1), tmp18, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp28 = np.copy(tmp0) * 0.5 - tmp28 += tmp1 - tmp28 += tmp2 * 0.5 - tmp14 = einsum(t1.aa, (0, 1), tmp13, (2, 3, 4, 1), (2, 0, 3, 4)) - tmp12 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 5, 0, 1), (2, 4, 3, 5)) - tmp5 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp7 = einsum(tmp6, (0, 1, 2, 3), t1.aa, (4, 3), (0, 1, 4, 2)) - tmp32 = einsum(tmp26, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp31 = einsum(tmp6, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (0, 2, 4, 5)) * -1 - tmp111 = einsum(t1.bb, (0, 1), tmp18, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp124 = np.copy(tmp95) - tmp124 += tmp91 * 4 - tmp80 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - tmp108 = einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp81 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) - tmp64 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - tmp63 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) - tmp105 = einsum(l1.aa, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp93 = einsum(t2.abab, (0, 1, 2, 3), l2.aaaa, (4, 2, 5, 0), (5, 1, 4, 3)) - tmp113 = einsum(t2.bbbb, (0, 1, 2, 3), l2.abab, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp107 = einsum(tmp6, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 3, 4)) - tmp83 = np.copy(tmp68) * 4 - tmp83 += tmp70 - tmp66 = einsum(l2.bbbb, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (4, 2, 5, 0)) - tmp84 = einsum(l2.abab, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 0), (4, 3, 5, 1)) - tmp36 = einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) - tmp35 = einsum(l1.aa, (0, 1), t2.abab, (1, 2, 0, 3), (2, 3)) - tmp50 = einsum(l1.bb, (0, 1), t2.bbbb, (2, 3, 4, 0), (1, 2, 3, 4)) - tmp40 = einsum(t2.bbbb, (0, 1, 2, 3), tmp18, (1, 0, 4, 3), (4, 2)) - tmp42 = einsum(t1.bb, (0, 1), tmp41, (0, 2), (2, 1)) - tmp39 = einsum(tmp13, (0, 1, 2, 3), t2.abab, (0, 1, 3, 4), (2, 4)) - tmp103 = np.copy(tmp52) - tmp103 += tmp51 * 4 - tmp53 = np.copy(np.transpose(tmp17, (1, 0, 3, 2))) - tmp53 += np.transpose(tmp19, (0, 1, 3, 2)) * -1 - tmp86 = einsum(t1.bb, (0, 1), tmp41, (0, 2), (2, 1)) * 0.5 - tmp27 = einsum(tmp26, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (1, 4)) - tmp29 = einsum(tmp28, (0, 1), t1.aa, (0, 2), (1, 2)) * 2 - tmp25 = einsum(t2.aaaa, (0, 1, 2, 3), tmp6, (1, 0, 4, 3), (4, 2)) - tmp45 = einsum(tmp26, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp44 = einsum(tmp6, (0, 1, 2, 3), t2.abab, (1, 4, 3, 5), (0, 2, 4, 5)) * -1 - tmp60 = einsum(tmp13, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 2, 5)) - tmp59 = einsum(tmp18, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 2, 5)) * -1 - tmp46 = np.copy(tmp12) - tmp46 += tmp14 - tmp21 = einsum(l1.bb, (0, 1), t2.abab, (2, 1, 3, 0), (2, 3)) - tmp20 = einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) - tmp33 = np.copy(np.transpose(tmp5, (1, 0, 3, 2))) - tmp33 += np.transpose(tmp7, (0, 1, 3, 2)) * -1 - tmp24 = einsum(t2.aaaa, (0, 1, 2, 3), l1.aa, (3, 4), (4, 0, 1, 2)) - tmp78 = np.copy(tmp31) * 4 - tmp78 += tmp32 - tmp56 = einsum(tmp28, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp4 = np.copy(tmp0) - tmp4 += tmp1 * 2 - tmp4 += tmp2 - tmp131 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 3, 4, 0), (4, 2, 3, 1)) - tmp133 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 5, 0, 1), (4, 5, 2, 3)) - tmp130 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (3, 4), (2, 0, 1, 4)) - tmp132 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 5), (0, 1, 4, 5)) - tmp129 = einsum(l2.aaaa, (0, 1, 2, 3), t1.aa, (3, 4), (2, 0, 1, 4)) - tmp122 = einsum(t2.bbbb, (0, 1, 2, 3), l1.bb, (4, 1), (0, 4, 2, 3)) - tmp127 = einsum(t1.bb, (0, 1), tmp111, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - tmp125 = einsum(t1.bb, (0, 1), tmp124, (0, 2, 3, 4), (2, 1, 3, 4)) - del tmp124 - tmp109 = np.copy(tmp108) - tmp109 += tmp80 - tmp109 += tmp81 * 2 - tmp126 = einsum(tmp18, (0, 1, 2, 3), t2.bbbb, (1, 0, 4, 5), (2, 3, 4, 5)) * -1 - tmp106 = np.copy(tmp105) - tmp106 += tmp63 * 2 - tmp106 += tmp64 - tmp115 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 5, 1), (3, 4, 0, 5)) - tmp128 = np.copy(tmp93) - tmp128 += tmp113 - tmp114 = einsum(t1.bb, (0, 1), tmp13, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp120 = einsum(t2.aaaa, (0, 1, 2, 3), tmp6, (1, 0, 4, 5), (4, 5, 2, 3)) * -1 - tmp117 = np.copy(tmp105) * 0.5 - del tmp105 - tmp117 += tmp63 - tmp117 += tmp64 * 0.5 - tmp116 = einsum(t2.aaaa, (0, 1, 2, 3), l1.aa, (4, 1), (0, 4, 2, 3)) - tmp121 = einsum(tmp107, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 3, 4)) * -1 - tmp119 = einsum(tmp83, (0, 1, 2, 3), t1.aa, (0, 4), (1, 4, 2, 3)) - tmp123 = np.copy(tmp95) - tmp123 += tmp91 * 4 - tmp88 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 5), (2, 4, 1, 5)) - tmp112 = einsum(tmp26, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - tmp85 = np.copy(tmp84) - tmp85 += tmp66 - tmp118 = np.copy(tmp68) - tmp118 += tmp70 * 0.25 - tmp110 = np.copy(tmp108) * 0.5 - del tmp108 - tmp110 += tmp80 * 0.5 - tmp110 += tmp81 - tmp37 = np.copy(t1.bb) - tmp37 += tmp35 - tmp37 += tmp36 * 2 - tmp98 = einsum(t1.bb, (0, 1), tmp50, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp94 = einsum(tmp93, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp49 = np.copy(t1.bb) * 0.5 - tmp49 += tmp35 * 0.5 - tmp49 += tmp36 - tmp43 = np.copy(tmp39) - tmp43 += tmp40 * 2 - tmp43 += tmp42 - del tmp42 - tmp82 = np.copy(tmp80) * 0.5 - tmp82 += tmp81 - tmp104 = einsum(t1.bb, (0, 1), tmp103, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp103 - tmp92 = einsum(tmp91, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 2), (1, 4, 3, 5)) - tmp101 = einsum(t2.bbbb, (0, 1, 2, 3), tmp53, (0, 1, 4, 5), (4, 5, 2, 3)) - tmp100 = einsum(t2.bbbb, (0, 1, 2, 3), tmp41, (1, 4), (0, 4, 2, 3)) * -1 - tmp97 = np.copy(tmp35) - tmp97 += tmp36 * 2 - tmp102 = einsum(t1.bb, (0, 1), tmp53, (0, 2, 3, 4), (2, 4, 3, 1)) - tmp96 = einsum(tmp95, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 2), (1, 4, 3, 5)) - tmp99 = np.copy(tmp80) - del tmp80 - tmp99 += tmp81 * 2 - del tmp81 - tmp87 = np.copy(tmp39) * 0.5 - del tmp39 - tmp87 += tmp40 - del tmp40 - tmp87 += tmp86 - del tmp86 - tmp38 = einsum(l1.aa, (0, 1), t2.abab, (2, 3, 0, 4), (1, 2, 3, 4)) - tmp30 = np.copy(tmp25) * 2 - tmp30 += tmp27 - tmp30 += tmp29 - del tmp29 - tmp48 = einsum(t2.abab, (0, 1, 2, 3), tmp13, (4, 1, 5, 2), (4, 0, 5, 3)) - tmp58 = einsum(l1.bb, (0, 1), t2.abab, (2, 3, 4, 0), (2, 1, 3, 4)) - tmp89 = np.copy(tmp44) - tmp89 += tmp45 - tmp90 = np.copy(tmp60) - tmp90 += tmp59 - tmp65 = np.copy(tmp63) * 2 - tmp65 += tmp64 - tmp47 = einsum(t1.bb, (0, 1), tmp46, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp72 = np.copy(tmp20) * 2 - tmp72 += tmp21 - tmp61 = einsum(tmp26, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (1, 2, 4, 5)) - tmp77 = einsum(tmp33, (0, 1, 2, 3), t1.aa, (0, 4), (1, 3, 2, 4)) - tmp76 = einsum(tmp33, (0, 1, 2, 3), t2.aaaa, (0, 1, 4, 5), (2, 3, 4, 5)) - tmp73 = einsum(t1.aa, (0, 1), tmp24, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp79 = einsum(tmp78, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - del tmp78 - tmp23 = np.copy(t1.aa) - tmp23 += tmp20 * 2 - tmp23 += tmp21 - tmp67 = einsum(tmp66, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp55 = np.copy(t1.aa) - tmp55 += tmp20 * 2 - tmp55 += tmp21 - tmp71 = einsum(t2.aaaa, (0, 1, 2, 3), tmp70, (1, 4, 3, 5), (0, 4, 2, 5)) - tmp74 = np.copy(tmp63) - del tmp63 - tmp74 += tmp64 * 0.5 - del tmp64 - tmp57 = np.copy(tmp25) - del tmp25 - tmp57 += tmp27 * 0.5 - del tmp27 - tmp57 += tmp56 - del tmp56 - tmp75 = einsum(t2.aaaa, (0, 1, 2, 3), tmp4, (1, 4), (4, 0, 2, 3)) * -1 - tmp69 = einsum(t2.aaaa, (0, 1, 2, 3), tmp68, (1, 4, 3, 5), (0, 4, 2, 5)) - tmp54 = einsum(t1.bb, (0, 1), tmp53, (0, 2, 3, 4), (2, 3, 4, 1)) * 2 - del tmp53 - tmp62 = np.copy(t1.bb) - tmp62 += tmp35 - del tmp35 - tmp62 += tmp36 * 2 - del tmp36 - tmp16 = np.copy(tmp8) * 0.5 - tmp16 += tmp9 * 0.5 - tmp16 += tmp10 - tmp34 = einsum(tmp33, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 3, 4)) * 2 - del tmp33 - tmp22 = np.copy(t1.aa) * 0.5 - tmp22 += tmp20 - del tmp20 - tmp22 += tmp21 * 0.5 - del tmp21 - tmp15 = np.copy(delta.bb.oo) * -1 - tmp15 += tmp8 - tmp15 += tmp9 - tmp15 += tmp10 * 2 - tmp11 = np.copy(delta.bb.oo) * -0.5 - tmp11 += tmp8 * 0.5 - del tmp8 - tmp11 += tmp9 * 0.5 - del tmp9 - tmp11 += tmp10 - del tmp10 - tmp3 = np.copy(delta.aa.oo) * -1 - tmp3 += tmp0 - del tmp0 - tmp3 += tmp1 * 2 - del tmp1 - tmp3 += tmp2 - del tmp2 - rdm2.bbbb.vvvv = np.copy(np.transpose(tmp133, (1, 0, 3, 2))) * 2 - del tmp133 - rdm2.bbbb.vvvv += einsum(tmp131, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) * 2 - rdm2.abab.vvvv = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 5), (0, 1, 4, 5)) - rdm2.abab.vvvv += einsum(t1.aa, (0, 1), tmp130, (0, 2, 3, 4), (2, 3, 1, 4)) - rdm2.aaaa.vvvv = np.copy(np.transpose(tmp132, (1, 0, 3, 2))) * 2 - del tmp132 - rdm2.aaaa.vvvv += einsum(tmp129, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * 2 - rdm2.bbbb.vvvo = np.copy(np.transpose(tmp131, (2, 1, 3, 0))) * 2 - rdm2.abab.vvvo = einsum(t1.aa, (0, 1), l2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) - rdm2.aaaa.vvvo = np.copy(np.transpose(tmp129, (2, 1, 3, 0))) * 2 - rdm2.bbbb.vvov = np.copy(np.transpose(tmp131, (2, 1, 0, 3))) * -2 - del tmp131 - rdm2.abab.vvov = np.copy(np.transpose(tmp130, (1, 2, 0, 3))) - del tmp130 - rdm2.aaaa.vvov = np.copy(np.transpose(tmp129, (2, 1, 0, 3))) * -2 - del tmp129 - rdm2.bbbb.vovv = np.copy(np.transpose(tmp122, (1, 0, 3, 2))) * 2 - rdm2.bbbb.vovv += einsum(t1.bb, (0, 1), tmp109, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.vovv += einsum(tmp109, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.vovv += np.transpose(tmp125, (2, 0, 1, 3)) - rdm2.bbbb.vovv += np.transpose(tmp125, (2, 0, 3, 1)) * -1 - rdm2.bbbb.vovv += np.transpose(tmp126, (1, 0, 3, 2)) * 2 - rdm2.bbbb.vovv += np.transpose(tmp127, (1, 0, 3, 2)) * 2 - rdm2.abab.vovv = einsum(l1.aa, (0, 1), t2.abab, (1, 2, 3, 4), (0, 2, 3, 4)) - rdm2.abab.vovv += einsum(tmp106, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.vovv += einsum(t1.aa, (0, 1), tmp128, (0, 2, 3, 4), (3, 2, 1, 4)) * 2 - del tmp128 - rdm2.abab.vovv += einsum(t1.bb, (0, 1), tmp115, (0, 2, 3, 4), (3, 2, 4, 1)) * -1 - rdm2.abab.vovv += einsum(t2.abab, (0, 1, 2, 3), tmp13, (0, 1, 4, 5), (5, 4, 2, 3)) * -1 - rdm2.abab.vovv += einsum(t1.aa, (0, 1), tmp114, (0, 2, 3, 4), (3, 2, 1, 4)) * -1 - rdm2.aaaa.vovv = np.copy(np.transpose(tmp116, (1, 0, 3, 2))) * 2 - rdm2.aaaa.vovv += einsum(t1.aa, (0, 1), tmp117, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.aaaa.vovv += einsum(tmp106, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.vovv += np.transpose(tmp119, (2, 0, 1, 3)) - rdm2.aaaa.vovv += np.transpose(tmp119, (2, 0, 3, 1)) * -1 - rdm2.aaaa.vovv += np.transpose(tmp120, (1, 0, 3, 2)) * 2 - rdm2.aaaa.vovv += np.transpose(tmp121, (1, 0, 3, 2)) * 2 - rdm2.bbbb.ovvv = np.copy(np.transpose(tmp122, (0, 1, 3, 2))) * -2 - del tmp122 - rdm2.bbbb.ovvv += einsum(t1.bb, (0, 1), tmp109, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.ovvv += einsum(tmp109, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.ovvv += einsum(tmp123, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) * -1 - del tmp123 - rdm2.bbbb.ovvv += np.transpose(tmp125, (0, 2, 3, 1)) - del tmp125 - rdm2.bbbb.ovvv += np.transpose(tmp126, (0, 1, 3, 2)) * -2 - del tmp126 - rdm2.bbbb.ovvv += np.transpose(tmp127, (0, 1, 3, 2)) * -2 - del tmp127 - rdm2.abab.ovvv = einsum(l1.bb, (0, 1), t2.abab, (2, 1, 3, 4), (2, 0, 3, 4)) - rdm2.abab.ovvv += einsum(t1.aa, (0, 1), tmp109, (2, 3), (0, 2, 1, 3)) - rdm2.abab.ovvv += einsum(t1.aa, (0, 1), tmp88, (0, 2, 3, 4), (2, 3, 1, 4)) * -1 - rdm2.abab.ovvv += einsum(t1.bb, (0, 1), tmp85, (2, 0, 3, 4), (2, 4, 3, 1)) * 2 - rdm2.abab.ovvv += einsum(tmp26, (0, 1, 2, 3), t2.abab, (0, 2, 4, 5), (1, 3, 4, 5)) * -1 - rdm2.abab.ovvv += einsum(tmp112, (0, 1, 2, 3), t1.bb, (1, 4), (0, 3, 2, 4)) * -1 - rdm2.aaaa.ovvv = np.copy(np.transpose(tmp116, (0, 1, 3, 2))) * -2 - del tmp116 - rdm2.aaaa.ovvv += einsum(t1.aa, (0, 1), tmp117, (2, 3), (0, 2, 1, 3)) * 2 - del tmp117 - rdm2.aaaa.ovvv += einsum(tmp106, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.ovvv += einsum(t1.aa, (0, 1), tmp118, (0, 2, 3, 4), (2, 3, 1, 4)) * -4 - del tmp118 - rdm2.aaaa.ovvv += np.transpose(tmp119, (0, 2, 3, 1)) - del tmp119 - rdm2.aaaa.ovvv += np.transpose(tmp120, (0, 1, 3, 2)) * -2 - del tmp120 - rdm2.aaaa.ovvv += np.transpose(tmp121, (0, 1, 3, 2)) * -2 - del tmp121 - rdm2.bbbb.vvoo = np.copy(l2.bbbb) * 2 - rdm2.abab.vvoo = np.copy(l2.abab) - rdm2.aaaa.vvoo = np.copy(l2.aaaa) * 2 - rdm2.bbbb.vovo = einsum(tmp109, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.vovo += np.transpose(tmp91, (2, 1, 3, 0)) * -4 - rdm2.bbbb.vovo += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.vovo += np.transpose(tmp95, (2, 1, 3, 0)) * -1 - rdm2.bbbb.vovo += np.transpose(tmp111, (2, 1, 3, 0)) * 2 - rdm2.abab.vovo = einsum(tmp106, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2.abab.vovo += np.transpose(tmp115, (2, 1, 3, 0)) * -1 - del tmp115 - rdm2.abab.vovo += einsum(t1.aa, (0, 1), tmp13, (0, 2, 3, 4), (4, 3, 1, 2)) * -1 - rdm2.aaaa.vovo = einsum(tmp106, (0, 1), delta.aa.oo, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.vovo += np.transpose(tmp70, (2, 1, 3, 0)) * -1 - rdm2.aaaa.vovo += einsum(t1.aa, (0, 1), l1.aa, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.vovo += np.transpose(tmp68, (2, 1, 3, 0)) * -4 - rdm2.aaaa.vovo += np.transpose(tmp107, (2, 1, 3, 0)) * 2 - rdm2.bbbb.voov = einsum(tmp110, (0, 1), delta.bb.oo, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.bbbb.voov += np.transpose(tmp91, (2, 1, 0, 3)) * 4 - rdm2.bbbb.voov += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.voov += np.transpose(tmp95, (2, 1, 0, 3)) - rdm2.bbbb.voov += np.transpose(tmp111, (2, 1, 0, 3)) * -2 - rdm2.abab.voov = einsum(l1.aa, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.voov += np.transpose(tmp113, (2, 1, 0, 3)) * 2 - del tmp113 - rdm2.abab.voov += np.transpose(tmp93, (2, 1, 0, 3)) * 2 - del tmp93 - rdm2.abab.voov += np.transpose(tmp114, (2, 1, 0, 3)) * -1 - del tmp114 - rdm2.aaaa.voov = einsum(tmp106, (0, 1), delta.aa.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.voov += np.transpose(tmp70, (2, 1, 0, 3)) - rdm2.aaaa.voov += einsum(t1.aa, (0, 1), l1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.voov += np.transpose(tmp68, (2, 1, 0, 3)) * 4 - rdm2.aaaa.voov += np.transpose(tmp107, (2, 1, 0, 3)) * -2 - rdm2.bbbb.ovvo = einsum(tmp109, (0, 1), delta.bb.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.ovvo += np.transpose(tmp91, (1, 2, 3, 0)) * 4 - rdm2.bbbb.ovvo += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.ovvo += np.transpose(tmp95, (1, 2, 3, 0)) - rdm2.bbbb.ovvo += np.transpose(tmp111, (1, 2, 3, 0)) * -2 - rdm2.abab.ovvo = np.copy(np.transpose(tmp66, (0, 3, 2, 1))) * 2 - del tmp66 - rdm2.abab.ovvo += einsum(l1.bb, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.abab.ovvo += np.transpose(tmp84, (0, 3, 2, 1)) * 2 - del tmp84 - rdm2.abab.ovvo += np.transpose(tmp112, (0, 3, 2, 1)) * -1 - del tmp112 - rdm2.aaaa.ovvo = einsum(tmp106, (0, 1), delta.aa.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.ovvo += np.transpose(tmp70, (1, 2, 3, 0)) - rdm2.aaaa.ovvo += einsum(t1.aa, (0, 1), l1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.ovvo += np.transpose(tmp68, (1, 2, 3, 0)) * 4 - rdm2.aaaa.ovvo += np.transpose(tmp107, (1, 2, 3, 0)) * -2 - rdm2.bbbb.ovov = einsum(tmp110, (0, 1), delta.bb.oo, (2, 3), (2, 0, 3, 1)) * 2 - del tmp110 - rdm2.bbbb.ovov += np.transpose(tmp91, (1, 2, 0, 3)) * -4 - del tmp91 - rdm2.bbbb.ovov += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.ovov += np.transpose(tmp95, (1, 2, 0, 3)) * -1 - del tmp95 - rdm2.bbbb.ovov += np.transpose(tmp111, (1, 2, 0, 3)) * 2 - del tmp111 - rdm2.abab.ovov = einsum(tmp109, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) - del tmp109 - rdm2.abab.ovov += np.transpose(tmp88, (1, 2, 0, 3)) * -1 - rdm2.abab.ovov += einsum(tmp26, (0, 1, 2, 3), t1.bb, (2, 4), (1, 3, 0, 4)) * -1 - rdm2.aaaa.ovov = einsum(tmp106, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) - del tmp106 - rdm2.aaaa.ovov += np.transpose(tmp70, (1, 2, 0, 3)) * -1 - del tmp70 - rdm2.aaaa.ovov += einsum(t1.aa, (0, 1), l1.aa, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.ovov += np.transpose(tmp68, (1, 2, 0, 3)) * -4 - del tmp68 - rdm2.aaaa.ovov += np.transpose(tmp107, (1, 2, 0, 3)) * 2 - del tmp107 - rdm2.bbbb.oovv = np.copy(t2.bbbb) * 2 - rdm2.bbbb.oovv += einsum(tmp82, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 4, 1)) * -4 - rdm2.bbbb.oovv += np.transpose(tmp92, (0, 1, 3, 2)) * -8 - rdm2.bbbb.oovv += np.transpose(tmp94, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp96, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp96, (1, 0, 2, 3)) * -2 - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp49, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.bbbb.oovv += tmp92 * 8 - del tmp92 - rdm2.bbbb.oovv += np.transpose(tmp94, (1, 0, 3, 2)) * 2 - del tmp94 - rdm2.bbbb.oovv += tmp96 * 2 - rdm2.bbbb.oovv += np.transpose(tmp96, (1, 0, 3, 2)) * 2 - del tmp96 - rdm2.bbbb.oovv += einsum(tmp37, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.oovv += einsum(tmp97, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp97, (2, 3), (0, 2, 3, 1)) * -1 - del tmp97 - rdm2.bbbb.oovv += tmp98 * 2 - rdm2.bbbb.oovv += einsum(tmp99, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 1, 4)) * 2 - del tmp99 - rdm2.bbbb.oovv += np.transpose(tmp98, (0, 1, 3, 2)) * -2 - del tmp98 - rdm2.bbbb.oovv += np.transpose(tmp100, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += einsum(tmp87, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) * -2 - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp43, (2, 3), (0, 2, 3, 1)) - rdm2.bbbb.oovv += np.transpose(tmp100, (1, 0, 3, 2)) * 2 - del tmp100 - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp87, (2, 3), (2, 0, 1, 3)) * 2 - rdm2.bbbb.oovv += einsum(tmp43, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.bbbb.oovv += np.transpose(tmp101, (1, 0, 3, 2)) * 2 - del tmp101 - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp102, (0, 2, 3, 4), (2, 3, 1, 4)) * 2 - del tmp102 - rdm2.bbbb.oovv += np.transpose(tmp104, (1, 0, 2, 3)) - rdm2.bbbb.oovv += tmp104 * -1 - rdm2.bbbb.oovv += np.transpose(tmp104, (1, 0, 3, 2)) * -1 - rdm2.bbbb.oovv += np.transpose(tmp104, (0, 1, 3, 2)) - del tmp104 - rdm2.abab.oovv = np.copy(t2.abab) - rdm2.abab.oovv += einsum(tmp82, (0, 1), t2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -2 - del tmp82 - rdm2.abab.oovv += einsum(tmp83, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp83 - rdm2.abab.oovv += einsum(t2.bbbb, (0, 1, 2, 3), tmp85, (4, 1, 5, 3), (4, 0, 5, 2)) * 4 - del tmp85 - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp37, (2, 3), (0, 2, 1, 3)) - rdm2.abab.oovv += einsum(tmp72, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp38, (0, 2, 3, 4), (2, 3, 1, 4)) * -1 - rdm2.abab.oovv += einsum(tmp65, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1 - rdm2.abab.oovv += einsum(t1.bb, (0, 1), tmp58, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - rdm2.abab.oovv += einsum(tmp41, (0, 1), t2.abab, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp87, (2, 3), (0, 2, 1, 3)) * -2 - del tmp87 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp4, (0, 4), (4, 1, 2, 3)) * -1 - rdm2.abab.oovv += einsum(tmp46, (0, 1, 2, 3), t2.abab, (0, 2, 4, 5), (1, 3, 4, 5)) - rdm2.abab.oovv += einsum(tmp47, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp88, (0, 4, 3, 5), (4, 1, 2, 5)) - del tmp88 - rdm2.abab.oovv += einsum(t1.bb, (0, 1), tmp30, (2, 3), (2, 0, 3, 1)) * -1 - rdm2.abab.oovv += einsum(tmp48, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - rdm2.abab.oovv += einsum(tmp89, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -2 - del tmp89 - rdm2.abab.oovv += einsum(t1.bb, (0, 1), tmp90, (2, 0, 3, 4), (2, 3, 4, 1)) * -2 - del tmp90 - rdm2.abab.oovv += einsum(t1.bb, (0, 1), tmp61, (2, 0, 3, 4), (2, 3, 4, 1)) - rdm2.aaaa.oovv = np.copy(t2.aaaa) * 2 - rdm2.aaaa.oovv += einsum(tmp65, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 4, 1)) * -2 - del tmp65 - rdm2.aaaa.oovv += np.transpose(tmp67, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp69, (0, 1, 3, 2)) * -8 - rdm2.aaaa.oovv += np.transpose(tmp71, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp71, (1, 0, 2, 3)) * -2 - rdm2.aaaa.oovv += einsum(tmp55, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.oovv += tmp67 * 2 - del tmp67 - rdm2.aaaa.oovv += tmp69 * 8 - del tmp69 - rdm2.aaaa.oovv += tmp71 * 2 - rdm2.aaaa.oovv += np.transpose(tmp71, (1, 0, 3, 2)) * 2 - del tmp71 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp23, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.oovv += einsum(tmp72, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.oovv += einsum(tmp72, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * -1 - del tmp72 - rdm2.aaaa.oovv += tmp73 * 2 - rdm2.aaaa.oovv += einsum(t2.aaaa, (0, 1, 2, 3), tmp74, (3, 4), (0, 1, 4, 2)) * 4 - del tmp74 - rdm2.aaaa.oovv += np.transpose(tmp73, (0, 1, 3, 2)) * -2 - del tmp73 - rdm2.aaaa.oovv += np.transpose(tmp75, (1, 0, 3, 2)) * -2 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp30, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.aaaa.oovv += einsum(tmp57, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * 2 - rdm2.aaaa.oovv += np.transpose(tmp75, (0, 1, 3, 2)) * 2 - del tmp75 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp30, (2, 3), (2, 0, 1, 3)) - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp57, (2, 3), (2, 0, 3, 1)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp76, (1, 0, 3, 2)) * 2 - del tmp76 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp77, (0, 2, 3, 4), (2, 3, 1, 4)) * 2 - del tmp77 - rdm2.aaaa.oovv += np.transpose(tmp79, (1, 0, 2, 3)) - rdm2.aaaa.oovv += tmp79 * -1 - rdm2.aaaa.oovv += np.transpose(tmp79, (1, 0, 3, 2)) * -1 - rdm2.aaaa.oovv += np.transpose(tmp79, (0, 1, 3, 2)) - del tmp79 - rdm2.bbbb.vooo = einsum(delta.bb.oo, (0, 1), l1.bb, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.vooo += einsum(l1.bb, (0, 1), delta.bb.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.vooo += np.transpose(tmp18, (3, 2, 1, 0)) * 2 - rdm2.abab.vooo = einsum(l1.aa, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2.abab.vooo += np.transpose(tmp13, (3, 2, 0, 1)) * -1 - del tmp13 - rdm2.aaaa.vooo = einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.vooo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.vooo += np.transpose(tmp6, (3, 2, 1, 0)) * 2 - rdm2.bbbb.ovoo = einsum(delta.bb.oo, (0, 1), l1.bb, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.ovoo += einsum(l1.bb, (0, 1), delta.bb.oo, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.ovoo += np.transpose(tmp18, (2, 3, 1, 0)) * -2 - del tmp18 - rdm2.abab.ovoo = einsum(l1.bb, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) - rdm2.abab.ovoo += np.transpose(tmp26, (1, 3, 0, 2)) * -1 - del tmp26 - rdm2.aaaa.ovoo = einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.ovoo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.ovoo += np.transpose(tmp6, (2, 3, 1, 0)) * -2 - del tmp6 - rdm2.bbbb.oovo = einsum(delta.bb.oo, (0, 1), tmp62, (2, 3), (2, 0, 3, 1)) - del tmp62 - rdm2.bbbb.oovo += einsum(delta.bb.oo, (0, 1), tmp37, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.oovo += np.transpose(tmp50, (2, 1, 3, 0)) * 2 - rdm2.bbbb.oovo += einsum(tmp43, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.bbbb.oovo += einsum(delta.bb.oo, (0, 1), tmp43, (2, 3), (0, 2, 3, 1)) - rdm2.bbbb.oovo += np.transpose(tmp51, (1, 2, 3, 0)) * 4 - rdm2.bbbb.oovo += np.transpose(tmp52, (1, 2, 3, 0)) - rdm2.bbbb.oovo += einsum(t1.bb, (0, 1), tmp16, (2, 3), (3, 0, 1, 2)) * 2 - rdm2.bbbb.oovo += np.transpose(tmp51, (2, 1, 3, 0)) * -4 - rdm2.bbbb.oovo += np.transpose(tmp52, (2, 1, 3, 0)) * -1 - rdm2.bbbb.oovo += einsum(tmp16, (0, 1), t1.bb, (2, 3), (2, 1, 3, 0)) * -2 - rdm2.bbbb.oovo += np.transpose(tmp54, (2, 1, 3, 0)) * -1 - rdm2.abab.oovo = einsum(tmp55, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2.abab.oovo += np.transpose(tmp58, (0, 2, 3, 1)) * -1 - del tmp58 - rdm2.abab.oovo += einsum(tmp30, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.abab.oovo += np.transpose(tmp59, (0, 2, 3, 1)) * -2 - del tmp59 - rdm2.abab.oovo += np.transpose(tmp60, (0, 2, 3, 1)) * -2 - del tmp60 - rdm2.abab.oovo += einsum(t1.aa, (0, 1), tmp16, (2, 3), (0, 3, 1, 2)) * -2 - rdm2.abab.oovo += einsum(t1.aa, (0, 1), tmp46, (0, 2, 3, 4), (2, 4, 1, 3)) - del tmp46 - rdm2.abab.oovo += np.transpose(tmp61, (0, 2, 3, 1)) - del tmp61 - rdm2.aaaa.oovo = einsum(tmp55, (0, 1), delta.aa.oo, (2, 3), (0, 2, 1, 3)) - del tmp55 - rdm2.aaaa.oovo += einsum(tmp23, (0, 1), delta.aa.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.oovo += np.transpose(tmp24, (2, 1, 3, 0)) * 2 - rdm2.aaaa.oovo += einsum(tmp30, (0, 1), delta.aa.oo, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.aaaa.oovo += einsum(tmp57, (0, 1), delta.aa.oo, (2, 3), (2, 0, 1, 3)) * 2 - del tmp57 - rdm2.aaaa.oovo += np.transpose(tmp31, (1, 2, 3, 0)) * 4 - rdm2.aaaa.oovo += np.transpose(tmp32, (1, 2, 3, 0)) - rdm2.aaaa.oovo += einsum(t1.aa, (0, 1), tmp28, (2, 3), (3, 0, 1, 2)) * 2 - rdm2.aaaa.oovo += np.transpose(tmp31, (2, 1, 3, 0)) * -4 - rdm2.aaaa.oovo += np.transpose(tmp32, (2, 1, 3, 0)) * -1 - rdm2.aaaa.oovo += einsum(t1.aa, (0, 1), tmp28, (2, 3), (0, 3, 1, 2)) * -2 - del tmp28 - rdm2.aaaa.oovo += np.transpose(tmp34, (2, 1, 3, 0)) * -1 - rdm2.bbbb.ooov = einsum(tmp49, (0, 1), delta.bb.oo, (2, 3), (0, 2, 3, 1)) * -2 - del tmp49 - rdm2.bbbb.ooov += einsum(delta.bb.oo, (0, 1), tmp37, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.ooov += np.transpose(tmp50, (2, 1, 0, 3)) * -2 - del tmp50 - rdm2.bbbb.ooov += einsum(tmp43, (0, 1), delta.bb.oo, (2, 3), (0, 2, 3, 1)) - rdm2.bbbb.ooov += einsum(delta.bb.oo, (0, 1), tmp43, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.bbbb.ooov += np.transpose(tmp51, (1, 2, 0, 3)) * -4 - rdm2.bbbb.ooov += np.transpose(tmp52, (1, 2, 0, 3)) * -1 - rdm2.bbbb.ooov += einsum(t1.bb, (0, 1), tmp41, (2, 3), (3, 0, 2, 1)) * -1 - rdm2.bbbb.ooov += np.transpose(tmp51, (2, 1, 0, 3)) * 4 - del tmp51 - rdm2.bbbb.ooov += np.transpose(tmp52, (2, 1, 0, 3)) - del tmp52 - rdm2.bbbb.ooov += einsum(t1.bb, (0, 1), tmp41, (2, 3), (0, 3, 2, 1)) - del tmp41 - rdm2.bbbb.ooov += np.transpose(tmp54, (2, 1, 0, 3)) - del tmp54 - rdm2.abab.ooov = einsum(tmp37, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) - del tmp37 - rdm2.abab.ooov += np.transpose(tmp38, (1, 2, 0, 3)) * -1 - del tmp38 - rdm2.abab.ooov += einsum(tmp43, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) * -1 - del tmp43 - rdm2.abab.ooov += np.transpose(tmp44, (1, 2, 0, 3)) * -2 - del tmp44 - rdm2.abab.ooov += np.transpose(tmp45, (1, 2, 0, 3)) * -2 - del tmp45 - rdm2.abab.ooov += einsum(tmp4, (0, 1), t1.bb, (2, 3), (1, 2, 0, 3)) * -1 - rdm2.abab.ooov += np.transpose(tmp47, (1, 2, 0, 3)) - del tmp47 - rdm2.abab.ooov += np.transpose(tmp48, (1, 2, 0, 3)) - del tmp48 - rdm2.aaaa.ooov = einsum(delta.aa.oo, (0, 1), tmp22, (2, 3), (2, 0, 1, 3)) * -2 - del tmp22 - rdm2.aaaa.ooov += einsum(tmp23, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) - del tmp23 - rdm2.aaaa.ooov += np.transpose(tmp24, (2, 1, 0, 3)) * -2 - del tmp24 - rdm2.aaaa.ooov += einsum(tmp30, (0, 1), delta.aa.oo, (2, 3), (0, 2, 3, 1)) - rdm2.aaaa.ooov += einsum(delta.aa.oo, (0, 1), tmp30, (2, 3), (0, 2, 1, 3)) * -1 - del tmp30 - rdm2.aaaa.ooov += np.transpose(tmp31, (1, 2, 0, 3)) * -4 - rdm2.aaaa.ooov += np.transpose(tmp32, (1, 2, 0, 3)) * -1 - rdm2.aaaa.ooov += einsum(t1.aa, (0, 1), tmp4, (2, 3), (3, 0, 2, 1)) * -1 - rdm2.aaaa.ooov += np.transpose(tmp31, (2, 1, 0, 3)) * 4 - del tmp31 - rdm2.aaaa.ooov += np.transpose(tmp32, (2, 1, 0, 3)) - del tmp32 - rdm2.aaaa.ooov += einsum(tmp4, (0, 1), t1.aa, (2, 3), (2, 1, 0, 3)) - rdm2.aaaa.ooov += np.transpose(tmp34, (2, 1, 0, 3)) - del tmp34 - rdm2.bbbb.oooo = einsum(tmp15, (0, 1), delta.bb.oo, (2, 3), (2, 1, 3, 0)) * -1 - rdm2.bbbb.oooo += einsum(tmp15, (0, 1), delta.bb.oo, (2, 3), (1, 2, 3, 0)) - del tmp15 - rdm2.bbbb.oooo += einsum(tmp16, (0, 1), delta.bb.oo, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.bbbb.oooo += einsum(tmp16, (0, 1), delta.bb.oo, (2, 3), (2, 1, 0, 3)) * 2 - del tmp16 - rdm2.bbbb.oooo += np.transpose(tmp17, (3, 2, 1, 0)) * 2 - del tmp17 - rdm2.bbbb.oooo += np.transpose(tmp19, (2, 3, 1, 0)) * -2 - del tmp19 - rdm2.abab.oooo = einsum(tmp11, (0, 1), delta.aa.oo, (2, 3), (2, 1, 3, 0)) * -2 - del tmp11 - rdm2.abab.oooo += einsum(tmp4, (0, 1), delta.bb.oo, (2, 3), (1, 2, 0, 3)) * -1 - rdm2.abab.oooo += np.transpose(tmp12, (1, 3, 0, 2)) - del tmp12 - rdm2.abab.oooo += np.transpose(tmp14, (1, 3, 0, 2)) - del tmp14 - rdm2.aaaa.oooo = einsum(delta.aa.oo, (0, 1), tmp3, (2, 3), (0, 3, 1, 2)) * -1 - rdm2.aaaa.oooo += einsum(delta.aa.oo, (0, 1), tmp3, (2, 3), (3, 0, 1, 2)) - del tmp3 - rdm2.aaaa.oooo += einsum(delta.aa.oo, (0, 1), tmp4, (2, 3), (3, 0, 2, 1)) * -1 - rdm2.aaaa.oooo += einsum(tmp4, (0, 1), delta.aa.oo, (2, 3), (2, 1, 0, 3)) - del tmp4, delta - rdm2.aaaa.oooo += np.transpose(tmp5, (3, 2, 1, 0)) * 2 - del tmp5 - rdm2.aaaa.oooo += np.transpose(tmp7, (2, 3, 1, 0)) * -2 - del tmp7 - rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv) - rdm2.abab = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv) - rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv) - rdm2 = Namespace( - aaaa=np.transpose(rdm2.aaaa, (0, 2, 1, 3)), - aabb=np.transpose(rdm2.abab, (0, 2, 1, 3)), - bbbb=np.transpose(rdm2.bbbb, (0, 2, 1, 3)), - ) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:44:26.195611. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp100 : array - tmp101 : array - tmp102 : array - tmp104 : array - tmp106 : array - tmp108 : array - tmp11 : array - tmp110 : array - tmp112 : array - tmp114 : array - tmp116 : array - tmp118 : array - tmp12 : array - tmp120 : array - tmp122 : array - tmp124 : array - tmp125 : array - tmp126 : array - tmp127 : array - tmp128 : array - tmp129 : array - tmp13 : array - tmp130 : array - tmp131 : array - tmp132 : array - tmp139 : array - tmp145 : array - tmp147 : array - tmp149 : array - tmp15 : array - tmp152 : array - tmp155 : array - tmp156 : array - tmp158 : array - tmp16 : array - tmp162 : array - tmp163 : array - tmp164 : array - tmp166 : array - tmp168 : array - tmp170 : array - tmp171 : array - tmp172 : array - tmp174 : array - tmp18 : array - tmp185 : array - tmp186 : array - tmp187 : array - tmp189 : array - tmp190 : array - tmp192 : array - tmp194 : array - tmp197 : array - tmp199 : array - tmp20 : array - tmp200 : array - tmp201 : array - tmp209 : array - tmp214 : array - tmp217 : array - tmp22 : array - tmp222 : array - tmp223 : array - tmp224 : array - tmp229 : array - tmp230 : array - tmp232 : array - tmp233 : array - tmp237 : array - tmp238 : array - tmp239 : array - tmp24 : array - tmp241 : array - tmp243 : array - tmp244 : array - tmp248 : array - tmp249 : array - tmp25 : array - tmp255 : array - tmp256 : array - tmp257 : array - tmp258 : array - tmp259 : array - tmp26 : array - tmp262 : array - tmp264 : array - tmp265 : array - tmp267 : array - tmp269 : array - tmp270 : array - tmp271 : array - tmp273 : array - tmp275 : array - tmp277 : array - tmp279 : array - tmp28 : array - tmp281 : array - tmp283 : array - tmp284 : array - tmp285 : array - tmp286 : array - tmp287 : array - tmp288 : array - tmp289 : array - tmp290 : array - tmp292 : array - tmp297 : array - tmp298 : array - tmp299 : array - tmp300 : array - tmp302 : array - tmp304 : array - tmp307 : array - tmp308 : array - tmp309 : array - tmp31 : array - tmp310 : array - tmp311 : array - tmp312 : array - tmp316 : array - tmp317 : array - tmp318 : array - tmp319 : array - tmp32 : array - tmp321 : array - tmp322 : array - tmp323 : array - tmp324 : array - tmp325 : array - tmp326 : array - tmp328 : array - tmp329 : array - tmp33 : array - tmp333 : array - tmp334 : array - tmp335 : array - tmp337 : array - tmp339 : array - tmp340 : array - tmp344 : array - tmp345 : array - tmp346 : array - tmp347 : array - tmp348 : array - tmp349 : array - tmp354 : array - tmp355 : array - tmp356 : array - tmp367 : array - tmp369 : array - tmp37 : array - tmp371 : array - tmp373 : array - tmp375 : array - tmp377 : array - tmp383 : array - tmp39 : array - tmp394 : array - tmp396 : array - tmp398 : array - tmp4 : array - tmp41 : array - tmp414 : array - tmp418 : array - tmp420 : array - tmp422 : array - tmp427 : array - tmp429 : array - tmp43 : array - tmp433 : array - tmp435 : array - tmp437 : array - tmp439 : array - tmp441 : array - tmp45 : array - tmp46 : array - tmp47 : array - tmp49 : array - tmp5 : array - tmp53 : array - tmp55 : array - tmp57 : array - tmp59 : array - tmp6 : array - tmp61 : array - tmp63 : array - tmp65 : array - tmp66 : array - tmp67 : array - tmp68 : array - tmp69 : array - tmp7 : array - tmp70 : array - tmp72 : array - tmp74 : array - tmp76 : array - tmp78 : array - tmp80 : array - tmp83 : array - tmp86 : array - tmp87 : array - tmp89 : array - tmp9 : array - """ - - tmp37 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp15 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp12 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp11 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 1), (0, 3)) - tmp39 = einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp13 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp9 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 0, 1), (2, 3)) - tmp7 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 1, 0, 3), (2, 3)) - tmp16 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp429 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp375 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp369 = einsum(t1.bb, (0, 1), tmp37, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp318 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp47 = einsum(tmp15, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp46 = einsum(tmp12, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp45 = einsum(t1.bb, (0, 1), tmp11, (2, 1), (0, 2)) - tmp233 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp43 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp41 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp28 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp244 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp18 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp230 = einsum(tmp39, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp319 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - tmp257 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp256 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 3), (1, 2)) - tmp255 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 1), (2, 3)) - tmp33 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp32 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 3, 0, 1), (2, 3)) - tmp31 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 0, 3, 1), (2, 3)) - tmp192 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp189 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 2, 0, 1)) - tmp26 = einsum(t1.aa, (0, 1), tmp13, (2, 1), (0, 2)) - tmp25 = einsum(tmp9, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp24 = einsum(tmp7, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp158 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp22 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 3), (4, 0)) - tmp20 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 1, 3), (4, 0)) - tmp1 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp6 = einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 1), (2, 3)) - tmp5 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - tmp4 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 0, 3, 1), (2, 3)) - tmp78 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp72 = einsum(t1.aa, (0, 1), tmp16, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp61 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp57 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp55 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) - tmp53 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp441 = einsum(tmp429, (0, 1, 2, 3), t1.bb, (3, 4), (0, 2, 1, 4)) - tmp439 = einsum(t1.bb, (0, 1), tmp429, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp437 = einsum(tmp39, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 4, 2, 5)) - tmp435 = einsum(tmp37, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp433 = einsum(t2.bbbb, (0, 1, 2, 3), tmp37, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp427 = einsum(t1.bb, (0, 1), v.bbbb.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp422 = einsum(tmp15, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp420 = einsum(tmp12, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp418 = einsum(tmp11, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp414 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp398 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 3, 5)) - tmp396 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp394 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp383 = einsum(t1.bb, (0, 1), v.bbbb.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp377 = einsum(t1.bb, (0, 1), tmp375, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - tmp373 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp371 = einsum(t1.bb, (0, 1), tmp369, (2, 3, 0, 4), (3, 2, 4, 1)) - tmp367 = einsum(t1.bb, (0, 1), tmp318, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp356 = einsum(t1.bb, (0, 1), tmp47, (2, 0), (2, 1)) - tmp355 = einsum(t1.bb, (0, 1), tmp46, (2, 0), (2, 1)) - tmp354 = einsum(t1.bb, (0, 1), tmp45, (2, 0), (2, 1)) - tmp349 = einsum(t1.bb, (0, 1), tmp233, (2, 3, 4, 0), (3, 2, 4, 1)) - tmp348 = einsum(t1.bb, (0, 1), tmp43, (2, 0), (2, 1)) - tmp347 = einsum(t1.bb, (0, 1), tmp41, (2, 0), (2, 1)) - tmp346 = einsum(tmp39, (0, 1, 2, 3), t2.abab, (4, 2, 3, 5), (4, 0, 1, 5)) - tmp345 = einsum(tmp39, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) - tmp344 = einsum(t2.bbbb, (0, 1, 2, 3), tmp37, (4, 1, 0, 3), (4, 2)) - tmp340 = einsum(v.aabb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp339 = einsum(t1.bb, (0, 1), tmp28, (0, 2), (2, 1)) - tmp337 = einsum(t1.bb, (0, 1), tmp244, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp335 = einsum(tmp18, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp334 = einsum(t2.abab, (0, 1, 2, 3), tmp16, (4, 5, 0, 2), (4, 5, 1, 3)) - tmp333 = einsum(t2.abab, (0, 1, 2, 3), tmp16, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp329 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) - tmp328 = einsum(t1.bb, (0, 1), tmp230, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp326 = einsum(t1.aa, (0, 1), tmp319, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp325 = einsum(tmp257, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp324 = einsum(t1.bb, (0, 1), tmp256, (1, 2), (0, 2)) - tmp323 = einsum(tmp255, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp322 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp321 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 0, 3, 1), (4, 2)) * -1 - tmp317 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp316 = einsum(t1.bb, (0, 1), f.bb.vv, (2, 1), (0, 2)) - tmp312 = einsum(t1.bb, (0, 1), tmp33, (2, 0), (2, 1)) - tmp311 = einsum(t1.bb, (0, 1), tmp32, (2, 0), (2, 1)) - tmp310 = einsum(t1.bb, (0, 1), tmp31, (2, 0), (2, 1)) - tmp309 = einsum(tmp13, (0, 1), t2.abab, (2, 3, 1, 4), (2, 0, 3, 4)) - tmp308 = einsum(tmp9, (0, 1), t2.abab, (2, 3, 1, 4), (2, 0, 3, 4)) - tmp307 = einsum(tmp7, (0, 1), t2.abab, (2, 3, 1, 4), (2, 0, 3, 4)) - tmp304 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp302 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp300 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 3), (4, 1)) - tmp299 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (4, 3, 1, 5), (4, 0, 2, 5)) - tmp298 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) - tmp297 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 3), (4, 2)) - tmp292 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (4, 2), (4, 0, 1, 3)) - tmp290 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp289 = einsum(tmp15, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp288 = einsum(tmp13, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp287 = einsum(tmp12, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp286 = einsum(tmp11, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp285 = einsum(tmp9, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp284 = einsum(tmp7, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp283 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp281 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp279 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp277 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp275 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp273 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 1, 5), (0, 4, 3, 5)) - tmp271 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp270 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 1, 4, 5)) - tmp269 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp267 = einsum(t1.bb, (0, 1), v.aabb.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp265 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp264 = einsum(f.aa.ov, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp262 = einsum(t1.bb, (0, 1), tmp192, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp259 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp258 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp249 = einsum(t1.aa, (0, 1), tmp244, (2, 0, 3, 4), (2, 4, 3, 1)) - tmp248 = einsum(t2.abab, (0, 1, 2, 3), tmp18, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp243 = einsum(t1.aa, (0, 1), v.aabb.vvoo, (2, 1, 3, 4), (0, 3, 4, 2)) - tmp241 = einsum(t1.aa, (0, 1), tmp233, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp239 = einsum(tmp39, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 2, 5)) - tmp238 = einsum(tmp37, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp237 = einsum(t2.abab, (0, 1, 2, 3), tmp37, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp232 = einsum(t1.aa, (0, 1), tmp230, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp229 = einsum(t1.aa, (0, 1), tmp189, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp224 = einsum(tmp15, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp223 = einsum(tmp12, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp222 = einsum(tmp11, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp217 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (4, 2, 5, 1)) - tmp214 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp209 = einsum(f.bb.ov, (0, 1), t2.abab, (2, 3, 4, 1), (2, 0, 3, 4)) - tmp201 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovoo, (1, 3, 4, 5), (0, 4, 5, 2)) - tmp200 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp199 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp197 = einsum(t1.aa, (0, 1), v.aabb.oooo, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp194 = einsum(t1.aa, (0, 1), tmp192, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp190 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 5, 2, 0)) - tmp187 = einsum(t1.aa, (0, 1), tmp26, (2, 0), (2, 1)) - tmp186 = einsum(tmp25, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp185 = einsum(t1.aa, (0, 1), tmp24, (2, 0), (2, 1)) - tmp174 = einsum(t1.aa, (0, 1), tmp158, (2, 3, 4, 0), (2, 4, 3, 1)) - tmp172 = einsum(t1.aa, (0, 1), tmp158, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp171 = einsum(t1.aa, (0, 1), tmp22, (2, 0), (2, 1)) - tmp170 = einsum(t1.aa, (0, 1), tmp20, (2, 0), (2, 1)) - tmp168 = einsum(tmp18, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp166 = einsum(t2.aaaa, (0, 1, 2, 3), tmp16, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp164 = einsum(t2.aaaa, (0, 1, 2, 3), tmp16, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp163 = einsum(t2.abab, (0, 1, 2, 3), tmp18, (4, 0, 1, 3), (4, 2)) - tmp162 = einsum(t2.aaaa, (0, 1, 2, 3), tmp16, (4, 0, 1, 3), (4, 2)) * -1 - tmp156 = einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp155 = einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 0, 3, 1), (2, 3)) - tmp152 = einsum(t1.aa, (0, 1), tmp1, (0, 2), (2, 1)) - tmp149 = einsum(tmp13, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp147 = einsum(tmp9, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp145 = einsum(tmp7, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp139 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp132 = einsum(t1.aa, (0, 1), tmp6, (2, 0), (2, 1)) - tmp131 = einsum(t1.aa, (0, 1), tmp5, (2, 0), (2, 1)) - tmp130 = einsum(t1.aa, (0, 1), tmp4, (2, 0), (2, 1)) - tmp129 = einsum(tmp15, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp128 = einsum(tmp13, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp127 = einsum(tmp12, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp126 = einsum(tmp11, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp125 = einsum(t2.aaaa, (0, 1, 2, 3), tmp9, (1, 3), (0, 2)) - tmp124 = einsum(tmp7, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp122 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp120 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp118 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp116 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp114 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp112 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp110 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (4, 1)) - tmp108 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 3, 1, 4), (2, 4)) * -1 - tmp106 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp104 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp102 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp101 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 3), (4, 2)) - tmp100 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 1, 0, 3), (4, 2)) * -1 - tmp89 = einsum(t1.aa, (0, 1), v.aaaa.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp87 = einsum(f.bb.ov, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp86 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp83 = einsum(t1.aa, (0, 1), f.aa.oo, (2, 0), (2, 1)) - tmp80 = einsum(t1.aa, (0, 1), tmp78, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - tmp76 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp74 = einsum(tmp72, (0, 1, 2, 3), t1.aa, (2, 4), (1, 0, 3, 4)) - tmp70 = einsum(t1.aa, (0, 1), tmp61, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp69 = einsum(t1.aa, (0, 1), tmp57, (2, 1), (0, 2)) - tmp68 = einsum(tmp55, (0, 1), t1.aa, (2, 0), (2, 1)) - tmp67 = einsum(t1.aa, (0, 1), tmp53, (2, 1), (0, 2)) - tmp66 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - tmp65 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 1, 3), (4, 2)) - tmp63 = einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (0, 3, 2, 4)) - tmp59 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 1), (4, 0, 2, 3)) - tmp49 = einsum(t1.aa, (0, 1), f.aa.vv, (2, 1), (0, 2)) - - return {f"tmp1": tmp1, f"tmp100": tmp100, f"tmp101": tmp101, f"tmp102": tmp102, f"tmp104": tmp104, f"tmp106": tmp106, f"tmp108": tmp108, f"tmp11": tmp11, f"tmp110": tmp110, f"tmp112": tmp112, f"tmp114": tmp114, f"tmp116": tmp116, f"tmp118": tmp118, f"tmp12": tmp12, f"tmp120": tmp120, f"tmp122": tmp122, f"tmp124": tmp124, f"tmp125": tmp125, f"tmp126": tmp126, f"tmp127": tmp127, f"tmp128": tmp128, f"tmp129": tmp129, f"tmp13": tmp13, f"tmp130": tmp130, f"tmp131": tmp131, f"tmp132": tmp132, f"tmp139": tmp139, f"tmp145": tmp145, f"tmp147": tmp147, f"tmp149": tmp149, f"tmp15": tmp15, f"tmp152": tmp152, f"tmp155": tmp155, f"tmp156": tmp156, f"tmp158": tmp158, f"tmp16": tmp16, f"tmp162": tmp162, f"tmp163": tmp163, f"tmp164": tmp164, f"tmp166": tmp166, f"tmp168": tmp168, f"tmp170": tmp170, f"tmp171": tmp171, f"tmp172": tmp172, f"tmp174": tmp174, f"tmp18": tmp18, f"tmp185": tmp185, f"tmp186": tmp186, f"tmp187": tmp187, f"tmp189": tmp189, f"tmp190": tmp190, f"tmp192": tmp192, f"tmp194": tmp194, f"tmp197": tmp197, f"tmp199": tmp199, f"tmp20": tmp20, f"tmp200": tmp200, f"tmp201": tmp201, f"tmp209": tmp209, f"tmp214": tmp214, f"tmp217": tmp217, f"tmp22": tmp22, f"tmp222": tmp222, f"tmp223": tmp223, f"tmp224": tmp224, f"tmp229": tmp229, f"tmp230": tmp230, f"tmp232": tmp232, f"tmp233": tmp233, f"tmp237": tmp237, f"tmp238": tmp238, f"tmp239": tmp239, f"tmp24": tmp24, f"tmp241": tmp241, f"tmp243": tmp243, f"tmp244": tmp244, f"tmp248": tmp248, f"tmp249": tmp249, f"tmp25": tmp25, f"tmp255": tmp255, f"tmp256": tmp256, f"tmp257": tmp257, f"tmp258": tmp258, f"tmp259": tmp259, f"tmp26": tmp26, f"tmp262": tmp262, f"tmp264": tmp264, f"tmp265": tmp265, f"tmp267": tmp267, f"tmp269": tmp269, f"tmp270": tmp270, f"tmp271": tmp271, f"tmp273": tmp273, f"tmp275": tmp275, f"tmp277": tmp277, f"tmp279": tmp279, f"tmp28": tmp28, f"tmp281": tmp281, f"tmp283": tmp283, f"tmp284": tmp284, f"tmp285": tmp285, f"tmp286": tmp286, f"tmp287": tmp287, f"tmp288": tmp288, f"tmp289": tmp289, f"tmp290": tmp290, f"tmp292": tmp292, f"tmp297": tmp297, f"tmp298": tmp298, f"tmp299": tmp299, f"tmp300": tmp300, f"tmp302": tmp302, f"tmp304": tmp304, f"tmp307": tmp307, f"tmp308": tmp308, f"tmp309": tmp309, f"tmp31": tmp31, f"tmp310": tmp310, f"tmp311": tmp311, f"tmp312": tmp312, f"tmp316": tmp316, f"tmp317": tmp317, f"tmp318": tmp318, f"tmp319": tmp319, f"tmp32": tmp32, f"tmp321": tmp321, f"tmp322": tmp322, f"tmp323": tmp323, f"tmp324": tmp324, f"tmp325": tmp325, f"tmp326": tmp326, f"tmp328": tmp328, f"tmp329": tmp329, f"tmp33": tmp33, f"tmp333": tmp333, f"tmp334": tmp334, f"tmp335": tmp335, f"tmp337": tmp337, f"tmp339": tmp339, f"tmp340": tmp340, f"tmp344": tmp344, f"tmp345": tmp345, f"tmp346": tmp346, f"tmp347": tmp347, f"tmp348": tmp348, f"tmp349": tmp349, f"tmp354": tmp354, f"tmp355": tmp355, f"tmp356": tmp356, f"tmp367": tmp367, f"tmp369": tmp369, f"tmp37": tmp37, f"tmp371": tmp371, f"tmp373": tmp373, f"tmp375": tmp375, f"tmp377": tmp377, f"tmp383": tmp383, f"tmp39": tmp39, f"tmp394": tmp394, f"tmp396": tmp396, f"tmp398": tmp398, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp414": tmp414, f"tmp418": tmp418, f"tmp420": tmp420, f"tmp422": tmp422, f"tmp427": tmp427, f"tmp429": tmp429, f"tmp43": tmp43, f"tmp433": tmp433, f"tmp435": tmp435, f"tmp437": tmp437, f"tmp439": tmp439, f"tmp441": tmp441, f"tmp45": tmp45, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp6": tmp6, f"tmp61": tmp61, f"tmp63": tmp63, f"tmp65": tmp65, f"tmp66": tmp66, f"tmp67": tmp67, f"tmp68": tmp68, f"tmp69": tmp69, f"tmp7": tmp7, f"tmp70": tmp70, f"tmp72": tmp72, f"tmp74": tmp74, f"tmp76": tmp76, f"tmp78": tmp78, f"tmp80": tmp80, f"tmp83": tmp83, f"tmp86": tmp86, f"tmp87": tmp87, f"tmp89": tmp89, f"tmp9": tmp9} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:44:26.398992. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp75 = np.copy(ints.tmp37) - tmp75 += np.transpose(ints.tmp37, (0, 2, 1, 3)) * -1 - tmp77 = np.copy(v.bbbb.ooov) - tmp77 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) * -1 - tmp16 = np.copy(ints.tmp16) - tmp16 += np.transpose(ints.tmp16, (0, 2, 1, 3)) * -1 - tmp18 = np.copy(v.aaaa.ooov) * -1 - tmp18 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) - tmp73 = einsum(r2.aba, (0, 1, 2), ints.tmp39, (0, 3, 4, 2), (3, 4, 1)) - tmp74 = einsum(v.aabb.ovoo, (0, 1, 2, 3), r2.aba, (0, 4, 1), (4, 2, 3)) - tmp76 = einsum(tmp75, (0, 1, 2, 3), r2.bbb, (4, 2, 3), (4, 0, 1)) * -1 - del tmp75 - tmp78 = einsum(r2.bbb, (0, 1, 2), tmp77, (1, 3, 4, 2), (0, 3, 4)) * -1 - del tmp77 - tmp17 = einsum(tmp16, (0, 1, 2, 3), r2.aaa, (4, 2, 3), (4, 0, 1)) * -1 - del tmp16 - tmp14 = einsum(v.aabb.ooov, (0, 1, 2, 3), r2.bab, (2, 4, 3), (4, 0, 1)) * -1 - tmp15 = einsum(ints.tmp18, (0, 1, 2, 3), r2.bab, (2, 4, 3), (0, 1, 4)) * -1 - tmp19 = einsum(r2.aaa, (0, 1, 2), tmp18, (3, 4, 1, 2), (0, 3, 4)) * -1 - del tmp18 - tmp2 = np.copy(f.bb.ov) - tmp2 += ints.tmp12 - tmp2 += ints.tmp15 - tmp2 += ints.tmp11 * -1 - tmp81 = np.copy(ints.tmp367) - tmp81 += ints.tmp37 - tmp81 += ints.tmp394 * 2 - tmp81 += ints.tmp433 * 2 - tmp81 += ints.tmp437 - tmp81 += np.transpose(ints.tmp441, (0, 2, 1, 3)) - tmp81 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) - tmp79 = np.copy(tmp73) * 0.5 - del tmp73 - tmp79 += np.transpose(tmp74, (0, 2, 1)) * -0.5 - del tmp74 - tmp79 += np.transpose(tmp76, (1, 2, 0)) * -1 - del tmp76 - tmp79 += np.transpose(tmp78, (0, 2, 1)) - del tmp78 - tmp83 = np.copy(ints.tmp41) * 2 - tmp83 += ints.tmp43 - tmp83 += ints.tmp31 * -1 - tmp83 += ints.tmp45 * -1 - tmp71 = np.copy(ints.tmp279) - tmp71 += ints.tmp283 * 0.5 - tmp71 += np.transpose(ints.tmp318, (0, 1, 3, 2)) * 0.5 - tmp93 = np.copy(ints.tmp371) - tmp93 += np.transpose(ints.tmp383, (0, 2, 1, 3)) - tmp93 += ints.tmp398 - tmp93 += ints.tmp427 - tmp93 += ints.tmp439 - tmp93 += ints.tmp396 * 2 - tmp93 += ints.tmp435 * 2 - tmp87 = np.copy(ints.tmp275) - tmp87 += ints.tmp319 - tmp87 += ints.tmp281 * 2 - tmp91 = np.copy(f.bb.oo) - tmp91 += ints.tmp28 - tmp91 += np.transpose(ints.tmp32, (1, 0)) - tmp91 += np.transpose(ints.tmp33, (1, 0)) - tmp91 += np.transpose(ints.tmp46, (1, 0)) - tmp91 += np.transpose(ints.tmp47, (1, 0)) - tmp89 = np.copy(ints.tmp317) - tmp89 += ints.tmp277 * 2 - tmp3 = np.copy(f.aa.ov) - tmp3 += ints.tmp13 - tmp3 += ints.tmp9 - tmp3 += ints.tmp7 * -1 - tmp32 = np.copy(f.aa.oo) - tmp32 += ints.tmp1 - tmp32 += np.transpose(ints.tmp25, (1, 0)) - tmp32 += np.transpose(ints.tmp26, (1, 0)) - tmp32 += np.transpose(ints.tmp5, (1, 0)) - tmp32 += np.transpose(ints.tmp6, (1, 0)) - tmp30 = np.copy(ints.tmp59) - tmp30 += ints.tmp112 * 2 - tmp34 = np.copy(ints.tmp106) - tmp34 += ints.tmp156 - tmp34 += ints.tmp172 - tmp34 += ints.tmp74 - tmp34 += np.transpose(ints.tmp89, (0, 2, 1, 3)) - tmp34 += ints.tmp104 * 2 - tmp34 += ints.tmp166 * 2 - tmp10 = np.copy(ints.tmp114) - tmp10 += ints.tmp120 * 0.5 - tmp10 += np.transpose(ints.tmp61, (0, 1, 3, 2)) * 0.5 - tmp12 = np.copy(ints.tmp118) - tmp12 += ints.tmp122 * 2 - tmp12 += ints.tmp63 - tmp24 = np.copy(ints.tmp20) * 2 - tmp24 += ints.tmp22 - tmp24 += ints.tmp24 * -1 - tmp24 += ints.tmp4 * -1 - tmp20 = np.copy(np.transpose(tmp14, (0, 2, 1))) * 0.5 - del tmp14 - tmp20 += tmp15 * -0.5 - del tmp15 - tmp20 += np.transpose(tmp17, (1, 2, 0)) * -1 - del tmp17 - tmp20 += np.transpose(tmp19, (0, 2, 1)) - del tmp19 - tmp22 = np.copy(ints.tmp102) - tmp22 += ints.tmp164 - tmp22 += ints.tmp168 * 0.5 - tmp22 += ints.tmp16 * 0.5 - tmp22 += np.transpose(ints.tmp174, (0, 2, 1, 3)) * 0.5 - tmp22 += ints.tmp70 * 0.5 - tmp22 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) * 0.5 - tmp60 = einsum(t1.bb, (0, 1), tmp2, (0, 2), (2, 1)) - tmp68 = einsum(r2.aba, (0, 1, 2), v.aabb.ovov, (0, 2, 3, 4), (1, 3, 4)) - tmp70 = einsum(r2.bbb, (0, 1, 2), v.bbbb.oovv, (3, 1, 4, 2), (0, 3, 4)) - tmp82 = einsum(r1.b, (0,), tmp81, (1, 2, 0, 3), (1, 2, 3)) - del tmp81 - tmp80 = einsum(t1.bb, (0, 1), tmp79, (2, 0, 3), (2, 3, 1)) * 2 - del tmp79 - tmp84 = einsum(tmp83, (0, 1), r2.bbb, (2, 1, 3), (2, 0, 3)) * -2 - del tmp83 - tmp67 = einsum(ints.tmp273, (0, 1, 2, 3), r2.aba, (0, 4, 2), (1, 4, 3)) - tmp72 = einsum(tmp71, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (4, 0, 2)) * -4 - del tmp71 - tmp69 = einsum(ints.tmp429, (0, 1, 2, 3), r2.bbb, (3, 2, 4), (0, 1, 4)) * -1 - tmp53 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.aba, (0, 2, 1), (3,)) - tmp54 = einsum(v.bbbb.ovov, (0, 1, 2, 3), r2.bbb, (0, 2, 1), (3,)) * -1 - tmp94 = einsum(tmp93, (0, 1, 2, 3), r1.b, (2,), (0, 1, 3)) - del tmp93 - tmp88 = einsum(r2.aba, (0, 1, 2), tmp87, (0, 3, 2, 4), (1, 3, 4)) - del tmp87 - tmp92 = einsum(tmp91, (0, 1), r2.bbb, (2, 0, 3), (2, 1, 3)) * -1 - del tmp91 - tmp86 = einsum(v.bbbb.ovov, (0, 1, 2, 3), r2.bbb, (4, 2, 3), (4, 0, 1)) - tmp90 = einsum(r2.bbb, (0, 1, 2), tmp89, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp89 - tmp51 = np.copy(ints.tmp39) - tmp51 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp1 = np.copy(ints.tmp18) - tmp1 += v.aabb.ooov - tmp63 = np.copy(ints.tmp37) - tmp63 += np.transpose(ints.tmp37, (0, 2, 1, 3)) * -1 - tmp63 += v.bbbb.ooov * -1 - tmp63 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) - tmp41 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (2, 0, 3), (1,)) * -1 - tmp40 = einsum(r2.aaa, (0, 1, 2), v.aaaa.ovov, (0, 2, 1, 3), (3,)) * -1 - tmp38 = einsum(tmp3, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp50 = np.copy(ints.tmp16) - tmp50 += np.transpose(ints.tmp16, (0, 2, 1, 3)) * -1 - tmp50 += v.aaaa.ooov * -1 - tmp50 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) - tmp33 = einsum(tmp32, (0, 1), r2.aaa, (2, 0, 3), (2, 1, 3)) * -1 - del tmp32 - tmp29 = einsum(r2.bab, (0, 1, 2), v.aabb.ovov, (3, 4, 0, 2), (1, 3, 4)) * -1 - tmp28 = einsum(ints.tmp116, (0, 1, 2, 3), r2.bab, (1, 4, 3), (0, 4, 2)) * -1 - tmp31 = einsum(r2.aaa, (0, 1, 2), tmp30, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp30 - tmp35 = einsum(tmp34, (0, 1, 2, 3), r1.a, (2,), (0, 1, 3)) - del tmp34 - tmp27 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (4, 2, 3), (4, 0, 1)) - tmp11 = einsum(r2.aaa, (0, 1, 2), tmp10, (3, 1, 4, 2), (0, 3, 4)) * -4 - del tmp10 - tmp13 = einsum(tmp12, (0, 1, 2, 3), r2.bab, (1, 4, 3), (4, 0, 2)) * -1 - del tmp12 - tmp25 = einsum(tmp24, (0, 1), r2.aaa, (2, 1, 3), (2, 0, 3)) * -2 - del tmp24 - tmp21 = einsum(tmp20, (0, 1, 2), t1.aa, (1, 3), (0, 2, 3)) * 2 - del tmp20 - tmp8 = einsum(ints.tmp158, (0, 1, 2, 3), r2.aaa, (2, 3, 4), (0, 1, 4)) - tmp23 = einsum(r1.a, (0,), tmp22, (1, 2, 0, 3), (1, 2, 3)) * 2 - del tmp22 - tmp9 = einsum(r2.aaa, (0, 1, 2), v.aaaa.oovv, (3, 1, 4, 2), (0, 3, 4)) - tmp97 = np.copy(ints.tmp377) - tmp97 += np.transpose(ints.tmp414, (1, 2, 0, 3)) - tmp97 += ints.tmp420 - tmp97 += ints.tmp422 - tmp97 += ints.tmp373 * -1 - tmp97 += ints.tmp418 * -1 - tmp61 = np.copy(ints.tmp256) - tmp61 += np.transpose(ints.tmp300, (1, 0)) * 2 - tmp61 += np.transpose(ints.tmp302, (1, 0)) - tmp61 += f.bb.vv * -1 - tmp61 += np.transpose(ints.tmp255, (1, 0)) * -1 - tmp61 += np.transpose(ints.tmp257, (1, 0)) * -1 - tmp61 += tmp60 - del tmp60 - tmp85 = np.copy(tmp67) - del tmp67 - tmp85 += tmp68 - del tmp68 - tmp85 += tmp69 * 2 - del tmp69 - tmp85 += tmp70 * 2 - del tmp70 - tmp85 += np.transpose(tmp72, (1, 0, 2)) * -1 - del tmp72 - tmp85 += tmp80 - del tmp80 - tmp85 += tmp82 - del tmp82 - tmp85 += np.transpose(tmp84, (1, 0, 2)) - del tmp84 - tmp55 = np.copy(tmp53) * -0.5 - del tmp53 - tmp55 += tmp54 - del tmp54 - tmp96 = np.copy(ints.tmp369) - tmp96 += ints.tmp375 - tmp96 += np.transpose(v.bbbb.oooo, (0, 2, 3, 1)) * -1 - tmp66 = np.copy(ints.tmp284) - tmp66 += ints.tmp286 * 2 - tmp66 += ints.tmp290 - tmp66 += ints.tmp297 * 2 - tmp66 += ints.tmp298 - tmp66 += ints.tmp311 - tmp66 += ints.tmp312 - tmp66 += ints.tmp321 * 2 - tmp66 += ints.tmp324 - tmp66 += ints.tmp329 - tmp66 += ints.tmp339 - tmp66 += ints.tmp344 * 2 - tmp66 += ints.tmp345 - tmp66 += ints.tmp347 * 2 - tmp66 += ints.tmp348 - tmp66 += ints.tmp355 - tmp66 += ints.tmp356 - tmp66 += f.bb.ov * -1 - tmp66 += ints.tmp12 * -1 - tmp66 += ints.tmp15 * -1 - tmp66 += ints.tmp264 * -1 - tmp66 += ints.tmp265 * -2 - tmp66 += ints.tmp285 * -1 - tmp66 += ints.tmp287 * -2 - tmp66 += ints.tmp288 * -1 - tmp66 += ints.tmp289 * -2 - tmp66 += ints.tmp310 * -1 - tmp66 += ints.tmp316 * -1 - tmp66 += ints.tmp322 * -1 - tmp66 += ints.tmp323 * -1 - tmp66 += ints.tmp325 * -1 - tmp66 += ints.tmp354 * -1 - tmp95 = np.copy(tmp86) * 2 - del tmp86 - tmp95 += np.transpose(tmp88, (1, 0, 2)) - del tmp88 - tmp95 += np.transpose(tmp90, (1, 0, 2)) * -2 - del tmp90 - tmp95 += np.transpose(tmp92, (1, 0, 2)) * -2 - del tmp92 - tmp95 += tmp94 - del tmp94 - tmp58 = np.copy(ints.tmp258) - tmp58 += v.aabb.oovv - tmp58 += ints.tmp304 * -1 - tmp4 = np.copy(f.aa.oo) - tmp4 += ints.tmp1 - tmp4 += np.transpose(ints.tmp20, (1, 0)) * 2 - tmp4 += np.transpose(ints.tmp22, (1, 0)) - tmp4 += np.transpose(ints.tmp25, (1, 0)) - tmp4 += np.transpose(ints.tmp26, (1, 0)) - tmp4 += np.transpose(ints.tmp5, (1, 0)) - tmp4 += np.transpose(ints.tmp6, (1, 0)) - tmp4 += np.transpose(ints.tmp24, (1, 0)) * -1 - tmp4 += np.transpose(ints.tmp4, (1, 0)) * -1 - tmp62 = np.copy(ints.tmp18) - tmp62 += ints.tmp259 - tmp62 += ints.tmp270 - tmp62 += ints.tmp271 * 2 - tmp62 += np.transpose(ints.tmp292, (1, 0, 2, 3)) - tmp62 += ints.tmp308 - tmp62 += ints.tmp309 - tmp62 += ints.tmp326 - tmp62 += ints.tmp333 - tmp62 += ints.tmp335 * 2 - tmp62 += ints.tmp340 - tmp62 += v.aabb.ooov - tmp62 += ints.tmp262 * -1 - tmp62 += ints.tmp267 * -1 - tmp62 += ints.tmp269 * -1 - tmp62 += ints.tmp299 * -1 - tmp62 += ints.tmp307 * -1 - tmp62 += ints.tmp328 * -1 - tmp62 += ints.tmp334 * -1 - tmp62 += ints.tmp337 * -1 - tmp62 += ints.tmp346 * -1 - tmp62 += np.transpose(ints.tmp349, (1, 0, 2, 3)) * -1 - tmp64 = einsum(r2.bab, (0, 1, 2), tmp63, (3, 4, 0, 2), (1, 3, 4)) - del tmp63 - tmp64 += einsum(tmp51, (0, 1, 2, 3), r2.aaa, (4, 0, 3), (4, 1, 2)) * 2 - tmp64 += einsum(r2.bab, (0, 1, 2), tmp1, (3, 1, 4, 2), (3, 0, 4)) - tmp59 = np.copy(ints.tmp192) - tmp59 += ints.tmp230 - tmp59 += ints.tmp233 - tmp59 += ints.tmp244 - tmp59 += v.aabb.oooo - tmp57 = np.copy(ints.tmp275) - tmp57 += ints.tmp281 * 2 - tmp57 += ints.tmp319 - tmp57 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp57 += ints.tmp273 * -1 - tmp56 = np.copy(ints.tmp279) * 2 - tmp56 += ints.tmp283 - tmp56 += np.transpose(ints.tmp318, (0, 1, 3, 2)) - tmp56 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp56 += ints.tmp277 * -2 - tmp56 += ints.tmp317 * -1 - tmp56 += v.bbbb.oovv * -1 - tmp65 = np.copy(tmp40) - tmp65 += tmp41 * 0.5 - tmp7 = np.copy(f.bb.oo) - tmp7 += ints.tmp28 - tmp7 += np.transpose(ints.tmp32, (1, 0)) - tmp7 += np.transpose(ints.tmp33, (1, 0)) - tmp7 += np.transpose(ints.tmp41, (1, 0)) * 2 - tmp7 += np.transpose(ints.tmp43, (1, 0)) - tmp7 += np.transpose(ints.tmp46, (1, 0)) - tmp7 += np.transpose(ints.tmp47, (1, 0)) - tmp7 += np.transpose(ints.tmp31, (1, 0)) * -1 - tmp7 += np.transpose(ints.tmp45, (1, 0)) * -1 - tmp46 = np.copy(ints.tmp118) - tmp46 += ints.tmp122 * 2 - tmp46 += ints.tmp63 - tmp46 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp46 += ints.tmp116 * -1 - tmp39 = np.copy(np.transpose(ints.tmp108, (1, 0))) * 2 - tmp39 += np.transpose(ints.tmp110, (1, 0)) - tmp39 += ints.tmp55 - tmp39 += f.aa.vv * -1 - tmp39 += np.transpose(ints.tmp53, (1, 0)) * -1 - tmp39 += np.transpose(ints.tmp57, (1, 0)) * -1 - tmp39 += tmp38 - del tmp38 - tmp45 = np.copy(ints.tmp114) * 2 - tmp45 += ints.tmp120 - tmp45 += np.transpose(ints.tmp61, (0, 1, 3, 2)) - tmp45 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp45 += ints.tmp112 * -2 - tmp45 += ints.tmp59 * -1 - tmp45 += v.aaaa.oovv * -1 - tmp44 = np.copy(ints.tmp100) * 2 - tmp44 += ints.tmp101 - tmp44 += ints.tmp124 * 2 - tmp44 += ints.tmp126 - tmp44 += ints.tmp131 - tmp44 += ints.tmp132 - tmp44 += ints.tmp152 - tmp44 += ints.tmp155 - tmp44 += ints.tmp162 * 2 - tmp44 += ints.tmp163 - tmp44 += ints.tmp170 * 2 - tmp44 += ints.tmp171 - tmp44 += ints.tmp186 - tmp44 += ints.tmp187 - tmp44 += ints.tmp65 * 2 - tmp44 += ints.tmp68 - tmp44 += ints.tmp83 - tmp44 += f.aa.ov * -1 - tmp44 += ints.tmp125 * -2 - tmp44 += ints.tmp127 * -1 - tmp44 += ints.tmp128 * -2 - tmp44 += ints.tmp129 * -1 - tmp44 += ints.tmp130 * -1 - tmp44 += ints.tmp13 * -1 - tmp44 += ints.tmp185 * -1 - tmp44 += ints.tmp49 * -1 - tmp44 += ints.tmp66 * -1 - tmp44 += ints.tmp67 * -1 - tmp44 += ints.tmp69 * -1 - tmp44 += ints.tmp86 * -2 - tmp44 += ints.tmp87 * -1 - tmp44 += ints.tmp9 * -1 - tmp52 = einsum(tmp50, (0, 1, 2, 3), r2.aba, (1, 4, 3), (0, 2, 4)) * -1 - del tmp50 - tmp52 += einsum(tmp51, (0, 1, 2, 3), r2.aba, (4, 2, 3), (4, 0, 1)) - del tmp51 - tmp52 += einsum(r2.bbb, (0, 1, 2), tmp1, (3, 4, 1, 2), (3, 4, 0)) * 2 - tmp49 = np.copy(ints.tmp190) - tmp49 += ints.tmp200 - tmp49 += ints.tmp201 * 2 - tmp49 += np.transpose(ints.tmp209, (0, 2, 1, 3)) - tmp49 += ints.tmp223 - tmp49 += ints.tmp224 - tmp49 += ints.tmp229 - tmp49 += ints.tmp237 - tmp49 += ints.tmp239 * 2 - tmp49 += ints.tmp243 - tmp49 += ints.tmp39 - tmp49 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp49 += ints.tmp194 * -1 - tmp49 += ints.tmp197 * -1 - tmp49 += ints.tmp199 * -1 - tmp49 += ints.tmp214 * -1 - tmp49 += ints.tmp222 * -1 - tmp49 += ints.tmp232 * -1 - tmp49 += ints.tmp238 * -1 - tmp49 += ints.tmp241 * -1 - tmp49 += ints.tmp248 * -1 - tmp49 += np.transpose(ints.tmp249, (0, 2, 1, 3)) * -1 - tmp47 = np.copy(ints.tmp189) - tmp47 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) - tmp47 += ints.tmp217 * -1 - tmp48 = np.copy(ints.tmp192) - tmp48 += ints.tmp230 - tmp48 += ints.tmp233 - tmp48 += ints.tmp244 - tmp48 += v.aabb.oooo - tmp37 = np.copy(ints.tmp72) - tmp37 += ints.tmp78 - tmp37 += np.transpose(v.aaaa.oooo, (0, 2, 3, 1)) * -1 - tmp43 = np.copy(ints.tmp139) - tmp43 += np.transpose(ints.tmp147, (2, 0, 1, 3)) - tmp43 += np.transpose(ints.tmp149, (2, 0, 1, 3)) - tmp43 += np.transpose(ints.tmp80, (2, 0, 1, 3)) - tmp43 += np.transpose(ints.tmp145, (2, 0, 1, 3)) * -1 - tmp43 += np.transpose(ints.tmp76, (2, 0, 1, 3)) * -1 - tmp36 = np.copy(tmp27) * 2 - del tmp27 - tmp36 += tmp28 - del tmp28 - tmp36 += tmp29 - del tmp29 - tmp36 += np.transpose(tmp31, (1, 0, 2)) * -2 - del tmp31 - tmp36 += np.transpose(tmp33, (1, 0, 2)) * -2 - del tmp33 - tmp36 += tmp35 - del tmp35 - tmp42 = np.copy(tmp40) * 2 - del tmp40 - tmp42 += tmp41 - del tmp41 - tmp26 = np.copy(tmp8) * 2 - del tmp8 - tmp26 += tmp9 * 2 - del tmp9 - tmp26 += np.transpose(tmp11, (1, 0, 2)) * -1 - del tmp11 - tmp26 += np.transpose(tmp13, (1, 0, 2)) - del tmp13 - tmp26 += tmp21 - del tmp21 - tmp26 += tmp23 - del tmp23 - tmp26 += np.transpose(tmp25, (1, 0, 2)) - del tmp25 - tmp6 = np.copy(ints.tmp37) - tmp6 += v.bbbb.ooov * -1 - tmp5 = np.copy(ints.tmp39) - tmp5 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp0 = np.copy(ints.tmp16) - tmp0 += v.aaaa.ooov * -1 - r2new.bbb = np.copy(tmp85) * -1 - r2new.bbb += np.transpose(tmp85, (1, 0, 2)) - del tmp85 - r2new.bbb += tmp95 - r2new.bbb += np.transpose(tmp95, (1, 0, 2)) * -1 - del tmp95 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp96, (3, 4, 0, 1), (3, 4, 2)) * 2 - del tmp96 - r2new.bbb += einsum(tmp61, (0, 1), r2.bbb, (2, 3, 0), (2, 3, 1)) * -2 - r2new.bbb += einsum(tmp55, (0,), t2.bbbb, (1, 2, 3, 0), (1, 2, 3)) * 4 - r2new.bbb += einsum(r1.b, (0,), tmp97, (1, 2, 0, 3), (2, 1, 3)) * -2 - del tmp97 - r2new.bbb += einsum(tmp66, (0, 1), r1.b, (2,), (2, 0, 1)) * -1 - r2new.bbb += einsum(r1.b, (0,), tmp66, (1, 2), (1, 0, 2)) - r2new.bab = einsum(tmp56, (0, 1, 2, 3), r2.bab, (1, 4, 3), (0, 4, 2)) - del tmp56 - r2new.bab += einsum(r2.aaa, (0, 1, 2), tmp57, (1, 3, 2, 4), (3, 0, 4)) * -2 - del tmp57 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp58, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp58 - r2new.bab += einsum(tmp59, (0, 1, 2, 3), r2.bab, (3, 1, 4), (2, 0, 4)) - del tmp59 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp61, (2, 3), (0, 1, 3)) * -1 - del tmp61 - r2new.bab += einsum(r1.a, (0,), tmp62, (1, 0, 2, 3), (2, 1, 3)) - del tmp62 - r2new.bab += einsum(tmp7, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -1 - r2new.bab += einsum(tmp4, (0, 1), r2.bab, (2, 0, 3), (2, 1, 3)) * -1 - r2new.bab += einsum(t1.bb, (0, 1), tmp64, (2, 3, 0), (3, 2, 1)) - del tmp64 - r2new.bab += einsum(tmp65, (0,), t2.abab, (1, 2, 0, 3), (2, 1, 3)) * 2 - del tmp65 - r2new.bab += einsum(tmp66, (0, 1), r1.a, (2,), (0, 2, 1)) - del tmp66 - r2new.aba = einsum(tmp45, (0, 1, 2, 3), r2.aba, (1, 4, 3), (0, 4, 2)) - del tmp45 - r2new.aba += einsum(tmp46, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (0, 4, 2)) * -2 - del tmp46 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp47, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp47 - r2new.aba += einsum(tmp48, (0, 1, 2, 3), r2.aba, (1, 3, 4), (0, 2, 4)) - del tmp48 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp39, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(r1.b, (0,), tmp49, (1, 2, 0, 3), (1, 2, 3)) - del tmp49 - r2new.aba += einsum(tmp7, (0, 1), r2.aba, (2, 0, 3), (2, 1, 3)) * -1 - r2new.aba += einsum(tmp4, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - r2new.aba += einsum(tmp52, (0, 1, 2), t1.aa, (1, 3), (0, 2, 3)) - del tmp52 - r2new.aba += einsum(tmp55, (0,), t2.abab, (1, 2, 3, 0), (1, 2, 3)) * 2 - del tmp55 - r2new.aba += einsum(tmp44, (0, 1), r1.b, (2,), (0, 2, 1)) - r2new.aaa = np.copy(tmp26) * -1 - r2new.aaa += np.transpose(tmp26, (1, 0, 2)) - del tmp26 - r2new.aaa += tmp36 - r2new.aaa += np.transpose(tmp36, (1, 0, 2)) * -1 - del tmp36 - r2new.aaa += einsum(tmp37, (0, 1, 2, 3), r2.aaa, (3, 2, 4), (0, 1, 4)) * -2 - del tmp37 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp39, (2, 3), (0, 1, 3)) * -2 - del tmp39 - r2new.aaa += einsum(tmp42, (0,), t2.aaaa, (1, 2, 3, 0), (1, 2, 3)) * 2 - del tmp42 - r2new.aaa += einsum(r1.a, (0,), tmp43, (0, 1, 2, 3), (2, 1, 3)) * -2 - del tmp43 - r2new.aaa += einsum(tmp44, (0, 1), r1.a, (2,), (2, 0, 1)) * -1 - r2new.aaa += einsum(r1.a, (0,), tmp44, (1, 2), (1, 0, 2)) - del tmp44 - r1new.b = einsum(tmp5, (0, 1, 2, 3), r2.aba, (0, 2, 3), (1,)) - del tmp5 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp6, (3, 1, 0, 2), (3,)) * -2 - del tmp6 - r1new.b += einsum(tmp3, (0, 1), r2.aba, (0, 2, 1), (2,)) * -1 - r1new.b += einsum(tmp2, (0, 1), r2.bbb, (2, 0, 1), (2,)) * 2 - r1new.b += einsum(r1.b, (0,), tmp7, (0, 1), (1,)) * -1 - del tmp7 - r1new.a = einsum(tmp0, (0, 1, 2, 3), r2.aaa, (2, 1, 3), (0,)) * -2 - del tmp0 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp1, (3, 1, 0, 2), (3,)) - del tmp1 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp2, (0, 2), (1,)) * -1 - del tmp2 - r1new.a += einsum(tmp3, (0, 1), r2.aaa, (2, 0, 1), (2,)) * 2 - del tmp3 - r1new.a += einsum(r1.a, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:48:26.993715. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp101 : array - tmp104 : array - tmp106 : array - tmp108 : array - tmp11 : array - tmp116 : array - tmp117 : array - tmp118 : array - tmp12 : array - tmp127 : array - tmp128 : array - tmp129 : array - tmp13 : array - tmp136 : array - tmp137 : array - tmp139 : array - tmp141 : array - tmp146 : array - tmp148 : array - tmp15 : array - tmp150 : array - tmp152 : array - tmp153 : array - tmp154 : array - tmp156 : array - tmp158 : array - tmp159 : array - tmp160 : array - tmp161 : array - tmp162 : array - tmp164 : array - tmp165 : array - tmp166 : array - tmp167 : array - tmp168 : array - tmp173 : array - tmp175 : array - tmp177 : array - tmp185 : array - tmp186 : array - tmp187 : array - tmp196 : array - tmp199 : array - tmp20 : array - tmp205 : array - tmp216 : array - tmp22 : array - tmp220 : array - tmp226 : array - tmp240 : array - tmp241 : array - tmp242 : array - tmp263 : array - tmp266 : array - tmp271 : array - tmp272 : array - tmp273 : array - tmp274 : array - tmp276 : array - tmp286 : array - tmp287 : array - tmp289 : array - tmp290 : array - tmp291 : array - tmp292 : array - tmp294 : array - tmp295 : array - tmp296 : array - tmp298 : array - tmp300 : array - tmp301 : array - tmp303 : array - tmp304 : array - tmp305 : array - tmp307 : array - tmp308 : array - tmp309 : array - tmp31 : array - tmp313 : array - tmp314 : array - tmp315 : array - tmp316 : array - tmp317 : array - tmp318 : array - tmp319 : array - tmp32 : array - tmp325 : array - tmp326 : array - tmp327 : array - tmp328 : array - tmp33 : array - tmp334 : array - tmp335 : array - tmp336 : array - tmp337 : array - tmp338 : array - tmp340 : array - tmp341 : array - tmp344 : array - tmp345 : array - tmp346 : array - tmp350 : array - tmp352 : array - tmp354 : array - tmp356 : array - tmp358 : array - tmp360 : array - tmp361 : array - tmp362 : array - tmp363 : array - tmp364 : array - tmp365 : array - tmp366 : array - tmp383 : array - tmp385 : array - tmp387 : array - tmp4 : array - tmp41 : array - tmp423 : array - tmp43 : array - tmp440 : array - tmp450 : array - tmp5 : array - tmp50 : array - tmp51 : array - tmp59 : array - tmp6 : array - tmp61 : array - tmp63 : array - tmp67 : array - tmp69 : array - tmp7 : array - tmp71 : array - tmp73 : array - tmp75 : array - tmp77 : array - tmp79 : array - tmp80 : array - tmp81 : array - tmp82 : array - tmp83 : array - tmp84 : array - tmp9 : array - tmp98 : array - """ - - tmp15 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp12 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp11 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 1), (0, 3)) - tmp13 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp9 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 0, 1), (2, 3)) - tmp7 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 1, 0, 3), (2, 3)) - tmp315 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp274 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp273 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 3, 0, 1), (2, 3)) - tmp272 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 0, 3, 1), (2, 3)) - tmp309 = einsum(tmp15, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp308 = einsum(tmp12, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp307 = einsum(t1.bb, (0, 1), tmp11, (2, 1), (0, 2)) - tmp298 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp296 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp300 = einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp287 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp33 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp32 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 3), (1, 2)) - tmp31 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 1), (2, 3)) - tmp160 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp177 = einsum(t1.aa, (0, 1), tmp13, (2, 1), (0, 2)) - tmp175 = einsum(tmp9, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp173 = einsum(tmp7, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp6 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp5 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) - tmp4 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp156 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 3), (4, 0)) - tmp154 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 3, 1), (4, 0)) * -1 - tmp158 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 2, 1)) - tmp137 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp108 = einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 1), (2, 3)) - tmp106 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - tmp104 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 0, 3, 1), (2, 3)) - tmp450 = einsum(t2.bbbb, (0, 1, 2, 3), tmp315, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp440 = einsum(v.bbbb.vvvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp423 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp387 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 5, 2, 3)) - tmp385 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp383 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp366 = einsum(tmp15, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp365 = einsum(tmp13, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp364 = einsum(tmp12, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp363 = einsum(tmp11, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp362 = einsum(tmp9, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp361 = einsum(tmp7, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp360 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp358 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp356 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp354 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp352 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp350 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 1, 5), (0, 4, 3, 5)) - tmp346 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp345 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovvv, (0, 4, 5, 2), (1, 4, 5, 3)) - tmp344 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovvv, (0, 2, 4, 5), (1, 4, 5, 3)) - tmp341 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp340 = einsum(f.aa.ov, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp338 = einsum(t1.bb, (0, 1), tmp274, (2, 0), (2, 1)) - tmp337 = einsum(t1.bb, (0, 1), tmp273, (2, 0), (2, 1)) - tmp336 = einsum(t1.bb, (0, 1), tmp272, (2, 0), (2, 1)) - tmp335 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) - tmp334 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 3), (4, 2)) - tmp328 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp327 = einsum(t1.bb, (0, 1), tmp309, (2, 0), (2, 1)) - tmp326 = einsum(t1.bb, (0, 1), tmp308, (2, 0), (2, 1)) - tmp325 = einsum(t1.bb, (0, 1), tmp307, (2, 0), (2, 1)) - tmp319 = einsum(t1.bb, (0, 1), tmp298, (2, 0), (2, 1)) - tmp318 = einsum(t1.bb, (0, 1), tmp296, (2, 0), (2, 1)) - tmp317 = einsum(tmp300, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) - tmp316 = einsum(t2.bbbb, (0, 1, 2, 3), tmp315, (4, 1, 0, 3), (4, 2)) - tmp314 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 2, 0, 1)) - tmp313 = einsum(t1.bb, (0, 1), tmp287, (0, 2), (2, 1)) - tmp305 = einsum(tmp33, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp304 = einsum(t1.bb, (0, 1), tmp32, (1, 2), (0, 2)) - tmp303 = einsum(t1.bb, (0, 1), tmp31, (2, 1), (0, 2)) - tmp301 = einsum(tmp300, (0, 1, 2, 3), t2.abab, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp295 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp294 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 0, 3, 1), (4, 2)) * -1 - tmp292 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - tmp291 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp290 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp289 = einsum(t1.bb, (0, 1), v.aabb.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp286 = einsum(t1.bb, (0, 1), f.bb.vv, (2, 1), (0, 2)) - tmp276 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 4, 5), (2, 4, 1, 5)) - tmp271 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) - tmp266 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (4, 2, 5, 1)) - tmp263 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (4, 5, 1, 2)) - tmp242 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp241 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp240 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp226 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp220 = einsum(t2.abab, (0, 1, 2, 3), tmp160, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp216 = einsum(t1.aa, (0, 1), v.aabb.vvvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp205 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp199 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp196 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp187 = einsum(t1.aa, (0, 1), tmp177, (2, 0), (2, 1)) - tmp186 = einsum(t1.aa, (0, 1), tmp175, (2, 0), (2, 1)) - tmp185 = einsum(tmp173, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp168 = einsum(tmp6, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp167 = einsum(t1.aa, (0, 1), tmp5, (1, 2), (0, 2)) - tmp166 = einsum(t1.aa, (0, 1), tmp4, (2, 1), (0, 2)) - tmp165 = einsum(t1.aa, (0, 1), tmp156, (2, 0), (2, 1)) - tmp164 = einsum(t1.aa, (0, 1), tmp154, (2, 0), (2, 1)) - tmp162 = einsum(t2.aaaa, (0, 1, 2, 3), tmp158, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp161 = einsum(t2.abab, (0, 1, 2, 3), tmp160, (4, 0, 1, 3), (4, 2)) - tmp159 = einsum(tmp158, (0, 1, 2, 3), t2.aaaa, (2, 1, 4, 3), (0, 4)) - tmp153 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - tmp152 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 3, 1), (4, 2)) * -1 - tmp150 = einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (0, 3, 2, 4)) - tmp148 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp146 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 1), (4, 0, 2, 3)) - tmp141 = einsum(t1.aa, (0, 1), v.aaaa.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp139 = einsum(t1.aa, (0, 1), tmp137, (0, 2), (2, 1)) - tmp136 = einsum(t1.aa, (0, 1), f.aa.vv, (2, 1), (0, 2)) - tmp129 = einsum(tmp108, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp128 = einsum(t1.aa, (0, 1), tmp106, (2, 0), (2, 1)) - tmp127 = einsum(t1.aa, (0, 1), tmp104, (2, 0), (2, 1)) - tmp118 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp117 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 3), (4, 2)) - tmp116 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 1, 3), (4, 2)) - tmp101 = einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 0, 3, 1), (2, 3)) - tmp98 = einsum(t1.aa, (0, 1), f.aa.oo, (2, 0), (2, 1)) - tmp84 = einsum(tmp15, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp83 = einsum(tmp13, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp82 = einsum(tmp12, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp81 = einsum(tmp11, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp80 = einsum(t2.aaaa, (0, 1, 2, 3), tmp9, (1, 3), (0, 2)) - tmp79 = einsum(tmp7, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp77 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp75 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp73 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp71 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp69 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp67 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp63 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 5, 0, 1)) - tmp61 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp59 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp51 = einsum(f.bb.ov, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp50 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp43 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp41 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 1), (4, 3)) * -1 - tmp22 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (4, 1)) - tmp20 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 3, 1, 4), (2, 4)) * -1 - - return {f"tmp101": tmp101, f"tmp104": tmp104, f"tmp106": tmp106, f"tmp108": tmp108, f"tmp11": tmp11, f"tmp116": tmp116, f"tmp117": tmp117, f"tmp118": tmp118, f"tmp12": tmp12, f"tmp127": tmp127, f"tmp128": tmp128, f"tmp129": tmp129, f"tmp13": tmp13, f"tmp136": tmp136, f"tmp137": tmp137, f"tmp139": tmp139, f"tmp141": tmp141, f"tmp146": tmp146, f"tmp148": tmp148, f"tmp15": tmp15, f"tmp150": tmp150, f"tmp152": tmp152, f"tmp153": tmp153, f"tmp154": tmp154, f"tmp156": tmp156, f"tmp158": tmp158, f"tmp159": tmp159, f"tmp160": tmp160, f"tmp161": tmp161, f"tmp162": tmp162, f"tmp164": tmp164, f"tmp165": tmp165, f"tmp166": tmp166, f"tmp167": tmp167, f"tmp168": tmp168, f"tmp173": tmp173, f"tmp175": tmp175, f"tmp177": tmp177, f"tmp185": tmp185, f"tmp186": tmp186, f"tmp187": tmp187, f"tmp196": tmp196, f"tmp199": tmp199, f"tmp20": tmp20, f"tmp205": tmp205, f"tmp216": tmp216, f"tmp22": tmp22, f"tmp220": tmp220, f"tmp226": tmp226, f"tmp240": tmp240, f"tmp241": tmp241, f"tmp242": tmp242, f"tmp263": tmp263, f"tmp266": tmp266, f"tmp271": tmp271, f"tmp272": tmp272, f"tmp273": tmp273, f"tmp274": tmp274, f"tmp276": tmp276, f"tmp286": tmp286, f"tmp287": tmp287, f"tmp289": tmp289, f"tmp290": tmp290, f"tmp291": tmp291, f"tmp292": tmp292, f"tmp294": tmp294, f"tmp295": tmp295, f"tmp296": tmp296, f"tmp298": tmp298, f"tmp300": tmp300, f"tmp301": tmp301, f"tmp303": tmp303, f"tmp304": tmp304, f"tmp305": tmp305, f"tmp307": tmp307, f"tmp308": tmp308, f"tmp309": tmp309, f"tmp31": tmp31, f"tmp313": tmp313, f"tmp314": tmp314, f"tmp315": tmp315, f"tmp316": tmp316, f"tmp317": tmp317, f"tmp318": tmp318, f"tmp319": tmp319, f"tmp32": tmp32, f"tmp325": tmp325, f"tmp326": tmp326, f"tmp327": tmp327, f"tmp328": tmp328, f"tmp33": tmp33, f"tmp334": tmp334, f"tmp335": tmp335, f"tmp336": tmp336, f"tmp337": tmp337, f"tmp338": tmp338, f"tmp340": tmp340, f"tmp341": tmp341, f"tmp344": tmp344, f"tmp345": tmp345, f"tmp346": tmp346, f"tmp350": tmp350, f"tmp352": tmp352, f"tmp354": tmp354, f"tmp356": tmp356, f"tmp358": tmp358, f"tmp360": tmp360, f"tmp361": tmp361, f"tmp362": tmp362, f"tmp363": tmp363, f"tmp364": tmp364, f"tmp365": tmp365, f"tmp366": tmp366, f"tmp383": tmp383, f"tmp385": tmp385, f"tmp387": tmp387, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp423": tmp423, f"tmp43": tmp43, f"tmp440": tmp440, f"tmp450": tmp450, f"tmp5": tmp5, f"tmp50": tmp50, f"tmp51": tmp51, f"tmp59": tmp59, f"tmp6": tmp6, f"tmp61": tmp61, f"tmp63": tmp63, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp7": tmp7, f"tmp71": tmp71, f"tmp73": tmp73, f"tmp75": tmp75, f"tmp77": tmp77, f"tmp79": tmp79, f"tmp80": tmp80, f"tmp81": tmp81, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp84": tmp84, f"tmp9": tmp9, f"tmp98": tmp98} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:48:27.157882. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp130 = np.copy(ints.tmp291) - tmp130 += np.transpose(ints.tmp360, (0, 1, 3, 2)) - tmp130 += np.transpose(ints.tmp356, (0, 1, 3, 2)) * 2 - tmp128 = np.copy(ints.tmp315) - tmp128 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) - tmp126 = einsum(r1.b, (0,), ints.tmp315, (1, 2, 3, 0), (1, 2, 3)) - tmp104 = np.copy(f.bb.ov) - tmp104 += ints.tmp12 - tmp104 += ints.tmp15 - tmp106 = np.copy(ints.tmp290) - tmp106 += ints.tmp354 * 2 - tmp88 = np.copy(ints.tmp300) - tmp88 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp99 = einsum(r1.b, (0,), v.bbbb.ooov, (1, 2, 3, 0), (1, 2, 3)) - tmp102 = np.copy(ints.tmp315) - tmp102 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) - tmp25 = np.copy(ints.tmp148) - tmp25 += np.transpose(ints.tmp75, (0, 1, 3, 2)) - tmp25 += np.transpose(ints.tmp69, (0, 1, 3, 2)) * 2 - tmp23 = np.copy(ints.tmp158) - tmp23 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) - tmp21 = einsum(r1.a, (0,), ints.tmp158, (1, 2, 3, 0), (1, 2, 3)) - tmp45 = np.copy(f.aa.ov) - tmp45 += ints.tmp13 - tmp45 += ints.tmp9 - tmp41 = np.copy(ints.tmp158) - tmp41 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) - tmp43 = np.copy(ints.tmp160) - tmp43 += v.aabb.ooov - tmp39 = einsum(v.aaaa.ooov, (0, 1, 2, 3), r1.a, (3,), (0, 1, 2)) - tmp47 = np.copy(ints.tmp146) - tmp47 += ints.tmp67 * 2 - tmp125 = einsum(r2.bbb, (0, 1, 2), ints.tmp11, (3, 1), (3, 2, 0)) - tmp131 = einsum(r1.b, (0,), tmp130, (1, 2, 0, 3), (1, 2, 3)) - del tmp130 - tmp129 = einsum(r2.bbb, (0, 1, 2), tmp128, (3, 4, 2, 1), (3, 4, 0)) * -1 - del tmp128 - tmp127 = einsum(t1.bb, (0, 1), tmp126, (2, 0, 3), (2, 3, 1)) - del tmp126 - tmp112 = einsum(r1.b, (0,), v.bbbb.ovov, (1, 2, 3, 0), (1, 3, 2)) - tmp113 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovvv, (3, 0, 4, 1), (2, 3, 4)) - tmp105 = einsum(tmp104, (0, 1), r2.bbb, (2, 1, 3), (0, 3, 2)) * -2 - del tmp104 - tmp107 = einsum(r1.b, (0,), tmp106, (1, 2, 3, 0), (1, 2, 3)) - del tmp106 - tmp101 = einsum(tmp88, (0, 1, 2, 3), r2.aba, (3, 4, 0), (1, 2, 4)) - tmp100 = einsum(t1.bb, (0, 1), tmp99, (2, 0, 3), (2, 3, 1)) - del tmp99 - tmp103 = einsum(r2.bbb, (0, 1, 2), tmp102, (3, 2, 4, 1), (3, 4, 0)) * -2 - del tmp102 - tmp26 = einsum(r1.a, (0,), tmp25, (1, 2, 0, 3), (1, 2, 3)) - del tmp25 - tmp24 = einsum(tmp23, (0, 1, 2, 3), r2.aaa, (4, 3, 2), (0, 1, 4)) * -1 - del tmp23 - tmp20 = einsum(r2.aaa, (0, 1, 2), ints.tmp7, (3, 1), (3, 2, 0)) - tmp22 = einsum(tmp21, (0, 1, 2), t1.aa, (1, 3), (0, 2, 3)) - del tmp21 - tmp46 = einsum(r2.aaa, (0, 1, 2), tmp45, (3, 1), (2, 3, 0)) * -1 - del tmp45 - tmp42 = einsum(r2.aaa, (0, 1, 2), tmp41, (3, 2, 4, 1), (3, 4, 0)) * -1 - del tmp41 - tmp44 = einsum(tmp43, (0, 1, 2, 3), r2.bab, (3, 4, 2), (0, 1, 4)) * -0.5 - tmp40 = einsum(tmp39, (0, 1, 2), t1.aa, (1, 3), (0, 2, 3)) - del tmp39 - tmp48 = einsum(r1.a, (0,), tmp47, (1, 2, 3, 0), (1, 2, 3)) * 0.5 - del tmp47 - tmp53 = einsum(r1.a, (0,), v.aaaa.ovov, (1, 2, 3, 0), (1, 3, 2)) - tmp54 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), r2.aaa, (3, 1, 4), (4, 0, 2)) * -1 - tmp0 = np.copy(f.bb.ov) - tmp0 += ints.tmp12 - tmp0 += ints.tmp15 - tmp0 += ints.tmp11 * -1 - tmp119 = einsum(v.bbbb.oovv, (0, 1, 2, 3), r1.b, (3,), (0, 1, 2)) - tmp134 = np.copy(ints.tmp440) - tmp134 += ints.tmp385 * 2 - tmp123 = np.copy(ints.tmp290) - tmp123 += ints.tmp354 * 2 - tmp121 = np.copy(ints.tmp292) - tmp121 += ints.tmp352 - tmp121 += ints.tmp358 * 2 - tmp132 = np.copy(tmp125) * 2 - del tmp125 - tmp132 += np.transpose(tmp127, (1, 0, 2)) - del tmp127 - tmp132 += np.transpose(tmp129, (1, 0, 2)) * -2 - del tmp129 - tmp132 += np.transpose(tmp131, (1, 0, 2)) - del tmp131 - tmp97 = np.copy(f.bb.vv) * 0.5 - tmp97 += np.transpose(ints.tmp31, (1, 0)) * 0.5 - tmp97 += np.transpose(ints.tmp33, (1, 0)) * 0.5 - tmp97 += np.transpose(ints.tmp41, (1, 0)) * -1 - tmp97 += np.transpose(ints.tmp43, (1, 0)) * -0.5 - tmp114 = np.copy(tmp112) - del tmp112 - tmp114 += tmp113 * 2 - del tmp113 - tmp110 = np.copy(ints.tmp383) - tmp110 += ints.tmp387 * 0.5 - tmp110 += v.bbbb.ovvv * 0.5 - tmp95 = np.copy(ints.tmp291) - tmp95 += np.transpose(ints.tmp356, (0, 1, 3, 2)) * 2 - tmp95 += np.transpose(ints.tmp360, (0, 1, 3, 2)) - tmp108 = np.copy(np.transpose(tmp100, (1, 0, 2))) - del tmp100 - tmp108 += np.transpose(tmp101, (1, 0, 2)) * -1 - del tmp101 - tmp108 += np.transpose(tmp103, (1, 0, 2)) * -1 - del tmp103 - tmp108 += tmp105 * -1 - del tmp105 - tmp108 += np.transpose(tmp107, (1, 0, 2)) - del tmp107 - tmp1 = np.copy(f.aa.ov) - tmp1 += ints.tmp13 - tmp1 += ints.tmp9 - tmp1 += ints.tmp7 * -1 - tmp14 = einsum(r1.a, (0,), v.aaaa.oovv, (1, 2, 3, 0), (1, 2, 3)) - tmp27 = np.copy(np.transpose(tmp20, (1, 0, 2))) * 2 - del tmp20 - tmp27 += tmp22 - del tmp22 - tmp27 += tmp24 * -2 - del tmp24 - tmp27 += tmp26 - del tmp26 - tmp29 = np.copy(ints.tmp141) - tmp29 += ints.tmp61 * 2 - tmp18 = np.copy(ints.tmp146) - tmp18 += ints.tmp67 * 2 - tmp37 = np.copy(f.aa.vv) * 0.5 - tmp37 += np.transpose(ints.tmp4, (1, 0)) * 0.5 - tmp37 += np.transpose(ints.tmp6, (1, 0)) * 0.5 - tmp37 += np.transpose(ints.tmp20, (1, 0)) * -1 - tmp37 += np.transpose(ints.tmp22, (1, 0)) * -0.5 - tmp35 = np.copy(ints.tmp150) - tmp35 += ints.tmp73 - tmp35 += ints.tmp77 * 2 - tmp49 = np.copy(np.transpose(tmp40, (1, 0, 2))) * 0.5 - del tmp40 - tmp49 += np.transpose(tmp42, (1, 0, 2)) * -1 - del tmp42 - tmp49 += np.transpose(tmp44, (1, 0, 2)) - del tmp44 - tmp49 += np.transpose(tmp46, (1, 0, 2)) * -1 - del tmp46 - tmp49 += np.transpose(tmp48, (1, 0, 2)) - del tmp48 - tmp33 = np.copy(ints.tmp148) - tmp33 += np.transpose(ints.tmp69, (0, 1, 3, 2)) * 2 - tmp33 += np.transpose(ints.tmp75, (0, 1, 3, 2)) - tmp51 = np.copy(ints.tmp59) - tmp51 += ints.tmp63 * 0.5 - tmp51 += v.aaaa.ovvv * 0.5 - tmp55 = np.copy(tmp53) - del tmp53 - tmp55 += tmp54 * 2 - del tmp54 - tmp10 = einsum(r1.b, (0,), tmp0, (1, 0), (1,)) - tmp8 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.aba, (1, 3, 0), (2,)) - tmp9 = einsum(v.bbbb.ovov, (0, 1, 2, 3), r2.bbb, (1, 3, 2), (0,)) - tmp120 = einsum(t1.bb, (0, 1), tmp119, (2, 0, 3), (2, 1, 3)) - del tmp119 - tmp135 = einsum(r1.b, (0,), tmp134, (1, 2, 0, 3), (1, 2, 3)) - del tmp134 - tmp117 = einsum(r2.bbb, (0, 1, 2), ints.tmp32, (1, 3), (2, 3, 0)) - tmp124 = einsum(tmp123, (0, 1, 2, 3), r2.bbb, (4, 3, 1), (0, 2, 4)) * -1 - del tmp123 - tmp122 = einsum(tmp121, (0, 1, 2, 3), r2.aba, (2, 4, 0), (1, 3, 4)) - del tmp121 - tmp133 = einsum(tmp132, (0, 1, 2), t1.bb, (0, 3), (1, 2, 3)) - del tmp132 - tmp118 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 4, 2, 1), (3, 0, 4)) - tmp93 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.aba, (1, 4, 0), (2, 4, 3)) - tmp98 = einsum(r2.bbb, (0, 1, 2), tmp97, (1, 3), (2, 3, 0)) * -4 - del tmp97 - tmp94 = einsum(v.bbbb.oovv, (0, 1, 2, 3), r2.bbb, (4, 3, 1), (0, 4, 2)) - tmp115 = einsum(tmp114, (0, 1, 2), t1.bb, (1, 3), (0, 2, 3)) - del tmp114 - tmp111 = einsum(r1.b, (0,), tmp110, (1, 2, 3, 0), (1, 2, 3)) * 2 - del tmp110 - tmp92 = einsum(ints.tmp350, (0, 1, 2, 3), r2.aba, (2, 4, 0), (1, 3, 4)) - tmp96 = einsum(tmp95, (0, 1, 2, 3), r2.bbb, (4, 2, 1), (0, 3, 4)) * -2 - del tmp95 - tmp109 = einsum(tmp108, (0, 1, 2), t1.bb, (0, 3), (1, 2, 3)) - del tmp108 - tmp77 = einsum(r2.bab, (0, 1, 2), v.aabb.ovov, (3, 1, 4, 0), (3, 2, 4)) * -1 - tmp87 = np.copy(np.transpose(r2.aaa, (2, 0, 1))) - tmp87 += einsum(t1.aa, (0, 1), r1.a, (2,), (0, 2, 1)) * 0.5 - tmp71 = einsum(tmp1, (0, 1), t1.aa, (0, 2), (2, 1)) - tmp78 = np.copy(ints.tmp315) * -1 - tmp78 += np.transpose(ints.tmp315, (0, 2, 1, 3)) - tmp78 += v.bbbb.ooov - tmp78 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) * -1 - tmp4 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (3, 1, 2), (0,)) * -1 - tmp3 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (1, 3, 2), (0,)) - tmp5 = einsum(tmp1, (0, 1), r1.a, (1,), (0,)) - tmp63 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.aba, (1, 3, 4), (4, 0, 2)) - tmp74 = np.copy(np.transpose(r2.bbb, (2, 0, 1))) - tmp74 += einsum(r1.b, (0,), t1.bb, (1, 2), (1, 0, 2)) * 0.5 - tmp64 = np.copy(ints.tmp158) - tmp64 += np.transpose(ints.tmp158, (0, 2, 1, 3)) * -1 - tmp64 += v.aaaa.ooov * -1 - tmp64 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) - tmp13 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (4, 3, 2), (0, 4, 1)) - tmp15 = einsum(t1.aa, (0, 1), tmp14, (2, 0, 3), (2, 1, 3)) - del tmp14 - tmp28 = einsum(t1.aa, (0, 1), tmp27, (2, 0, 3), (2, 1, 3)) - del tmp27 - tmp30 = einsum(tmp29, (0, 1, 2, 3), r1.a, (2,), (0, 1, 3)) - del tmp29 - tmp19 = einsum(tmp18, (0, 1, 2, 3), r2.aaa, (4, 3, 1), (0, 4, 2)) * -1 - del tmp18 - tmp17 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (3, 4, 2), (0, 4, 1)) * -1 - tmp16 = einsum(ints.tmp71, (0, 1, 2, 3), r2.bab, (3, 4, 1), (0, 2, 4)) * -1 - tmp12 = einsum(ints.tmp5, (0, 1), r2.aaa, (2, 0, 3), (3, 1, 2)) - tmp32 = einsum(v.aaaa.oovv, (0, 1, 2, 3), r2.aaa, (4, 3, 1), (0, 4, 2)) - tmp38 = einsum(tmp37, (0, 1), r2.aaa, (2, 0, 3), (3, 2, 1)) * -4 - del tmp37 - tmp36 = einsum(r2.bab, (0, 1, 2), tmp35, (3, 2, 4, 0), (3, 1, 4)) * -1 - del tmp35 - tmp50 = einsum(t1.aa, (0, 1), tmp49, (0, 2, 3), (2, 1, 3)) * 2 - del tmp49 - tmp34 = einsum(tmp33, (0, 1, 2, 3), r2.aaa, (4, 2, 1), (0, 4, 3)) * -2 - del tmp33 - tmp52 = einsum(tmp51, (0, 1, 2, 3), r1.a, (3,), (0, 1, 2)) * 2 - del tmp51 - tmp56 = einsum(tmp55, (0, 1, 2), t1.aa, (1, 3), (0, 3, 2)) - del tmp55 - tmp137 = np.copy(ints.tmp423) - tmp137 += ints.tmp450 * -1 - tmp11 = np.copy(tmp8) * -1 - del tmp8 - tmp11 += tmp9 * 2 - del tmp9 - tmp11 += tmp10 - del tmp10 - tmp136 = np.copy(tmp117) * 2 - del tmp117 - tmp136 += tmp118 * 2 - del tmp118 - tmp136 += tmp120 - del tmp120 - tmp136 += tmp122 - del tmp122 - tmp136 += tmp124 * -2 - del tmp124 - tmp136 += tmp133 - del tmp133 - tmp136 += tmp135 - del tmp135 - tmp91 = np.copy(ints.tmp271) - tmp91 += ints.tmp294 * 2 - tmp91 += ints.tmp304 - tmp91 += ints.tmp313 - tmp91 += ints.tmp316 * 2 - tmp91 += ints.tmp317 - tmp91 += ints.tmp318 * 2 - tmp91 += ints.tmp319 - tmp91 += ints.tmp326 - tmp91 += ints.tmp327 - tmp91 += ints.tmp328 - tmp91 += ints.tmp334 * 2 - tmp91 += ints.tmp335 - tmp91 += ints.tmp337 - tmp91 += ints.tmp338 - tmp91 += ints.tmp361 - tmp91 += ints.tmp363 * 2 - tmp91 += f.bb.ov * -1 - tmp91 += ints.tmp12 * -1 - tmp91 += ints.tmp15 * -1 - tmp91 += ints.tmp286 * -1 - tmp91 += ints.tmp295 * -1 - tmp91 += ints.tmp303 * -1 - tmp91 += ints.tmp305 * -1 - tmp91 += ints.tmp325 * -1 - tmp91 += ints.tmp336 * -1 - tmp91 += ints.tmp340 * -1 - tmp91 += ints.tmp341 * -2 - tmp91 += ints.tmp362 * -1 - tmp91 += ints.tmp364 * -2 - tmp91 += ints.tmp365 * -1 - tmp91 += ints.tmp366 * -2 - tmp138 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 1, 4, 0), (2, 3, 4)) * -1 - tmp139 = np.copy(t2.bbbb) - tmp139 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - tmp116 = np.copy(tmp92) - del tmp92 - tmp116 += tmp93 - del tmp93 - tmp116 += tmp94 * 2 - del tmp94 - tmp116 += tmp96 * -1 - del tmp96 - tmp116 += tmp98 * -1 - del tmp98 - tmp116 += tmp109 - del tmp109 - tmp116 += tmp111 - del tmp111 - tmp116 += np.transpose(tmp115, (0, 2, 1)) - del tmp115 - tmp86 = np.copy(f.bb.oo) - tmp86 += np.transpose(ints.tmp273, (1, 0)) - tmp86 += np.transpose(ints.tmp274, (1, 0)) - tmp86 += ints.tmp287 - tmp86 += np.transpose(ints.tmp296, (1, 0)) * 2 - tmp86 += np.transpose(ints.tmp298, (1, 0)) - tmp86 += np.transpose(ints.tmp308, (1, 0)) - tmp86 += np.transpose(ints.tmp309, (1, 0)) - tmp86 += np.transpose(ints.tmp272, (1, 0)) * -1 - tmp86 += np.transpose(ints.tmp307, (1, 0)) * -1 - tmp82 = np.copy(np.transpose(r2.bab, (2, 1, 0))) * -1 - tmp82 += einsum(r1.a, (0,), t1.bb, (1, 2), (1, 0, 2)) - tmp80 = np.copy(np.transpose(r2.aaa, (2, 0, 1))) * 2 - tmp80 += einsum(t1.aa, (0, 1), r1.a, (2,), (0, 2, 1)) - tmp85 = np.copy(ints.tmp276) - tmp85 += ints.tmp289 - tmp85 += ints.tmp301 - tmp85 += ints.tmp344 - tmp85 += ints.tmp346 * 2 - tmp85 += np.transpose(v.aabb.vvov, (2, 0, 1, 3)) - tmp85 += ints.tmp263 * -1 - tmp85 += np.transpose(ints.tmp345, (0, 2, 1, 3)) * -1 - tmp81 = np.copy(ints.tmp292) - tmp81 += ints.tmp352 - tmp81 += ints.tmp358 * 2 - tmp81 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp81 += ints.tmp350 * -1 - tmp89 = einsum(v.aabb.vvov, (0, 1, 2, 3), r2.bab, (3, 1, 4), (4, 2, 0)) * -1 - tmp89 += einsum(tmp77, (0, 1, 2), t1.aa, (0, 3), (1, 2, 3)) * -1 - tmp89 += einsum(tmp88, (0, 1, 2, 3), tmp87, (0, 3, 4), (1, 2, 4)) * -2 - del tmp87 - tmp83 = np.copy(ints.tmp314) - tmp83 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) - tmp83 += ints.tmp266 * -1 - tmp90 = einsum(v.aabb.ovvv, (0, 1, 2, 3), r2.bab, (3, 1, 4), (0, 4, 2)) - tmp90 += einsum(r2.bab, (0, 1, 2), tmp88, (3, 4, 2, 1), (3, 4, 0)) * -1 - del tmp88 - tmp84 = np.copy(ints.tmp32) * 0.5 - tmp84 += np.transpose(ints.tmp41, (1, 0)) - tmp84 += np.transpose(ints.tmp43, (1, 0)) * 0.5 - tmp84 += f.bb.vv * -0.5 - tmp84 += np.transpose(ints.tmp31, (1, 0)) * -0.5 - tmp84 += np.transpose(ints.tmp33, (1, 0)) * -0.5 - tmp84 += einsum(tmp0, (0, 1), t1.bb, (0, 2), (1, 2)) * 0.5 - tmp72 = np.copy(np.transpose(ints.tmp20, (1, 0))) * 2 - tmp72 += np.transpose(ints.tmp22, (1, 0)) - tmp72 += ints.tmp5 - tmp72 += f.aa.vv * -1 - tmp72 += np.transpose(ints.tmp4, (1, 0)) * -1 - tmp72 += np.transpose(ints.tmp6, (1, 0)) * -1 - tmp72 += np.transpose(tmp71, (1, 0)) - del tmp71 - tmp79 = np.copy(np.transpose(ints.tmp291, (0, 1, 3, 2))) - tmp79 += ints.tmp356 * 2 - tmp79 += ints.tmp360 - tmp79 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp79 += ints.tmp290 * -1 - tmp79 += ints.tmp354 * -2 - tmp79 += v.bbbb.oovv * -1 - tmp79 += einsum(t1.bb, (0, 1), tmp78, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp78 - tmp6 = np.copy(tmp3) * 2 - del tmp3 - tmp6 += tmp4 - del tmp4 - tmp6 += tmp5 - del tmp5 - tmp73 = np.copy(ints.tmp205) - tmp73 += ints.tmp216 - tmp73 += ints.tmp220 - tmp73 += ints.tmp240 - tmp73 += ints.tmp242 * 2 - tmp73 += v.aabb.ovvv - tmp73 += ints.tmp196 * -1 - tmp73 += np.transpose(ints.tmp241, (0, 1, 3, 2)) * -1 - tmp62 = np.copy(ints.tmp101) - tmp62 += ints.tmp116 * 2 - tmp62 += ints.tmp117 - tmp62 += ints.tmp128 - tmp62 += ints.tmp129 - tmp62 += ints.tmp139 - tmp62 += ints.tmp152 * 2 - tmp62 += ints.tmp159 * 2 - tmp62 += ints.tmp161 - tmp62 += ints.tmp164 * 2 - tmp62 += ints.tmp165 - tmp62 += ints.tmp167 - tmp62 += ints.tmp186 - tmp62 += ints.tmp187 - tmp62 += ints.tmp79 * 2 - tmp62 += ints.tmp81 - tmp62 += ints.tmp98 - tmp62 += f.aa.ov * -1 - tmp62 += ints.tmp127 * -1 - tmp62 += ints.tmp136 * -1 - tmp62 += ints.tmp13 * -1 - tmp62 += ints.tmp153 * -1 - tmp62 += ints.tmp166 * -1 - tmp62 += ints.tmp168 * -1 - tmp62 += ints.tmp185 * -1 - tmp62 += ints.tmp50 * -2 - tmp62 += ints.tmp51 * -1 - tmp62 += ints.tmp80 * -2 - tmp62 += ints.tmp82 * -1 - tmp62 += ints.tmp83 * -2 - tmp62 += ints.tmp84 * -1 - tmp62 += ints.tmp9 * -1 - tmp66 = np.copy(np.transpose(r2.bbb, (2, 0, 1))) * 2 - tmp66 += einsum(r1.b, (0,), t1.bb, (1, 2), (1, 0, 2)) - tmp69 = np.copy(ints.tmp226) - tmp69 += v.aabb.oovv - tmp69 += ints.tmp199 * -1 - tmp58 = np.copy(f.aa.oo) - tmp58 += np.transpose(ints.tmp106, (1, 0)) - tmp58 += np.transpose(ints.tmp108, (1, 0)) - tmp58 += ints.tmp137 - tmp58 += np.transpose(ints.tmp154, (1, 0)) * 2 - tmp58 += np.transpose(ints.tmp156, (1, 0)) - tmp58 += np.transpose(ints.tmp175, (1, 0)) - tmp58 += np.transpose(ints.tmp177, (1, 0)) - tmp58 += np.transpose(ints.tmp104, (1, 0)) * -1 - tmp58 += np.transpose(ints.tmp173, (1, 0)) * -1 - tmp70 = np.copy(ints.tmp32) - tmp70 += np.transpose(ints.tmp41, (1, 0)) * 2 - tmp70 += np.transpose(ints.tmp43, (1, 0)) - tmp70 += f.bb.vv * -1 - tmp70 += np.transpose(ints.tmp31, (1, 0)) * -1 - tmp70 += np.transpose(ints.tmp33, (1, 0)) * -1 - tmp70 += einsum(tmp0, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp76 = einsum(r2.aba, (0, 1, 2), v.aabb.vvov, (3, 0, 4, 1), (2, 4, 3)) * -1 - tmp76 += einsum(tmp43, (0, 1, 2, 3), r2.aba, (4, 3, 1), (0, 2, 4)) - tmp75 = einsum(r2.aba, (0, 1, 2), v.aabb.ovvv, (3, 0, 4, 1), (2, 3, 4)) * -0.5 - tmp75 += einsum(tmp63, (0, 1, 2), t1.bb, (2, 3), (0, 1, 3)) * 0.5 - tmp75 += einsum(tmp43, (0, 1, 2, 3), tmp74, (2, 3, 4), (0, 1, 4)) * -1 - del tmp43, tmp74 - tmp65 = np.copy(np.transpose(ints.tmp148, (0, 1, 3, 2))) - tmp65 += ints.tmp69 * 2 - tmp65 += ints.tmp75 - tmp65 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp65 += ints.tmp146 * -1 - tmp65 += ints.tmp67 * -2 - tmp65 += v.aaaa.oovv * -1 - tmp65 += einsum(tmp64, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) * -1 - del tmp64 - tmp68 = np.copy(np.transpose(r2.aba, (2, 0, 1))) - tmp68 += einsum(r1.b, (0,), t1.aa, (1, 2), (1, 2, 0)) * -1 - tmp67 = np.copy(ints.tmp150) - tmp67 += ints.tmp73 - tmp67 += ints.tmp77 * 2 - tmp67 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp67 += ints.tmp71 * -1 - tmp61 = np.copy(t2.aaaa) - tmp61 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - tmp31 = np.copy(tmp12) * 2 - del tmp12 - tmp31 += tmp13 * 2 - del tmp13 - tmp31 += tmp15 - del tmp15 - tmp31 += tmp16 - del tmp16 - tmp31 += tmp17 - del tmp17 - tmp31 += np.transpose(tmp19, (0, 2, 1)) * -2 - del tmp19 - tmp31 += np.transpose(tmp28, (0, 2, 1)) - del tmp28 - tmp31 += tmp30 - del tmp30 - tmp59 = np.copy(ints.tmp118) - tmp59 += ints.tmp162 * -1 - tmp57 = np.copy(tmp32) * 2 - del tmp32 - tmp57 += np.transpose(tmp34, (0, 2, 1)) * -1 - del tmp34 - tmp57 += np.transpose(tmp36, (0, 2, 1)) - del tmp36 - tmp57 += np.transpose(tmp38, (0, 2, 1)) * -1 - del tmp38 - tmp57 += np.transpose(tmp50, (0, 2, 1)) - del tmp50 - tmp57 += tmp52 - del tmp52 - tmp57 += tmp56 - del tmp56 - tmp60 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (1, 3, 4), (4, 0, 2)) - tmp7 = np.copy(ints.tmp32) - tmp7 += np.transpose(ints.tmp41, (1, 0)) * 2 - tmp7 += np.transpose(ints.tmp43, (1, 0)) - tmp7 += f.bb.vv * -1 - tmp7 += np.transpose(ints.tmp31, (1, 0)) * -1 - tmp7 += np.transpose(ints.tmp33, (1, 0)) * -1 - tmp2 = np.copy(np.transpose(ints.tmp20, (1, 0))) * 2 - tmp2 += np.transpose(ints.tmp22, (1, 0)) - tmp2 += ints.tmp5 - tmp2 += f.aa.vv * -1 - tmp2 += np.transpose(ints.tmp4, (1, 0)) * -1 - tmp2 += np.transpose(ints.tmp6, (1, 0)) * -1 - r2new.bbb = einsum(v.bbbb.vvvv, (0, 1, 2, 3), r2.bbb, (3, 1, 4), (0, 2, 4)) * -2 - r2new.bbb += np.transpose(tmp116, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp116, (2, 1, 0)) - del tmp116 - r2new.bbb += np.transpose(tmp136, (1, 2, 0)) - r2new.bbb += np.transpose(tmp136, (2, 1, 0)) * -1 - del tmp136 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp86, (2, 3), (0, 1, 3)) * -2 - r2new.bbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp11, (1,), (2, 3, 0)) * 2 - r2new.bbb += einsum(tmp137, (0, 1, 2, 3), r1.b, (3,), (2, 1, 0)) * 2 - del tmp137 - r2new.bbb += einsum(tmp139, (0, 1, 2, 3), tmp138, (4, 0, 1), (3, 2, 4)) * -2 - del tmp139, tmp138 - r2new.bbb += einsum(r1.b, (0,), tmp91, (1, 2), (0, 2, 1)) * -1 - r2new.bbb += einsum(r1.b, (0,), tmp91, (1, 2), (2, 0, 1)) - r2new.bab = einsum(r2.bab, (0, 1, 2), v.aabb.vvvv, (3, 1, 4, 0), (4, 3, 2)) - r2new.bab += einsum(tmp77, (0, 1, 2), t2.abab, (0, 2, 3, 4), (4, 3, 1)) * -1 - del tmp77 - r2new.bab += einsum(tmp79, (0, 1, 2, 3), r2.bab, (3, 4, 1), (2, 4, 0)) - del tmp79 - r2new.bab += einsum(tmp80, (0, 1, 2), tmp81, (0, 3, 1, 4), (4, 2, 3)) - del tmp80, tmp81 - r2new.bab += einsum(tmp83, (0, 1, 2, 3), tmp82, (1, 3, 4), (4, 2, 0)) - del tmp83, tmp82 - r2new.bab += einsum(tmp72, (0, 1), r2.bab, (2, 0, 3), (2, 1, 3)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp84, (0, 3), (3, 1, 2)) * -2 - del tmp84 - r2new.bab += einsum(r1.a, (0,), tmp85, (1, 2, 0, 3), (3, 2, 1)) * -1 - del tmp85 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp86, (2, 3), (0, 1, 3)) * -1 - del tmp86 - r2new.bab += einsum(tmp6, (0,), t2.abab, (0, 1, 2, 3), (3, 2, 1)) - r2new.bab += einsum(t1.bb, (0, 1), tmp89, (2, 0, 3), (1, 3, 2)) - del tmp89 - r2new.bab += einsum(t1.aa, (0, 1), tmp90, (0, 2, 3), (3, 1, 2)) * -1 - del tmp90 - r2new.bab += einsum(r1.a, (0,), tmp91, (1, 2), (2, 0, 1)) - del tmp91 - r2new.aba = einsum(r2.aba, (0, 1, 2), v.aabb.vvvv, (3, 0, 4, 1), (3, 4, 2)) - r2new.aba += einsum(tmp63, (0, 1, 2), t2.abab, (1, 2, 3, 4), (3, 4, 0)) - del tmp63 - r2new.aba += einsum(tmp65, (0, 1, 2, 3), r2.aba, (3, 4, 1), (2, 4, 0)) - del tmp65 - r2new.aba += einsum(tmp66, (0, 1, 2), tmp67, (3, 0, 4, 1), (4, 2, 3)) - del tmp66, tmp67 - r2new.aba += einsum(tmp68, (0, 1, 2), tmp69, (3, 0, 4, 2), (1, 4, 3)) * -1 - del tmp68, tmp69 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp70, (1, 3), (0, 3, 2)) * -1 - del tmp70 - r2new.aba += einsum(tmp72, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - del tmp72 - r2new.aba += einsum(r1.b, (0,), tmp73, (1, 2, 3, 0), (2, 3, 1)) * -1 - del tmp73 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp58, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(tmp11, (0,), t2.abab, (1, 0, 2, 3), (2, 3, 1)) - r2new.aba += einsum(t1.aa, (0, 1), tmp75, (2, 0, 3), (1, 3, 2)) * 2 - del tmp75 - r2new.aba += einsum(t1.bb, (0, 1), tmp76, (2, 0, 3), (3, 1, 2)) - del tmp76 - r2new.aba += einsum(tmp62, (0, 1), r1.b, (2,), (1, 2, 0)) - r2new.aaa = einsum(r2.aaa, (0, 1, 2), v.aaaa.vvvv, (3, 1, 4, 0), (3, 4, 2)) * -2 - r2new.aaa += np.transpose(tmp31, (1, 2, 0)) - r2new.aaa += np.transpose(tmp31, (2, 1, 0)) * -1 - del tmp31 - r2new.aaa += np.transpose(tmp57, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp57, (2, 1, 0)) - del tmp57 - r2new.aaa += einsum(tmp58, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp58 - r2new.aaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp6, (1,), (2, 3, 0)) * 2 - r2new.aaa += einsum(tmp59, (0, 1, 2, 3), r1.a, (3,), (2, 1, 0)) * 2 - del tmp59 - r2new.aaa += einsum(tmp61, (0, 1, 2, 3), tmp60, (4, 0, 1), (3, 2, 4)) * -2 - del tmp61, tmp60 - r2new.aaa += einsum(r1.a, (0,), tmp62, (1, 2), (0, 2, 1)) * -1 - r2new.aaa += einsum(r1.a, (0,), tmp62, (1, 2), (2, 0, 1)) - del tmp62 - r1new.b = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovvv, (2, 1, 3, 0), (3,)) * 2 - r1new.b += einsum(v.aabb.ovvv, (0, 1, 2, 3), r2.aba, (1, 3, 0), (2,)) * -1 - r1new.b += einsum(tmp1, (0, 1), r2.aba, (1, 2, 0), (2,)) * -1 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp0, (2, 1), (0,)) * 2 - r1new.b += einsum(r1.b, (0,), tmp7, (0, 1), (1,)) * -1 - del tmp7 - r1new.b += einsum(t1.bb, (0, 1), tmp11, (0,), (1,)) * -1 - del tmp11 - r1new.a = einsum(v.aaaa.ovvv, (0, 1, 2, 3), r2.aaa, (3, 1, 0), (2,)) * 2 - r1new.a += einsum(v.aabb.vvov, (0, 1, 2, 3), r2.bab, (3, 1, 2), (0,)) * -1 - r1new.a += einsum(tmp0, (0, 1), r2.bab, (1, 2, 0), (2,)) * -1 - del tmp0 - r1new.a += einsum(tmp1, (0, 1), r2.aaa, (2, 1, 0), (2,)) * 2 - del tmp1 - r1new.a += einsum(r1.a, (0,), tmp2, (0, 1), (1,)) * -1 - del tmp2 - r1new.a += einsum(t1.aa, (0, 1), tmp6, (0,), (1,)) * -1 - del tmp6 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:52:01.173376. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp100 : array - tmp101 : array - tmp103 : array - tmp105 : array - tmp107 : array - tmp109 : array - tmp11 : array - tmp111 : array - tmp113 : array - tmp115 : array - tmp117 : array - tmp119 : array - tmp120 : array - tmp122 : array - tmp124 : array - tmp125 : array - tmp127 : array - tmp129 : array - tmp13 : array - tmp130 : array - tmp132 : array - tmp133 : array - tmp135 : array - tmp137 : array - tmp138 : array - tmp140 : array - tmp141 : array - tmp143 : array - tmp144 : array - tmp146 : array - tmp148 : array - tmp149 : array - tmp15 : array - tmp151 : array - tmp152 : array - tmp154 : array - tmp155 : array - tmp156 : array - tmp157 : array - tmp159 : array - tmp161 : array - tmp162 : array - tmp163 : array - tmp164 : array - tmp165 : array - tmp167 : array - tmp168 : array - tmp169 : array - tmp17 : array - tmp170 : array - tmp172 : array - tmp174 : array - tmp175 : array - tmp176 : array - tmp177 : array - tmp178 : array - tmp179 : array - tmp181 : array - tmp182 : array - tmp184 : array - tmp185 : array - tmp186 : array - tmp187 : array - tmp188 : array - tmp189 : array - tmp19 : array - tmp190 : array - tmp191 : array - tmp193 : array - tmp194 : array - tmp196 : array - tmp197 : array - tmp199 : array - tmp2 : array - tmp201 : array - tmp203 : array - tmp204 : array - tmp205 : array - tmp206 : array - tmp207 : array - tmp209 : array - tmp21 : array - tmp210 : array - tmp211 : array - tmp212 : array - tmp214 : array - tmp215 : array - tmp22 : array - tmp223 : array - tmp225 : array - tmp230 : array - tmp232 : array - tmp238 : array - tmp240 : array - tmp247 : array - tmp248 : array - tmp25 : array - tmp250 : array - tmp251 : array - tmp253 : array - tmp254 : array - tmp256 : array - tmp26 : array - tmp262 : array - tmp264 : array - tmp27 : array - tmp275 : array - tmp277 : array - tmp279 : array - tmp28 : array - tmp281 : array - tmp283 : array - tmp285 : array - tmp291 : array - tmp292 : array - tmp294 : array - tmp295 : array - tmp297 : array - tmp299 : array - tmp30 : array - tmp301 : array - tmp306 : array - tmp307 : array - tmp309 : array - tmp314 : array - tmp315 : array - tmp317 : array - tmp319 : array - tmp32 : array - tmp320 : array - tmp324 : array - tmp325 : array - tmp327 : array - tmp328 : array - tmp333 : array - tmp334 : array - tmp336 : array - tmp34 : array - tmp346 : array - tmp349 : array - tmp351 : array - tmp353 : array - tmp355 : array - tmp357 : array - tmp359 : array - tmp36 : array - tmp361 : array - tmp37 : array - tmp38 : array - tmp39 : array - tmp391 : array - tmp393 : array - tmp4 : array - tmp41 : array - tmp422 : array - tmp425 : array - tmp426 : array - tmp428 : array - tmp43 : array - tmp430 : array - tmp432 : array - tmp434 : array - tmp436 : array - tmp438 : array - tmp449 : array - tmp45 : array - tmp451 : array - tmp453 : array - tmp46 : array - tmp47 : array - tmp49 : array - tmp5 : array - tmp51 : array - tmp53 : array - tmp55 : array - tmp57 : array - tmp59 : array - tmp61 : array - tmp62 : array - tmp64 : array - tmp65 : array - tmp66 : array - tmp68 : array - tmp7 : array - tmp70 : array - tmp72 : array - tmp74 : array - tmp76 : array - tmp78 : array - tmp8 : array - tmp80 : array - tmp82 : array - tmp83 : array - tmp85 : array - tmp86 : array - tmp88 : array - tmp89 : array - tmp90 : array - tmp92 : array - tmp94 : array - tmp96 : array - tmp98 : array - """ - - tmp45 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp119 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp41 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp38 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp39 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp36 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp89 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 1), (0, 3)) - tmp32 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 0, 1), (2, 3)) - tmp82 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 1, 0, 3), (2, 3)) - tmp214 = einsum(tmp45, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp333 = einsum(t1.bb, (0, 1), tmp119, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp327 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 2, 0, 1)) - tmp324 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp174 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp176 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp314 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp151 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp306 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp124 = einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp211 = einsum(tmp41, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp209 = einsum(tmp38, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp156 = einsum(tmp39, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp205 = einsum(t1.bb, (0, 1), tmp36, (2, 1), (0, 2)) - tmp203 = einsum(tmp89, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp155 = einsum(t1.aa, (0, 1), tmp32, (2, 1), (0, 2)) - tmp154 = einsum(tmp82, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp196 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp193 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp190 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp188 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp186 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (0, 2, 3, 1), (2, 3)) - tmp184 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 1), (2, 3)) - tmp181 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) - tmp178 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp169 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp167 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp27 = einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 1), (2, 3)) - tmp163 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 3, 0, 1), (2, 3)) - tmp161 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 0, 3, 1), (2, 3)) - tmp26 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - tmp25 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (1, 3), (0, 2)) - tmp148 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp49 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 3), (4, 0)) - tmp143 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp140 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp47 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 1, 3), (4, 0)) - tmp21 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp1 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp453 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp451 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp449 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 4, 1, 3), (2, 4)) - tmp438 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp436 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp434 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp432 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp430 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp428 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp426 = einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (0, 3, 2, 4)) - tmp425 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp422 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (4, 2, 5, 1)) - tmp393 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (4, 1)) - tmp391 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 3, 1, 4), (2, 4)) * -1 - tmp361 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp359 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp357 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp355 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp353 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 1, 5), (0, 4, 3, 5)) - tmp351 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp349 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - tmp346 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 1), (4, 0, 2, 3)) - tmp336 = einsum(tmp214, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 3, 4)) - tmp334 = einsum(tmp333, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp328 = einsum(t1.aa, (0, 1), tmp327, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp325 = einsum(tmp324, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) - tmp320 = einsum(t1.aa, (0, 1), tmp174, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp319 = einsum(t1.aa, (0, 1), tmp176, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp317 = einsum(tmp314, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp315 = einsum(t1.bb, (0, 1), tmp314, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp309 = einsum(t1.aa, (0, 1), tmp151, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp307 = einsum(t1.bb, (0, 1), tmp306, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp301 = einsum(t2.abab, (0, 1, 2, 3), tmp45, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp299 = einsum(tmp124, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 4, 2, 5)) - tmp297 = einsum(tmp124, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 2, 5)) - tmp295 = einsum(tmp119, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp294 = einsum(tmp119, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp292 = einsum(t2.bbbb, (0, 1, 2, 3), tmp119, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp291 = einsum(t2.abab, (0, 1, 2, 3), tmp119, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp285 = einsum(tmp38, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp283 = einsum(tmp38, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp281 = einsum(tmp36, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp279 = einsum(t2.abab, (0, 1, 2, 3), tmp36, (4, 3), (0, 1, 4, 2)) - tmp277 = einsum(tmp89, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp275 = einsum(tmp89, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp264 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 5, 3), (0, 1, 5, 4)) - tmp262 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp256 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 3, 5)) - tmp254 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovoo, (1, 3, 4, 5), (0, 4, 5, 2)) - tmp253 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp251 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp250 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp248 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp247 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp240 = einsum(t1.aa, (0, 1), v.aabb.vvoo, (2, 1, 3, 4), (0, 3, 4, 2)) - tmp238 = einsum(t1.bb, (0, 1), v.bbbb.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp232 = einsum(t1.aa, (0, 1), v.aabb.oooo, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp230 = einsum(t1.bb, (0, 1), v.bbbb.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp225 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp223 = einsum(f.bb.ov, (0, 1), t2.abab, (2, 3, 4, 1), (2, 0, 3, 4)) - tmp215 = einsum(t1.bb, (0, 1), tmp214, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp212 = einsum(t1.aa, (0, 1), tmp211, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp210 = einsum(t1.bb, (0, 1), tmp209, (2, 0), (2, 1)) - tmp207 = einsum(t1.aa, (0, 1), tmp156, (2, 0), (2, 1)) - tmp206 = einsum(t1.bb, (0, 1), tmp205, (2, 0), (2, 1)) - tmp204 = einsum(t1.bb, (0, 1), tmp203, (2, 0), (2, 1)) - tmp201 = einsum(t1.aa, (0, 1), tmp155, (2, 0), (2, 1)) - tmp199 = einsum(t1.aa, (0, 1), tmp154, (2, 0), (2, 1)) - tmp197 = einsum(tmp196, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp194 = einsum(t1.aa, (0, 1), tmp193, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp191 = einsum(t1.aa, (0, 1), tmp190, (2, 1), (0, 2)) - tmp189 = einsum(tmp188, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp187 = einsum(tmp186, (0, 1), t1.bb, (2, 0), (2, 1)) - tmp185 = einsum(tmp184, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp182 = einsum(tmp181, (0, 1), t1.aa, (2, 0), (2, 1)) - tmp179 = einsum(t1.aa, (0, 1), tmp178, (2, 1), (0, 2)) - tmp177 = einsum(t1.bb, (0, 1), tmp176, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp175 = einsum(t1.bb, (0, 1), tmp174, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp172 = einsum(t1.aa, (0, 1), tmp169, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp170 = einsum(tmp169, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 3, 4)) - tmp168 = einsum(t1.bb, (0, 1), tmp167, (2, 0), (2, 1)) - tmp165 = einsum(t1.aa, (0, 1), tmp27, (2, 0), (2, 1)) - tmp164 = einsum(t1.bb, (0, 1), tmp163, (2, 0), (2, 1)) - tmp162 = einsum(t1.bb, (0, 1), tmp161, (2, 0), (2, 1)) - tmp159 = einsum(t1.aa, (0, 1), tmp26, (2, 0), (2, 1)) - tmp157 = einsum(tmp25, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp152 = einsum(t1.bb, (0, 1), tmp151, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp149 = einsum(t1.aa, (0, 1), tmp148, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp146 = einsum(t1.aa, (0, 1), tmp49, (2, 0), (2, 1)) - tmp144 = einsum(t1.bb, (0, 1), tmp143, (2, 0), (2, 1)) - tmp141 = einsum(t1.bb, (0, 1), tmp140, (2, 0), (2, 1)) - tmp138 = einsum(t1.aa, (0, 1), tmp47, (2, 0), (2, 1)) - tmp137 = einsum(tmp124, (0, 1, 2, 3), t2.abab, (4, 2, 3, 5), (4, 0, 1, 5)) - tmp135 = einsum(tmp45, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp133 = einsum(tmp45, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp132 = einsum(tmp41, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 1, 4, 5)) - tmp130 = einsum(t2.aaaa, (0, 1, 2, 3), tmp41, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp129 = einsum(t2.abab, (0, 1, 2, 3), tmp41, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp127 = einsum(t2.aaaa, (0, 1, 2, 3), tmp41, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp125 = einsum(tmp124, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) - tmp122 = einsum(t2.abab, (0, 1, 2, 3), tmp45, (4, 0, 1, 3), (4, 2)) - tmp120 = einsum(tmp119, (0, 1, 2, 3), t2.bbbb, (2, 1, 4, 3), (0, 4)) - tmp117 = einsum(tmp41, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) * -1 - tmp115 = einsum(tmp39, (0, 1), t2.abab, (2, 3, 1, 4), (2, 0, 3, 4)) - tmp113 = einsum(tmp39, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp111 = einsum(tmp32, (0, 1), t2.abab, (2, 3, 1, 4), (2, 0, 3, 4)) - tmp109 = einsum(tmp32, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp107 = einsum(tmp82, (0, 1), t2.abab, (2, 3, 1, 4), (2, 0, 3, 4)) - tmp105 = einsum(tmp82, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp103 = einsum(tmp38, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp101 = einsum(tmp38, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp100 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (0, 2), (1, 3)) - tmp98 = einsum(t2.aaaa, (0, 1, 2, 3), tmp39, (1, 3), (0, 2)) - tmp96 = einsum(tmp36, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp94 = einsum(tmp36, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp92 = einsum(tmp89, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp90 = einsum(t2.abab, (0, 1, 2, 3), tmp89, (1, 3), (0, 2)) - tmp88 = einsum(tmp32, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp86 = einsum(tmp32, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp85 = einsum(tmp82, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp83 = einsum(t2.aaaa, (0, 1, 2, 3), tmp82, (1, 3), (0, 2)) - tmp80 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp78 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp76 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - tmp74 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp72 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 0, 3, 1), (4, 2)) * -1 - tmp70 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 1, 3), (4, 2)) - tmp68 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp66 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp65 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (4, 3, 1, 5), (4, 0, 2, 5)) - tmp64 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 1, 4, 5)) - tmp62 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp61 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.abab, (1, 4, 3, 5), (0, 2, 4, 5)) - tmp59 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp57 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp55 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) - tmp53 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t2.bbbb, (1, 2, 4, 3), (0, 4)) - tmp51 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (2, 1, 4, 3), (0, 4)) * -1 - tmp46 = einsum(v.aabb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp43 = einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp37 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) - tmp34 = einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 0, 3, 1), (2, 3)) - tmp30 = einsum(t1.bb, (0, 1), v.aabb.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp28 = einsum(t1.aa, (0, 1), v.aaaa.oooo, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp22 = einsum(t1.bb, (0, 1), tmp21, (0, 2), (2, 1)) - tmp19 = einsum(t1.aa, (0, 1), tmp1, (0, 2), (2, 1)) - tmp17 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (4, 2), (4, 0, 1, 3)) - tmp15 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp13 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp11 = einsum(f.bb.ov, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp10 = einsum(f.aa.ov, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp8 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp7 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp5 = einsum(t1.aa, (0, 1), f.aa.vv, (2, 1), (0, 2)) - tmp4 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp2 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp100": tmp100, f"tmp101": tmp101, f"tmp103": tmp103, f"tmp105": tmp105, f"tmp107": tmp107, f"tmp109": tmp109, f"tmp11": tmp11, f"tmp111": tmp111, f"tmp113": tmp113, f"tmp115": tmp115, f"tmp117": tmp117, f"tmp119": tmp119, f"tmp120": tmp120, f"tmp122": tmp122, f"tmp124": tmp124, f"tmp125": tmp125, f"tmp127": tmp127, f"tmp129": tmp129, f"tmp13": tmp13, f"tmp130": tmp130, f"tmp132": tmp132, f"tmp133": tmp133, f"tmp135": tmp135, f"tmp137": tmp137, f"tmp138": tmp138, f"tmp140": tmp140, f"tmp141": tmp141, f"tmp143": tmp143, f"tmp144": tmp144, f"tmp146": tmp146, f"tmp148": tmp148, f"tmp149": tmp149, f"tmp15": tmp15, f"tmp151": tmp151, f"tmp152": tmp152, f"tmp154": tmp154, f"tmp155": tmp155, f"tmp156": tmp156, f"tmp157": tmp157, f"tmp159": tmp159, f"tmp161": tmp161, f"tmp162": tmp162, f"tmp163": tmp163, f"tmp164": tmp164, f"tmp165": tmp165, f"tmp167": tmp167, f"tmp168": tmp168, f"tmp169": tmp169, f"tmp17": tmp17, f"tmp170": tmp170, f"tmp172": tmp172, f"tmp174": tmp174, f"tmp175": tmp175, f"tmp176": tmp176, f"tmp177": tmp177, f"tmp178": tmp178, f"tmp179": tmp179, f"tmp181": tmp181, f"tmp182": tmp182, f"tmp184": tmp184, f"tmp185": tmp185, f"tmp186": tmp186, f"tmp187": tmp187, f"tmp188": tmp188, f"tmp189": tmp189, f"tmp19": tmp19, f"tmp190": tmp190, f"tmp191": tmp191, f"tmp193": tmp193, f"tmp194": tmp194, f"tmp196": tmp196, f"tmp197": tmp197, f"tmp199": tmp199, f"tmp2": tmp2, f"tmp201": tmp201, f"tmp203": tmp203, f"tmp204": tmp204, f"tmp205": tmp205, f"tmp206": tmp206, f"tmp207": tmp207, f"tmp209": tmp209, f"tmp21": tmp21, f"tmp210": tmp210, f"tmp211": tmp211, f"tmp212": tmp212, f"tmp214": tmp214, f"tmp215": tmp215, f"tmp22": tmp22, f"tmp223": tmp223, f"tmp225": tmp225, f"tmp230": tmp230, f"tmp232": tmp232, f"tmp238": tmp238, f"tmp240": tmp240, f"tmp247": tmp247, f"tmp248": tmp248, f"tmp25": tmp25, f"tmp250": tmp250, f"tmp251": tmp251, f"tmp253": tmp253, f"tmp254": tmp254, f"tmp256": tmp256, f"tmp26": tmp26, f"tmp262": tmp262, f"tmp264": tmp264, f"tmp27": tmp27, f"tmp275": tmp275, f"tmp277": tmp277, f"tmp279": tmp279, f"tmp28": tmp28, f"tmp281": tmp281, f"tmp283": tmp283, f"tmp285": tmp285, f"tmp291": tmp291, f"tmp292": tmp292, f"tmp294": tmp294, f"tmp295": tmp295, f"tmp297": tmp297, f"tmp299": tmp299, f"tmp30": tmp30, f"tmp301": tmp301, f"tmp306": tmp306, f"tmp307": tmp307, f"tmp309": tmp309, f"tmp314": tmp314, f"tmp315": tmp315, f"tmp317": tmp317, f"tmp319": tmp319, f"tmp32": tmp32, f"tmp320": tmp320, f"tmp324": tmp324, f"tmp325": tmp325, f"tmp327": tmp327, f"tmp328": tmp328, f"tmp333": tmp333, f"tmp334": tmp334, f"tmp336": tmp336, f"tmp34": tmp34, f"tmp346": tmp346, f"tmp349": tmp349, f"tmp351": tmp351, f"tmp353": tmp353, f"tmp355": tmp355, f"tmp357": tmp357, f"tmp359": tmp359, f"tmp36": tmp36, f"tmp361": tmp361, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp39": tmp39, f"tmp391": tmp391, f"tmp393": tmp393, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp422": tmp422, f"tmp425": tmp425, f"tmp426": tmp426, f"tmp428": tmp428, f"tmp43": tmp43, f"tmp430": tmp430, f"tmp432": tmp432, f"tmp434": tmp434, f"tmp436": tmp436, f"tmp438": tmp438, f"tmp449": tmp449, f"tmp45": tmp45, f"tmp451": tmp451, f"tmp453": tmp453, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp51": tmp51, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp61": tmp61, f"tmp62": tmp62, f"tmp64": tmp64, f"tmp65": tmp65, f"tmp66": tmp66, f"tmp68": tmp68, f"tmp7": tmp7, f"tmp70": tmp70, f"tmp72": tmp72, f"tmp74": tmp74, f"tmp76": tmp76, f"tmp78": tmp78, f"tmp8": tmp8, f"tmp80": tmp80, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp85": tmp85, f"tmp86": tmp86, f"tmp88": tmp88, f"tmp89": tmp89, f"tmp90": tmp90, f"tmp92": tmp92, f"tmp94": tmp94, f"tmp96": tmp96, f"tmp98": tmp98} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:52:01.379390. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp53 = einsum(t2.bbbb, (0, 1, 2, 3), r2.bbb, (0, 1, 3), (2,)) - tmp52 = einsum(r2.aba, (0, 1, 2), t2.abab, (0, 1, 2, 3), (3,)) - tmp90 = np.copy(f.bb.oo) - tmp90 += ints.tmp163 - tmp90 += ints.tmp167 - tmp90 += ints.tmp205 - tmp90 += ints.tmp209 - tmp90 += np.transpose(ints.tmp21, (1, 0)) - tmp88 = np.copy(ints.tmp425) - tmp88 += np.transpose(ints.tmp430, (0, 1, 3, 2)) * 2 - tmp86 = np.copy(ints.tmp426) - tmp86 += ints.tmp432 - tmp86 += ints.tmp436 * 2 - tmp62 = np.copy(f.bb.ov) - tmp62 += ints.tmp36 - tmp62 += ints.tmp38 - tmp62 += ints.tmp89 * -1 - tmp76 = np.copy(ints.tmp119) - tmp76 += np.transpose(ints.tmp119, (0, 2, 1, 3)) * -1 - tmp49 = einsum(t1.bb, (0, 1), r2.bbb, (2, 3, 1), (2, 3, 0)) - tmp78 = np.copy(v.bbbb.ooov) - tmp78 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) * -1 - tmp47 = einsum(t1.aa, (0, 1), r2.aba, (2, 3, 1), (2, 0, 3)) - tmp81 = np.copy(ints.tmp140) * 2 - tmp81 += ints.tmp143 - tmp81 += ints.tmp161 * -1 - tmp81 += ints.tmp203 * -1 - tmp54 = np.copy(tmp52) * -0.5 - del tmp52 - tmp54 += tmp53 - del tmp53 - tmp74 = np.copy(ints.tmp324) - tmp74 += np.transpose(ints.tmp434, (0, 1, 3, 2)) * 2 - tmp74 += np.transpose(ints.tmp438, (0, 1, 3, 2)) - tmp40 = np.copy(f.aa.ov) - tmp40 += ints.tmp32 - tmp40 += ints.tmp39 - tmp40 += ints.tmp82 * -1 - tmp36 = np.copy(ints.tmp47) * 2 - tmp36 += ints.tmp49 - tmp36 += ints.tmp154 * -1 - tmp36 += ints.tmp25 * -1 - tmp22 = einsum(t1.bb, (0, 1), r2.bab, (2, 3, 1), (3, 2, 0)) * -1 - tmp27 = np.copy(ints.tmp193) - tmp27 += np.transpose(ints.tmp355, (0, 1, 3, 2)) * 2 - tmp27 += np.transpose(ints.tmp359, (0, 1, 3, 2)) - tmp34 = np.copy(v.aaaa.ooov) - tmp34 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) * -1 - tmp31 = einsum(r2.aaa, (0, 1, 2), t1.aa, (3, 2), (0, 1, 3)) - tmp29 = np.copy(ints.tmp349) - tmp29 += ints.tmp357 - tmp29 += ints.tmp361 * 2 - tmp25 = einsum(r2.aaa, (0, 1, 2), t2.aaaa, (0, 1, 3, 2), (3,)) - tmp32 = np.copy(ints.tmp41) * -1 - tmp32 += np.transpose(ints.tmp41, (0, 2, 1, 3)) - tmp12 = einsum(r2.bab, (0, 1, 2), t2.abab, (1, 0, 3, 2), (3,)) * -1 - tmp14 = np.copy(ints.tmp346) - tmp14 += np.transpose(ints.tmp351, (0, 1, 3, 2)) * 2 - tmp16 = np.copy(f.aa.oo) - tmp16 += ints.tmp155 - tmp16 += ints.tmp156 - tmp16 += np.transpose(ints.tmp1, (1, 0)) - tmp16 += ints.tmp26 - tmp16 += ints.tmp27 - tmp84 = einsum(ints.tmp119, (0, 1, 2, 3), r1.b, (0,), (1, 2, 3)) - tmp91 = einsum(tmp90, (0, 1), r2.bbb, (2, 0, 3), (2, 1, 3)) * -1 - del tmp90 - tmp85 = einsum(v.bbbb.ovov, (0, 1, 2, 3), r2.bbb, (4, 2, 3), (4, 0, 1)) - tmp89 = einsum(tmp88, (0, 1, 2, 3), r2.bbb, (4, 0, 3), (4, 1, 2)) * -1 - del tmp88 - tmp87 = einsum(tmp86, (0, 1, 2, 3), r2.aba, (0, 4, 2), (4, 1, 3)) - del tmp86 - tmp63 = einsum(t1.bb, (0, 1), tmp62, (0, 2), (1, 2)) - tmp68 = einsum(ints.tmp428, (0, 1, 2, 3), r2.aba, (0, 4, 2), (1, 4, 3)) - tmp77 = einsum(tmp49, (0, 1, 2), tmp76, (0, 3, 2, 4), (1, 3, 4)) * 2 - del tmp76 - tmp70 = einsum(ints.tmp314, (0, 1, 2, 3), r2.bbb, (1, 0, 4), (2, 3, 4)) * -1 - tmp79 = einsum(tmp78, (0, 1, 2, 3), tmp49, (0, 4, 2), (4, 1, 3)) * 2 - del tmp78 - tmp73 = einsum(tmp47, (0, 1, 2), v.aabb.ooov, (1, 0, 3, 4), (2, 3, 4)) - tmp82 = einsum(r2.bbb, (0, 1, 2), tmp81, (1, 3), (0, 3, 2)) * -2 - del tmp81 - tmp80 = einsum(tmp54, (0,), v.bbbb.ovov, (1, 0, 2, 3), (1, 2, 3)) * 2 - tmp67 = einsum(r1.b, (0,), v.bbbb.ooov, (1, 0, 2, 3), (1, 2, 3)) - tmp71 = einsum(r2.bbb, (0, 1, 2), v.bbbb.oovv, (3, 1, 4, 2), (0, 3, 4)) - tmp72 = einsum(tmp47, (0, 1, 2), ints.tmp45, (0, 1, 3, 4), (3, 2, 4)) - tmp75 = einsum(tmp74, (0, 1, 2, 3), r2.bbb, (4, 0, 3), (4, 1, 2)) * -2 - del tmp74 - tmp69 = einsum(r2.aba, (0, 1, 2), v.aabb.ovov, (0, 2, 3, 4), (1, 3, 4)) - tmp41 = einsum(t1.aa, (0, 1), tmp40, (0, 2), (1, 2)) - tmp37 = einsum(tmp36, (0, 1), r2.aaa, (2, 0, 3), (2, 1, 3)) * -2 - del tmp36 - tmp20 = einsum(ints.tmp169, (0, 1, 2, 3), r2.aaa, (0, 1, 4), (2, 3, 4)) - tmp21 = einsum(r2.aaa, (0, 1, 2), v.aaaa.oovv, (3, 1, 4, 2), (0, 3, 4)) - tmp24 = einsum(tmp22, (0, 1, 2), ints.tmp124, (3, 1, 2, 4), (3, 0, 4)) - tmp23 = einsum(v.aabb.ovoo, (0, 1, 2, 3), tmp22, (4, 3, 2), (4, 0, 1)) - tmp28 = einsum(tmp27, (0, 1, 2, 3), r2.aaa, (4, 0, 3), (4, 1, 2)) * -2 - del tmp27 - tmp35 = einsum(tmp31, (0, 1, 2), tmp34, (0, 3, 2, 4), (1, 3, 4)) * 2 - del tmp34 - tmp30 = einsum(tmp29, (0, 1, 2, 3), r2.bab, (1, 4, 3), (4, 0, 2)) * -1 - del tmp29 - tmp19 = einsum(r1.a, (0,), v.aaaa.ooov, (1, 0, 2, 3), (1, 2, 3)) - tmp26 = einsum(tmp25, (0,), v.aaaa.ovov, (1, 2, 3, 0), (1, 3, 2)) * -1 - tmp33 = einsum(tmp32, (0, 1, 2, 3), tmp31, (0, 4, 1), (4, 2, 3)) * 2 - del tmp32 - tmp11 = einsum(r2.bab, (0, 1, 2), v.aabb.ovov, (3, 4, 0, 2), (1, 3, 4)) * -1 - tmp13 = einsum(tmp12, (0,), v.aaaa.ovov, (1, 2, 3, 0), (1, 3, 2)) - tmp8 = einsum(r1.a, (0,), ints.tmp41, (0, 1, 2, 3), (1, 2, 3)) - tmp15 = einsum(r2.aaa, (0, 1, 2), tmp14, (1, 3, 4, 2), (0, 3, 4)) * -1 - del tmp14 - tmp10 = einsum(r2.bab, (0, 1, 2), ints.tmp353, (3, 0, 4, 2), (3, 1, 4)) * -1 - tmp17 = einsum(r2.aaa, (0, 1, 2), tmp16, (1, 3), (0, 3, 2)) * -1 - del tmp16 - tmp9 = einsum(v.aaaa.ovov, (0, 1, 2, 3), r2.aaa, (4, 2, 3), (4, 0, 1)) - tmp93 = np.copy(ints.tmp306) - tmp93 += ints.tmp333 - tmp93 += np.transpose(v.bbbb.oooo, (0, 2, 3, 1)) * -1 - tmp92 = np.copy(tmp84) - del tmp84 - tmp92 += tmp85 * 2 - del tmp85 - tmp92 += np.transpose(tmp87, (1, 0, 2)) - del tmp87 - tmp92 += np.transpose(tmp89, (1, 0, 2)) * -2 - del tmp89 - tmp92 += np.transpose(tmp91, (1, 0, 2)) * -2 - del tmp91 - tmp64 = np.copy(np.transpose(ints.tmp186, (1, 0))) - tmp64 += ints.tmp449 * 2 - tmp64 += ints.tmp451 - tmp64 += f.bb.vv * -1 - tmp64 += ints.tmp184 * -1 - tmp64 += ints.tmp188 * -1 - tmp64 += tmp63 - del tmp63 - tmp83 = np.copy(tmp67) - del tmp67 - tmp83 += tmp68 - del tmp68 - tmp83 += tmp69 - del tmp69 - tmp83 += tmp70 * 2 - del tmp70 - tmp83 += tmp71 * 2 - del tmp71 - tmp83 += tmp72 - del tmp72 - tmp83 += tmp73 * -1 - del tmp73 - tmp83 += np.transpose(tmp75, (1, 0, 2)) * -1 - del tmp75 - tmp83 += np.transpose(tmp77, (1, 0, 2)) - del tmp77 - tmp83 += tmp79 - del tmp79 - tmp83 += np.transpose(tmp80, (1, 0, 2)) * -1 - del tmp80 - tmp83 += np.transpose(tmp82, (1, 0, 2)) - del tmp82 - tmp58 = np.copy(ints.tmp151) - tmp58 += ints.tmp174 - tmp58 += np.transpose(ints.tmp176, (1, 0, 2, 3)) - tmp58 += ints.tmp214 - tmp58 += v.aabb.oooo - tmp4 = np.copy(f.aa.oo) - tmp4 += ints.tmp155 - tmp4 += ints.tmp156 - tmp4 += np.transpose(ints.tmp1, (1, 0)) - tmp4 += np.transpose(ints.tmp26, (1, 0)) - tmp4 += np.transpose(ints.tmp27, (1, 0)) - tmp4 += ints.tmp47 * 2 - tmp4 += ints.tmp49 - tmp4 += ints.tmp154 * -1 - tmp4 += ints.tmp25 * -1 - tmp61 = np.copy(ints.tmp45) - tmp61 += v.aabb.ooov - tmp55 = np.copy(ints.tmp324) - tmp55 += np.transpose(ints.tmp434, (0, 1, 3, 2)) * 2 - tmp55 += np.transpose(ints.tmp438, (0, 1, 3, 2)) - tmp55 += np.transpose(v.bbbb.ovov, (0, 2, 3, 1)) - tmp55 += ints.tmp425 * -1 - tmp55 += np.transpose(ints.tmp430, (0, 1, 3, 2)) * -2 - tmp55 += v.bbbb.oovv * -1 - tmp66 = np.copy(tmp25) - del tmp25 - tmp66 += tmp12 * 0.5 - del tmp12 - tmp59 = np.copy(ints.tmp119) - tmp59 += np.transpose(ints.tmp119, (0, 2, 1, 3)) * -1 - tmp59 += v.bbbb.ooov * -1 - tmp59 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) - tmp57 = np.copy(ints.tmp196) - tmp57 += v.aabb.oovv - tmp57 += ints.tmp453 * -1 - tmp60 = np.copy(ints.tmp45) - tmp60 += v.aabb.ooov - tmp56 = np.copy(ints.tmp426) - tmp56 += ints.tmp432 - tmp56 += ints.tmp436 * 2 - tmp56 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp56 += ints.tmp428 * -1 - tmp65 = np.copy(f.bb.oo) - tmp65 += ints.tmp140 * 2 - tmp65 += ints.tmp143 - tmp65 += ints.tmp163 - tmp65 += ints.tmp167 - tmp65 += ints.tmp205 - tmp65 += ints.tmp209 - tmp65 += np.transpose(ints.tmp21, (1, 0)) - tmp65 += ints.tmp161 * -1 - tmp65 += ints.tmp203 * -1 - tmp51 = np.copy(f.aa.oo) - tmp51 += ints.tmp155 - tmp51 += ints.tmp156 - tmp51 += np.transpose(ints.tmp1, (1, 0)) - tmp51 += ints.tmp26 - tmp51 += ints.tmp27 - tmp51 += ints.tmp47 * 2 - tmp51 += ints.tmp49 - tmp51 += ints.tmp154 * -1 - tmp51 += ints.tmp25 * -1 - tmp46 = np.copy(ints.tmp151) - tmp46 += np.transpose(ints.tmp174, (0, 1, 3, 2)) - tmp46 += ints.tmp176 - tmp46 += ints.tmp214 - tmp46 += v.aabb.oooo - tmp42 = np.copy(np.transpose(ints.tmp181, (1, 0))) - tmp42 += ints.tmp391 * 2 - tmp42 += ints.tmp393 - tmp42 += f.aa.vv * -1 - tmp42 += ints.tmp178 * -1 - tmp42 += ints.tmp190 * -1 - tmp42 += tmp41 - del tmp41 - tmp43 = np.copy(ints.tmp193) - tmp43 += np.transpose(ints.tmp355, (0, 1, 3, 2)) * 2 - tmp43 += np.transpose(ints.tmp359, (0, 1, 3, 2)) - tmp43 += np.transpose(v.aaaa.ovov, (0, 2, 3, 1)) - tmp43 += ints.tmp346 * -1 - tmp43 += np.transpose(ints.tmp351, (0, 1, 3, 2)) * -2 - tmp43 += v.aaaa.oovv * -1 - tmp45 = np.copy(ints.tmp327) - tmp45 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) - tmp45 += ints.tmp422 * -1 - tmp50 = np.copy(ints.tmp124) - tmp50 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp44 = np.copy(ints.tmp349) - tmp44 += ints.tmp357 - tmp44 += ints.tmp361 * 2 - tmp44 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp44 += ints.tmp353 * -1 - tmp48 = np.copy(ints.tmp41) * -1 - tmp48 += np.transpose(ints.tmp41, (0, 2, 1, 3)) - tmp48 += v.aaaa.ooov - tmp48 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) * -1 - tmp7 = np.copy(f.bb.oo) - tmp7 += ints.tmp140 * 2 - tmp7 += ints.tmp143 - tmp7 += np.transpose(ints.tmp163, (1, 0)) - tmp7 += np.transpose(ints.tmp167, (1, 0)) - tmp7 += ints.tmp205 - tmp7 += ints.tmp209 - tmp7 += np.transpose(ints.tmp21, (1, 0)) - tmp7 += ints.tmp161 * -1 - tmp7 += ints.tmp203 * -1 - tmp39 = np.copy(ints.tmp148) - tmp39 += ints.tmp211 - tmp39 += np.transpose(v.aaaa.oooo, (0, 2, 3, 1)) * -1 - tmp38 = np.copy(tmp19) - del tmp19 - tmp38 += tmp20 * 2 - del tmp20 - tmp38 += tmp21 * 2 - del tmp21 - tmp38 += tmp23 - del tmp23 - tmp38 += tmp24 * -1 - del tmp24 - tmp38 += tmp26 * 2 - del tmp26 - tmp38 += np.transpose(tmp28, (1, 0, 2)) * -1 - del tmp28 - tmp38 += np.transpose(tmp30, (1, 0, 2)) - del tmp30 - tmp38 += np.transpose(tmp33, (1, 0, 2)) - del tmp33 - tmp38 += tmp35 - del tmp35 - tmp38 += np.transpose(tmp37, (1, 0, 2)) - del tmp37 - tmp18 = np.copy(tmp8) - del tmp8 - tmp18 += tmp9 * 2 - del tmp9 - tmp18 += tmp10 - del tmp10 - tmp18 += tmp11 - del tmp11 - tmp18 += tmp13 - del tmp13 - tmp18 += np.transpose(tmp15, (1, 0, 2)) * -2 - del tmp15 - tmp18 += np.transpose(tmp17, (1, 0, 2)) * -2 - del tmp17 - tmp2 = np.copy(ints.tmp120) - tmp2 += ints.tmp125 * 0.5 - tmp2 += ints.tmp141 - tmp2 += ints.tmp144 * 0.5 - tmp2 += ints.tmp164 * 0.5 - tmp2 += ints.tmp168 * 0.5 - tmp2 += ints.tmp187 * 0.5 - tmp2 += ints.tmp206 * 0.5 - tmp2 += ints.tmp210 * 0.5 - tmp2 += ints.tmp22 * 0.5 - tmp2 += ints.tmp37 * 0.5 - tmp2 += ints.tmp4 * 0.5 - tmp2 += ints.tmp53 - tmp2 += ints.tmp55 * 0.5 - tmp2 += ints.tmp72 - tmp2 += ints.tmp85 * 0.5 - tmp2 += ints.tmp92 - tmp2 += f.bb.ov * -0.5 - tmp2 += ints.tmp100 * -0.5 - tmp2 += ints.tmp103 * -1 - tmp2 += ints.tmp10 * -0.5 - tmp2 += ints.tmp13 * -1 - tmp2 += ints.tmp162 * -0.5 - tmp2 += ints.tmp185 * -0.5 - tmp2 += ints.tmp189 * -0.5 - tmp2 += ints.tmp204 * -0.5 - tmp2 += ints.tmp36 * -0.5 - tmp2 += ints.tmp38 * -0.5 - tmp2 += ints.tmp74 * -0.5 - tmp2 += ints.tmp7 * -0.5 - tmp2 += ints.tmp88 * -0.5 - tmp2 += ints.tmp96 * -1 - tmp3 = np.copy(ints.tmp117) - tmp3 += ints.tmp122 * 0.5 - tmp3 += ints.tmp138 - tmp3 += ints.tmp146 * 0.5 - tmp3 += ints.tmp159 * 0.5 - tmp3 += ints.tmp165 * 0.5 - tmp3 += ints.tmp182 * 0.5 - tmp3 += ints.tmp19 * 0.5 - tmp3 += ints.tmp201 * 0.5 - tmp3 += ints.tmp207 * 0.5 - tmp3 += ints.tmp2 * 0.5 - tmp3 += ints.tmp34 * 0.5 - tmp3 += ints.tmp51 - tmp3 += ints.tmp57 * 0.5 - tmp3 += ints.tmp70 - tmp3 += ints.tmp83 - tmp3 += ints.tmp90 * 0.5 - tmp3 += f.aa.ov * -0.5 - tmp3 += ints.tmp101 * -0.5 - tmp3 += ints.tmp11 * -0.5 - tmp3 += ints.tmp157 * -0.5 - tmp3 += ints.tmp179 * -0.5 - tmp3 += ints.tmp191 * -0.5 - tmp3 += ints.tmp199 * -0.5 - tmp3 += ints.tmp32 * -0.5 - tmp3 += ints.tmp39 * -0.5 - tmp3 += ints.tmp5 * -0.5 - tmp3 += ints.tmp76 * -0.5 - tmp3 += ints.tmp86 * -1 - tmp3 += ints.tmp8 * -1 - tmp3 += ints.tmp94 * -0.5 - tmp3 += ints.tmp98 * -1 - tmp6 = np.copy(np.transpose(ints.tmp225, (1, 2, 0, 3))) - tmp6 += np.transpose(ints.tmp230, (1, 2, 0, 3)) - tmp6 += np.transpose(ints.tmp238, (0, 2, 1, 3)) - tmp6 += np.transpose(ints.tmp251, (0, 2, 1, 3)) * 2 - tmp6 += np.transpose(ints.tmp256, (0, 2, 1, 3)) - tmp6 += ints.tmp281 - tmp6 += ints.tmp285 - tmp6 += ints.tmp295 * 2 - tmp6 += ints.tmp307 - tmp6 += ints.tmp315 - tmp6 += ints.tmp334 - tmp6 += ints.tmp119 * -1 - tmp6 += ints.tmp248 * -2 - tmp6 += ints.tmp262 * -1 - tmp6 += ints.tmp277 * -1 - tmp6 += ints.tmp292 * -2 - tmp6 += ints.tmp299 * -1 - tmp6 += np.transpose(ints.tmp317, (0, 2, 1, 3)) * -1 - tmp6 += ints.tmp325 * -1 - tmp6 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) * -1 - tmp5 = np.copy(ints.tmp124) - tmp5 += np.transpose(ints.tmp223, (0, 2, 1, 3)) - tmp5 += np.transpose(ints.tmp240, (0, 2, 1, 3)) - tmp5 += np.transpose(ints.tmp250, (0, 2, 1, 3)) - tmp5 += np.transpose(ints.tmp254, (0, 2, 1, 3)) * 2 - tmp5 += ints.tmp264 - tmp5 += ints.tmp279 - tmp5 += ints.tmp283 - tmp5 += ints.tmp291 - tmp5 += ints.tmp297 * 2 - tmp5 += ints.tmp328 - tmp5 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp5 += np.transpose(ints.tmp232, (0, 2, 1, 3)) * -1 - tmp5 += ints.tmp247 * -1 - tmp5 += ints.tmp253 * -1 - tmp5 += ints.tmp275 * -1 - tmp5 += ints.tmp294 * -1 - tmp5 += ints.tmp301 * -1 - tmp5 += ints.tmp309 * -1 - tmp5 += ints.tmp319 * -1 - tmp5 += np.transpose(ints.tmp320, (0, 2, 1, 3)) * -1 - tmp5 += ints.tmp336 * -1 - tmp0 = np.copy(ints.tmp111) - tmp0 += ints.tmp115 - tmp0 += ints.tmp129 - tmp0 += ints.tmp135 * 2 - tmp0 += np.transpose(ints.tmp17, (1, 0, 2, 3)) - tmp0 += ints.tmp197 - tmp0 += ints.tmp45 - tmp0 += np.transpose(ints.tmp46, (1, 0, 2, 3)) - tmp0 += np.transpose(ints.tmp64, (1, 0, 2, 3)) - tmp0 += np.transpose(ints.tmp68, (1, 0, 2, 3)) * 2 - tmp0 += ints.tmp80 - tmp0 += v.aabb.ooov - tmp0 += ints.tmp107 * -1 - tmp0 += ints.tmp132 * -1 - tmp0 += ints.tmp137 * -1 - tmp0 += ints.tmp152 * -1 - tmp0 += ints.tmp175 * -1 - tmp0 += np.transpose(ints.tmp177, (1, 0, 2, 3)) * -1 - tmp0 += ints.tmp215 * -1 - tmp0 += np.transpose(ints.tmp30, (1, 0, 2, 3)) * -1 - tmp0 += ints.tmp61 * -1 - tmp0 += ints.tmp65 * -1 - tmp1 = np.copy(ints.tmp109) - tmp1 += ints.tmp113 - tmp1 += ints.tmp130 * 2 - tmp1 += ints.tmp149 - tmp1 += np.transpose(ints.tmp15, (1, 2, 0, 3)) - tmp1 += ints.tmp170 - tmp1 += ints.tmp212 - tmp1 += np.transpose(ints.tmp28, (1, 2, 0, 3)) - tmp1 += np.transpose(ints.tmp43, (0, 2, 1, 3)) - tmp1 += np.transpose(ints.tmp62, (0, 2, 1, 3)) * 2 - tmp1 += np.transpose(ints.tmp66, (0, 2, 1, 3)) - tmp1 += ints.tmp105 * -1 - tmp1 += ints.tmp127 * -2 - tmp1 += ints.tmp133 * -1 - tmp1 += np.transpose(ints.tmp172, (0, 2, 1, 3)) * -1 - tmp1 += ints.tmp194 * -1 - tmp1 += ints.tmp41 * -1 - tmp1 += ints.tmp59 * -2 - tmp1 += ints.tmp78 * -1 - tmp1 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) * -1 - r2new.bbb = np.copy(tmp83) * -1 - r2new.bbb += np.transpose(tmp83, (1, 0, 2)) - del tmp83 - r2new.bbb += tmp92 - r2new.bbb += np.transpose(tmp92, (1, 0, 2)) * -1 - del tmp92 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp93, (0, 1, 3, 4), (3, 4, 2)) * 2 - del tmp93 - r2new.bbb += einsum(tmp64, (0, 1), r2.bbb, (2, 3, 0), (2, 3, 1)) * -2 - r2new.bbb += einsum(tmp62, (0, 1), r1.b, (2,), (2, 0, 1)) - r2new.bbb += einsum(r1.b, (0,), tmp62, (1, 2), (1, 0, 2)) * -1 - r2new.bab = einsum(r2.bab, (0, 1, 2), tmp55, (0, 3, 4, 2), (3, 1, 4)) - del tmp55 - r2new.bab += einsum(r2.aaa, (0, 1, 2), tmp56, (1, 3, 2, 4), (3, 0, 4)) * -2 - del tmp56 - r2new.bab += einsum(tmp57, (0, 1, 2, 3), r2.bab, (4, 0, 2), (4, 1, 3)) * -1 - del tmp57 - r2new.bab += einsum(tmp58, (0, 1, 2, 3), r2.bab, (2, 0, 4), (3, 1, 4)) - del tmp58 - r2new.bab += einsum(tmp22, (0, 1, 2), tmp59, (1, 3, 2, 4), (3, 0, 4)) - del tmp59 - r2new.bab += einsum(tmp60, (0, 1, 2, 3), tmp22, (0, 4, 2), (4, 1, 3)) * -1 - del tmp22, tmp60 - r2new.bab += einsum(tmp31, (0, 1, 2), tmp61, (0, 2, 3, 4), (3, 1, 4)) * -2 - del tmp31 - r2new.bab += einsum(tmp64, (0, 1), r2.bab, (2, 3, 0), (2, 3, 1)) * -1 - del tmp64 - r2new.bab += einsum(tmp65, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -1 - del tmp65 - r2new.bab += einsum(tmp4, (0, 1), r2.bab, (2, 0, 3), (2, 1, 3)) * -1 - r2new.bab += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp66, (1,), (2, 0, 3)) * 2 - del tmp66 - r2new.bab += einsum(r1.a, (0,), tmp61, (0, 1, 2, 3), (2, 1, 3)) - del tmp61 - r2new.bab += einsum(r1.a, (0,), tmp62, (1, 2), (1, 0, 2)) * -1 - del tmp62 - r2new.aba = einsum(tmp43, (0, 1, 2, 3), r2.aba, (0, 4, 3), (1, 4, 2)) - del tmp43 - r2new.aba += einsum(tmp44, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (0, 4, 2)) * -2 - del tmp44 - r2new.aba += einsum(tmp45, (0, 1, 2, 3), r2.aba, (4, 0, 2), (4, 1, 3)) * -1 - del tmp45 - r2new.aba += einsum(tmp46, (0, 1, 2, 3), r2.aba, (0, 2, 4), (1, 3, 4)) - del tmp46 - r2new.aba += einsum(tmp47, (0, 1, 2), tmp48, (0, 1, 3, 4), (3, 2, 4)) * -1 - del tmp48 - r2new.aba += einsum(tmp50, (0, 1, 2, 3), tmp49, (1, 4, 2), (0, 4, 3)) * -2 - del tmp49 - r2new.aba += einsum(tmp50, (0, 1, 2, 3), tmp47, (4, 0, 1), (4, 2, 3)) - del tmp47 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp42, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(tmp7, (0, 1), r2.aba, (2, 0, 3), (2, 1, 3)) * -1 - r2new.aba += einsum(tmp51, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - del tmp51 - r2new.aba += einsum(tmp54, (0,), v.aabb.ovov, (1, 2, 3, 0), (1, 3, 2)) * 2 - del tmp54 - r2new.aba += einsum(r1.b, (0,), tmp50, (1, 0, 2, 3), (1, 2, 3)) - del tmp50 - r2new.aba += einsum(tmp40, (0, 1), r1.b, (2,), (0, 2, 1)) * -1 - r2new.aaa = np.copy(tmp18) - r2new.aaa += np.transpose(tmp18, (1, 0, 2)) * -1 - del tmp18 - r2new.aaa += tmp38 * -1 - r2new.aaa += np.transpose(tmp38, (1, 0, 2)) - del tmp38 - r2new.aaa += einsum(tmp39, (0, 1, 2, 3), r2.aaa, (1, 0, 4), (2, 3, 4)) * -2 - del tmp39 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp42, (2, 3), (0, 1, 3)) * -2 - del tmp42 - r2new.aaa += einsum(r1.a, (0,), tmp40, (1, 2), (0, 1, 2)) - r2new.aaa += einsum(r1.a, (0,), tmp40, (1, 2), (1, 0, 2)) * -1 - del tmp40 - r1new.b = einsum(tmp5, (0, 1, 2, 3), r2.aba, (0, 1, 3), (2,)) - del tmp5 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp6, (1, 0, 3, 2), (3,)) * -2 - del tmp6 - r1new.b += einsum(tmp3, (0, 1), r2.aba, (0, 2, 1), (2,)) * 2 - r1new.b += einsum(tmp2, (0, 1), r2.bbb, (2, 0, 1), (2,)) * -4 - r1new.b += einsum(r1.b, (0,), tmp7, (0, 1), (1,)) * -1 - del tmp7 - r1new.a = einsum(r2.bab, (0, 1, 2), tmp0, (1, 3, 0, 2), (3,)) - del tmp0 - r1new.a += einsum(tmp1, (0, 1, 2, 3), r2.aaa, (1, 0, 3), (2,)) * -2 - del tmp1 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp2, (0, 2), (1,)) * 2 - del tmp2 - r1new.a += einsum(tmp3, (0, 1), r2.aaa, (2, 0, 1), (2,)) * -4 - del tmp3 - r1new.a += einsum(r1.a, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:55:46.551398. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp10 : array - tmp100 : array - tmp101 : array - tmp103 : array - tmp11 : array - tmp111 : array - tmp112 : array - tmp114 : array - tmp115 : array - tmp117 : array - tmp118 : array - tmp120 : array - tmp121 : array - tmp123 : array - tmp125 : array - tmp127 : array - tmp128 : array - tmp13 : array - tmp130 : array - tmp131 : array - tmp133 : array - tmp134 : array - tmp136 : array - tmp137 : array - tmp139 : array - tmp141 : array - tmp142 : array - tmp144 : array - tmp145 : array - tmp147 : array - tmp149 : array - tmp150 : array - tmp151 : array - tmp153 : array - tmp154 : array - tmp156 : array - tmp157 : array - tmp158 : array - tmp159 : array - tmp160 : array - tmp161 : array - tmp163 : array - tmp164 : array - tmp169 : array - tmp171 : array - tmp173 : array - tmp174 : array - tmp175 : array - tmp176 : array - tmp177 : array - tmp178 : array - tmp179 : array - tmp181 : array - tmp183 : array - tmp185 : array - tmp186 : array - tmp187 : array - tmp188 : array - tmp19 : array - tmp190 : array - tmp191 : array - tmp193 : array - tmp194 : array - tmp195 : array - tmp196 : array - tmp197 : array - tmp198 : array - tmp2 : array - tmp20 : array - tmp200 : array - tmp201 : array - tmp22 : array - tmp226 : array - tmp228 : array - tmp23 : array - tmp230 : array - tmp232 : array - tmp238 : array - tmp240 : array - tmp246 : array - tmp247 : array - tmp249 : array - tmp250 : array - tmp252 : array - tmp254 : array - tmp256 : array - tmp26 : array - tmp27 : array - tmp276 : array - tmp278 : array - tmp28 : array - tmp284 : array - tmp285 : array - tmp287 : array - tmp288 : array - tmp29 : array - tmp290 : array - tmp292 : array - tmp294 : array - tmp305 : array - tmp307 : array - tmp309 : array - tmp31 : array - tmp310 : array - tmp33 : array - tmp34 : array - tmp35 : array - tmp36 : array - tmp4 : array - tmp43 : array - tmp45 : array - tmp47 : array - tmp49 : array - tmp5 : array - tmp51 : array - tmp53 : array - tmp55 : array - tmp57 : array - tmp59 : array - tmp61 : array - tmp63 : array - tmp65 : array - tmp67 : array - tmp69 : array - tmp7 : array - tmp71 : array - tmp73 : array - tmp74 : array - tmp76 : array - tmp77 : array - tmp79 : array - tmp8 : array - tmp81 : array - tmp82 : array - tmp83 : array - tmp85 : array - tmp86 : array - tmp88 : array - tmp89 : array - tmp90 : array - tmp92 : array - tmp94 : array - tmp96 : array - tmp98 : array - """ - - tmp35 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp36 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp33 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp89 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 1), (0, 3)) - tmp29 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 0, 1), (2, 3)) - tmp82 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 1, 0, 3), (2, 3)) - tmp117 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp114 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 2, 1)) - tmp200 = einsum(t1.bb, (0, 1), tmp35, (2, 1), (0, 2)) - tmp197 = einsum(t1.aa, (0, 1), tmp36, (2, 1), (0, 2)) - tmp195 = einsum(t1.bb, (0, 1), tmp33, (2, 1), (0, 2)) - tmp193 = einsum(tmp89, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp190 = einsum(t1.aa, (0, 1), tmp29, (2, 1), (0, 2)) - tmp187 = einsum(tmp82, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp28 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp177 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp175 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (0, 2, 3, 1), (2, 3)) - tmp173 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 1), (2, 3)) - tmp27 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) - tmp26 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp163 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp160 = einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 1), (2, 3)) - tmp158 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 3, 0, 1), (2, 3)) - tmp156 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 0, 3, 1), (2, 3)) - tmp153 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - tmp150 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t1.aa, (1, 3), (0, 2)) - tmp136 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 3), (4, 0)) - tmp133 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp130 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp127 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp120 = einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 4, 1), (2, 0, 4, 3)) - tmp111 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 2, 1)) - tmp22 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp19 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp310 = einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (0, 3, 2, 4)) - tmp309 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp307 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp305 = einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp294 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 1, 5), (4, 0, 5, 3)) - tmp292 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp290 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp288 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 5), (0, 4, 2, 5)) - tmp287 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp285 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp284 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp278 = einsum(tmp117, (0, 1, 2, 3), t2.abab, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp276 = einsum(t2.bbbb, (0, 1, 2, 3), tmp114, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp256 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 5), (0, 4, 3, 5)) - tmp254 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 5, 2, 3)) - tmp252 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp250 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp249 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ovvv, (1, 4, 5, 3), (0, 2, 4, 5)) - tmp247 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp246 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ovvv, (1, 3, 4, 5), (0, 2, 4, 5)) - tmp240 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp238 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp232 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp230 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 4, 1, 3), (2, 4)) - tmp228 = einsum(t1.aa, (0, 1), v.aabb.vvvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp226 = einsum(v.bbbb.vvvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp201 = einsum(t1.bb, (0, 1), tmp200, (2, 0), (2, 1)) - tmp198 = einsum(t1.aa, (0, 1), tmp197, (2, 0), (2, 1)) - tmp196 = einsum(t1.bb, (0, 1), tmp195, (2, 0), (2, 1)) - tmp194 = einsum(t1.bb, (0, 1), tmp193, (2, 0), (2, 1)) - tmp191 = einsum(tmp190, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp188 = einsum(t1.aa, (0, 1), tmp187, (2, 0), (2, 1)) - tmp186 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - tmp185 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 2, 0, 1)) - tmp183 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp181 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t1.aa, (4, 1), (4, 0, 2, 3)) - tmp179 = einsum(t1.aa, (0, 1), tmp28, (2, 1), (0, 2)) - tmp178 = einsum(tmp177, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp176 = einsum(t1.bb, (0, 1), tmp175, (1, 2), (0, 2)) - tmp174 = einsum(tmp173, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp171 = einsum(t1.aa, (0, 1), tmp27, (1, 2), (0, 2)) - tmp169 = einsum(t1.aa, (0, 1), tmp26, (2, 1), (0, 2)) - tmp164 = einsum(t1.bb, (0, 1), tmp163, (2, 0), (2, 1)) - tmp161 = einsum(tmp160, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp159 = einsum(t1.bb, (0, 1), tmp158, (2, 0), (2, 1)) - tmp157 = einsum(t1.bb, (0, 1), tmp156, (2, 0), (2, 1)) - tmp154 = einsum(tmp153, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp151 = einsum(tmp150, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp149 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (4, 2, 5, 1)) - tmp147 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp145 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp144 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 1, 5), (0, 4, 3, 5)) - tmp142 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 1), (4, 0, 5, 3)) - tmp141 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp139 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp137 = einsum(t1.aa, (0, 1), tmp136, (2, 0), (2, 1)) - tmp134 = einsum(t1.bb, (0, 1), tmp133, (2, 0), (2, 1)) - tmp131 = einsum(t1.bb, (0, 1), tmp130, (2, 0), (2, 1)) - tmp128 = einsum(tmp127, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp125 = einsum(tmp120, (0, 1, 2, 3), t2.abab, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp123 = einsum(t2.aaaa, (0, 1, 2, 3), tmp111, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp121 = einsum(tmp120, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) - tmp118 = einsum(tmp117, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp115 = einsum(tmp114, (0, 1, 2, 3), t2.bbbb, (2, 1, 4, 3), (0, 4)) - tmp112 = einsum(t2.aaaa, (0, 1, 2, 3), tmp111, (4, 1, 0, 3), (4, 2)) - tmp103 = einsum(t2.bbbb, (0, 1, 2, 3), tmp35, (1, 3), (0, 2)) - tmp101 = einsum(t2.abab, (0, 1, 2, 3), tmp35, (1, 3), (0, 2)) - tmp100 = einsum(tmp36, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp98 = einsum(tmp36, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp96 = einsum(t2.bbbb, (0, 1, 2, 3), tmp33, (1, 3), (0, 2)) - tmp94 = einsum(tmp33, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp92 = einsum(tmp89, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp90 = einsum(t2.abab, (0, 1, 2, 3), tmp89, (1, 3), (0, 2)) - tmp88 = einsum(tmp29, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp86 = einsum(tmp29, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp85 = einsum(tmp82, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp83 = einsum(t2.aaaa, (0, 1, 2, 3), tmp82, (1, 3), (0, 2)) - tmp81 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 4, 5, 3), (1, 2, 4, 5)) - tmp79 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.vvov, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp77 = einsum(v.aabb.vvov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 5, 0, 1)) - tmp76 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovvv, (0, 4, 5, 2), (1, 4, 5, 3)) - tmp74 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 5, 1, 2)) - tmp73 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovvv, (0, 2, 4, 5), (1, 4, 5, 3)) - tmp71 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp69 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - tmp67 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp65 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 0, 3, 1), (4, 2)) * -1 - tmp63 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 3, 1), (4, 2)) * -1 - tmp61 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 4, 5), (2, 4, 1, 5)) - tmp59 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp57 = einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp55 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) - tmp53 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t2.bbbb, (1, 2, 4, 3), (0, 4)) - tmp51 = einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) - tmp49 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (4, 1)) - tmp47 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 3, 1, 4), (2, 4)) * -1 - tmp45 = einsum(t1.bb, (0, 1), v.aabb.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp43 = einsum(t1.aa, (0, 1), v.aaaa.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp34 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) - tmp31 = einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 0, 3, 1), (2, 3)) - tmp23 = einsum(t1.bb, (0, 1), tmp22, (0, 2), (2, 1)) - tmp20 = einsum(t1.aa, (0, 1), tmp19, (0, 2), (2, 1)) - tmp13 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp11 = einsum(f.bb.ov, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp10 = einsum(f.aa.ov, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp8 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp7 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp5 = einsum(t1.aa, (0, 1), f.aa.vv, (2, 1), (0, 2)) - tmp4 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp2 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - - return {f"tmp10": tmp10, f"tmp100": tmp100, f"tmp101": tmp101, f"tmp103": tmp103, f"tmp11": tmp11, f"tmp111": tmp111, f"tmp112": tmp112, f"tmp114": tmp114, f"tmp115": tmp115, f"tmp117": tmp117, f"tmp118": tmp118, f"tmp120": tmp120, f"tmp121": tmp121, f"tmp123": tmp123, f"tmp125": tmp125, f"tmp127": tmp127, f"tmp128": tmp128, f"tmp13": tmp13, f"tmp130": tmp130, f"tmp131": tmp131, f"tmp133": tmp133, f"tmp134": tmp134, f"tmp136": tmp136, f"tmp137": tmp137, f"tmp139": tmp139, f"tmp141": tmp141, f"tmp142": tmp142, f"tmp144": tmp144, f"tmp145": tmp145, f"tmp147": tmp147, f"tmp149": tmp149, f"tmp150": tmp150, f"tmp151": tmp151, f"tmp153": tmp153, f"tmp154": tmp154, f"tmp156": tmp156, f"tmp157": tmp157, f"tmp158": tmp158, f"tmp159": tmp159, f"tmp160": tmp160, f"tmp161": tmp161, f"tmp163": tmp163, f"tmp164": tmp164, f"tmp169": tmp169, f"tmp171": tmp171, f"tmp173": tmp173, f"tmp174": tmp174, f"tmp175": tmp175, f"tmp176": tmp176, f"tmp177": tmp177, f"tmp178": tmp178, f"tmp179": tmp179, f"tmp181": tmp181, f"tmp183": tmp183, f"tmp185": tmp185, f"tmp186": tmp186, f"tmp187": tmp187, f"tmp188": tmp188, f"tmp19": tmp19, f"tmp190": tmp190, f"tmp191": tmp191, f"tmp193": tmp193, f"tmp194": tmp194, f"tmp195": tmp195, f"tmp196": tmp196, f"tmp197": tmp197, f"tmp198": tmp198, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp200": tmp200, f"tmp201": tmp201, f"tmp22": tmp22, f"tmp226": tmp226, f"tmp228": tmp228, f"tmp23": tmp23, f"tmp230": tmp230, f"tmp232": tmp232, f"tmp238": tmp238, f"tmp240": tmp240, f"tmp246": tmp246, f"tmp247": tmp247, f"tmp249": tmp249, f"tmp250": tmp250, f"tmp252": tmp252, f"tmp254": tmp254, f"tmp256": tmp256, f"tmp26": tmp26, f"tmp27": tmp27, f"tmp276": tmp276, f"tmp278": tmp278, f"tmp28": tmp28, f"tmp284": tmp284, f"tmp285": tmp285, f"tmp287": tmp287, f"tmp288": tmp288, f"tmp29": tmp29, f"tmp290": tmp290, f"tmp292": tmp292, f"tmp294": tmp294, f"tmp305": tmp305, f"tmp307": tmp307, f"tmp309": tmp309, f"tmp31": tmp31, f"tmp310": tmp310, f"tmp33": tmp33, f"tmp34": tmp34, f"tmp35": tmp35, f"tmp36": tmp36, f"tmp4": tmp4, f"tmp43": tmp43, f"tmp45": tmp45, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp51": tmp51, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp61": tmp61, f"tmp63": tmp63, f"tmp65": tmp65, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp7": tmp7, f"tmp71": tmp71, f"tmp73": tmp73, f"tmp74": tmp74, f"tmp76": tmp76, f"tmp77": tmp77, f"tmp79": tmp79, f"tmp8": tmp8, f"tmp81": tmp81, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp85": tmp85, f"tmp86": tmp86, f"tmp88": tmp88, f"tmp89": tmp89, f"tmp90": tmp90, f"tmp92": tmp92, f"tmp94": tmp94, f"tmp96": tmp96, f"tmp98": tmp98} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:55:46.717104. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp94 = np.copy(ints.tmp114) * -1 - tmp94 += np.transpose(ints.tmp114, (0, 2, 1, 3)) - tmp118 = np.copy(f.bb.ov) - tmp118 += ints.tmp33 - tmp118 += ints.tmp35 - tmp62 = np.copy(f.aa.ov) - tmp62 += ints.tmp29 - tmp62 += ints.tmp36 - tmp44 = np.copy(ints.tmp111) - tmp44 += np.transpose(ints.tmp111, (0, 2, 1, 3)) * -1 - tmp105 = einsum(t1.aa, (0, 1), ints.tmp117, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp36 = einsum(t2.bbbb, (0, 1, 2, 3), r2.bbb, (2, 3, 1), (0,)) - tmp35 = einsum(t2.abab, (0, 1, 2, 3), r2.aba, (2, 3, 0), (1,)) - tmp108 = einsum(t1.aa, (0, 1), v.aabb.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp95 = einsum(t1.bb, (0, 1), tmp94, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp94 - tmp100 = einsum(ints.tmp89, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp119 = einsum(tmp118, (0, 1), t1.bb, (0, 2), (2, 1)) - del tmp118 - tmp17 = einsum(r2.bab, (0, 1, 2), t2.abab, (3, 2, 1, 0), (3,)) * -1 - tmp15 = einsum(t1.aa, (0, 1), r1.a, (1,), (0,)) - tmp63 = einsum(t1.aa, (0, 1), tmp62, (0, 2), (1, 2)) - del tmp62 - tmp48 = einsum(t1.bb, (0, 1), ints.tmp120, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp53 = einsum(ints.tmp82, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp45 = einsum(t1.aa, (0, 1), tmp44, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp44 - tmp22 = einsum(r2.bbb, (0, 1, 2), t1.bb, (3, 1), (2, 3, 0)) - tmp106 = np.copy(ints.tmp287) - tmp106 += tmp105 - del tmp105 - tmp103 = np.copy(tmp35) * -0.5 - tmp103 += tmp36 - tmp109 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp109 += tmp108 * -1 - del tmp108 - tmp96 = np.copy(ints.tmp285) * 2 - tmp96 += ints.tmp292 - tmp96 += np.transpose(ints.tmp307, (0, 1, 3, 2)) - tmp96 += tmp95 * -1 - del tmp95 - tmp101 = np.copy(f.bb.vv) * 0.5 - tmp101 += ints.tmp173 * 0.5 - tmp101 += ints.tmp177 * 0.5 - tmp101 += ints.tmp230 * -1 - tmp101 += ints.tmp232 * -0.5 - tmp101 += np.transpose(tmp100, (1, 0)) * 0.5 - del tmp100 - tmp98 = np.copy(v.bbbb.ooov) - tmp98 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) * -1 - tmp120 = np.copy(ints.tmp175) - tmp120 += np.transpose(tmp119, (1, 0)) - del tmp119 - tmp116 = np.copy(np.transpose(ints.tmp305, (0, 1, 3, 2))) - tmp116 += ints.tmp288 * 2 - tmp114 = np.copy(ints.tmp284) - tmp114 += ints.tmp310 - tmp114 += ints.tmp290 * 2 - tmp34 = einsum(r1.b, (0,), t1.bb, (1, 0), (1,)) - tmp19 = np.copy(f.aa.ov) - tmp19 += ints.tmp29 - tmp19 += ints.tmp36 - tmp19 += ints.tmp82 * -1 - tmp66 = np.copy(tmp15) - tmp66 += tmp17 - tmp60 = np.copy(np.transpose(ints.tmp181, (0, 1, 3, 2))) - tmp60 += ints.tmp142 * 2 - tmp64 = np.copy(ints.tmp27) - tmp64 += np.transpose(tmp63, (1, 0)) - del tmp63 - tmp2 = einsum(t1.aa, (0, 1), r2.aaa, (2, 1, 3), (3, 0, 2)) - tmp16 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (2, 3, 1), (0,)) - tmp6 = einsum(t1.bb, (0, 1), r2.bab, (1, 2, 3), (3, 0, 2)) * -1 - tmp49 = np.copy(ints.tmp141) * 0.5 - tmp49 += ints.tmp147 - tmp49 += ints.tmp186 * 0.5 - tmp49 += tmp48 * -0.5 - del tmp48 - tmp54 = np.copy(f.aa.vv) * 0.5 - tmp54 += ints.tmp26 * 0.5 - tmp54 += ints.tmp28 * 0.5 - tmp54 += ints.tmp47 * -1 - tmp54 += ints.tmp49 * -0.5 - tmp54 += np.transpose(tmp53, (1, 0)) * 0.5 - del tmp53 - tmp51 = np.copy(v.aaaa.ooov) * -1 - tmp51 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) - tmp46 = np.copy(ints.tmp139) * 2 - tmp46 += ints.tmp145 - tmp46 += np.transpose(ints.tmp183, (0, 1, 3, 2)) - tmp46 += tmp45 * -1 - del tmp45 - tmp93 = einsum(tmp22, (0, 1, 2), v.bbbb.ovvv, (1, 3, 4, 2), (0, 3, 4)) * -1 - tmp107 = einsum(tmp106, (0, 1, 2, 3), r2.aba, (2, 4, 0), (1, 4, 3)) - del tmp106 - tmp104 = einsum(tmp103, (0,), v.bbbb.ovov, (1, 2, 0, 3), (1, 3, 2)) * 2 - del tmp103 - tmp110 = einsum(tmp109, (0, 1, 2, 3), r2.aba, (2, 4, 0), (1, 4, 3)) - del tmp109 - tmp92 = einsum(r2.bbb, (0, 1, 2), v.bbbb.oovv, (3, 2, 4, 1), (3, 0, 4)) - tmp91 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), r1.b, (3,), (0, 1, 2)) - tmp97 = einsum(r2.bbb, (0, 1, 2), tmp96, (2, 3, 1, 4), (3, 0, 4)) * -2 - del tmp96 - tmp102 = einsum(r2.bbb, (0, 1, 2), tmp101, (1, 3), (2, 0, 3)) * -4 - del tmp101 - tmp99 = einsum(tmp22, (0, 1, 2), tmp98, (0, 3, 1, 4), (3, 2, 4)) * 2 - del tmp98 - tmp123 = np.copy(t2.bbbb) - tmp123 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - tmp121 = einsum(tmp120, (0, 1), r2.bbb, (2, 1, 3), (3, 2, 0)) * -1 - del tmp120 - tmp117 = einsum(r2.bbb, (0, 1, 2), tmp116, (2, 3, 1, 4), (3, 0, 4)) * -1 - del tmp116 - tmp115 = einsum(tmp114, (0, 1, 2, 3), r2.aba, (2, 4, 0), (1, 4, 3)) - del tmp114 - tmp112 = einsum(r2.bbb, (0, 1, 2), v.bbbb.ovov, (3, 4, 2, 1), (3, 0, 4)) - tmp113 = einsum(tmp34, (0,), v.bbbb.ovov, (1, 2, 0, 3), (1, 2, 3)) - tmp80 = einsum(tmp19, (0, 1), t1.aa, (0, 2), (2, 1)) - tmp30 = np.copy(ints.tmp117) - tmp30 += v.aabb.ooov - tmp74 = np.copy(ints.tmp120) - tmp74 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp38 = np.copy(f.bb.ov) - tmp38 += ints.tmp33 - tmp38 += ints.tmp35 - tmp38 += ints.tmp89 * -1 - tmp82 = np.copy(ints.tmp114) * -1 - tmp82 += np.transpose(ints.tmp114, (0, 2, 1, 3)) - tmp82 += v.bbbb.ooov - tmp82 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) * -1 - tmp86 = np.copy(t2.abab) - tmp86 += einsum(t1.aa, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - tmp72 = np.copy(ints.tmp111) - tmp72 += np.transpose(ints.tmp111, (0, 2, 1, 3)) * -1 - tmp72 += v.aaaa.ooov * -1 - tmp72 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) - tmp77 = np.copy(t2.abab) - tmp77 += einsum(t1.aa, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - tmp58 = einsum(r2.bab, (0, 1, 2), ints.tmp144, (3, 2, 4, 0), (3, 4, 1)) * -1 - tmp67 = einsum(tmp66, (0,), v.aaaa.ovov, (1, 2, 0, 3), (1, 3, 2)) - del tmp66 - tmp61 = einsum(tmp60, (0, 1, 2, 3), r2.aaa, (4, 2, 0), (1, 4, 3)) * -1 - del tmp60 - tmp59 = einsum(v.aabb.ovov, (0, 1, 2, 3), r2.bab, (3, 4, 2), (0, 4, 1)) * -1 - tmp57 = einsum(r2.aaa, (0, 1, 2), v.aaaa.ovov, (3, 4, 2, 1), (3, 0, 4)) - tmp65 = einsum(r2.aaa, (0, 1, 2), tmp64, (3, 1), (2, 0, 3)) * -1 - del tmp64 - tmp69 = np.copy(t2.aaaa) - tmp69 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - tmp41 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), tmp2, (4, 0, 3), (4, 1, 2)) * -1 - tmp39 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), r1.a, (3,), (0, 1, 2)) - tmp43 = einsum(tmp16, (0,), v.aaaa.ovov, (1, 2, 0, 3), (1, 2, 3)) * -1 - tmp42 = einsum(tmp6, (0, 1, 2), v.aabb.ovoo, (3, 4, 1, 0), (3, 2, 4)) - tmp50 = einsum(r2.bab, (0, 1, 2), tmp49, (3, 2, 4, 0), (3, 1, 4)) * -2 - del tmp49 - tmp40 = einsum(v.aaaa.oovv, (0, 1, 2, 3), r2.aaa, (4, 3, 1), (0, 4, 2)) - tmp55 = einsum(r2.aaa, (0, 1, 2), tmp54, (1, 3), (2, 0, 3)) * -4 - del tmp54 - tmp52 = einsum(tmp2, (0, 1, 2), tmp51, (0, 1, 3, 4), (3, 2, 4)) * 2 - del tmp51 - tmp47 = einsum(tmp46, (0, 1, 2, 3), r2.aaa, (4, 2, 0), (1, 4, 3)) * -2 - del tmp46 - tmp26 = einsum(t1.aa, (0, 1), r2.aba, (1, 2, 3), (3, 0, 2)) - tmp111 = np.copy(tmp91) - del tmp91 - tmp111 += tmp92 * 2 - del tmp92 - tmp111 += tmp93 * 2 - del tmp93 - tmp111 += np.transpose(tmp97, (0, 2, 1)) * -1 - del tmp97 - tmp111 += tmp99 * -1 - del tmp99 - tmp111 += np.transpose(tmp102, (0, 2, 1)) * -1 - del tmp102 - tmp111 += np.transpose(tmp104, (0, 2, 1)) * -1 - del tmp104 - tmp111 += np.transpose(tmp107, (0, 2, 1)) - del tmp107 - tmp111 += tmp110 - del tmp110 - tmp124 = einsum(tmp123, (0, 1, 2, 3), r2.bbb, (2, 3, 4), (4, 1, 0)) * -1 - del tmp123 - tmp122 = np.copy(tmp112) * 2 - del tmp112 - tmp122 += tmp113 - del tmp113 - tmp122 += np.transpose(tmp115, (0, 2, 1)) - del tmp115 - tmp122 += np.transpose(tmp117, (0, 2, 1)) * -2 - del tmp117 - tmp122 += np.transpose(tmp121, (0, 2, 1)) * -2 - del tmp121 - tmp90 = np.copy(f.bb.oo) - tmp90 += ints.tmp130 * 2 - tmp90 += ints.tmp133 - tmp90 += ints.tmp158 - tmp90 += ints.tmp163 - tmp90 += ints.tmp195 - tmp90 += ints.tmp200 - tmp90 += np.transpose(ints.tmp22, (1, 0)) - tmp90 += ints.tmp156 * -1 - tmp90 += ints.tmp193 * -1 - tmp88 = np.copy(np.transpose(ints.tmp27, (1, 0))) - tmp88 += ints.tmp47 * 2 - tmp88 += ints.tmp49 - tmp88 += f.aa.vv * -1 - tmp88 += np.transpose(ints.tmp26, (1, 0)) * -1 - tmp88 += np.transpose(ints.tmp28, (1, 0)) * -1 - tmp88 += tmp80 - tmp4 = einsum(r2.bab, (0, 1, 2), t1.aa, (3, 1), (3, 2, 0)) * -1 - tmp18 = np.copy(tmp15) * 0.5 - del tmp15 - tmp18 += tmp16 - del tmp16 - tmp18 += tmp17 * 0.5 - del tmp17 - tmp84 = np.copy(ints.tmp284) - tmp84 += ints.tmp290 * 2 - tmp84 += ints.tmp310 - tmp84 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp84 += ints.tmp287 * -1 - tmp84 += einsum(t1.aa, (0, 1), tmp30, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - tmp85 = np.copy(ints.tmp149) - tmp85 += np.transpose(ints.tmp185, (0, 1, 3, 2)) * -1 - tmp85 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) * -1 - tmp85 += einsum(tmp74, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - tmp89 = np.copy(np.transpose(ints.tmp175, (1, 0))) * 0.5 - tmp89 += ints.tmp230 - tmp89 += ints.tmp232 * 0.5 - tmp89 += f.bb.vv * -0.5 - tmp89 += ints.tmp173 * -0.5 - tmp89 += ints.tmp177 * -0.5 - tmp89 += einsum(t1.bb, (0, 1), tmp38, (0, 2), (1, 2)) * 0.5 - tmp83 = np.copy(ints.tmp285) * 2 - tmp83 += ints.tmp292 - tmp83 += np.transpose(ints.tmp307, (0, 1, 3, 2)) - tmp83 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp83 += ints.tmp288 * -2 - tmp83 += np.transpose(ints.tmp305, (0, 1, 3, 2)) * -1 - tmp83 += v.bbbb.oovv * -1 - tmp83 += einsum(t1.bb, (0, 1), tmp82, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp82 - tmp87 = einsum(tmp86, (0, 1, 2, 3), r2.bab, (3, 2, 4), (0, 4, 1)) * -1 - del tmp86 - tmp37 = np.copy(tmp34) - del tmp34 - tmp37 += tmp35 * -1 - del tmp35 - tmp37 += tmp36 * 2 - del tmp36 - tmp76 = np.copy(ints.tmp294) - tmp76 += np.transpose(ints.tmp309, (0, 1, 3, 2)) * -1 - tmp76 += v.aabb.oovv * -1 - tmp76 += einsum(t1.bb, (0, 1), tmp30, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp73 = np.copy(ints.tmp139) * 2 - tmp73 += ints.tmp145 - tmp73 += np.transpose(ints.tmp183, (0, 1, 3, 2)) - tmp73 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp73 += ints.tmp142 * -2 - tmp73 += np.transpose(ints.tmp181, (0, 1, 3, 2)) * -1 - tmp73 += v.aaaa.oovv * -1 - tmp73 += einsum(tmp72, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) * -1 - del tmp72 - tmp24 = einsum(t1.bb, (0, 1), r2.aba, (2, 1, 3), (3, 0, 2)) - tmp79 = np.copy(np.transpose(ints.tmp175, (1, 0))) - tmp79 += ints.tmp230 * 2 - tmp79 += ints.tmp232 - tmp79 += f.bb.vv * -1 - tmp79 += np.transpose(ints.tmp173, (1, 0)) * -1 - tmp79 += np.transpose(ints.tmp177, (1, 0)) * -1 - tmp79 += einsum(t1.bb, (0, 1), tmp38, (0, 2), (1, 2)) - tmp81 = np.copy(np.transpose(ints.tmp27, (1, 0))) - tmp81 += ints.tmp47 * 2 - tmp81 += ints.tmp49 - tmp81 += f.aa.vv * -1 - tmp81 += ints.tmp26 * -1 - tmp81 += ints.tmp28 * -1 - tmp81 += tmp80 - del tmp80 - tmp78 = einsum(tmp77, (0, 1, 2, 3), r2.aba, (2, 3, 4), (4, 0, 1)) - del tmp77 - tmp71 = np.copy(f.aa.oo) - tmp71 += ints.tmp127 * 2 - tmp71 += ints.tmp136 - tmp71 += ints.tmp153 - tmp71 += ints.tmp160 - tmp71 += ints.tmp190 - tmp71 += ints.tmp197 - tmp71 += np.transpose(ints.tmp19, (1, 0)) - tmp71 += ints.tmp150 * -1 - tmp71 += ints.tmp187 * -1 - tmp75 = np.copy(ints.tmp141) - tmp75 += ints.tmp147 * 2 - tmp75 += ints.tmp186 - tmp75 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp75 += ints.tmp144 * -1 - tmp75 += einsum(t1.bb, (0, 1), tmp74, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - del tmp74 - tmp68 = np.copy(tmp57) * 2 - del tmp57 - tmp68 += tmp58 - del tmp58 - tmp68 += tmp59 - del tmp59 - tmp68 += np.transpose(tmp61, (0, 2, 1)) * -2 - del tmp61 - tmp68 += np.transpose(tmp65, (0, 2, 1)) * -2 - del tmp65 - tmp68 += np.transpose(tmp67, (0, 2, 1)) - del tmp67 - tmp70 = einsum(tmp69, (0, 1, 2, 3), r2.aaa, (2, 3, 4), (4, 1, 0)) * -1 - del tmp69 - tmp56 = np.copy(tmp39) - del tmp39 - tmp56 += tmp40 * 2 - del tmp40 - tmp56 += tmp41 * 2 - del tmp41 - tmp56 += tmp42 - del tmp42 - tmp56 += tmp43 * 2 - del tmp43 - tmp56 += np.transpose(tmp47, (0, 2, 1)) * -1 - del tmp47 - tmp56 += np.transpose(tmp50, (0, 2, 1)) - del tmp50 - tmp56 += tmp52 * -1 - del tmp52 - tmp56 += np.transpose(tmp55, (0, 2, 1)) * -1 - del tmp55 - tmp33 = np.copy(np.transpose(ints.tmp175, (1, 0))) - tmp33 += ints.tmp230 * 2 - tmp33 += ints.tmp232 - tmp33 += f.bb.vv * -1 - tmp33 += np.transpose(ints.tmp173, (1, 0)) * -1 - tmp33 += np.transpose(ints.tmp177, (1, 0)) * -1 - tmp31 = einsum(t1.bb, (0, 1), tmp22, (2, 3, 1), (2, 3, 0)) * -1 - tmp29 = einsum(tmp26, (0, 1, 2), t1.bb, (3, 2), (0, 1, 3)) - tmp28 = np.copy(ints.tmp112) - tmp28 += ints.tmp118 * 0.5 - tmp28 += ints.tmp128 - tmp28 += ints.tmp137 * 0.5 - tmp28 += ints.tmp154 * 0.5 - tmp28 += ints.tmp161 * 0.5 - tmp28 += ints.tmp171 * 0.5 - tmp28 += ints.tmp191 * 0.5 - tmp28 += ints.tmp198 * 0.5 - tmp28 += ints.tmp20 * 0.5 - tmp28 += ints.tmp2 * 0.5 - tmp28 += ints.tmp31 * 0.5 - tmp28 += ints.tmp51 - tmp28 += ints.tmp57 * 0.5 - tmp28 += ints.tmp63 - tmp28 += ints.tmp83 - tmp28 += ints.tmp90 * 0.5 - tmp28 += f.aa.ov * -0.5 - tmp28 += ints.tmp101 * -0.5 - tmp28 += ints.tmp11 * -0.5 - tmp28 += ints.tmp151 * -0.5 - tmp28 += ints.tmp169 * -0.5 - tmp28 += ints.tmp179 * -0.5 - tmp28 += ints.tmp188 * -0.5 - tmp28 += ints.tmp29 * -0.5 - tmp28 += ints.tmp36 * -0.5 - tmp28 += ints.tmp5 * -0.5 - tmp28 += ints.tmp69 * -0.5 - tmp28 += ints.tmp86 * -1 - tmp28 += ints.tmp8 * -1 - tmp28 += ints.tmp94 * -0.5 - tmp28 += ints.tmp98 * -1 - tmp9 = np.copy(ints.tmp115) * 2 - tmp9 += ints.tmp121 - tmp9 += ints.tmp131 * 2 - tmp9 += ints.tmp134 - tmp9 += ints.tmp159 - tmp9 += ints.tmp164 - tmp9 += ints.tmp176 - tmp9 += ints.tmp196 - tmp9 += ints.tmp201 - tmp9 += ints.tmp23 - tmp9 += ints.tmp34 - tmp9 += ints.tmp4 - tmp9 += ints.tmp53 * 2 - tmp9 += ints.tmp55 - tmp9 += ints.tmp65 * 2 - tmp9 += ints.tmp85 - tmp9 += ints.tmp92 * 2 - tmp9 += f.bb.ov * -1 - tmp9 += ints.tmp100 * -1 - tmp9 += ints.tmp103 * -2 - tmp9 += ints.tmp10 * -1 - tmp9 += ints.tmp13 * -2 - tmp9 += ints.tmp157 * -1 - tmp9 += ints.tmp174 * -1 - tmp9 += ints.tmp178 * -1 - tmp9 += ints.tmp194 * -1 - tmp9 += ints.tmp33 * -1 - tmp9 += ints.tmp35 * -1 - tmp9 += ints.tmp67 * -1 - tmp9 += ints.tmp7 * -1 - tmp9 += ints.tmp88 * -1 - tmp9 += ints.tmp96 * -2 - tmp25 = np.copy(ints.tmp284) - tmp25 += ints.tmp290 * 2 - tmp25 += ints.tmp310 - tmp25 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp25 += ints.tmp287 * -1 - tmp23 = np.copy(ints.tmp285) * 2 - tmp23 += ints.tmp292 - tmp23 += np.transpose(ints.tmp307, (0, 1, 3, 2)) - tmp23 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp23 += ints.tmp288 * -2 - tmp23 += np.transpose(ints.tmp305, (0, 1, 3, 2)) * -1 - tmp23 += v.bbbb.oovv * -1 - tmp27 = np.copy(np.transpose(ints.tmp309, (0, 1, 3, 2))) - tmp27 += v.aabb.oovv - tmp27 += ints.tmp294 * -1 - tmp32 = np.copy(ints.tmp114) - tmp32 += v.bbbb.ooov * -1 - tmp21 = np.copy(np.transpose(ints.tmp238, (0, 3, 1, 2))) * 0.5 - tmp21 += np.transpose(ints.tmp247, (0, 2, 1, 3)) - tmp21 += np.transpose(ints.tmp254, (0, 2, 1, 3)) * 0.5 - tmp21 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) * 0.5 - tmp21 += ints.tmp226 * -0.5 - tmp21 += np.transpose(ints.tmp250, (0, 2, 1, 3)) * -1 - tmp21 += np.transpose(ints.tmp276, (0, 3, 1, 2)) * -0.5 - tmp20 = np.copy(ints.tmp228) - tmp20 += np.transpose(ints.tmp240, (0, 1, 3, 2)) - tmp20 += ints.tmp246 - tmp20 += ints.tmp252 * 2 - tmp20 += np.transpose(ints.tmp278, (0, 1, 3, 2)) - tmp20 += v.aabb.ovvv - tmp20 += ints.tmp249 * -1 - tmp20 += np.transpose(ints.tmp256, (0, 1, 3, 2)) * -1 - tmp3 = np.copy(ints.tmp139) * 2 - tmp3 += ints.tmp145 - tmp3 += np.transpose(ints.tmp183, (0, 1, 3, 2)) - tmp3 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp3 += ints.tmp142 * -2 - tmp3 += np.transpose(ints.tmp181, (0, 1, 3, 2)) * -1 - tmp3 += v.aaaa.oovv * -1 - tmp7 = np.copy(np.transpose(ints.tmp185, (0, 1, 3, 2))) - tmp7 += np.transpose(v.aabb.vvoo, (2, 3, 0, 1)) - tmp7 += ints.tmp149 * -1 - tmp0 = np.copy(ints.tmp125) - tmp0 += np.transpose(ints.tmp45, (0, 2, 1, 3)) - tmp0 += ints.tmp61 - tmp0 += np.transpose(ints.tmp73, (0, 2, 1, 3)) - tmp0 += np.transpose(ints.tmp79, (0, 2, 1, 3)) * 2 - tmp0 += np.transpose(v.aabb.vvov, (2, 0, 1, 3)) - tmp0 += np.transpose(ints.tmp76, (0, 2, 1, 3)) * -1 - tmp0 += ints.tmp81 * -1 - tmp12 = einsum(tmp2, (0, 1, 2), t1.aa, (3, 2), (0, 1, 3)) * -1 - tmp5 = np.copy(ints.tmp141) - tmp5 += ints.tmp147 * 2 - tmp5 += ints.tmp186 - tmp5 += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - tmp5 += ints.tmp144 * -1 - tmp13 = np.copy(ints.tmp111) - tmp13 += v.aaaa.ooov * -1 - tmp8 = np.copy(ints.tmp112) * 2 - tmp8 += ints.tmp118 - tmp8 += ints.tmp128 * 2 - tmp8 += ints.tmp137 - tmp8 += ints.tmp154 - tmp8 += ints.tmp161 - tmp8 += ints.tmp171 - tmp8 += ints.tmp191 - tmp8 += ints.tmp198 - tmp8 += ints.tmp20 - tmp8 += ints.tmp2 - tmp8 += ints.tmp31 - tmp8 += ints.tmp51 * 2 - tmp8 += ints.tmp57 - tmp8 += ints.tmp63 * 2 - tmp8 += ints.tmp83 * 2 - tmp8 += ints.tmp90 - tmp8 += f.aa.ov * -1 - tmp8 += ints.tmp101 * -1 - tmp8 += ints.tmp11 * -1 - tmp8 += ints.tmp151 * -1 - tmp8 += ints.tmp169 * -1 - tmp8 += ints.tmp179 * -1 - tmp8 += ints.tmp188 * -1 - tmp8 += ints.tmp29 * -1 - tmp8 += ints.tmp36 * -1 - tmp8 += ints.tmp5 * -1 - tmp8 += ints.tmp69 * -1 - tmp8 += ints.tmp86 * -2 - tmp8 += ints.tmp8 * -2 - tmp8 += ints.tmp94 * -1 - tmp8 += ints.tmp98 * -2 - tmp11 = np.copy(ints.tmp120) - tmp11 += np.transpose(v.aabb.ovoo, (0, 2, 3, 1)) - tmp1 = np.copy(ints.tmp59) * 0.5 - tmp1 += np.transpose(ints.tmp71, (0, 1, 3, 2)) - tmp1 += np.transpose(ints.tmp77, (0, 1, 3, 2)) * 0.5 - tmp1 += v.aaaa.ovvv * 0.5 - tmp1 += ints.tmp123 * -0.5 - tmp1 += np.transpose(ints.tmp43, (0, 2, 3, 1)) * -0.5 - tmp1 += np.transpose(ints.tmp74, (0, 1, 3, 2)) * -1 - tmp10 = einsum(tmp6, (0, 1, 2), t1.aa, (3, 2), (3, 0, 1)) - tmp14 = np.copy(np.transpose(ints.tmp27, (1, 0))) - tmp14 += ints.tmp47 * 2 - tmp14 += ints.tmp49 - tmp14 += f.aa.vv * -1 - tmp14 += np.transpose(ints.tmp26, (1, 0)) * -1 - tmp14 += np.transpose(ints.tmp28, (1, 0)) * -1 - r2new.bbb = einsum(v.bbbb.vvvv, (0, 1, 2, 3), r2.bbb, (3, 1, 4), (0, 2, 4)) * -2 - r2new.bbb += np.transpose(tmp111, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp111, (2, 1, 0)) - del tmp111 - r2new.bbb += np.transpose(tmp122, (1, 2, 0)) - r2new.bbb += np.transpose(tmp122, (2, 1, 0)) * -1 - del tmp122 - r2new.bbb += einsum(v.bbbb.ovov, (0, 1, 2, 3), tmp124, (4, 0, 2), (3, 1, 4)) * -2 - del tmp124 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp90, (2, 3), (0, 1, 3)) * -2 - r2new.bbb += einsum(r1.b, (0,), tmp38, (1, 2), (0, 2, 1)) - r2new.bbb += einsum(r1.b, (0,), tmp38, (1, 2), (2, 0, 1)) * -1 - r2new.bab = einsum(r2.bab, (0, 1, 2), v.aabb.vvvv, (3, 1, 4, 0), (4, 3, 2)) - r2new.bab += einsum(tmp6, (0, 1, 2), v.aabb.vvov, (3, 2, 1, 4), (4, 3, 0)) - r2new.bab += einsum(v.aabb.ovvv, (0, 1, 2, 3), tmp4, (0, 4, 3), (2, 1, 4)) - r2new.bab += einsum(r1.a, (0,), v.aabb.vvov, (1, 0, 2, 3), (3, 1, 2)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp83, (2, 3, 0, 4), (4, 1, 3)) - del tmp83 - r2new.bab += einsum(r2.aaa, (0, 1, 2), tmp84, (2, 3, 1, 4), (4, 0, 3)) * -2 - del tmp84 - r2new.bab += einsum(tmp85, (0, 1, 2, 3), r2.bab, (4, 2, 0), (4, 3, 1)) - del tmp85 - r2new.bab += einsum(tmp87, (0, 1, 2), v.aabb.ovov, (0, 3, 2, 4), (4, 3, 1)) * -1 - del tmp87 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp88, (1, 3), (0, 3, 2)) * -1 - del tmp88 - r2new.bab += einsum(tmp89, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -2 - del tmp89 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp90, (2, 3), (0, 1, 3)) * -1 - del tmp90 - r2new.bab += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp18, (0,), (3, 1, 2)) * 2 - r2new.bab += einsum(r1.a, (0,), tmp38, (1, 2), (2, 0, 1)) * -1 - r2new.aba = einsum(r2.aba, (0, 1, 2), v.aabb.vvvv, (3, 0, 4, 1), (3, 4, 2)) - r2new.aba += einsum(tmp24, (0, 1, 2), v.aabb.vvov, (3, 2, 1, 4), (3, 4, 0)) * -1 - r2new.aba += einsum(r1.b, (0,), v.aabb.ovvv, (1, 2, 3, 0), (2, 3, 1)) * -1 - r2new.aba += einsum(tmp26, (0, 1, 2), v.aabb.ovvv, (1, 3, 4, 2), (3, 4, 0)) * -1 - r2new.aba += einsum(tmp73, (0, 1, 2, 3), r2.aba, (2, 4, 0), (3, 4, 1)) - del tmp73 - r2new.aba += einsum(r2.bbb, (0, 1, 2), tmp75, (3, 2, 4, 1), (4, 0, 3)) * -2 - del tmp75 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp76, (2, 3, 1, 4), (0, 4, 3)) - del tmp76 - r2new.aba += einsum(tmp78, (0, 1, 2), v.aabb.ovov, (1, 3, 2, 4), (3, 4, 0)) - del tmp78 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp79, (1, 3), (0, 3, 2)) * -1 - del tmp79 - r2new.aba += einsum(tmp81, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - del tmp81 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp71, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(v.aabb.ovov, (0, 1, 2, 3), tmp37, (2,), (1, 3, 0)) - r2new.aba += einsum(tmp19, (0, 1), r1.b, (2,), (1, 2, 0)) * -1 - r2new.aaa = einsum(r2.aaa, (0, 1, 2), v.aaaa.vvvv, (3, 1, 4, 0), (3, 4, 2)) * -2 - r2new.aaa += np.transpose(tmp56, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp56, (2, 1, 0)) - del tmp56 - r2new.aaa += np.transpose(tmp68, (1, 2, 0)) - r2new.aaa += np.transpose(tmp68, (2, 1, 0)) * -1 - del tmp68 - r2new.aaa += einsum(v.aaaa.ovov, (0, 1, 2, 3), tmp70, (4, 0, 2), (3, 1, 4)) * -2 - del tmp70 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp71, (2, 3), (0, 1, 3)) * -2 - del tmp71 - r2new.aaa += einsum(tmp19, (0, 1), r1.a, (2,), (2, 1, 0)) - r2new.aaa += einsum(r1.a, (0,), tmp19, (1, 2), (2, 0, 1)) * -1 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp20, (2, 0, 3, 1), (3,)) * -1 - del tmp20 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp21, (2, 3, 0, 1), (3,)) * -4 - del tmp21 - r1new.b += einsum(tmp23, (0, 1, 2, 3), tmp22, (0, 1, 2), (3,)) * 2 - del tmp22, tmp23 - r1new.b += einsum(tmp25, (0, 1, 2, 3), tmp24, (0, 1, 2), (3,)) - del tmp24, tmp25 - r1new.b += einsum(tmp27, (0, 1, 2, 3), tmp26, (0, 1, 2), (3,)) - del tmp26, tmp27 - r1new.b += einsum(tmp9, (0, 1), r2.bbb, (2, 1, 0), (2,)) * -2 - r1new.b += einsum(tmp28, (0, 1), r2.aba, (1, 2, 0), (2,)) * 2 - del tmp28 - r1new.b += einsum(tmp29, (0, 1, 2), tmp30, (0, 1, 2, 3), (3,)) * -1 - del tmp30, tmp29 - r1new.b += einsum(tmp32, (0, 1, 2, 3), tmp31, (0, 2, 1), (3,)) * -2 - del tmp32, tmp31 - r1new.b += einsum(r1.b, (0,), tmp33, (0, 1), (1,)) * -1 - del tmp33 - r1new.b += einsum(tmp38, (0, 1), tmp37, (0,), (1,)) * -1 - del tmp38, tmp37 - r1new.a = einsum(tmp0, (0, 1, 2, 3), r2.bab, (3, 1, 0), (2,)) * -1 - del tmp0 - r1new.a += einsum(tmp1, (0, 1, 2, 3), r2.aaa, (1, 2, 0), (3,)) * -4 - del tmp1 - r1new.a += einsum(tmp3, (0, 1, 2, 3), tmp2, (0, 1, 2), (3,)) * 2 - del tmp2, tmp3 - r1new.a += einsum(tmp5, (0, 1, 2, 3), tmp4, (0, 1, 3), (2,)) * -1 - del tmp4, tmp5 - r1new.a += einsum(tmp6, (0, 1, 2), tmp7, (0, 1, 2, 3), (3,)) * -1 - del tmp6, tmp7 - r1new.a += einsum(r2.aaa, (0, 1, 2), tmp8, (2, 1), (0,)) * -2 - del tmp8 - r1new.a += einsum(tmp9, (0, 1), r2.bab, (1, 2, 0), (2,)) - del tmp9 - r1new.a += einsum(tmp11, (0, 1, 2, 3), tmp10, (0, 1, 2), (3,)) - del tmp11, tmp10 - r1new.a += einsum(tmp13, (0, 1, 2, 3), tmp12, (0, 2, 1), (3,)) * -2 - del tmp13, tmp12 - r1new.a += einsum(r1.a, (0,), tmp14, (0, 1), (1,)) * -1 - del tmp14 - r1new.a += einsum(tmp19, (0, 1), tmp18, (0,), (1,)) * -2 - del tmp19, tmp18 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/UCCSDT.py b/ebcc/codegen/UCCSDT.py deleted file mode 100644 index e2d90271..00000000 --- a/ebcc/codegen/UCCSDT.py +++ /dev/null @@ -1,9150 +0,0 @@ -# Code generated for ebcc. - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, Namespace -from ebcc.precision import types - -def energy(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, **kwargs): - # energy - e_cc = 0 - e_cc += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 3), ()) - e_cc += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 3, 1, 2), ()) * -1.0 - e_cc += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 2, 1, 3), ()) - x0 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x0 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x0 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x1 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x1 += einsum(f.bb.ov, (0, 1), (0, 1)) - x1 += einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - x1 += einsum(t1.bb, (0, 1), x0, (0, 2, 1, 3), (2, 3)) * -0.5 - del x0 - e_cc += einsum(t1.bb, (0, 1), x1, (0, 1), ()) - del x1 - x2 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x2 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x2 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x3 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x3 += einsum(f.aa.ov, (0, 1), (0, 1)) - x3 += einsum(t1.aa, (0, 1), x2, (0, 2, 1, 3), (2, 3)) * -0.5 - del x2 - e_cc += einsum(t1.aa, (0, 1), x3, (0, 1), ()) - del x3 - - return e_cc - -def update_amps(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, **kwargs): - t1new = Namespace() - t2new = Namespace() - t3new = Namespace() - - # T amplitudes - t1new_bb = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - t1new_bb += einsum(f.bb.ov, (0, 1), (0, 1)) - t1new_bb += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 0, 2, 5, 1, 3), (4, 5)) * 2.0 - t1new_bb += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.bbbbbb, (4, 0, 2, 5, 1, 3), (4, 5)) * 3.0 - t1new_bb += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.abaaba, (0, 4, 2, 1, 5, 3), (4, 5)) - t1new_aa = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - t1new_aa += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 2, 0, 5, 3, 1), (4, 5)) * 2.0 - t1new_aa += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.aaaaaa, (4, 0, 2, 5, 1, 3), (4, 5)) * 3.0 - t1new_aa += einsum(f.aa.ov, (0, 1), (0, 1)) - t1new_aa += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.babbab, (0, 4, 2, 3, 5, 1), (4, 5)) * -1.0 - t2new_aaaa = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - t2new_aaaa += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.vvvv, (4, 2, 5, 3), (0, 1, 4, 5)) * 2.0 - t2new_abab = np.zeros((nocc[0], nocc[1], nvir[0], nvir[1]), dtype=types[float]) - t2new_abab += einsum(v.aabb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - t2new_bbbb = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - t2new_bbbb += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.vvvv, (4, 3, 5, 2), (0, 1, 4, 5)) * -2.0 - x0 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x0 += einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - t1new_bb += einsum(x0, (0, 1), (0, 1)) - x1 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x1 += einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - x2 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x2 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x2 += einsum(x1, (0, 1, 2, 3), (0, 1, 2, 3)) - t1new_bb += einsum(t2.bbbb, (0, 1, 2, 3), x2, (4, 0, 1, 3), (4, 2)) * 2.0 - t2new_abab += einsum(x2, (0, 1, 2, 3), t3.babbab, (1, 4, 2, 5, 6, 3), (4, 0, 6, 5)) * 2.0 - del x2 - x3 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x3 += einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 4, 1), (0, 4, 2, 3)) - x4 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x4 += einsum(v.aabb.ovoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x4 += einsum(x3, (0, 1, 2, 3), (1, 0, 2, 3)) - t1new_bb += einsum(t2.abab, (0, 1, 2, 3), x4, (1, 4, 0, 2), (4, 3)) * -1.0 - t2new_abab += einsum(x4, (0, 1, 2, 3), t3.abaaba, (4, 0, 2, 5, 6, 3), (4, 1, 5, 6)) * -2.0 - x5 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x5 += einsum(t2.abab, (0, 1, 2, 3), (1, 3, 0, 2)) - x5 += einsum(t1.aa, (0, 1), t1.bb, (2, 3), (2, 3, 0, 1)) - t1new_bb += einsum(v.aabb.ovvv, (0, 1, 2, 3), x5, (4, 3, 0, 1), (4, 2)) - t1new_aa += einsum(v.aabb.vvov, (0, 1, 2, 3), x5, (2, 3, 4, 1), (4, 0)) - x6 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x6 += einsum(t2.bbbb, (0, 1, 2, 3), (0, 1, 2, 3)) - x6 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * 0.5 - t1new_bb += einsum(v.bbbb.ovvv, (0, 1, 2, 3), x6, (0, 4, 1, 3), (4, 2)) * 2.0 - x7 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x7 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x7 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x8 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x8 += einsum(t1.bb, (0, 1), x7, (0, 2, 1, 3), (2, 3)) - x9 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x9 += einsum(f.bb.ov, (0, 1), (0, 1)) - x9 += einsum(x0, (0, 1), (0, 1)) - x9 += einsum(x8, (0, 1), (0, 1)) * -1.0 - del x8 - t1new_bb += einsum(x9, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) * 2.0 - t1new_aa += einsum(x9, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - t2new_aaaa += einsum(x9, (0, 1), t3.abaaba, (2, 0, 3, 4, 1, 5), (2, 3, 4, 5)) * 2.0 - t2new_abab += einsum(x9, (0, 1), t3.babbab, (2, 3, 0, 4, 5, 1), (3, 2, 5, 4)) * 2.0 - t2new_bbbb += einsum(x9, (0, 1), t3.bbbbbb, (2, 3, 0, 4, 5, 1), (2, 3, 4, 5)) * 6.0 - x10 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x10 += einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 0, 1), (2, 3)) - t1new_aa += einsum(x10, (0, 1), (0, 1)) - x11 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x11 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x11 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x12 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x12 += einsum(t1.aa, (0, 1), x11, (0, 2, 1, 3), (2, 3)) - x13 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x13 += einsum(f.aa.ov, (0, 1), (0, 1)) - x13 += einsum(x10, (0, 1), (0, 1)) - del x10 - x13 += einsum(x12, (0, 1), (0, 1)) * -1.0 - del x12 - t1new_bb += einsum(x13, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - t1new_aa += einsum(x13, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) * 2.0 - t2new_aaaa += einsum(x13, (0, 1), t3.aaaaaa, (2, 3, 0, 4, 5, 1), (2, 3, 4, 5)) * 6.0 - t2new_abab += einsum(x13, (0, 1), t3.abaaba, (2, 3, 0, 4, 5, 1), (2, 3, 4, 5)) * 2.0 - t2new_bbbb += einsum(x13, (0, 1), t3.babbab, (2, 0, 3, 4, 1, 5), (2, 3, 4, 5)) * 2.0 - x14 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x14 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x14 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - t1new_bb += einsum(t1.bb, (0, 1), x14, (0, 2, 1, 3), (2, 3)) * -1.0 - x15 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x15 += einsum(t1.aa, (0, 1), v.aabb.ovoo, (0, 1, 2, 3), (2, 3)) - x16 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x16 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 2, 1, 3), (0, 4)) - x17 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x17 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - x18 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x18 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x18 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x19 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x19 += einsum(t1.bb, (0, 1), x18, (2, 3, 0, 1), (2, 3)) - x20 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x20 += einsum(t1.bb, (0, 1), x9, (2, 1), (2, 0)) - x21 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x21 += einsum(f.bb.oo, (0, 1), (0, 1)) - x21 += einsum(x15, (0, 1), (1, 0)) - x21 += einsum(x16, (0, 1), (1, 0)) * 2.0 - x21 += einsum(x17, (0, 1), (1, 0)) - x21 += einsum(x19, (0, 1), (1, 0)) * -1.0 - x21 += einsum(x20, (0, 1), (0, 1)) - t1new_bb += einsum(t1.bb, (0, 1), x21, (0, 2), (2, 1)) * -1.0 - t2new_abab += einsum(x21, (0, 1), t2.abab, (2, 0, 3, 4), (2, 1, 3, 4)) * -1.0 - t3new_abaaba = np.zeros((nocc[0], nocc[1], nocc[0], nvir[0], nvir[1], nvir[0]), dtype=types[float]) - t3new_abaaba += einsum(x21, (0, 1), t3.abaaba, (2, 0, 3, 4, 5, 6), (2, 1, 3, 4, 5, 6)) * -2.0 - del x21 - x22 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x22 += einsum(f.bb.vv, (0, 1), (0, 1)) - x22 += einsum(t1.bb, (0, 1), v.bbbb.ovvv, (0, 2, 3, 1), (2, 3)) * -1.0 - t1new_bb += einsum(t1.bb, (0, 1), x22, (1, 2), (0, 2)) - del x22 - x23 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x23 += einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (3, 4, 0, 2)) - x24 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x24 += einsum(v.aabb.ooov, (0, 1, 2, 3), (2, 3, 0, 1)) - x24 += einsum(x23, (0, 1, 2, 3), (0, 1, 3, 2)) - t1new_aa += einsum(t2.abab, (0, 1, 2, 3), x24, (1, 3, 0, 4), (4, 2)) * -1.0 - t2new_abab += einsum(x24, (0, 1, 2, 3), t3.babbab, (4, 2, 0, 5, 6, 1), (3, 4, 6, 5)) * -2.0 - x25 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x25 += einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - x26 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x26 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x26 += einsum(x25, (0, 1, 2, 3), (0, 1, 2, 3)) - t1new_aa += einsum(t2.aaaa, (0, 1, 2, 3), x26, (4, 0, 1, 3), (4, 2)) * 2.0 - t2new_abab += einsum(x26, (0, 1, 2, 3), t3.abaaba, (1, 4, 2, 5, 6, 3), (0, 4, 5, 6)) * 2.0 - del x26 - x27 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x27 += einsum(t2.aaaa, (0, 1, 2, 3), (0, 1, 2, 3)) - x27 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) * 0.5 - t1new_aa += einsum(v.aaaa.ovvv, (0, 1, 2, 3), x27, (0, 4, 3, 1), (4, 2)) * -2.0 - del x27 - x28 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x28 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x28 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - t1new_aa += einsum(t1.aa, (0, 1), x28, (0, 2, 1, 3), (2, 3)) * -1.0 - x29 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x29 += einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 1), (2, 3)) - x30 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x30 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - x31 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x31 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 1, 2), (0, 4)) * -1.0 - x32 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x32 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x32 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x33 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x33 += einsum(t1.aa, (0, 1), x32, (2, 3, 0, 1), (2, 3)) - x34 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x34 += einsum(t1.aa, (0, 1), x13, (2, 1), (2, 0)) - x35 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x35 += einsum(f.aa.oo, (0, 1), (0, 1)) - x35 += einsum(x29, (0, 1), (1, 0)) - x35 += einsum(x30, (0, 1), (1, 0)) - x35 += einsum(x31, (0, 1), (1, 0)) * 2.0 - x35 += einsum(x33, (0, 1), (1, 0)) * -1.0 - x35 += einsum(x34, (0, 1), (0, 1)) - t1new_aa += einsum(t1.aa, (0, 1), x35, (0, 2), (2, 1)) * -1.0 - t2new_abab += einsum(x35, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -1.0 - t3new_babbab = np.zeros((nocc[1], nocc[0], nocc[1], nvir[1], nvir[0], nvir[1]), dtype=types[float]) - t3new_babbab += einsum(x35, (0, 1), t3.babbab, (2, 0, 3, 4, 5, 6), (2, 1, 3, 4, 5, 6)) * -2.0 - del x35 - x36 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x36 += einsum(f.aa.vv, (0, 1), (0, 1)) - x36 += einsum(t1.aa, (0, 1), v.aaaa.ovvv, (0, 1, 2, 3), (2, 3)) - t1new_aa += einsum(t1.aa, (0, 1), x36, (1, 2), (0, 2)) - del x36 - x37 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x37 += einsum(t1.aa, (0, 1), v.aaaa.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x38 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x38 += einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (3, 4, 0, 2)) - t2new_abab += einsum(x38, (0, 1, 2, 3), (2, 0, 3, 1)) - x39 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x39 += einsum(t2.abab, (0, 1, 2, 3), x38, (1, 3, 4, 5), (4, 0, 2, 5)) - x40 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x40 += einsum(t2.aaaa, (0, 1, 2, 3), (0, 1, 2, 3)) - x40 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -0.5 - x41 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x41 += einsum(x28, (0, 1, 2, 3), x40, (0, 4, 2, 5), (1, 4, 3, 5)) * 2.0 - x42 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x42 += einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (4, 5, 0, 2)) - x43 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x43 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x43 += einsum(x42, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x44 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x44 += einsum(t2.abab, (0, 1, 2, 3), x43, (1, 3, 4, 5), (4, 0, 5, 2)) - del x43 - x45 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x45 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x45 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x46 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x46 += einsum(t1.aa, (0, 1), x45, (2, 1, 3, 4), (2, 0, 3, 4)) - x47 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x47 += einsum(t2.aaaa, (0, 1, 2, 3), x46, (1, 4, 5, 3), (0, 4, 2, 5)) * -2.0 - x48 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x48 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - x49 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x49 += einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - x50 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x50 += einsum(t1.aa, (0, 1), x49, (2, 3, 4, 0), (2, 4, 3, 1)) - x51 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x51 += einsum(t1.aa, (0, 1), x37, (2, 3, 1, 4), (0, 2, 3, 4)) - x52 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x52 += einsum(t2.abab, (0, 1, 2, 3), x23, (1, 3, 4, 5), (4, 0, 5, 2)) - x53 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x53 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x53 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x54 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x54 += einsum(t2.aaaa, (0, 1, 2, 3), x53, (4, 5, 1, 3), (0, 4, 5, 2)) * 2.0 - del x53 - x55 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x55 += einsum(x25, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x55 += einsum(x25, (0, 1, 2, 3), (0, 2, 1, 3)) - x56 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x56 += einsum(t2.aaaa, (0, 1, 2, 3), x55, (4, 1, 5, 3), (0, 4, 5, 2)) * 2.0 - x57 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x57 += einsum(x48, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x57 += einsum(x50, (0, 1, 2, 3), (0, 2, 1, 3)) - x57 += einsum(x51, (0, 1, 2, 3), (0, 2, 1, 3)) - del x51 - x57 += einsum(x52, (0, 1, 2, 3), (0, 2, 1, 3)) - x57 += einsum(x54, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x54 - x57 += einsum(x56, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - x58 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x58 += einsum(t1.aa, (0, 1), x57, (2, 0, 3, 4), (2, 3, 4, 1)) - del x57 - x59 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x59 += einsum(x37, (0, 1, 2, 3), (0, 1, 2, 3)) - x59 += einsum(x39, (0, 1, 2, 3), (0, 1, 2, 3)) - del x39 - x59 += einsum(x41, (0, 1, 2, 3), (1, 0, 3, 2)) - del x41 - x59 += einsum(x44, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x44 - x59 += einsum(x47, (0, 1, 2, 3), (1, 0, 2, 3)) - del x47 - x59 += einsum(x58, (0, 1, 2, 3), (0, 1, 3, 2)) - del x58 - t2new_aaaa += einsum(x59, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - t2new_aaaa += einsum(x59, (0, 1, 2, 3), (0, 1, 3, 2)) - t2new_aaaa += einsum(x59, (0, 1, 2, 3), (1, 0, 2, 3)) - t2new_aaaa += einsum(x59, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x59 - x60 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x60 += einsum(f.aa.vv, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) - x61 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x61 += einsum(t2.abab, (0, 1, 2, 3), x7, (1, 4, 3, 5), (4, 5, 0, 2)) - x62 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x62 += einsum(t2.abab, (0, 1, 2, 3), x61, (1, 3, 4, 5), (4, 0, 5, 2)) * -1.0 - x63 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x63 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x63 += einsum(x60, (0, 1, 2, 3), (1, 0, 3, 2)) * -2.0 - del x60 - x63 += einsum(x62, (0, 1, 2, 3), (1, 0, 3, 2)) - del x62 - t2new_aaaa += einsum(x63, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - t2new_aaaa += einsum(x63, (0, 1, 2, 3), (0, 1, 2, 3)) - del x63 - x64 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x64 += einsum(t1.aa, (0, 1), v.aaaa.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x65 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x65 += einsum(t1.aa, (0, 1), x64, (2, 3, 1, 4), (0, 2, 3, 4)) - x66 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x66 += einsum(v.aabb.vvov, (0, 1, 2, 3), t3.abaaba, (4, 2, 5, 6, 3, 1), (4, 5, 6, 0)) - x67 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x67 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 0, 6, 3, 1), (4, 5, 6, 2)) * -1.0 - x68 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x68 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x68 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x69 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x69 += einsum(t2.aaaa, (0, 1, 2, 3), x68, (1, 4, 5, 3), (0, 4, 2, 5)) - x70 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x70 += einsum(t2.aaaa, (0, 1, 2, 3), x69, (4, 1, 5, 3), (0, 4, 2, 5)) * -4.0 - del x69 - x71 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x71 += einsum(t1.bb, (0, 1), v.aabb.vvov, (2, 3, 0, 1), (2, 3)) - x72 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x72 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - x73 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x73 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 3, 1, 4), (2, 4)) * -1.0 - x74 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x74 += einsum(t1.aa, (0, 1), x45, (0, 1, 2, 3), (2, 3)) - del x45 - x75 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x75 += einsum(x71, (0, 1), (1, 0)) * -1.0 - x75 += einsum(x72, (0, 1), (1, 0)) - x75 += einsum(x73, (0, 1), (1, 0)) * 2.0 - x75 += einsum(x74, (0, 1), (1, 0)) * -1.0 - x76 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x76 += einsum(x75, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 4, 1)) * -2.0 - del x75 - x77 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x77 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - x78 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x78 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 2, 5, 6, 3, 1), (4, 5, 0, 6)) - x79 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x79 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 2, 6, 3, 1), (4, 5, 0, 6)) * -1.0 - x80 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x80 += einsum(x13, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) * -2.0 - x81 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x81 += einsum(t1.aa, (0, 1), x25, (2, 3, 4, 1), (2, 0, 4, 3)) - x82 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x82 += einsum(v.aaaa.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x82 += einsum(x81, (0, 1, 2, 3), (3, 1, 2, 0)) - x83 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x83 += einsum(t1.aa, (0, 1), x82, (0, 2, 3, 4), (2, 3, 4, 1)) - del x82 - x84 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x84 += einsum(x77, (0, 1, 2, 3), (2, 1, 0, 3)) * -2.0 - x84 += einsum(x78, (0, 1, 2, 3), (2, 1, 0, 3)) * 2.0 - x84 += einsum(x79, (0, 1, 2, 3), (2, 1, 0, 3)) * 6.0 - x84 += einsum(x80, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x84 += einsum(x83, (0, 1, 2, 3), (1, 0, 2, 3)) - del x83 - x85 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x85 += einsum(t1.aa, (0, 1), x84, (0, 2, 3, 4), (2, 3, 4, 1)) - del x84 - x86 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x86 += einsum(x65, (0, 1, 2, 3), (0, 1, 2, 3)) - del x65 - x86 += einsum(x66, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x66 - x86 += einsum(x67, (0, 1, 2, 3), (0, 1, 2, 3)) * -6.0 - del x67 - x86 += einsum(x70, (0, 1, 2, 3), (1, 0, 3, 2)) - del x70 - x86 += einsum(x76, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x76 - x86 += einsum(x85, (0, 1, 2, 3), (1, 0, 3, 2)) - del x85 - t2new_aaaa += einsum(x86, (0, 1, 2, 3), (0, 1, 2, 3)) - t2new_aaaa += einsum(x86, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x86 - x87 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x87 += einsum(v.aabb.ooov, (0, 1, 2, 3), t3.abaaba, (4, 2, 1, 5, 3, 6), (4, 0, 5, 6)) - x88 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x88 += einsum(v.aaaa.ooov, (0, 1, 2, 3), t3.aaaaaa, (4, 1, 2, 5, 6, 3), (4, 0, 5, 6)) - x89 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x89 += einsum(t2.aaaa, (0, 1, 2, 3), x49, (4, 5, 0, 1), (4, 5, 2, 3)) - x90 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x90 += einsum(x23, (0, 1, 2, 3), t3.abaaba, (4, 0, 3, 5, 1, 6), (2, 4, 5, 6)) - x91 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x91 += einsum(x25, (0, 1, 2, 3), t3.aaaaaa, (4, 1, 2, 5, 6, 3), (0, 4, 5, 6)) * -1.0 - x92 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x92 += einsum(f.aa.oo, (0, 1), (0, 1)) - x92 += einsum(x34, (0, 1), (1, 0)) - x93 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x93 += einsum(x92, (0, 1), t2.aaaa, (2, 1, 3, 4), (2, 0, 3, 4)) * -2.0 - del x92 - x94 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x94 += einsum(x29, (0, 1), (1, 0)) - x94 += einsum(x30, (0, 1), (1, 0)) - x94 += einsum(x31, (0, 1), (1, 0)) * 2.0 - x94 += einsum(x33, (0, 1), (1, 0)) * -1.0 - x95 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x95 += einsum(x94, (0, 1), t2.aaaa, (2, 0, 3, 4), (2, 1, 3, 4)) * -2.0 - del x94 - x96 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x96 += einsum(x87, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x87 - x96 += einsum(x88, (0, 1, 2, 3), (0, 1, 3, 2)) * -6.0 - del x88 - x96 += einsum(x89, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x89 - x96 += einsum(x90, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - del x90 - x96 += einsum(x91, (0, 1, 2, 3), (0, 1, 3, 2)) * 6.0 - del x91 - x96 += einsum(x93, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x93 - x96 += einsum(x95, (0, 1, 2, 3), (0, 1, 3, 2)) - del x95 - t2new_aaaa += einsum(x96, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - t2new_aaaa += einsum(x96, (0, 1, 2, 3), (1, 0, 2, 3)) - del x96 - x97 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x97 += einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - t2new_aaaa += einsum(x97, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - t2new_aaaa += einsum(x97, (0, 1, 2, 3), (1, 0, 2, 3)) - del x97 - x98 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x98 += einsum(t2.aaaa, (0, 1, 2, 3), (0, 1, 2, 3)) - x98 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - x99 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x99 += einsum(v.aaaa.ovov, (0, 1, 2, 3), x98, (4, 5, 1, 3), (0, 2, 4, 5)) - x100 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x100 += einsum(v.aaaa.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x100 += einsum(x99, (0, 1, 2, 3), (1, 3, 0, 2)) - t2new_aaaa += einsum(t2.aaaa, (0, 1, 2, 3), x100, (0, 4, 1, 5), (4, 5, 2, 3)) * 2.0 - del x100 - x101 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x101 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - x102 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x102 += einsum(t1.aa, (0, 1), x101, (2, 3, 0, 4), (2, 3, 4, 1)) * -2.0 - x102 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x102 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - t2new_aaaa += einsum(t1.aa, (0, 1), x102, (2, 3, 0, 4), (2, 3, 4, 1)) * -1.0 - del x102 - x103 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x103 += einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 0, 4), (1, 4, 2, 3)) - x104 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x104 += einsum(v.aabb.ovvv, (0, 1, 2, 3), (2, 3, 0, 1)) - x104 += einsum(x103, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - t2new_abab += einsum(x104, (0, 1, 2, 3), t3.abaaba, (4, 5, 2, 6, 0, 3), (4, 5, 6, 1)) * 2.0 - x105 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x105 += einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 2, 3, 4), (3, 4, 1, 2)) - x106 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x106 += einsum(v.aabb.vvov, (0, 1, 2, 3), (2, 3, 0, 1)) - x106 += einsum(x105, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - t2new_abab += einsum(x106, (0, 1, 2, 3), t3.babbab, (4, 5, 0, 6, 2, 1), (5, 4, 3, 6)) * 2.0 - x107 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x107 += einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 0, 4), (2, 1, 3, 4)) - x108 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x108 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) - x108 += einsum(x107, (0, 1, 2, 3), (0, 1, 2, 3)) - t2new_abab += einsum(x108, (0, 1, 2, 3), t3.babbab, (4, 5, 0, 2, 6, 3), (5, 4, 6, 1)) * 2.0 - del x108 - x109 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x109 += einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 0, 4), (2, 1, 3, 4)) - x110 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x110 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) - x110 += einsum(x109, (0, 1, 2, 3), (0, 1, 2, 3)) - t2new_abab += einsum(x110, (0, 1, 2, 3), t3.abaaba, (4, 5, 0, 2, 6, 3), (4, 5, 1, 6)) * 2.0 - del x110 - x111 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x111 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - x112 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x112 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x112 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x113 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x113 += einsum(t2.bbbb, (0, 1, 2, 3), (0, 1, 2, 3)) - x113 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -0.5 - x114 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x114 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x114 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) - x115 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x115 += einsum(t1.bb, (0, 1), x114, (2, 3, 1, 4), (2, 0, 3, 4)) - x116 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x116 += einsum(t1.bb, (0, 1), x18, (2, 3, 0, 4), (2, 3, 4, 1)) - x117 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x117 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x117 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x117 += einsum(x111, (0, 1, 2, 3), (1, 0, 3, 2)) - x117 += einsum(x112, (0, 1, 2, 3), x113, (0, 4, 3, 5), (1, 4, 2, 5)) * -2.0 - x117 += einsum(x115, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x117 += einsum(x116, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - t2new_abab += einsum(t2.abab, (0, 1, 2, 3), x117, (1, 4, 3, 5), (0, 4, 2, 5)) - del x117 - x118 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x118 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x118 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) - x119 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x119 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x119 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - x120 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x120 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x120 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x120 += einsum(x11, (0, 1, 2, 3), x40, (0, 4, 3, 5), (1, 4, 2, 5)) * -2.0 - x120 += einsum(t1.aa, (0, 1), x118, (2, 1, 3, 4), (2, 0, 4, 3)) * -1.0 - x120 += einsum(t1.aa, (0, 1), x119, (0, 2, 3, 4), (3, 2, 4, 1)) * -1.0 - del x119 - t2new_abab += einsum(t2.abab, (0, 1, 2, 3), x120, (0, 4, 2, 5), (4, 1, 5, 3)) * -1.0 - del x120 - x121 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x121 += einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 4), (1, 4, 2, 3)) - x122 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x122 += einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (3, 4, 0, 2)) - x123 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x123 += einsum(v.aabb.oovv, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - x123 += einsum(x121, (0, 1, 2, 3), (1, 0, 3, 2)) - x123 += einsum(x122, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - x123 += einsum(v.aabb.ovov, (0, 1, 2, 3), x5, (2, 4, 5, 1), (3, 4, 0, 5)) - t2new_abab += einsum(t2.abab, (0, 1, 2, 3), x123, (3, 4, 0, 5), (5, 1, 2, 4)) - del x123 - x124 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x124 += einsum(t1.aa, (0, 1), v.aabb.ooov, (2, 0, 3, 4), (3, 4, 2, 1)) - x125 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x125 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x125 += einsum(x124, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x125 += einsum(x38, (0, 1, 2, 3), (0, 1, 2, 3)) - x125 += einsum(v.aabb.ovov, (0, 1, 2, 3), x40, (0, 4, 1, 5), (2, 3, 4, 5)) * 2.0 - t2new_abab += einsum(t2.bbbb, (0, 1, 2, 3), x125, (1, 3, 4, 5), (4, 0, 5, 2)) * 2.0 - del x125 - x126 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x126 += einsum(t2.aaaa, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x126 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -1.0 - x127 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x127 += einsum(t1.bb, (0, 1), v.aabb.ovvv, (2, 3, 4, 1), (0, 4, 2, 3)) - x128 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x128 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x128 += einsum(x127, (0, 1, 2, 3), (0, 1, 2, 3)) - x128 += einsum(t1.bb, (0, 1), x4, (0, 2, 3, 4), (2, 1, 3, 4)) * -1.0 - t2new_abab += einsum(x126, (0, 1, 2, 3), x128, (4, 5, 0, 2), (1, 4, 3, 5)) - del x126, x128 - x129 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x129 += einsum(t1.bb, (0, 1), v.aabb.vvov, (2, 3, 4, 1), (0, 4, 2, 3)) - x130 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x130 += einsum(v.aabb.ovoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x130 += einsum(x3, (0, 1, 2, 3), (0, 1, 2, 3)) - x131 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x131 += einsum(v.aabb.vvoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x131 += einsum(x129, (0, 1, 2, 3), (1, 0, 3, 2)) - x131 += einsum(t1.aa, (0, 1), x130, (2, 3, 0, 4), (3, 2, 4, 1)) * -1.0 - t2new_abab += einsum(t2.abab, (0, 1, 2, 3), x131, (1, 4, 2, 5), (0, 4, 5, 3)) * -1.0 - del x131 - x132 = np.zeros((nvir[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x132 += einsum(t1.bb, (0, 1), v.aabb.vvov, (2, 3, 0, 4), (1, 4, 2, 3)) - x133 = np.zeros((nvir[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x133 += einsum(t1.aa, (0, 1), v.aabb.ovvv, (0, 2, 3, 4), (3, 4, 1, 2)) - x134 = np.zeros((nvir[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x134 += einsum(v.aabb.vvvv, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - x134 += einsum(x132, (0, 1, 2, 3), (1, 0, 3, 2)) - x134 += einsum(x133, (0, 1, 2, 3), (1, 0, 3, 2)) - t2new_abab += einsum(t2.abab, (0, 1, 2, 3), x134, (3, 4, 2, 5), (0, 1, 5, 4)) * -1.0 - del x134 - x135 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x135 += einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 4, 1), (0, 4, 2, 3)) - x136 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x136 += einsum(t1.aa, (0, 1), v.aabb.ovoo, (2, 1, 3, 4), (3, 4, 0, 2)) - x137 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x137 += einsum(v.aabb.ovov, (0, 1, 2, 3), x5, (4, 3, 5, 1), (4, 2, 5, 0)) - x138 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x138 += einsum(v.aabb.oooo, (0, 1, 2, 3), (2, 3, 0, 1)) - x138 += einsum(x135, (0, 1, 2, 3), (1, 0, 3, 2)) - x138 += einsum(x136, (0, 1, 2, 3), (1, 0, 3, 2)) - x138 += einsum(x137, (0, 1, 2, 3), (1, 0, 3, 2)) - t2new_abab += einsum(t2.abab, (0, 1, 2, 3), x138, (1, 4, 0, 5), (5, 4, 2, 3)) - del x138 - x139 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x139 += einsum(t1.aa, (0, 1), x13, (0, 2), (2, 1)) - x140 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x140 += einsum(f.aa.vv, (0, 1), (0, 1)) * -1.0 - x140 += einsum(x71, (0, 1), (1, 0)) * -1.0 - x140 += einsum(x72, (0, 1), (1, 0)) - x140 += einsum(x73, (0, 1), (1, 0)) * 2.0 - x140 += einsum(x74, (0, 1), (1, 0)) * -1.0 - del x74 - x140 += einsum(x139, (0, 1), (0, 1)) - t2new_abab += einsum(x140, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1.0 - t3new_babbab += einsum(x140, (0, 1), t3.babbab, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) * -2.0 - del x140 - x141 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x141 += einsum(t1.aa, (0, 1), v.aabb.ovvv, (0, 1, 2, 3), (2, 3)) - x142 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x142 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 4, 1, 3), (2, 4)) - x143 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x143 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 4), (3, 4)) - x144 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x144 += einsum(t1.bb, (0, 1), x114, (0, 2, 1, 3), (2, 3)) - del x114 - x145 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x145 += einsum(t1.bb, (0, 1), x9, (0, 2), (2, 1)) - x146 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x146 += einsum(f.bb.vv, (0, 1), (0, 1)) * -1.0 - x146 += einsum(x141, (0, 1), (1, 0)) * -1.0 - x146 += einsum(x142, (0, 1), (1, 0)) * 2.0 - x146 += einsum(x143, (0, 1), (1, 0)) - x146 += einsum(x144, (0, 1), (0, 1)) * -1.0 - x146 += einsum(x145, (0, 1), (0, 1)) - t2new_abab += einsum(x146, (0, 1), t2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -1.0 - t3new_abaaba += einsum(x146, (0, 1), t3.abaaba, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) * -2.0 - del x146 - x147 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x147 += einsum(t1.aa, (0, 1), v.aabb.vvoo, (2, 1, 3, 4), (3, 4, 0, 2)) - x148 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x148 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x148 += einsum(x38, (0, 1, 2, 3), (0, 1, 2, 3)) - x149 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x149 += einsum(t1.bb, (0, 1), x148, (2, 1, 3, 4), (2, 0, 3, 4)) - del x148 - x150 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x150 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 5, 3), (1, 5, 0, 4)) - x151 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x151 += einsum(v.aabb.oooo, (0, 1, 2, 3), (2, 3, 0, 1)) - x151 += einsum(x135, (0, 1, 2, 3), (0, 1, 3, 2)) - x151 += einsum(x150, (0, 1, 2, 3), (0, 1, 3, 2)) - x152 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x152 += einsum(v.aabb.ovoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x152 += einsum(x147, (0, 1, 2, 3), (1, 0, 2, 3)) - x152 += einsum(x149, (0, 1, 2, 3), (0, 1, 2, 3)) - x152 += einsum(t1.aa, (0, 1), x151, (2, 3, 0, 4), (3, 2, 4, 1)) * -1.0 - del x151 - t2new_abab += einsum(t1.bb, (0, 1), x152, (0, 2, 3, 4), (3, 2, 4, 1)) * -1.0 - del x152 - x153 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x153 += einsum(t1.aa, (0, 1), v.aabb.vvvv, (2, 1, 3, 4), (3, 4, 0, 2)) - x154 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x154 += einsum(v.aabb.ovvv, (0, 1, 2, 3), (2, 3, 0, 1)) - x154 += einsum(x153, (0, 1, 2, 3), (1, 0, 2, 3)) - t2new_abab += einsum(t1.bb, (0, 1), x154, (1, 2, 3, 4), (3, 0, 4, 2)) - del x154 - x155 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x155 += einsum(t1.bb, (0, 1), v.aabb.oovv, (2, 3, 4, 1), (0, 4, 2, 3)) - x156 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x156 += einsum(v.aabb.ooov, (0, 1, 2, 3), (2, 3, 0, 1)) - x156 += einsum(x155, (0, 1, 2, 3), (0, 1, 3, 2)) - t2new_abab += einsum(t1.aa, (0, 1), x156, (2, 3, 0, 4), (4, 2, 1, 3)) * -1.0 - del x156 - x157 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x157 += einsum(t1.bb, (0, 1), v.bbbb.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x158 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x158 += einsum(t1.bb, (0, 1), x157, (2, 3, 1, 4), (0, 2, 3, 4)) - x159 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x159 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 0, 6, 1, 3), (4, 5, 6, 2)) - x160 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x160 += einsum(v.aabb.ovvv, (0, 1, 2, 3), t3.babbab, (4, 0, 5, 6, 1, 3), (4, 5, 6, 2)) - x161 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x161 += einsum(t2.bbbb, (0, 1, 2, 3), x7, (1, 4, 3, 5), (4, 0, 5, 2)) - x162 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x162 += einsum(t2.bbbb, (0, 1, 2, 3), x161, (1, 4, 3, 5), (4, 0, 5, 2)) * -4.0 - del x161 - x163 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x163 += einsum(t2.abab, (0, 1, 2, 3), x11, (0, 4, 2, 5), (1, 3, 4, 5)) - x164 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x164 += einsum(t2.abab, (0, 1, 2, 3), x163, (4, 5, 0, 2), (4, 1, 5, 3)) * -1.0 - x165 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x165 += einsum(x141, (0, 1), (1, 0)) * -1.0 - x165 += einsum(x142, (0, 1), (1, 0)) * 2.0 - x165 += einsum(x143, (0, 1), (1, 0)) - x165 += einsum(x144, (0, 1), (0, 1)) * -1.0 - del x144 - x166 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x166 += einsum(x165, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 1, 4)) * -2.0 - del x165 - x167 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x167 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - x168 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x168 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 2, 6, 3, 1), (4, 5, 0, 6)) * -1.0 - x169 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x169 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 0, 5, 6, 1, 3), (4, 5, 2, 6)) - x170 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x170 += einsum(x9, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) * -2.0 - x171 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x171 += einsum(t1.bb, (0, 1), x1, (2, 3, 4, 1), (2, 0, 4, 3)) - x172 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x172 += einsum(v.bbbb.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x172 += einsum(x171, (0, 1, 2, 3), (3, 1, 2, 0)) - x173 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x173 += einsum(t1.bb, (0, 1), x172, (0, 2, 3, 4), (2, 3, 4, 1)) - del x172 - x174 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x174 += einsum(x167, (0, 1, 2, 3), (2, 1, 0, 3)) * -2.0 - x174 += einsum(x168, (0, 1, 2, 3), (2, 1, 0, 3)) * 6.0 - x174 += einsum(x169, (0, 1, 2, 3), (2, 1, 0, 3)) * 2.0 - x174 += einsum(x170, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x174 += einsum(x173, (0, 1, 2, 3), (1, 0, 2, 3)) - del x173 - x175 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x175 += einsum(t1.bb, (0, 1), x174, (0, 2, 3, 4), (2, 3, 4, 1)) - del x174 - x176 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x176 += einsum(x158, (0, 1, 2, 3), (0, 1, 2, 3)) - del x158 - x176 += einsum(x159, (0, 1, 2, 3), (0, 1, 2, 3)) * -6.0 - del x159 - x176 += einsum(x160, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x160 - x176 += einsum(x162, (0, 1, 2, 3), (0, 1, 2, 3)) - del x162 - x176 += einsum(x164, (0, 1, 2, 3), (0, 1, 2, 3)) - del x164 - x176 += einsum(x166, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x166 - x176 += einsum(x175, (0, 1, 2, 3), (1, 0, 3, 2)) - del x175 - t2new_bbbb += einsum(x176, (0, 1, 2, 3), (0, 1, 2, 3)) - t2new_bbbb += einsum(x176, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x176 - x177 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x177 += einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x178 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x178 += einsum(t2.abab, (0, 1, 2, 3), x127, (4, 5, 0, 2), (4, 1, 3, 5)) - x179 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x179 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x179 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x179 += einsum(x111, (0, 1, 2, 3), (1, 0, 3, 2)) - x180 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x180 += einsum(t2.bbbb, (0, 1, 2, 3), x179, (1, 4, 3, 5), (4, 0, 5, 2)) * 2.0 - del x179 - x181 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x181 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x181 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x182 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x182 += einsum(t1.bb, (0, 1), x181, (2, 1, 3, 4), (2, 0, 3, 4)) - del x181 - x183 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x183 += einsum(t2.bbbb, (0, 1, 2, 3), x182, (1, 4, 5, 3), (4, 0, 5, 2)) * -2.0 - x184 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x184 += einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - x185 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x185 += einsum(t1.bb, (0, 1), x184, (2, 3, 4, 0), (2, 4, 3, 1)) - x186 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x186 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (0, 2, 4, 5), (1, 4, 5, 3)) - x187 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x187 += einsum(t2.abab, (0, 1, 2, 3), x3, (4, 5, 0, 2), (4, 1, 5, 3)) - x188 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x188 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x188 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - x189 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x189 += einsum(t2.bbbb, (0, 1, 2, 3), x188, (1, 4, 5, 3), (4, 5, 0, 2)) * 2.0 - x190 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x190 += einsum(x1, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x190 += einsum(x1, (0, 1, 2, 3), (0, 2, 1, 3)) - x191 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x191 += einsum(t2.bbbb, (0, 1, 2, 3), x190, (4, 1, 5, 3), (4, 5, 0, 2)) * 2.0 - x192 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x192 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x192 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x192 += einsum(x177, (0, 1, 2, 3), (0, 1, 2, 3)) - x193 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x193 += einsum(t1.bb, (0, 1), x192, (2, 3, 1, 4), (2, 3, 0, 4)) - x194 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x194 += einsum(x185, (0, 1, 2, 3), (0, 2, 1, 3)) - x194 += einsum(x186, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x194 += einsum(x187, (0, 1, 2, 3), (0, 2, 1, 3)) - x194 += einsum(x189, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x189 - x194 += einsum(x191, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x191 - x194 += einsum(x193, (0, 1, 2, 3), (2, 1, 0, 3)) - x195 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x195 += einsum(t1.bb, (0, 1), x194, (2, 0, 3, 4), (2, 3, 4, 1)) - del x194 - x196 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x196 += einsum(x177, (0, 1, 2, 3), (0, 1, 2, 3)) - x196 += einsum(x111, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x196 += einsum(x178, (0, 1, 2, 3), (0, 1, 2, 3)) - del x178 - x196 += einsum(x180, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x180 - x196 += einsum(x183, (0, 1, 2, 3), (0, 1, 3, 2)) - del x183 - x196 += einsum(x195, (0, 1, 2, 3), (0, 1, 3, 2)) - del x195 - t2new_bbbb += einsum(x196, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - t2new_bbbb += einsum(x196, (0, 1, 2, 3), (0, 1, 3, 2)) - t2new_bbbb += einsum(x196, (0, 1, 2, 3), (1, 0, 2, 3)) - t2new_bbbb += einsum(x196, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x196 - x197 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x197 += einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - x198 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x198 += einsum(v.bbbb.ooov, (0, 1, 2, 3), t3.bbbbbb, (4, 1, 2, 5, 6, 3), (4, 0, 5, 6)) - x199 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x199 += einsum(t2.bbbb, (0, 1, 2, 3), x184, (4, 5, 0, 1), (4, 5, 2, 3)) - x200 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x200 += einsum(v.aabb.ovoo, (0, 1, 2, 3), t3.babbab, (4, 0, 3, 5, 1, 6), (4, 2, 5, 6)) - x201 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x201 += einsum(x1, (0, 1, 2, 3), t3.bbbbbb, (4, 1, 2, 5, 6, 3), (0, 4, 5, 6)) * -1.0 - x202 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x202 += einsum(x3, (0, 1, 2, 3), t3.babbab, (4, 2, 1, 5, 3, 6), (0, 4, 5, 6)) - x203 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x203 += einsum(f.bb.oo, (0, 1), (0, 1)) - x203 += einsum(x20, (0, 1), (1, 0)) - x204 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x204 += einsum(x203, (0, 1), t2.bbbb, (2, 1, 3, 4), (0, 2, 3, 4)) * -2.0 - del x203 - x205 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x205 += einsum(x15, (0, 1), (1, 0)) - x205 += einsum(x16, (0, 1), (1, 0)) * 2.0 - x205 += einsum(x17, (0, 1), (1, 0)) - x205 += einsum(x19, (0, 1), (1, 0)) * -1.0 - x206 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x206 += einsum(x205, (0, 1), t2.bbbb, (2, 0, 3, 4), (1, 2, 3, 4)) * -2.0 - del x205 - x207 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x207 += einsum(x197, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x197 - x207 += einsum(x198, (0, 1, 2, 3), (0, 1, 3, 2)) * -6.0 - del x198 - x207 += einsum(x199, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x199 - x207 += einsum(x200, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x200 - x207 += einsum(x201, (0, 1, 2, 3), (0, 1, 3, 2)) * 6.0 - del x201 - x207 += einsum(x202, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - del x202 - x207 += einsum(x204, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x204 - x207 += einsum(x206, (0, 1, 2, 3), (1, 0, 3, 2)) - del x206 - t2new_bbbb += einsum(x207, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - t2new_bbbb += einsum(x207, (0, 1, 2, 3), (1, 0, 2, 3)) - del x207 - x208 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x208 += einsum(f.bb.vv, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - x209 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x209 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x209 += einsum(x208, (0, 1, 2, 3), (1, 0, 3, 2)) * -2.0 - del x208 - t2new_bbbb += einsum(x209, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - t2new_bbbb += einsum(x209, (0, 1, 2, 3), (0, 1, 2, 3)) - del x209 - x210 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x210 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - x211 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x211 += einsum(v.bbbb.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x211 += einsum(x210, (0, 1, 2, 3), (3, 1, 2, 0)) * -1.0 - x211 += einsum(x171, (0, 1, 2, 3), (2, 1, 3, 0)) - t2new_bbbb += einsum(t2.bbbb, (0, 1, 2, 3), x211, (0, 4, 1, 5), (4, 5, 2, 3)) * -2.0 - del x211 - x212 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x212 += einsum(t1.bb, (0, 1), x210, (2, 3, 0, 4), (2, 3, 4, 1)) * -2.0 - x212 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x212 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - t2new_bbbb += einsum(t1.bb, (0, 1), x212, (2, 3, 0, 4), (2, 3, 1, 4)) - del x212 - x213 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x213 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 2, 5, 6, 3, 7), (4, 5, 0, 6, 7, 1)) - x214 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x214 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 1, 5), (4, 2, 3, 5)) - x215 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x215 += einsum(t2.aaaa, (0, 1, 2, 3), x214, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - x216 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x216 += einsum(t2.aaaa, (0, 1, 2, 3), x77, (4, 5, 1, 6), (4, 5, 0, 2, 3, 6)) - x217 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x217 += einsum(x28, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 0, 6, 7, 2), (4, 5, 1, 6, 7, 3)) * 6.0 - x218 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x218 += einsum(x213, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * 2.0 - del x213 - x218 += einsum(x215, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -4.0 - del x215 - x218 += einsum(x216, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -4.0 - del x216 - x218 += einsum(x217, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x217 - t3new_aaaaaa = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - t3new_aaaaaa += einsum(x218, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new_aaaaaa += einsum(x218, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new_aaaaaa += einsum(x218, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new_aaaaaa += einsum(x218, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - t3new_aaaaaa += einsum(x218, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - t3new_aaaaaa += einsum(x218, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - t3new_aaaaaa += einsum(x218, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new_aaaaaa += einsum(x218, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new_aaaaaa += einsum(x218, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - del x218 - x219 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x219 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 5, 1, 3), (0, 2, 4, 5)) - x220 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x220 += einsum(t2.aaaa, (0, 1, 2, 3), x118, (1, 3, 4, 5), (0, 2, 4, 5)) * 2.0 - x221 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x221 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x221 += einsum(x219, (0, 1, 2, 3), (0, 1, 3, 2)) - x221 += einsum(x220, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x220 - x222 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x222 += einsum(t2.aaaa, (0, 1, 2, 3), x221, (4, 5, 3, 6), (0, 1, 4, 2, 5, 6)) * -2.0 - del x221 - x223 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x223 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - x224 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x224 += einsum(t1.aa, (0, 1), x223, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - del x223 - x225 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x225 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - x226 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x226 += einsum(t2.aaaa, (0, 1, 2, 3), x68, (1, 4, 5, 3), (0, 4, 2, 5)) * 2.0 - x227 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x227 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x227 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x227 += einsum(x225, (0, 1, 2, 3), (0, 1, 2, 3)) - x227 += einsum(x226, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x228 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x228 += einsum(t2.aaaa, (0, 1, 2, 3), x227, (4, 5, 6, 3), (0, 1, 4, 5, 2, 6)) * -1.0 - del x227 - x229 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x229 += einsum(x224, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x224 - x229 += einsum(x228, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x228 - x230 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x230 += einsum(t1.aa, (0, 1), x229, (2, 3, 0, 4, 5, 6), (2, 3, 4, 5, 6, 1)) * 2.0 - del x229 - x231 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x231 += einsum(x222, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - del x222 - x231 += einsum(x230, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - del x230 - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * -1.0 - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) * -1.0 - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) * -1.0 - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) - t3new_aaaaaa += einsum(x231, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) * -1.0 - del x231 - x232 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x232 += einsum(v.aaaa.oooo, (0, 1, 2, 3), t3.aaaaaa, (4, 3, 1, 5, 6, 7), (4, 0, 2, 5, 6, 7)) * -1.0 - x233 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x233 += einsum(f.aa.oo, (0, 1), (0, 1)) - x233 += einsum(x30, (0, 1), (1, 0)) - x233 += einsum(x31, (0, 1), (1, 0)) * 2.0 - x233 += einsum(x34, (0, 1), (0, 1)) - x234 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x234 += einsum(x233, (0, 1), t3.aaaaaa, (2, 3, 0, 4, 5, 6), (2, 3, 1, 4, 5, 6)) * 6.0 - del x233 - x235 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x235 += einsum(x232, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * 6.0 - del x232 - x235 += einsum(x234, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) - del x234 - t3new_aaaaaa += einsum(x235, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new_aaaaaa += einsum(x235, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * -1.0 - t3new_aaaaaa += einsum(x235, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - del x235 - x236 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x236 += einsum(v.aaaa.vvvv, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 6, 7, 3, 1), (4, 5, 6, 7, 0, 2)) * -1.0 - x237 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x237 += einsum(f.aa.vv, (0, 1), (0, 1)) * -1.0 - x237 += einsum(x72, (0, 1), (1, 0)) - x237 += einsum(x73, (0, 1), (1, 0)) * 2.0 - x237 += einsum(x139, (0, 1), (0, 1)) - x238 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x238 += einsum(x237, (0, 1), t3.aaaaaa, (2, 3, 4, 5, 6, 0), (2, 3, 4, 5, 6, 1)) * 6.0 - del x237 - x239 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x239 += einsum(x236, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -6.0 - del x236 - x239 += einsum(x238, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 3, 4)) * -1.0 - del x238 - t3new_aaaaaa += einsum(x239, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new_aaaaaa += einsum(x239, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - t3new_aaaaaa += einsum(x239, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - del x239 - x240 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x240 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 2, 0, 5, 3, 6), (4, 5, 6, 1)) - x241 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x241 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.aaaaaa, (4, 0, 2, 5, 6, 3), (4, 5, 6, 1)) - x242 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x242 += einsum(x240, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x242 += einsum(x241, (0, 1, 2, 3), (0, 2, 1, 3)) * -3.0 - x243 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x243 += einsum(t2.aaaa, (0, 1, 2, 3), x242, (4, 5, 6, 3), (0, 1, 4, 2, 5, 6)) * -4.0 - del x242 - x244 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x244 += einsum(v.aabb.ooov, (0, 1, 2, 3), t3.abaaba, (4, 2, 5, 6, 3, 7), (4, 5, 0, 1, 6, 7)) - x245 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x245 += einsum(x32, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 2, 6, 7, 3), (4, 5, 0, 1, 6, 7)) * 3.0 - x246 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x246 += einsum(x244, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x244 - x246 += einsum(x245, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x245 - x247 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x247 += einsum(t1.aa, (0, 1), x246, (2, 3, 0, 4, 5, 6), (2, 3, 4, 5, 6, 1)) * 2.0 - del x246 - x248 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x248 += einsum(x243, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 5, 4)) * -1.0 - del x243 - x248 += einsum(x247, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - del x247 - t3new_aaaaaa += einsum(x248, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new_aaaaaa += einsum(x248, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - t3new_aaaaaa += einsum(x248, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - t3new_aaaaaa += einsum(x248, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - t3new_aaaaaa += einsum(x248, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - t3new_aaaaaa += einsum(x248, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - t3new_aaaaaa += einsum(x248, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - t3new_aaaaaa += einsum(x248, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) - t3new_aaaaaa += einsum(x248, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - del x248 - x249 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x249 += einsum(x101, (0, 1, 2, 3), (1, 0, 3, 2)) - x249 += einsum(x81, (0, 1, 2, 3), (0, 1, 2, 3)) - x250 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x250 += einsum(x249, (0, 1, 2, 3), t3.aaaaaa, (4, 2, 3, 5, 6, 7), (4, 0, 1, 5, 6, 7)) * -6.0 - del x249 - x251 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x251 += einsum(x29, (0, 1), (1, 0)) - del x29 - x251 += einsum(x33, (0, 1), (1, 0)) * -1.0 - del x33 - x252 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x252 += einsum(x251, (0, 1), t3.aaaaaa, (2, 3, 0, 4, 5, 6), (2, 3, 1, 4, 5, 6)) * 6.0 - x253 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x253 += einsum(x250, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) - del x250 - x253 += einsum(x252, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - del x252 - t3new_aaaaaa += einsum(x253, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - t3new_aaaaaa += einsum(x253, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -1.0 - t3new_aaaaaa += einsum(x253, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) * -1.0 - del x253 - x254 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x254 += einsum(t1.aa, (0, 1), x118, (0, 1, 2, 3), (2, 3)) - x255 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x255 += einsum(x71, (0, 1), (1, 0)) - del x71 - x255 += einsum(x254, (0, 1), (1, 0)) * -1.0 - del x254 - x256 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x256 += einsum(x255, (0, 1), t3.aaaaaa, (2, 3, 4, 5, 6, 0), (2, 3, 4, 5, 6, 1)) * 6.0 - x257 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x257 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 6, 7, 3, 1), (4, 5, 6, 0, 2, 7)) * -1.0 - x258 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x258 += einsum(x98, (0, 1, 2, 3), x257, (4, 5, 6, 0, 1, 7), (4, 5, 6, 2, 3, 7)) * 6.0 - del x98, x257 - x259 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x259 += einsum(x256, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) - del x256 - x259 += einsum(x258, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x258 - t3new_aaaaaa += einsum(x259, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new_aaaaaa += einsum(x259, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - t3new_aaaaaa += einsum(x259, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - del x259 - x260 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x260 += einsum(x38, (0, 1, 2, 3), t3.abaaba, (4, 0, 5, 6, 1, 7), (2, 4, 5, 6, 7, 3)) - x261 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x261 += einsum(t2.aaaa, (0, 1, 2, 3), x25, (4, 0, 1, 5), (4, 2, 3, 5)) - x262 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x262 += einsum(t2.aaaa, (0, 1, 2, 3), x261, (4, 5, 6, 3), (4, 0, 1, 5, 6, 2)) * -1.0 - x263 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x263 += einsum(x46, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 0, 6, 7, 3), (4, 5, 1, 6, 7, 2)) * -6.0 - x264 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x264 += einsum(x78, (0, 1, 2, 3), (0, 1, 2, 3)) - x264 += einsum(x79, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x265 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x265 += einsum(t2.aaaa, (0, 1, 2, 3), x264, (4, 5, 1, 6), (0, 4, 5, 2, 3, 6)) * -4.0 - del x264 - x266 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x266 += einsum(x260, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * 2.0 - del x260 - x266 += einsum(x262, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * -4.0 - del x262 - x266 += einsum(x263, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) - del x263 - x266 += einsum(x265, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x265 - t3new_aaaaaa += einsum(x266, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new_aaaaaa += einsum(x266, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - t3new_aaaaaa += einsum(x266, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - t3new_aaaaaa += einsum(x266, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) - t3new_aaaaaa += einsum(x266, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) * -1.0 - t3new_aaaaaa += einsum(x266, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) - t3new_aaaaaa += einsum(x266, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - t3new_aaaaaa += einsum(x266, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) - t3new_aaaaaa += einsum(x266, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) * -1.0 - del x266 - x267 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x267 += einsum(t2.aaaa, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0000000000000204 - x267 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -1.0 - x268 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x268 += einsum(x267, (0, 1, 2, 3), x68, (0, 4, 5, 2), (4, 1, 5, 3)) * 0.9999999999999901 - del x267 - x269 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x269 += einsum(x225, (0, 1, 2, 3), (0, 1, 2, 3)) - x269 += einsum(x268, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x268 - x270 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x270 += einsum(x269, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 1, 6, 7, 3), (4, 5, 0, 6, 7, 2)) * 6.0000000000000595 - del x269 - x271 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x271 += einsum(t2.aaaa, (0, 1, 2, 3), (0, 1, 2, 3)) - x271 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -0.499999999999995 - x272 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x272 += einsum(v.aabb.ovov, (0, 1, 2, 3), x271, (0, 4, 1, 5), (2, 3, 4, 5)) - x273 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x273 += einsum(x272, (0, 1, 2, 3), t3.abaaba, (4, 0, 5, 6, 1, 7), (4, 5, 2, 6, 7, 3)) * 4.00000000000004 - del x272 - x274 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x274 += einsum(x270, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) - del x270 - x274 += einsum(x273, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) - del x273 - t3new_aaaaaa += einsum(x274, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new_aaaaaa += einsum(x274, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - t3new_aaaaaa += einsum(x274, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - t3new_aaaaaa += einsum(x274, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) - t3new_aaaaaa += einsum(x274, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) * -1.0 - t3new_aaaaaa += einsum(x274, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) - t3new_aaaaaa += einsum(x274, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - t3new_aaaaaa += einsum(x274, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) - t3new_aaaaaa += einsum(x274, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - del x274 - x275 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x275 += einsum(t2.aaaa, (0, 1, 2, 3), x64, (4, 5, 3, 6), (4, 0, 1, 2, 6, 5)) - x276 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x276 += einsum(t2.aaaa, (0, 1, 2, 3), x25, (4, 5, 6, 3), (4, 0, 1, 6, 5, 2)) - x277 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x277 += einsum(t1.aa, (0, 1), x276, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - del x276 - x278 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x278 += einsum(t2.aaaa, (0, 1, 2, 3), x46, (4, 5, 6, 3), (0, 1, 5, 4, 2, 6)) - x279 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x279 += einsum(x277, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - del x277 - x279 += einsum(x278, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - del x278 - x280 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x280 += einsum(t1.aa, (0, 1), x279, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 6, 1)) * 2.0 - del x279 - x281 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x281 += einsum(x275, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -2.0 - del x275 - x281 += einsum(x280, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -1.0 - del x280 - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * -1.0 - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * -1.0 - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * -1.0 - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 4, 3)) - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) * -1.0 - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) - t3new_aaaaaa += einsum(x281, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) * -1.0 - del x281 - x282 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x282 += einsum(x49, (0, 1, 2, 3), t3.aaaaaa, (4, 2, 3, 5, 6, 7), (0, 4, 1, 5, 6, 7)) - t3new_aaaaaa += einsum(x282, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * 6.0 - t3new_aaaaaa += einsum(x282, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -6.0 - t3new_aaaaaa += einsum(x282, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) * -6.0 - t3new_aaaaaa += einsum(x282, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * 6.0 - t3new_aaaaaa += einsum(x282, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 5, 3)) * 6.0 - t3new_aaaaaa += einsum(x282, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -6.0 - del x282 - x283 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x283 += einsum(x61, (0, 1, 2, 3), t3.abaaba, (4, 0, 5, 6, 1, 7), (4, 5, 2, 6, 7, 3)) * -2.00000000000002 - t3new_aaaaaa += einsum(x283, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) - t3new_aaaaaa += einsum(x283, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - t3new_aaaaaa += einsum(x283, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) - t3new_aaaaaa += einsum(x283, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 4, 3)) * -1.0 - t3new_aaaaaa += einsum(x283, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 5, 3)) - t3new_aaaaaa += einsum(x283, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 3, 5)) * -1.0 - t3new_aaaaaa += einsum(x283, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -1.0 - t3new_aaaaaa += einsum(x283, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - t3new_aaaaaa += einsum(x283, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x283 - x284 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x284 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 6, 7, 1, 3), (4, 5, 6, 0, 7, 2)) - x285 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x285 += einsum(t1.aa, (0, 1), x284, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x284 - t3new_aaaaaa += einsum(x285, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 6.0 - t3new_aaaaaa += einsum(x285, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -6.0 - t3new_aaaaaa += einsum(x285, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -6.0 - t3new_aaaaaa += einsum(x285, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * 6.0 - t3new_aaaaaa += einsum(x285, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * 6.0 - t3new_aaaaaa += einsum(x285, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -6.0 - del x285 - x286 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x286 += einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - x287 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x287 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - x288 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x288 += einsum(x286, (0, 1, 2, 3), (0, 2, 1, 3)) - x288 += einsum(x48, (0, 1, 2, 3), (0, 2, 1, 3)) - x288 += einsum(x287, (0, 1, 2, 3), (0, 2, 1, 3)) * 2.0 - x289 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x289 += einsum(t1.aa, (0, 1), x81, (2, 3, 0, 4), (3, 2, 4, 1)) - del x81 - x290 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x290 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x290 += einsum(x37, (0, 1, 2, 3), (1, 0, 2, 3)) - x291 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x291 += einsum(t1.aa, (0, 1), x290, (2, 3, 1, 4), (2, 3, 0, 4)) - x292 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x292 += einsum(v.aaaa.ooov, (0, 1, 2, 3), x40, (1, 4, 3, 5), (0, 2, 4, 5)) * 2.0 - x293 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x293 += einsum(x52, (0, 1, 2, 3), (0, 1, 2, 3)) - x293 += einsum(x289, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x293 += einsum(x56, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x56 - x293 += einsum(x291, (0, 1, 2, 3), (2, 1, 0, 3)) - del x291 - x293 += einsum(x292, (0, 1, 2, 3), (2, 0, 1, 3)) - del x292 - x294 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x294 += einsum(x101, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0 - del x101 - x294 += einsum(v.aaaa.oooo, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x294 += einsum(v.aaaa.oooo, (0, 1, 2, 3), (0, 2, 1, 3)) - x295 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x295 += einsum(t1.aa, (0, 1), x294, (2, 3, 0, 4), (2, 3, 4, 1)) - x296 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x296 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x296 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - x296 += einsum(x288, (0, 1, 2, 3), (0, 1, 2, 3)) - x296 += einsum(x288, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x288 - x296 += einsum(x293, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x296 += einsum(x293, (0, 1, 2, 3), (1, 0, 2, 3)) - del x293 - x296 += einsum(x50, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x296 += einsum(x50, (0, 1, 2, 3), (1, 0, 2, 3)) - x296 += einsum(x80, (0, 1, 2, 3), (2, 1, 0, 3)) - x296 += einsum(x295, (0, 1, 2, 3), (1, 0, 2, 3)) - x297 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x297 += einsum(t2.aaaa, (0, 1, 2, 3), x296, (4, 5, 1, 6), (0, 4, 5, 2, 3, 6)) * -2.0 - del x296 - t3new_aaaaaa += einsum(x297, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - t3new_aaaaaa += einsum(x297, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 3, 5)) - t3new_aaaaaa += einsum(x297, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x297 - x298 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x298 += einsum(x286, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.5 - del x286 - x298 += einsum(x48, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.5 - x298 += einsum(x287, (0, 1, 2, 3), (0, 2, 1, 3)) - del x287 - x299 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x299 += einsum(t2.aaaa, (0, 1, 2, 3), x55, (4, 1, 5, 3), (0, 4, 5, 2)) - x300 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x300 += einsum(t1.aa, (0, 1), x290, (2, 3, 1, 4), (2, 3, 0, 4)) * 0.5 - del x290 - x301 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x301 += einsum(v.aaaa.ooov, (0, 1, 2, 3), x40, (1, 4, 3, 5), (0, 2, 4, 5)) - x302 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x302 += einsum(x52, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x302 += einsum(x289, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x289 - x302 += einsum(x299, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x299 - x302 += einsum(x300, (0, 1, 2, 3), (2, 1, 0, 3)) - del x300 - x302 += einsum(x301, (0, 1, 2, 3), (2, 0, 1, 3)) - del x301 - x303 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x303 += einsum(x13, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) * -1.0 - x304 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x304 += einsum(t1.aa, (0, 1), x294, (2, 3, 0, 4), (2, 3, 4, 1)) * 0.5 - del x294 - x305 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x305 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - x305 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * 0.5 - x305 += einsum(x298, (0, 1, 2, 3), (0, 1, 2, 3)) - x305 += einsum(x298, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x298 - x305 += einsum(x302, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x305 += einsum(x302, (0, 1, 2, 3), (1, 0, 2, 3)) - del x302 - x305 += einsum(x50, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - x305 += einsum(x50, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - x305 += einsum(x303, (0, 1, 2, 3), (2, 1, 0, 3)) - del x303 - x305 += einsum(x304, (0, 1, 2, 3), (1, 0, 2, 3)) - del x304 - x306 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x306 += einsum(t2.aaaa, (0, 1, 2, 3), x305, (4, 5, 1, 6), (0, 4, 5, 2, 3, 6)) * -4.0 - del x305 - t3new_aaaaaa += einsum(x306, (0, 1, 2, 3, 4, 5), (1, 0, 2, 5, 4, 3)) * -1.0 - t3new_aaaaaa += einsum(x306, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 5, 3)) * -1.0 - t3new_aaaaaa += einsum(x306, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - t3new_aaaaaa += einsum(x306, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 4, 3)) - t3new_aaaaaa += einsum(x306, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - t3new_aaaaaa += einsum(x306, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) - del x306 - x307 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x307 += einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ovvv, (4, 5, 6, 3), (1, 4, 5, 6, 0, 2)) - x308 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x308 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 5, 0, 6, 7, 1), (5, 2, 7, 3, 4, 6)) - x309 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x309 += einsum(x127, (0, 1, 2, 3), t3.abaaba, (4, 5, 2, 6, 7, 3), (0, 5, 7, 1, 4, 6)) - x310 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x310 += einsum(t2.bbbb, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.00000000000002 - x310 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -1.0 - x311 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x311 += einsum(x310, (0, 1, 2, 3), x7, (0, 4, 2, 5), (4, 1, 5, 3)) - del x310 - x312 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x312 += einsum(x111, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.00000000000001 - x312 += einsum(x311, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x311 - x313 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x313 += einsum(x312, (0, 1, 2, 3), t3.babbab, (4, 5, 1, 6, 7, 3), (0, 4, 2, 6, 5, 7)) * 2.0 - del x312 - x314 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x314 += einsum(t2.abab, (0, 1, 2, 3), x11, (0, 4, 2, 5), (1, 3, 4, 5)) * 1.00000000000001 - x315 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x315 += einsum(t2.bbbb, (0, 1, 2, 3), (0, 1, 2, 3)) - x315 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -0.499999999999995 - x316 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x316 += einsum(v.aabb.ovov, (0, 1, 2, 3), x315, (2, 4, 3, 5), (4, 5, 0, 1)) * 2.00000000000002 - x317 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x317 += einsum(x314, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x317 += einsum(x316, (0, 1, 2, 3), (0, 1, 2, 3)) - del x316 - x318 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x318 += einsum(x317, (0, 1, 2, 3), t3.abaaba, (4, 5, 2, 6, 7, 3), (5, 0, 7, 1, 4, 6)) * 2.0 - del x317 - x319 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x319 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), (0, 2, 3, 5, 1, 4)) - x319 += einsum(t1.bb, (0, 1), t2.abab, (2, 3, 4, 5), (0, 3, 5, 1, 2, 4)) * -0.5 - x320 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x320 += einsum(x14, (0, 1, 2, 3), x319, (0, 4, 2, 5, 6, 7), (1, 4, 3, 5, 6, 7)) * 2.0 - x321 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x321 += einsum(x182, (0, 1, 2, 3), x319, (0, 4, 3, 5, 6, 7), (1, 4, 2, 5, 6, 7)) * -2.0 - del x319 - x322 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x322 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (0, 4, 5, 1), (5, 3, 2, 4)) - x323 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x323 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 4, 5, 3), (1, 5, 2, 4)) - x324 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x324 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 0, 2, 5, 6, 3), (4, 5, 6, 1)) - x325 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x325 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.abaaba, (0, 4, 2, 5, 6, 1), (4, 6, 5, 3)) * -1.0 - x326 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x326 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x326 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) - x326 += einsum(x109, (0, 1, 2, 3), (0, 2, 3, 1)) - x326 += einsum(x109, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - x327 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x327 += einsum(t2.abab, (0, 1, 2, 3), x326, (0, 4, 2, 5), (1, 3, 4, 5)) - del x326 - x328 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x328 += einsum(x13, (0, 1), t2.abab, (0, 2, 3, 4), (2, 4, 1, 3)) - x329 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x329 += einsum(v.aabb.vvov, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - x329 += einsum(x105, (0, 1, 2, 3), (0, 1, 2, 3)) - x329 += einsum(x322, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x322 - x329 += einsum(x323, (0, 1, 2, 3), (0, 1, 2, 3)) - del x323 - x329 += einsum(x324, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x329 += einsum(x325, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x329 += einsum(x327, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x327 - x329 += einsum(x328, (0, 1, 2, 3), (0, 1, 3, 2)) - del x328 - x330 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x330 += einsum(t2.abab, (0, 1, 2, 3), x329, (4, 5, 6, 2), (4, 1, 5, 3, 0, 6)) - del x329 - x331 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x331 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 5), (1, 3, 4, 5)) - x332 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x332 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x332 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) - x333 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x333 += einsum(t2.bbbb, (0, 1, 2, 3), x332, (1, 3, 4, 5), (0, 4, 5, 2)) * 2.0 - del x332 - x334 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x334 += einsum(t1.bb, (0, 1), x1, (2, 0, 3, 4), (2, 3, 1, 4)) - x335 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x335 += einsum(t2.bbbb, (0, 1, 2, 3), x7, (1, 4, 3, 5), (4, 0, 5, 2)) * 2.0 - x336 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x336 += einsum(x334, (0, 1, 2, 3), (0, 1, 2, 3)) - del x334 - x336 += einsum(x111, (0, 1, 2, 3), (0, 1, 2, 3)) - x336 += einsum(x335, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - x337 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x337 += einsum(t1.bb, (0, 1), x336, (2, 0, 3, 4), (2, 3, 4, 1)) - del x336 - x338 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x338 += einsum(x157, (0, 1, 2, 3), (0, 2, 1, 3)) - x338 += einsum(x331, (0, 1, 2, 3), (0, 3, 2, 1)) - x338 += einsum(x333, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x333 - x338 += einsum(x337, (0, 1, 2, 3), (0, 2, 1, 3)) - del x337 - x339 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x339 += einsum(t2.abab, (0, 1, 2, 3), x338, (4, 3, 5, 6), (4, 1, 5, 6, 0, 2)) - del x338 - x340 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x340 += einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 6, 3), (1, 4, 5, 6, 0, 2)) - x341 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x341 += einsum(t1.bb, (0, 1), x340, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x340 - x342 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x342 += einsum(v.aabb.ovoo, (0, 1, 2, 3), t3.abaaba, (4, 5, 0, 6, 7, 1), (5, 2, 3, 7, 4, 6)) - x343 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x343 += einsum(x188, (0, 1, 2, 3), t3.babbab, (4, 5, 0, 6, 7, 3), (1, 2, 4, 6, 5, 7)) * 2.0 - del x188 - x344 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x344 += einsum(t1.aa, (0, 1), v.aabb.ovoo, (0, 2, 3, 4), (3, 4, 1, 2)) - x345 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x345 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (1, 5, 2, 4)) - x346 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x346 += einsum(v.aabb.vvoo, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - x346 += einsum(x344, (0, 1, 2, 3), (1, 0, 3, 2)) - x346 += einsum(x345, (0, 1, 2, 3), (0, 1, 3, 2)) - del x345 - x347 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x347 += einsum(t2.abab, (0, 1, 2, 3), x346, (4, 5, 2, 6), (4, 5, 1, 3, 0, 6)) - del x346 - x348 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x348 += einsum(v.aabb.oooo, (0, 1, 2, 3), (2, 3, 0, 1)) - x348 += einsum(x136, (0, 1, 2, 3), (1, 0, 3, 2)) - x348 += einsum(x150, (0, 1, 2, 3), (0, 1, 3, 2)) - del x150 - x349 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x349 += einsum(t2.abab, (0, 1, 2, 3), x348, (4, 5, 0, 6), (4, 5, 1, 3, 6, 2)) - del x348 - x350 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x350 += einsum(t1.aa, (0, 1), x3, (2, 3, 0, 4), (2, 3, 1, 4)) - x351 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x351 += einsum(x129, (0, 1, 2, 3), (0, 1, 3, 2)) - x351 += einsum(x350, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x350 - x352 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x352 += einsum(t2.abab, (0, 1, 2, 3), x351, (4, 5, 2, 6), (4, 5, 1, 3, 0, 6)) - del x351 - x353 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x353 += einsum(v.aabb.ooov, (0, 1, 2, 3), (2, 3, 0, 1)) - x353 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x354 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x354 += einsum(t1.bb, (0, 1), x353, (2, 1, 3, 4), (2, 0, 3, 4)) - x355 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x355 += einsum(t2.abab, (0, 1, 2, 3), x354, (4, 5, 6, 0), (5, 4, 1, 3, 6, 2)) - del x354 - x356 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x356 += einsum(x341, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - del x341 - x356 += einsum(x342, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -2.0 - del x342 - x356 += einsum(x343, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - del x343 - x356 += einsum(x347, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - del x347 - x356 += einsum(x349, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - del x349 - x356 += einsum(x352, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x352 - x356 += einsum(x355, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x355 - x357 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x357 += einsum(t1.bb, (0, 1), x356, (2, 0, 3, 4, 5, 6), (2, 3, 4, 1, 5, 6)) - del x356 - x358 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x358 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (4, 2, 5, 1), (5, 3, 0, 4)) - x359 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x359 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (4, 2, 5, 3), (1, 5, 0, 4)) - x360 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x360 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 5, 2, 6, 1, 3), (4, 6, 5, 0)) - x361 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x361 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.abaaba, (4, 5, 2, 3, 6, 1), (5, 6, 4, 0)) * -1.0 - x362 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x362 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x362 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - x362 += einsum(x25, (0, 1, 2, 3), (1, 0, 2, 3)) - x362 += einsum(x25, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x363 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x363 += einsum(t2.abab, (0, 1, 2, 3), x362, (4, 5, 0, 2), (1, 3, 4, 5)) - del x362 - x364 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x364 += einsum(v.aabb.ooov, (0, 1, 2, 3), (2, 3, 0, 1)) - x364 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x364 += einsum(x358, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x358 - x364 += einsum(x359, (0, 1, 2, 3), (0, 1, 2, 3)) - del x359 - x364 += einsum(x360, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x364 += einsum(x361, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x364 += einsum(x363, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x363 - x365 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x365 += einsum(t2.abab, (0, 1, 2, 3), x364, (4, 5, 6, 0), (4, 1, 5, 3, 6, 2)) - del x364 - x366 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x366 += einsum(t1.bb, (0, 1), v.aabb.vvvv, (2, 3, 4, 1), (0, 4, 2, 3)) - x367 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x367 += einsum(t1.aa, (0, 1), x127, (2, 3, 0, 4), (2, 3, 1, 4)) - x368 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x368 += einsum(t2.abab, (0, 1, 2, 3), x3, (4, 1, 0, 5), (4, 3, 2, 5)) - x369 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x369 += einsum(x366, (0, 1, 2, 3), (0, 1, 3, 2)) - del x366 - x369 += einsum(x367, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x367 - x369 += einsum(x368, (0, 1, 2, 3), (0, 1, 3, 2)) - del x368 - x370 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x370 += einsum(t2.abab, (0, 1, 2, 3), x369, (4, 5, 2, 6), (4, 1, 5, 3, 0, 6)) - del x369 - x371 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x371 += einsum(t2.abab, (0, 1, 2, 3), x3, (4, 1, 5, 2), (4, 3, 0, 5)) - x372 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x372 += einsum(v.aabb.oovv, (0, 1, 2, 3), (2, 3, 0, 1)) - x372 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) - x373 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x373 += einsum(t1.bb, (0, 1), x372, (1, 2, 3, 4), (0, 2, 3, 4)) - del x372 - x374 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x374 += einsum(x371, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x371 - x374 += einsum(x373, (0, 1, 2, 3), (0, 1, 3, 2)) - del x373 - x375 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x375 += einsum(t2.abab, (0, 1, 2, 3), x374, (4, 5, 0, 6), (4, 1, 5, 3, 6, 2)) - del x374 - x376 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x376 += einsum(v.aabb.vvov, (0, 1, 2, 3), (2, 3, 0, 1)) - x376 += einsum(x105, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x105 - x377 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x377 += einsum(t2.bbbb, (0, 1, 2, 3), x376, (1, 3, 4, 5), (0, 2, 4, 5)) - del x376 - x378 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x378 += einsum(t2.abab, (0, 1, 2, 3), x377, (4, 5, 6, 2), (4, 1, 5, 3, 0, 6)) * 2.0 - del x377 - x379 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x379 += einsum(t2.bbbb, (0, 1, 2, 3), x353, (1, 3, 4, 5), (0, 2, 4, 5)) - del x353 - x380 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x380 += einsum(t2.abab, (0, 1, 2, 3), x379, (4, 5, 6, 0), (4, 1, 5, 3, 6, 2)) * 2.0 - del x379 - x381 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x381 += einsum(x307, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x307 - x381 += einsum(x308, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -2.0 - del x308 - x381 += einsum(x309, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 2.0 - del x309 - x381 += einsum(x313, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x313 - x381 += einsum(x318, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x318 - x381 += einsum(x320, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - del x320 - x381 += einsum(x321, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x321 - x381 += einsum(x330, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - del x330 - x381 += einsum(x339, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x339 - x381 += einsum(x357, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x357 - x381 += einsum(x365, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - del x365 - x381 += einsum(x370, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x370 - x381 += einsum(x375, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x375 - x381 += einsum(x378, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x378 - x381 += einsum(x380, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x380 - t3new_babbab += einsum(x381, (0, 1, 2, 3, 4, 5), (0, 4, 1, 2, 5, 3)) * -1.0 - t3new_babbab += einsum(x381, (0, 1, 2, 3, 4, 5), (0, 4, 1, 3, 5, 2)) - t3new_babbab += einsum(x381, (0, 1, 2, 3, 4, 5), (1, 4, 0, 2, 5, 3)) - t3new_babbab += einsum(x381, (0, 1, 2, 3, 4, 5), (1, 4, 0, 3, 5, 2)) * -1.0 - del x381 - x382 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x382 += einsum(t2.bbbb, (0, 1, 2, 3), x1, (4, 0, 1, 5), (4, 2, 3, 5)) - x383 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x383 += einsum(t2.abab, (0, 1, 2, 3), x382, (4, 5, 6, 3), (4, 1, 5, 6, 0, 2)) * -1.0 - x384 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x384 += einsum(t2.abab, (0, 1, 2, 3), (1, 3, 0, 2)) - x384 += einsum(t1.aa, (0, 1), t1.bb, (2, 3), (2, 3, 0, 1)) * 0.99999999999999 - x385 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x385 += einsum(v.aabb.ovov, (0, 1, 2, 3), x384, (4, 3, 0, 5), (2, 4, 1, 5)) * 1.00000000000001 - x386 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x386 += einsum(x129, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x386 += einsum(x385, (0, 1, 2, 3), (1, 0, 2, 3)) - del x385 - x387 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x387 += einsum(x386, (0, 1, 2, 3), t3.babbab, (4, 5, 1, 6, 2, 7), (0, 4, 6, 7, 5, 3)) * -2.0 - del x386 - x388 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x388 += einsum(x135, (0, 1, 2, 3), (0, 1, 3, 2)) - x388 += einsum(x137, (0, 1, 2, 3), (0, 1, 3, 2)) - x389 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x389 += einsum(x388, (0, 1, 2, 3), t3.babbab, (4, 2, 1, 5, 6, 7), (0, 4, 5, 7, 3, 6)) * -2.0 - del x388 - x390 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x390 += einsum(t1.aa, (0, 1), v.aabb.oooo, (2, 0, 3, 4), (3, 4, 2, 1)) - x391 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x391 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.babbab, (4, 5, 2, 3, 6, 1), (4, 0, 5, 6)) * -1.0 - x392 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x392 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 5, 0, 6, 3, 1), (5, 2, 4, 6)) - x393 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x393 += einsum(t2.abab, (0, 1, 2, 3), x18, (4, 5, 1, 3), (4, 5, 0, 2)) - x394 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x394 += einsum(t2.abab, (0, 1, 2, 3), x24, (4, 3, 0, 5), (4, 1, 5, 2)) - x395 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x395 += einsum(t2.abab, (0, 1, 2, 3), x106, (4, 3, 2, 5), (4, 1, 0, 5)) - x396 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x396 += einsum(x9, (0, 1), t2.abab, (2, 3, 4, 1), (0, 3, 2, 4)) - x397 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x397 += einsum(v.aabb.ovoo, (0, 1, 2, 3), x40, (0, 4, 1, 5), (2, 3, 4, 5)) * 2.0 - x398 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x398 += einsum(v.aabb.ovoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x398 += einsum(x390, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x390 - x398 += einsum(x147, (0, 1, 2, 3), (1, 0, 2, 3)) - x398 += einsum(x391, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - x398 += einsum(x392, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - x398 += einsum(x393, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x393 - x398 += einsum(x394, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x394 - x398 += einsum(x395, (0, 1, 2, 3), (0, 1, 2, 3)) - del x395 - x398 += einsum(x396, (0, 1, 2, 3), (0, 1, 2, 3)) - del x396 - x398 += einsum(x397, (0, 1, 2, 3), (1, 0, 2, 3)) - del x397 - x399 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x399 += einsum(t2.bbbb, (0, 1, 2, 3), x398, (1, 4, 5, 6), (4, 0, 2, 3, 5, 6)) * -2.0 - del x398 - x400 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x400 += einsum(v.aabb.vvoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x400 += einsum(x344, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - x401 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x401 += einsum(x400, (0, 1, 2, 3), t3.babbab, (4, 5, 0, 6, 2, 7), (1, 4, 6, 7, 5, 3)) * -2.0 - del x400 - x402 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x402 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 1, 0, 5), (4, 2, 3, 5)) * -1.0 - x403 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x403 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.bbbbbb, (4, 0, 2, 5, 6, 3), (4, 5, 6, 1)) - x404 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x404 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 0, 2, 5, 1, 6), (4, 5, 6, 3)) - x405 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x405 += einsum(x402, (0, 1, 2, 3), (0, 2, 1, 3)) - x405 += einsum(x403, (0, 1, 2, 3), (0, 2, 1, 3)) * -3.0 - x405 += einsum(x404, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x406 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x406 += einsum(t2.abab, (0, 1, 2, 3), x405, (4, 5, 6, 3), (4, 1, 5, 6, 0, 2)) * 2.0 - del x405 - x407 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x407 += einsum(v.aabb.oooo, (0, 1, 2, 3), (2, 3, 0, 1)) - x407 += einsum(x136, (0, 1, 2, 3), (1, 0, 3, 2)) - x408 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x408 += einsum(x407, (0, 1, 2, 3), t3.babbab, (4, 2, 0, 5, 6, 7), (1, 4, 5, 7, 3, 6)) * -2.0 - del x407 - x409 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x409 += einsum(f.bb.oo, (0, 1), (0, 1)) - x409 += einsum(x16, (0, 1), (0, 1)) * 2.0 - x409 += einsum(x17, (0, 1), (0, 1)) - x409 += einsum(x20, (0, 1), (1, 0)) - x410 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x410 += einsum(x409, (0, 1), t3.babbab, (2, 3, 1, 4, 5, 6), (0, 2, 4, 6, 3, 5)) * -2.0 - del x409 - x411 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x411 += einsum(t1.aa, (0, 1), x135, (2, 3, 4, 0), (2, 3, 4, 1)) - x412 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x412 += einsum(x1, (0, 1, 2, 3), (0, 1, 2, 3)) - x412 += einsum(x1, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x413 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x413 += einsum(t2.abab, (0, 1, 2, 3), x412, (4, 5, 1, 3), (4, 5, 0, 2)) - x414 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x414 += einsum(x3, (0, 1, 2, 3), x40, (2, 4, 3, 5), (0, 1, 4, 5)) * 2.0 - del x40 - x415 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x415 += einsum(x411, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x411 - x415 += einsum(x413, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x413 - x415 += einsum(x149, (0, 1, 2, 3), (1, 0, 2, 3)) - del x149 - x415 += einsum(x414, (0, 1, 2, 3), (0, 1, 2, 3)) - del x414 - x416 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x416 += einsum(t2.bbbb, (0, 1, 2, 3), x415, (4, 1, 5, 6), (4, 0, 2, 3, 5, 6)) * -2.0 - del x415 - x417 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x417 += einsum(x15, (0, 1), (1, 0)) - del x15 - x417 += einsum(x19, (0, 1), (1, 0)) * -1.0 - del x19 - x418 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x418 += einsum(x417, (0, 1), t3.babbab, (2, 3, 0, 4, 5, 6), (1, 2, 4, 6, 3, 5)) * -2.0 - x419 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x419 += einsum(x383, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * 2.0 - del x383 - x419 += einsum(x387, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x387 - x419 += einsum(x389, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x389 - x419 += einsum(x399, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - del x399 - x419 += einsum(x401, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - del x401 - x419 += einsum(x406, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - del x406 - x419 += einsum(x408, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x408 - x419 += einsum(x410, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x410 - x419 += einsum(x416, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x416 - x419 += einsum(x418, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - del x418 - t3new_babbab += einsum(x419, (0, 1, 2, 3, 4, 5), (0, 4, 1, 2, 5, 3)) * -1.0 - t3new_babbab += einsum(x419, (0, 1, 2, 3, 4, 5), (1, 4, 0, 2, 5, 3)) - del x419 - x420 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x420 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 5, 6, 7, 1, 3), (4, 6, 2, 7, 5, 0)) - x421 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x421 += einsum(t2.abab, (0, 1, 2, 3), x420, (4, 5, 1, 6, 7, 0), (4, 5, 3, 6, 7, 2)) - del x420 - x422 = np.zeros((nvir[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x422 += einsum(v.aabb.vvvv, (0, 1, 2, 3), (2, 3, 0, 1)) - x422 += einsum(x133, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x133 - x423 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x423 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), (0, 2, 3, 5, 1, 4)) - x423 += einsum(t1.aa, (0, 1), t2.bbbb, (2, 3, 4, 5), (2, 3, 4, 5, 0, 1)) - x424 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x424 += einsum(x422, (0, 1, 2, 3), x423, (4, 5, 0, 6, 7, 2), (4, 5, 6, 1, 7, 3)) * 2.0 - del x422 - x425 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x425 += einsum(v.aabb.oovv, (0, 1, 2, 3), (2, 3, 0, 1)) - x425 += einsum(x122, (0, 1, 2, 3), (1, 0, 3, 2)) - x426 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x426 += einsum(x425, (0, 1, 2, 3), t3.babbab, (4, 2, 5, 6, 7, 0), (4, 5, 1, 6, 3, 7)) * -2.0 - del x425 - x427 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x427 += einsum(t1.aa, (0, 1), v.aabb.oovv, (2, 0, 3, 4), (3, 4, 2, 1)) - x428 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x428 += einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovvv, (1, 3, 4, 5), (4, 5, 0, 2)) - x429 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x429 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 2, 0, 5, 6, 1), (6, 3, 4, 5)) - x430 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x430 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x430 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x431 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x431 += einsum(t2.abab, (0, 1, 2, 3), x430, (1, 4, 3, 5), (4, 5, 0, 2)) - x432 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x432 += einsum(t2.abab, (0, 1, 2, 3), x24, (1, 4, 0, 5), (4, 3, 5, 2)) - del x24 - x433 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x433 += einsum(t2.abab, (0, 1, 2, 3), x106, (1, 4, 2, 5), (4, 3, 0, 5)) - x434 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x434 += einsum(v.aabb.ovvv, (0, 1, 2, 3), (2, 3, 0, 1)) - x434 += einsum(x427, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x427 - x434 += einsum(x428, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - del x428 - x434 += einsum(x429, (0, 1, 2, 3), (1, 0, 2, 3)) * -2.0 - x434 += einsum(x431, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x431 - x434 += einsum(x432, (0, 1, 2, 3), (0, 1, 2, 3)) - del x432 - x434 += einsum(x433, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x433 - x435 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x435 += einsum(t2.bbbb, (0, 1, 2, 3), x434, (3, 4, 5, 6), (0, 1, 4, 2, 5, 6)) * -2.0 - del x434 - x436 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x436 += einsum(v.aabb.ovov, (0, 1, 2, 3), x384, (2, 4, 5, 1), (3, 4, 0, 5)) - x437 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x437 += einsum(x121, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.99999999999999 - x437 += einsum(x436, (0, 1, 2, 3), (1, 0, 2, 3)) - x438 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x438 += einsum(x437, (0, 1, 2, 3), t3.babbab, (4, 2, 5, 6, 7, 1), (4, 5, 0, 6, 3, 7)) * -2.00000000000002 - del x437 - x439 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x439 += einsum(t1.bb, (0, 1), x430, (0, 2, 1, 3), (2, 3)) - x440 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x440 += einsum(x141, (0, 1), (1, 0)) - del x141 - x440 += einsum(x439, (0, 1), (0, 1)) * -1.0 - del x439 - x441 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x441 += einsum(x440, (0, 1), t3.babbab, (2, 3, 4, 5, 6, 0), (2, 4, 1, 5, 3, 6)) * -2.0 - x442 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x442 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), t3.babbab, (4, 5, 6, 3, 7, 1), (4, 6, 0, 2, 5, 7)) * -1.0 - x443 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x443 += einsum(x106, (0, 1, 2, 3), x423, (4, 5, 1, 6, 7, 2), (0, 4, 5, 6, 7, 3)) - del x106, x423 - x444 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x444 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x444 += einsum(x124, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x444 += einsum(x42, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x42 - x445 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x445 += einsum(t2.bbbb, (0, 1, 2, 3), x444, (4, 3, 5, 6), (4, 0, 1, 2, 5, 6)) * -1.0 - del x444 - x446 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x446 += einsum(f.bb.ov, (0, 1), (0, 1)) - x446 += einsum(x0, (0, 1), (0, 1)) - del x0 - x447 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x447 += einsum(x446, (0, 1), t3.babbab, (2, 3, 4, 5, 6, 1), (0, 2, 4, 5, 3, 6)) * -1.0 - del x446 - x448 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x448 += einsum(x442, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - del x442 - x448 += einsum(x443, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - del x443 - x448 += einsum(x445, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - del x445 - x448 += einsum(x447, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - del x447 - x449 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x449 += einsum(t1.bb, (0, 1), x448, (0, 2, 3, 4, 5, 6), (2, 3, 4, 1, 5, 6)) * 2.0 - del x448 - x450 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x450 += einsum(f.bb.vv, (0, 1), (0, 1)) - x450 += einsum(x143, (0, 1), (1, 0)) * -1.0 - x451 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x451 += einsum(x450, (0, 1), t3.babbab, (2, 3, 4, 5, 6, 0), (2, 4, 1, 5, 3, 6)) * -2.0 - del x450 - x452 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x452 += einsum(x167, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x452 += einsum(x169, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x453 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x453 += einsum(t2.abab, (0, 1, 2, 3), x452, (4, 5, 1, 6), (4, 5, 6, 3, 0, 2)) * 2.0 - del x452 - x454 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x454 += einsum(x421, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 2.0 - del x421 - x454 += einsum(x424, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - del x424 - x454 += einsum(x426, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - del x426 - x454 += einsum(x435, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x435 - x454 += einsum(x438, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - del x438 - x454 += einsum(x441, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x441 - x454 += einsum(x449, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x449 - x454 += einsum(x451, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - del x451 - x454 += einsum(x453, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x453 - t3new_babbab += einsum(x454, (0, 1, 2, 3, 4, 5), (0, 4, 1, 2, 5, 3)) * -1.0 - t3new_babbab += einsum(x454, (0, 1, 2, 3, 4, 5), (0, 4, 1, 3, 5, 2)) - del x454 - x455 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x455 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.babbab, (0, 4, 2, 5, 6, 3), (5, 1, 4, 6)) - x456 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x456 += einsum(t2.bbbb, (0, 1, 2, 3), x455, (4, 3, 5, 6), (0, 1, 2, 4, 5, 6)) - x457 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x457 += einsum(t2.abab, (0, 1, 2, 3), x168, (4, 5, 1, 6), (5, 4, 3, 6, 0, 2)) * -1.0 - x458 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x458 += einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 0, 1), (2, 3)) - x459 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x459 += einsum(t1.bb, (0, 1), x458, (0, 2), (1, 2)) - del x458 - x460 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x460 += einsum(v.bbbb.ovov, (0, 1, 2, 3), x6, (0, 2, 3, 4), (4, 1)) * 2.0 - del x6 - x461 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x461 += einsum(x459, (0, 1), (0, 1)) - del x459 - x461 += einsum(x460, (0, 1), (0, 1)) * -1.0 - del x460 - x462 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x462 += einsum(x461, (0, 1), t3.babbab, (2, 3, 4, 5, 6, 1), (2, 4, 0, 5, 3, 6)) * -2.0 - del x461 - x463 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x463 += einsum(t2.bbbb, (0, 1, 2, 3), x61, (4, 3, 5, 6), (4, 0, 1, 2, 5, 6)) - x464 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x464 += einsum(t1.bb, (0, 1), x463, (0, 2, 3, 4, 5, 6), (3, 2, 4, 1, 5, 6)) * 2.0 - del x463 - x465 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x465 += einsum(x456, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 4.0 - del x456 - x465 += einsum(x457, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -6.0 - del x457 - x465 += einsum(x462, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - del x462 - x465 += einsum(x464, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x464 - t3new_babbab += einsum(x465, (0, 1, 2, 3, 4, 5), (1, 4, 0, 2, 5, 3)) - t3new_babbab += einsum(x465, (0, 1, 2, 3, 4, 5), (1, 4, 0, 3, 5, 2)) * -1.0 - del x465 - x466 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x466 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x466 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x466 += einsum(x225, (0, 1, 2, 3), (1, 0, 3, 2)) * 1.00000000000001 - x466 += einsum(x11, (0, 1, 2, 3), x271, (0, 4, 2, 5), (1, 4, 3, 5)) * -2.00000000000002 - x466 += einsum(x46, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x466 += einsum(t1.aa, (0, 1), x32, (2, 3, 0, 4), (3, 2, 4, 1)) * -1.0 - t3new_babbab += einsum(x466, (0, 1, 2, 3), t3.babbab, (4, 0, 5, 6, 2, 7), (4, 1, 5, 6, 3, 7)) * 2.0 - del x466 - x467 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x467 += einsum(t2.aaaa, (0, 1, 2, 3), (0, 1, 2, 3)) - x467 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -0.4999999999999949 - x468 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x468 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x468 += einsum(x124, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x124 - x468 += einsum(x38, (0, 1, 2, 3), (0, 1, 2, 3)) - x468 += einsum(t2.abab, (0, 1, 2, 3), x7, (1, 4, 3, 5), (4, 5, 0, 2)) * -1.00000000000001 - x468 += einsum(v.aabb.ovov, (0, 1, 2, 3), x467, (0, 4, 1, 5), (2, 3, 4, 5)) * 2.0000000000000204 - del x467 - t3new_babbab += einsum(x468, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 0, 6, 7, 1), (4, 2, 5, 6, 3, 7)) * 6.0 - del x468 - x469 = np.zeros((nvir[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x469 += einsum(v.bbbb.vvvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x469 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 4, 1, 5), (5, 2, 4, 3)) - x469 += einsum(t1.bb, (0, 1), x107, (0, 2, 3, 4), (4, 1, 3, 2)) - t3new_babbab += einsum(x469, (0, 1, 2, 3), t3.babbab, (4, 5, 6, 0, 7, 2), (4, 5, 6, 1, 7, 3)) * -2.0 - del x469 - x470 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x470 += einsum(t2.bbbb, (0, 1, 2, 3), (0, 1, 2, 3)) - x470 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - x471 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x471 += einsum(v.bbbb.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x471 += einsum(x184, (0, 1, 2, 3), (3, 0, 2, 1)) - x471 += einsum(x184, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - x471 += einsum(v.bbbb.ovov, (0, 1, 2, 3), x470, (4, 5, 3, 1), (0, 5, 2, 4)) - t3new_babbab += einsum(x471, (0, 1, 2, 3), t3.babbab, (0, 4, 2, 5, 6, 7), (1, 4, 3, 5, 6, 7)) * 2.0 - del x471 - x472 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x472 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x472 += einsum(x185, (0, 1, 2, 3), (1, 0, 2, 3)) - x473 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x473 += einsum(t2.bbbb, (0, 1, 2, 3), x18, (4, 5, 1, 3), (4, 5, 0, 2)) * 2.0 - x474 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x474 += einsum(t2.bbbb, (0, 1, 2, 3), x190, (4, 5, 1, 3), (4, 5, 0, 2)) * 2.0 - x475 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x475 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x475 += einsum(x1, (0, 1, 2, 3), (0, 2, 1, 3)) - x476 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x476 += einsum(t1.bb, (0, 1), x475, (2, 3, 4, 1), (2, 3, 4, 0)) - del x475 - x477 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x477 += einsum(t1.bb, (0, 1), x476, (2, 0, 3, 4), (4, 2, 3, 1)) - x478 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x478 += einsum(x186, (0, 1, 2, 3), (0, 2, 1, 3)) - x478 += einsum(x187, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x478 += einsum(x473, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x473 - x478 += einsum(x474, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x474 - x478 += einsum(x193, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x193 - x478 += einsum(x477, (0, 1, 2, 3), (0, 2, 1, 3)) - del x477 - x479 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x479 += einsum(x210, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0 - x479 += einsum(v.bbbb.oooo, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x479 += einsum(v.bbbb.oooo, (0, 1, 2, 3), (0, 2, 1, 3)) - x480 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x480 += einsum(t1.bb, (0, 1), x479, (2, 3, 0, 4), (2, 3, 4, 1)) - x481 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x481 += einsum(x472, (0, 1, 2, 3), (0, 1, 2, 3)) - x481 += einsum(x472, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x472 - x481 += einsum(x478, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x481 += einsum(x478, (0, 1, 2, 3), (1, 2, 0, 3)) - del x478 - x481 += einsum(x170, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x481 += einsum(x480, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - t3new_babbab += einsum(t2.abab, (0, 1, 2, 3), x481, (1, 4, 5, 6), (5, 0, 4, 6, 2, 3)) * -1.0 - del x481 - x482 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x482 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x482 += einsum(x185, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - x483 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x483 += einsum(t2.bbbb, (0, 1, 2, 3), x18, (4, 5, 1, 3), (4, 5, 0, 2)) - del x18 - x484 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x484 += einsum(t2.bbbb, (0, 1, 2, 3), x190, (4, 5, 1, 3), (4, 5, 0, 2)) - del x190 - x485 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x485 += einsum(t1.bb, (0, 1), x192, (2, 3, 1, 4), (2, 3, 0, 4)) * 0.5 - del x192 - x486 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x486 += einsum(t1.bb, (0, 1), x476, (2, 0, 3, 4), (4, 2, 3, 1)) * 0.5 - del x476 - x487 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x487 += einsum(x186, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.5 - x487 += einsum(x187, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.5 - x487 += einsum(x483, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x483 - x487 += einsum(x484, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x484 - x487 += einsum(x485, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x485 - x487 += einsum(x486, (0, 1, 2, 3), (0, 2, 1, 3)) - del x486 - x488 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x488 += einsum(x482, (0, 1, 2, 3), (0, 1, 2, 3)) - x488 += einsum(x482, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x482 - x488 += einsum(x487, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x488 += einsum(x487, (0, 1, 2, 3), (1, 2, 0, 3)) - del x487 - x488 += einsum(x9, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) * -1.0 - x488 += einsum(t1.bb, (0, 1), x479, (2, 3, 0, 4), (4, 3, 2, 1)) * -0.5 - del x479 - t3new_babbab += einsum(t2.abab, (0, 1, 2, 3), x488, (1, 4, 5, 6), (5, 0, 4, 3, 2, 6)) * 2.0 - del x488 - x489 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x489 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 5, 6, 7, 3, 1), (5, 2, 4, 6, 0, 7)) - x490 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x490 += einsum(t2.abab, (0, 1, 2, 3), x489, (4, 1, 5, 6, 0, 7), (4, 3, 5, 6, 2, 7)) - del x489 - x491 = np.zeros((nvir[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x491 += einsum(v.aabb.vvvv, (0, 1, 2, 3), (2, 3, 0, 1)) - x491 += einsum(x132, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x132 - x492 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x492 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), (1, 4, 0, 2, 3, 5)) - x492 += einsum(t1.bb, (0, 1), t2.aaaa, (2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x493 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x493 += einsum(x491, (0, 1, 2, 3), x492, (4, 0, 5, 6, 2, 7), (4, 1, 5, 6, 7, 3)) * 2.0 - del x491 - x494 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x494 += einsum(v.aabb.vvoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x494 += einsum(x129, (0, 1, 2, 3), (1, 0, 3, 2)) - del x129 - x495 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x495 += einsum(x494, (0, 1, 2, 3), t3.abaaba, (4, 0, 5, 6, 7, 2), (1, 7, 4, 5, 6, 3)) * -2.0 - del x494 - x496 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x496 += einsum(t1.bb, (0, 1), v.aabb.vvoo, (2, 3, 4, 0), (4, 1, 2, 3)) - x497 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x497 += einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.vvov, (4, 5, 1, 3), (0, 2, 4, 5)) - x498 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x498 += einsum(t2.abab, (0, 1, 2, 3), x118, (0, 2, 4, 5), (1, 3, 4, 5)) - del x118 - x499 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x499 += einsum(t2.abab, (0, 1, 2, 3), x4, (1, 4, 0, 5), (4, 3, 5, 2)) - x500 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x500 += einsum(t2.abab, (0, 1, 2, 3), x104, (3, 4, 0, 5), (1, 4, 5, 2)) - x501 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x501 += einsum(v.aabb.vvov, (0, 1, 2, 3), (2, 3, 0, 1)) - x501 += einsum(x496, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x496 - x501 += einsum(x497, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - del x497 - x501 += einsum(x324, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x324 - x501 += einsum(x325, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x325 - x501 += einsum(x498, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x498 - x501 += einsum(x499, (0, 1, 2, 3), (0, 1, 2, 3)) - del x499 - x501 += einsum(x500, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x500 - x502 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x502 += einsum(t2.aaaa, (0, 1, 2, 3), x501, (4, 5, 3, 6), (4, 5, 0, 1, 2, 6)) * -2.0 - del x501 - x503 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x503 += einsum(v.aabb.ovov, (0, 1, 2, 3), x384, (4, 3, 0, 5), (2, 4, 1, 5)) - del x384 - x504 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x504 += einsum(x344, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.99999999999999 - del x344 - x504 += einsum(x503, (0, 1, 2, 3), (0, 1, 3, 2)) - del x503 - x505 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x505 += einsum(x504, (0, 1, 2, 3), t3.abaaba, (4, 0, 5, 6, 7, 3), (1, 7, 4, 5, 6, 2)) * -2.00000000000002 - del x504 - x506 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x506 += einsum(f.aa.vv, (0, 1), (0, 1)) * -1.0 - x506 += einsum(x72, (0, 1), (0, 1)) - del x72 - x506 += einsum(x73, (0, 1), (0, 1)) * 2.0 - del x73 - x506 += einsum(x139, (0, 1), (1, 0)) - del x139 - x507 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x507 += einsum(x506, (0, 1), t3.abaaba, (2, 3, 4, 5, 6, 1), (3, 6, 2, 4, 5, 0)) * -2.0 - del x506 - x508 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x508 += einsum(x255, (0, 1), t3.abaaba, (2, 3, 4, 5, 6, 0), (3, 6, 2, 4, 5, 1)) * -2.0 - del x255 - x509 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x509 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), t3.abaaba, (4, 5, 6, 1, 7, 3), (5, 7, 4, 6, 0, 2)) - x510 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x510 += einsum(x104, (0, 1, 2, 3), x492, (4, 0, 5, 6, 3, 7), (4, 1, 2, 5, 6, 7)) - del x492 - x511 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x511 += einsum(t1.bb, (0, 1), v.aabb.ovoo, (2, 3, 4, 0), (4, 1, 2, 3)) - x512 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x512 += einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 2, 4, 5)) - x513 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x513 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x513 += einsum(x511, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x513 += einsum(x512, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x512 - x513 += einsum(x163, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x163 - x514 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x514 += einsum(t2.aaaa, (0, 1, 2, 3), x513, (4, 5, 6, 3), (4, 5, 0, 1, 6, 2)) * -1.0 - del x513 - x515 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x515 += einsum(x509, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x509 - x515 += einsum(x510, (0, 1, 2, 3, 4, 5), (0, 1, 4, 3, 2, 5)) - del x510 - x515 += einsum(x514, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x514 - x516 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x516 += einsum(t1.aa, (0, 1), x515, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 6, 1)) * 2.0 - del x515 - x517 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x517 += einsum(x77, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x77 - x517 += einsum(x78, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x78 - x517 += einsum(x79, (0, 1, 2, 3), (0, 1, 2, 3)) * -3.0 - del x79 - x518 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x518 += einsum(t2.abab, (0, 1, 2, 3), x517, (4, 5, 0, 6), (1, 3, 4, 5, 6, 2)) * 2.0 - del x517 - x519 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x519 += einsum(x490, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -2.0 - del x490 - x519 += einsum(x493, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x493 - x519 += einsum(x495, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x495 - x519 += einsum(x502, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x502 - x519 += einsum(x505, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x505 - x519 += einsum(x507, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x507 - x519 += einsum(x508, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x508 - x519 += einsum(x516, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x516 - x519 += einsum(x518, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x518 - t3new_abaaba += einsum(x519, (0, 1, 2, 3, 4, 5), (3, 0, 2, 4, 1, 5)) - t3new_abaaba += einsum(x519, (0, 1, 2, 3, 4, 5), (3, 0, 2, 5, 1, 4)) * -1.0 - del x519 - x520 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x520 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 5, 2, 6, 7, 3), (4, 6, 5, 0, 7, 1)) - x521 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x521 += einsum(t2.abab, (0, 1, 2, 3), x64, (4, 5, 2, 6), (1, 3, 4, 0, 6, 5)) - del x64 - x522 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x522 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 5, 3), (1, 5, 4, 2)) - x523 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x523 += einsum(t2.abab, (0, 1, 2, 3), x522, (4, 1, 5, 6), (4, 3, 0, 5, 6, 2)) - del x522 - x524 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x524 += einsum(x38, (0, 1, 2, 3), t3.babbab, (4, 5, 0, 6, 7, 1), (4, 6, 2, 5, 7, 3)) - x525 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x525 += einsum(t2.abab, (0, 1, 2, 3), x23, (4, 3, 5, 0), (1, 4, 5, 2)) - x526 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x526 += einsum(t2.abab, (0, 1, 2, 3), x525, (4, 1, 5, 6), (4, 3, 5, 0, 6, 2)) - del x525 - x527 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x527 += einsum(t2.aaaa, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.00000000000002 - x527 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -1.0 - x528 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x528 += einsum(x527, (0, 1, 2, 3), x68, (0, 4, 5, 2), (4, 1, 5, 3)) - del x68, x527 - x529 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x529 += einsum(x225, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.00000000000001 - x529 += einsum(x528, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x528 - x530 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x530 += einsum(x529, (0, 1, 2, 3), t3.abaaba, (4, 5, 1, 6, 7, 3), (5, 7, 4, 0, 6, 2)) * 2.0 - del x529 - x531 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x531 += einsum(v.aabb.ovov, (0, 1, 2, 3), x271, (0, 4, 1, 5), (2, 3, 4, 5)) * 2.0 - del x271 - x532 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x532 += einsum(x61, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x61 - x532 += einsum(x531, (0, 1, 2, 3), (0, 1, 2, 3)) - del x531 - x533 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x533 += einsum(x532, (0, 1, 2, 3), t3.babbab, (4, 5, 0, 6, 7, 1), (4, 6, 2, 5, 3, 7)) * 2.00000000000002 - del x532 - x534 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x534 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), (1, 4, 0, 2, 3, 5)) - x534 += einsum(t1.aa, (0, 1), t2.abab, (2, 3, 4, 5), (3, 5, 0, 2, 4, 1)) * -0.5 - x535 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x535 += einsum(x28, (0, 1, 2, 3), x534, (4, 5, 0, 6, 2, 7), (4, 5, 1, 6, 3, 7)) * 2.0 - del x28, x534 - x536 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x536 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), (1, 4, 0, 2, 3, 5)) * 2.0 - x536 += einsum(t1.aa, (0, 1), t2.abab, (2, 3, 4, 5), (3, 5, 0, 2, 4, 1)) * -1.0 - x537 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x537 += einsum(x46, (0, 1, 2, 3), x536, (4, 5, 0, 6, 3, 7), (4, 5, 1, 6, 2, 7)) * -1.0 - del x46, x536 - x538 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x538 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 5), (3, 5, 4, 2)) - x539 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x539 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 5), (3, 5, 0, 4)) - x540 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x540 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x540 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) - x540 += einsum(x107, (0, 1, 2, 3), (0, 2, 3, 1)) - x540 += einsum(x107, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - del x107 - x541 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x541 += einsum(t2.abab, (0, 1, 2, 3), x540, (1, 4, 3, 5), (4, 5, 0, 2)) - del x540 - x542 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x542 += einsum(v.aabb.ovvv, (0, 1, 2, 3), (2, 3, 0, 1)) - x542 += einsum(x103, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x543 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x543 += einsum(t2.aaaa, (0, 1, 2, 3), x542, (4, 5, 1, 3), (4, 5, 0, 2)) * 2.0 - del x542 - x544 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x544 += einsum(x9, (0, 1), t2.abab, (2, 0, 3, 4), (1, 4, 2, 3)) - del x9 - x545 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x545 += einsum(v.aabb.ovvv, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - x545 += einsum(x103, (0, 1, 2, 3), (1, 0, 2, 3)) - del x103 - x545 += einsum(x538, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x538 - x545 += einsum(x539, (0, 1, 2, 3), (1, 0, 2, 3)) - del x539 - x545 += einsum(x455, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - del x455 - x545 += einsum(x429, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - del x429 - x545 += einsum(x541, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x541 - x545 += einsum(x543, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x543 - x545 += einsum(x544, (0, 1, 2, 3), (0, 1, 2, 3)) - del x544 - x546 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x546 += einsum(t2.abab, (0, 1, 2, 3), x545, (3, 4, 5, 6), (1, 4, 5, 0, 6, 2)) - del x545 - x547 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x547 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x547 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) - x548 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x548 += einsum(t2.aaaa, (0, 1, 2, 3), x547, (1, 3, 4, 5), (0, 2, 4, 5)) * 2.0 - del x547 - x549 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x549 += einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 3, 0, 4), (2, 3, 1, 4)) - x550 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x550 += einsum(x549, (0, 1, 2, 3), (1, 0, 2, 3)) - del x549 - x550 += einsum(x225, (0, 1, 2, 3), (0, 1, 2, 3)) - del x225 - x550 += einsum(x226, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x226 - x551 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x551 += einsum(t1.aa, (0, 1), x550, (2, 0, 3, 4), (2, 3, 4, 1)) - del x550 - x552 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x552 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x552 += einsum(x219, (0, 1, 2, 3), (0, 1, 3, 2)) - del x219 - x552 += einsum(x548, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x548 - x552 += einsum(x551, (0, 1, 2, 3), (0, 3, 1, 2)) - del x551 - x553 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x553 += einsum(t2.abab, (0, 1, 2, 3), x552, (4, 5, 6, 2), (1, 3, 4, 0, 5, 6)) - del x552 - x554 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x554 += einsum(v.aabb.ooov, (0, 1, 2, 3), t3.babbab, (4, 5, 2, 6, 7, 3), (4, 6, 5, 0, 1, 7)) - x555 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x555 += einsum(t2.abab, (0, 1, 2, 3), x25, (4, 5, 6, 2), (1, 3, 4, 0, 6, 5)) - x556 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x556 += einsum(t1.aa, (0, 1), x555, (2, 3, 4, 5, 6, 0), (2, 3, 4, 5, 6, 1)) - del x555 - x557 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x557 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x557 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x558 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x558 += einsum(x557, (0, 1, 2, 3), t3.abaaba, (4, 5, 0, 6, 7, 3), (5, 7, 4, 1, 2, 6)) * 2.0 - del x557 - x559 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x559 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 5), (3, 5, 0, 4)) - x560 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x560 += einsum(v.aabb.oovv, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - x560 += einsum(x121, (0, 1, 2, 3), (1, 0, 3, 2)) - x560 += einsum(x559, (0, 1, 2, 3), (1, 0, 3, 2)) - del x559 - x561 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x561 += einsum(t2.abab, (0, 1, 2, 3), x560, (3, 4, 5, 6), (1, 4, 5, 6, 0, 2)) - del x560 - x562 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x562 += einsum(x136, (0, 1, 2, 3), (1, 0, 2, 3)) - x562 += einsum(x137, (0, 1, 2, 3), (1, 0, 2, 3)) - del x137 - x563 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x563 += einsum(t2.abab, (0, 1, 2, 3), x562, (1, 4, 5, 6), (4, 3, 5, 6, 0, 2)) - x564 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x564 += einsum(t1.bb, (0, 1), x23, (0, 2, 3, 4), (1, 2, 3, 4)) - x565 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x565 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) - x565 += einsum(x564, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x564 - x566 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x566 += einsum(t2.abab, (0, 1, 2, 3), x565, (3, 4, 5, 6), (1, 4, 5, 6, 0, 2)) - del x565 - x567 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x567 += einsum(v.aabb.oooo, (0, 1, 2, 3), (2, 3, 0, 1)) - x567 += einsum(x135, (0, 1, 2, 3), (1, 0, 3, 2)) - del x135 - x568 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x568 += einsum(t2.abab, (0, 1, 2, 3), x567, (1, 4, 5, 6), (4, 3, 5, 6, 0, 2)) - x569 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x569 += einsum(x554, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * 2.0 - del x554 - x569 += einsum(x556, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x556 - x569 += einsum(x558, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x558 - x569 += einsum(x561, (0, 1, 2, 3, 4, 5), (0, 1, 4, 3, 2, 5)) * -1.0 - del x561 - x569 += einsum(x563, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x563 - x569 += einsum(x566, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x566 - x569 += einsum(x568, (0, 1, 2, 3, 4, 5), (0, 1, 4, 3, 2, 5)) * -1.0 - del x568 - x570 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x570 += einsum(t1.aa, (0, 1), x569, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 6, 1)) - del x569 - x571 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x571 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x571 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x571 += einsum(x1, (0, 1, 2, 3), (0, 1, 2, 3)) - x571 += einsum(x1, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x572 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x572 += einsum(t2.abab, (0, 1, 2, 3), x571, (4, 5, 1, 3), (4, 5, 0, 2)) - del x571 - x573 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x573 += einsum(t2.aaaa, (0, 1, 2, 3), x130, (4, 5, 1, 3), (4, 5, 0, 2)) * 2.0 - del x130 - x574 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x574 += einsum(v.aabb.ovoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x574 += einsum(x3, (0, 1, 2, 3), (1, 0, 2, 3)) - del x3 - x574 += einsum(x391, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - del x391 - x574 += einsum(x392, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - del x392 - x574 += einsum(x572, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x572 - x574 += einsum(x573, (0, 1, 2, 3), (1, 0, 2, 3)) - del x573 - x575 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x575 += einsum(t2.abab, (0, 1, 2, 3), x574, (1, 4, 5, 6), (4, 3, 5, 0, 6, 2)) - del x574 - x576 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x576 += einsum(t1.bb, (0, 1), x38, (0, 2, 3, 4), (1, 2, 3, 4)) - del x38 - x577 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x577 += einsum(t2.abab, (0, 1, 2, 3), x23, (1, 4, 5, 0), (3, 4, 5, 2)) - x578 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x578 += einsum(x153, (0, 1, 2, 3), (1, 0, 2, 3)) - del x153 - x578 += einsum(x576, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x576 - x578 += einsum(x577, (0, 1, 2, 3), (1, 0, 2, 3)) - del x577 - x579 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x579 += einsum(t2.abab, (0, 1, 2, 3), x578, (3, 4, 5, 6), (1, 4, 5, 0, 6, 2)) - del x578 - x580 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x580 += einsum(v.aabb.vvov, (0, 1, 2, 3), x5, (4, 3, 5, 1), (4, 2, 5, 0)) - del x5 - x581 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x581 += einsum(x147, (0, 1, 2, 3), (1, 0, 2, 3)) - del x147 - x581 += einsum(x580, (0, 1, 2, 3), (1, 0, 2, 3)) - del x580 - x582 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x582 += einsum(t2.abab, (0, 1, 2, 3), x581, (1, 4, 5, 6), (4, 3, 5, 0, 6, 2)) - del x581 - x583 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x583 += einsum(x520, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -2.0 - del x520 - x583 += einsum(x521, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x521 - x583 += einsum(x523, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x523 - x583 += einsum(x524, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 2.0 - del x524 - x583 += einsum(x526, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x526 - x583 += einsum(x530, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x530 - x583 += einsum(x533, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x533 - x583 += einsum(x535, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x535 - x583 += einsum(x537, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - del x537 - x583 += einsum(x546, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x546 - x583 += einsum(x553, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x553 - x583 += einsum(x570, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - del x570 - x583 += einsum(x575, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x575 - x583 += einsum(x579, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - del x579 - x583 += einsum(x582, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - del x582 - t3new_abaaba += einsum(x583, (0, 1, 2, 3, 4, 5), (2, 0, 3, 4, 1, 5)) * -1.0 - t3new_abaaba += einsum(x583, (0, 1, 2, 3, 4, 5), (2, 0, 3, 5, 1, 4)) - t3new_abaaba += einsum(x583, (0, 1, 2, 3, 4, 5), (3, 0, 2, 4, 1, 5)) - t3new_abaaba += einsum(x583, (0, 1, 2, 3, 4, 5), (3, 0, 2, 5, 1, 4)) * -1.0 - del x583 - x584 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x584 += einsum(t2.abab, (0, 1, 2, 3), x261, (4, 5, 6, 2), (1, 3, 4, 0, 5, 6)) * -1.0 - del x261 - x585 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x585 += einsum(x122, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.99999999999999 - del x122 - x585 += einsum(x436, (0, 1, 2, 3), (0, 1, 3, 2)) - del x436 - x586 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x586 += einsum(x585, (0, 1, 2, 3), t3.abaaba, (4, 5, 3, 6, 0, 7), (5, 1, 4, 2, 6, 7)) * -2.00000000000002 - del x585 - x587 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x587 += einsum(x562, (0, 1, 2, 3), t3.abaaba, (4, 0, 3, 5, 6, 7), (1, 6, 4, 2, 5, 7)) * -2.0 - del x562 - x588 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x588 += einsum(t1.bb, (0, 1), v.aabb.oooo, (2, 3, 4, 0), (4, 1, 2, 3)) - x589 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x589 += einsum(t2.abab, (0, 1, 2, 3), x4, (1, 4, 5, 2), (4, 3, 5, 0)) - del x4 - x590 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x590 += einsum(t2.abab, (0, 1, 2, 3), x32, (4, 5, 0, 2), (1, 3, 4, 5)) - x591 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x591 += einsum(t2.abab, (0, 1, 2, 3), x104, (3, 4, 5, 2), (1, 4, 5, 0)) - del x104 - x592 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x592 += einsum(x13, (0, 1), t2.abab, (2, 3, 1, 4), (3, 4, 0, 2)) - del x13 - x593 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x593 += einsum(v.aabb.ooov, (0, 1, 2, 3), x113, (2, 4, 3, 5), (4, 5, 0, 1)) * 2.0 - x594 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x594 += einsum(v.aabb.ooov, (0, 1, 2, 3), (2, 3, 0, 1)) - x594 += einsum(x588, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x588 - x594 += einsum(x155, (0, 1, 2, 3), (0, 1, 3, 2)) - del x155 - x594 += einsum(x360, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - del x360 - x594 += einsum(x361, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - del x361 - x594 += einsum(x589, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x589 - x594 += einsum(x590, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x590 - x594 += einsum(x591, (0, 1, 2, 3), (0, 1, 2, 3)) - del x591 - x594 += einsum(x592, (0, 1, 2, 3), (0, 1, 2, 3)) - del x592 - x594 += einsum(x593, (0, 1, 2, 3), (0, 1, 3, 2)) - del x593 - x595 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x595 += einsum(t2.aaaa, (0, 1, 2, 3), x594, (4, 5, 1, 6), (4, 5, 0, 6, 2, 3)) * -2.0 - del x594 - x596 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x596 += einsum(v.aabb.oovv, (0, 1, 2, 3), (2, 3, 0, 1)) - x596 += einsum(x121, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x121 - x597 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x597 += einsum(x596, (0, 1, 2, 3), t3.abaaba, (4, 5, 2, 6, 0, 7), (5, 1, 4, 3, 6, 7)) * -2.0 - del x596 - x598 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x598 += einsum(x214, (0, 1, 2, 3), (0, 2, 1, 3)) - del x214 - x598 += einsum(x240, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x240 - x598 += einsum(x241, (0, 1, 2, 3), (0, 2, 1, 3)) * -3.0 - del x241 - x599 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x599 += einsum(t2.abab, (0, 1, 2, 3), x598, (4, 5, 6, 2), (1, 3, 4, 0, 5, 6)) * 2.0 - del x598 - x600 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x600 += einsum(x567, (0, 1, 2, 3), t3.abaaba, (4, 0, 2, 5, 6, 7), (1, 6, 4, 3, 5, 7)) * -2.0 - del x567 - x601 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x601 += einsum(f.aa.oo, (0, 1), (0, 1)) - x601 += einsum(x30, (0, 1), (0, 1)) - del x30 - x601 += einsum(x31, (0, 1), (0, 1)) * 2.0 - del x31 - x601 += einsum(x34, (0, 1), (1, 0)) - del x34 - x602 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x602 += einsum(x601, (0, 1), t3.abaaba, (2, 3, 1, 4, 5, 6), (3, 5, 2, 0, 4, 6)) * -2.0 - del x601 - x603 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x603 += einsum(t1.bb, (0, 1), x136, (2, 0, 3, 4), (2, 1, 3, 4)) - del x136 - x604 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x604 += einsum(t2.abab, (0, 1, 2, 3), x55, (4, 0, 5, 2), (1, 3, 4, 5)) - x605 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x605 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x605 += einsum(x127, (0, 1, 2, 3), (0, 1, 2, 3)) - x606 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x606 += einsum(t1.aa, (0, 1), x605, (2, 3, 4, 1), (2, 3, 4, 0)) - del x605 - x607 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x607 += einsum(x113, (0, 1, 2, 3), x23, (0, 2, 4, 5), (1, 3, 4, 5)) * 2.0 - del x23 - x608 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x608 += einsum(x603, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x603 - x608 += einsum(x604, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x604 - x608 += einsum(x606, (0, 1, 2, 3), (0, 1, 3, 2)) - del x606 - x608 += einsum(x607, (0, 1, 2, 3), (0, 1, 2, 3)) - del x607 - x609 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x609 += einsum(t2.aaaa, (0, 1, 2, 3), x608, (4, 5, 6, 1), (4, 5, 0, 6, 2, 3)) * -2.0 - del x608 - x610 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x610 += einsum(x251, (0, 1), t3.abaaba, (2, 3, 0, 4, 5, 6), (3, 5, 2, 1, 4, 6)) * -2.0 - del x251 - x611 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x611 += einsum(x584, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * 2.0 - del x584 - x611 += einsum(x586, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x586 - x611 += einsum(x587, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x587 - x611 += einsum(x595, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - del x595 - x611 += einsum(x597, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - del x597 - x611 += einsum(x599, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x599 - x611 += einsum(x600, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - del x600 - x611 += einsum(x602, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x602 - x611 += einsum(x609, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x609 - x611 += einsum(x610, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - del x610 - t3new_abaaba += einsum(x611, (0, 1, 2, 3, 4, 5), (2, 0, 3, 4, 1, 5)) * -1.0 - t3new_abaaba += einsum(x611, (0, 1, 2, 3, 4, 5), (3, 0, 2, 4, 1, 5)) - del x611 - x612 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x612 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x612 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x612 += einsum(x111, (0, 1, 2, 3), (1, 0, 3, 2)) * 1.00000000000001 - x612 += einsum(x112, (0, 1, 2, 3), x315, (0, 4, 3, 5), (1, 4, 2, 5)) * -2.00000000000002 - del x112 - x612 += einsum(x115, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x115 - x612 += einsum(x116, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x116 - t3new_abaaba += einsum(x612, (0, 1, 2, 3), t3.abaaba, (4, 0, 5, 6, 2, 7), (4, 1, 5, 6, 3, 7)) * 2.0 - del x612 - x613 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x613 += einsum(t2.bbbb, (0, 1, 2, 3), (0, 1, 2, 3)) - x613 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -0.4999999999999949 - x614 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x614 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x614 += einsum(x511, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x511 - x614 += einsum(x127, (0, 1, 2, 3), (0, 1, 2, 3)) - x614 += einsum(x314, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x314 - x614 += einsum(v.aabb.ovov, (0, 1, 2, 3), x613, (2, 4, 3, 5), (4, 5, 0, 1)) * 2.0000000000000204 - del x613 - t3new_abaaba += einsum(x614, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 2, 6, 7, 3), (4, 0, 5, 6, 1, 7)) * 6.0 - del x614 - x615 = np.zeros((nvir[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x615 += einsum(v.aaaa.vvvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x615 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 4, 1, 5), (5, 2, 3, 4)) * -1.0 - x615 += einsum(t1.aa, (0, 1), x109, (0, 2, 3, 4), (4, 1, 2, 3)) * -1.0 - del x109 - t3new_abaaba += einsum(x615, (0, 1, 2, 3), t3.abaaba, (4, 5, 6, 0, 7, 3), (4, 5, 6, 2, 7, 1)) * -2.0 - del x615 - x616 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x616 += einsum(v.aaaa.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x616 += einsum(x49, (0, 1, 2, 3), (2, 0, 3, 1)) * -1.0 - x616 += einsum(x49, (0, 1, 2, 3), (2, 1, 3, 0)) - del x49 - x616 += einsum(x99, (0, 1, 2, 3), (1, 3, 0, 2)) - del x99 - t3new_abaaba += einsum(x616, (0, 1, 2, 3), t3.abaaba, (0, 4, 2, 5, 6, 7), (1, 4, 3, 5, 6, 7)) * 2.0 - del x616 - x617 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x617 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x617 += einsum(x50, (0, 1, 2, 3), (1, 0, 2, 3)) - del x50 - x618 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x618 += einsum(t2.aaaa, (0, 1, 2, 3), x32, (4, 5, 1, 3), (0, 4, 5, 2)) * 2.0 - del x32 - x619 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x619 += einsum(t2.aaaa, (0, 1, 2, 3), x55, (4, 5, 1, 3), (0, 4, 5, 2)) * 2.0 - del x55 - x620 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x620 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x620 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x620 += einsum(x37, (0, 1, 2, 3), (0, 1, 2, 3)) - del x37 - x621 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x621 += einsum(t1.aa, (0, 1), x620, (2, 3, 1, 4), (2, 3, 0, 4)) - del x620 - x622 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x622 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x622 += einsum(x25, (0, 1, 2, 3), (0, 2, 1, 3)) - del x25 - x623 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x623 += einsum(t1.aa, (0, 1), x622, (2, 3, 4, 1), (2, 3, 4, 0)) - del x622 - x624 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x624 += einsum(t1.aa, (0, 1), x623, (2, 0, 3, 4), (4, 2, 3, 1)) - del x623 - x625 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x625 += einsum(x48, (0, 1, 2, 3), (0, 2, 1, 3)) - del x48 - x625 += einsum(x52, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x52 - x625 += einsum(x618, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x618 - x625 += einsum(x619, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - del x619 - x625 += einsum(x621, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x621 - x625 += einsum(x624, (0, 1, 2, 3), (0, 2, 1, 3)) - del x624 - x626 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x626 += einsum(x617, (0, 1, 2, 3), (0, 1, 2, 3)) - x626 += einsum(x617, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x617 - x626 += einsum(x625, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x626 += einsum(x625, (0, 1, 2, 3), (1, 2, 0, 3)) - del x625 - x626 += einsum(x80, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x80 - x626 += einsum(x295, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x295 - x627 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x627 += einsum(t2.abab, (0, 1, 2, 3), x626, (0, 4, 5, 6), (1, 3, 4, 5, 6, 2)) - del x626 - t3new_abaaba += einsum(x627, (0, 1, 2, 3, 4, 5), (3, 0, 2, 4, 1, 5)) * -1.0 - t3new_abaaba += einsum(x627, (0, 1, 2, 3, 4, 5), (3, 0, 2, 5, 1, 4)) - del x627 - x628 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x628 += einsum(t2.bbbb, (0, 1, 2, 3), x430, (1, 4, 3, 5), (0, 4, 5, 2)) * 2.0 - del x430 - x629 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x629 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x629 += einsum(x331, (0, 1, 2, 3), (0, 1, 3, 2)) - del x331 - x629 += einsum(x628, (0, 1, 2, 3), (0, 3, 1, 2)) * -1.0 - del x628 - x630 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x630 += einsum(t2.bbbb, (0, 1, 2, 3), x629, (4, 5, 3, 6), (4, 0, 1, 5, 6, 2)) * -2.0 - del x629 - x631 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x631 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - x632 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x632 += einsum(t1.bb, (0, 1), x631, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - del x631 - x633 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x633 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x633 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x633 += einsum(x111, (0, 1, 2, 3), (0, 1, 2, 3)) - x633 += einsum(x335, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x335 - x634 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x634 += einsum(t2.bbbb, (0, 1, 2, 3), x633, (4, 5, 6, 3), (4, 5, 0, 1, 6, 2)) * -1.0 - del x633 - x635 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x635 += einsum(x632, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x632 - x635 += einsum(x634, (0, 1, 2, 3, 4, 5), (3, 2, 1, 0, 5, 4)) * -1.0 - del x634 - x636 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x636 += einsum(t1.bb, (0, 1), x635, (2, 3, 0, 4, 5, 6), (2, 3, 4, 5, 6, 1)) * 2.0 - del x635 - x637 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x637 += einsum(x630, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - del x630 - x637 += einsum(x636, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - del x636 - t3new_bbbbbb = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * -1.0 - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) * -1.0 - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) * -1.0 - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) - t3new_bbbbbb += einsum(x637, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) * -1.0 - del x637 - x638 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x638 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 0, 5, 6, 1, 7), (4, 5, 2, 6, 7, 3)) - x639 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x639 += einsum(t2.bbbb, (0, 1, 2, 3), x402, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - del x402 - x640 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x640 += einsum(t2.bbbb, (0, 1, 2, 3), x167, (4, 5, 1, 6), (4, 5, 0, 2, 3, 6)) - del x167 - x641 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x641 += einsum(x14, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 0, 6, 7, 2), (4, 5, 1, 6, 7, 3)) * 6.0 - del x14 - x642 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x642 += einsum(x638, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * 2.0 - del x638 - x642 += einsum(x639, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -4.0 - del x639 - x642 += einsum(x640, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -4.0 - del x640 - x642 += einsum(x641, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x641 - t3new_bbbbbb += einsum(x642, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new_bbbbbb += einsum(x642, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new_bbbbbb += einsum(x642, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new_bbbbbb += einsum(x642, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - t3new_bbbbbb += einsum(x642, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - t3new_bbbbbb += einsum(x642, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - t3new_bbbbbb += einsum(x642, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new_bbbbbb += einsum(x642, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new_bbbbbb += einsum(x642, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - del x642 - x643 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x643 += einsum(x127, (0, 1, 2, 3), t3.babbab, (4, 2, 5, 6, 3, 7), (0, 4, 5, 6, 7, 1)) - del x127 - x644 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x644 += einsum(t2.bbbb, (0, 1, 2, 3), x382, (4, 5, 6, 3), (4, 0, 1, 5, 6, 2)) * -1.0 - del x382 - x645 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x645 += einsum(x182, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 0, 6, 7, 3), (4, 5, 1, 6, 7, 2)) * -6.0 - x646 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x646 += einsum(x168, (0, 1, 2, 3), (0, 1, 2, 3)) - del x168 - x646 += einsum(x169, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.3333333333333333 - del x169 - x647 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x647 += einsum(t2.bbbb, (0, 1, 2, 3), x646, (4, 5, 1, 6), (4, 5, 0, 6, 2, 3)) * -12.0 - del x646 - x648 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x648 += einsum(x643, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * 2.0 - del x643 - x648 += einsum(x644, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) * -4.0 - del x644 - x648 += einsum(x645, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) - del x645 - x648 += einsum(x647, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 4, 3)) - del x647 - t3new_bbbbbb += einsum(x648, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new_bbbbbb += einsum(x648, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - t3new_bbbbbb += einsum(x648, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - t3new_bbbbbb += einsum(x648, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) - t3new_bbbbbb += einsum(x648, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) * -1.0 - t3new_bbbbbb += einsum(x648, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) - t3new_bbbbbb += einsum(x648, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - t3new_bbbbbb += einsum(x648, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) - t3new_bbbbbb += einsum(x648, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) * -1.0 - del x648 - x649 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x649 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 6, 7, 1, 3), (4, 5, 6, 0, 7, 2)) - x650 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x650 += einsum(t1.bb, (0, 1), x649, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x649 - t3new_bbbbbb += einsum(x650, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 6.0 - t3new_bbbbbb += einsum(x650, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -6.0 - t3new_bbbbbb += einsum(x650, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -6.0 - t3new_bbbbbb += einsum(x650, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * 6.0 - t3new_bbbbbb += einsum(x650, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * 6.0 - t3new_bbbbbb += einsum(x650, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) * -6.0 - del x650 - x651 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x651 += einsum(x440, (0, 1), t3.bbbbbb, (2, 3, 4, 5, 6, 0), (2, 3, 4, 5, 6, 1)) * 6.0 - del x440 - x652 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x652 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 6, 7, 3, 1), (4, 5, 6, 0, 2, 7)) * -1.0 - x653 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x653 += einsum(x470, (0, 1, 2, 3), x652, (4, 5, 6, 0, 1, 7), (4, 5, 6, 2, 3, 7)) * 6.0 - del x470, x652 - x654 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x654 += einsum(x651, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) - del x651 - x654 += einsum(x653, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x653 - t3new_bbbbbb += einsum(x654, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new_bbbbbb += einsum(x654, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - t3new_bbbbbb += einsum(x654, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - del x654 - x655 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x655 += einsum(t2.bbbb, (0, 1, 2, 3), x157, (4, 5, 3, 6), (4, 0, 1, 2, 6, 5)) - del x157 - x656 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x656 += einsum(t2.bbbb, (0, 1, 2, 3), x1, (4, 5, 6, 3), (4, 0, 1, 6, 5, 2)) - del x1 - x657 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x657 += einsum(t1.bb, (0, 1), x656, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - del x656 - x658 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x658 += einsum(t2.bbbb, (0, 1, 2, 3), x182, (4, 5, 6, 3), (5, 4, 0, 1, 6, 2)) - del x182 - x659 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x659 += einsum(x657, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - del x657 - x659 += einsum(x658, (0, 1, 2, 3, 4, 5), (0, 3, 2, 1, 5, 4)) * -1.0 - del x658 - x660 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x660 += einsum(t1.bb, (0, 1), x659, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 6, 1)) * 2.0 - del x659 - x661 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x661 += einsum(x655, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -2.0 - del x655 - x661 += einsum(x660, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -1.0 - del x660 - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) * -1.0 - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * -1.0 - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * -1.0 - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 4, 3)) - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 5, 4)) * -1.0 - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) * -1.0 - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) - t3new_bbbbbb += einsum(x661, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) * -1.0 - del x661 - x662 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x662 += einsum(v.bbbb.oooo, (0, 1, 2, 3), t3.bbbbbb, (4, 3, 1, 5, 6, 7), (4, 0, 2, 5, 6, 7)) * -1.0 - x663 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x663 += einsum(f.bb.oo, (0, 1), (0, 1)) - x663 += einsum(x16, (0, 1), (1, 0)) * 2.0 - del x16 - x663 += einsum(x17, (0, 1), (1, 0)) - del x17 - x663 += einsum(x20, (0, 1), (0, 1)) - del x20 - x664 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x664 += einsum(x663, (0, 1), t3.bbbbbb, (2, 3, 0, 4, 5, 6), (2, 3, 1, 4, 5, 6)) * 6.0 - del x663 - x665 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x665 += einsum(x662, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * 6.0 - del x662 - x665 += einsum(x664, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) - del x664 - t3new_bbbbbb += einsum(x665, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new_bbbbbb += einsum(x665, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * -1.0 - t3new_bbbbbb += einsum(x665, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) - del x665 - x666 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x666 += einsum(v.bbbb.vvvv, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 6, 7, 3, 1), (4, 5, 6, 7, 0, 2)) * -1.0 - x667 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x667 += einsum(f.bb.vv, (0, 1), (0, 1)) * -1.0 - x667 += einsum(x142, (0, 1), (1, 0)) * 2.0 - del x142 - x667 += einsum(x143, (0, 1), (1, 0)) - del x143 - x667 += einsum(x145, (0, 1), (0, 1)) - del x145 - x668 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x668 += einsum(x667, (0, 1), t3.bbbbbb, (2, 3, 4, 5, 6, 0), (2, 3, 4, 5, 6, 1)) * 6.0 - del x667 - x669 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x669 += einsum(x666, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -6.0 - del x666 - x669 += einsum(x668, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 3, 4)) * -1.0 - del x668 - t3new_bbbbbb += einsum(x669, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new_bbbbbb += einsum(x669, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - t3new_bbbbbb += einsum(x669, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - del x669 - x670 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x670 += einsum(x210, (0, 1, 2, 3), (1, 0, 3, 2)) - del x210 - x670 += einsum(x171, (0, 1, 2, 3), (0, 1, 2, 3)) - x671 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x671 += einsum(x670, (0, 1, 2, 3), t3.bbbbbb, (4, 2, 3, 5, 6, 7), (4, 0, 1, 5, 6, 7)) * -6.0 - del x670 - x672 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x672 += einsum(x417, (0, 1), t3.bbbbbb, (2, 3, 0, 4, 5, 6), (2, 3, 1, 4, 5, 6)) * 6.0 - del x417 - x673 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x673 += einsum(x671, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) - del x671 - x673 += einsum(x672, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * -1.0 - del x672 - t3new_bbbbbb += einsum(x673, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) - t3new_bbbbbb += einsum(x673, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) * -1.0 - t3new_bbbbbb += einsum(x673, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 3, 4)) * -1.0 - del x673 - x674 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x674 += einsum(x403, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x403 - x674 += einsum(x404, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.3333333333333333 - del x404 - x675 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x675 += einsum(t2.bbbb, (0, 1, 2, 3), x674, (4, 5, 6, 3), (4, 0, 1, 5, 6, 2)) * -12.0 - del x674 - x676 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x676 += einsum(v.aabb.ovoo, (0, 1, 2, 3), t3.babbab, (4, 0, 5, 6, 1, 7), (4, 5, 2, 3, 6, 7)) - x677 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x677 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x677 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x678 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x678 += einsum(x677, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 0, 6, 7, 3), (4, 5, 1, 2, 6, 7)) - del x677 - x679 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x679 += einsum(x676, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -0.3333333333333333 - del x676 - x679 += einsum(x678, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x678 - x680 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x680 += einsum(t1.bb, (0, 1), x679, (2, 3, 0, 4, 5, 6), (2, 3, 4, 5, 6, 1)) * 6.0 - del x679 - x681 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x681 += einsum(x675, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) * -1.0 - del x675 - x681 += einsum(x680, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - del x680 - t3new_bbbbbb += einsum(x681, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new_bbbbbb += einsum(x681, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - t3new_bbbbbb += einsum(x681, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - t3new_bbbbbb += einsum(x681, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) * -1.0 - t3new_bbbbbb += einsum(x681, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - t3new_bbbbbb += einsum(x681, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -1.0 - t3new_bbbbbb += einsum(x681, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - t3new_bbbbbb += einsum(x681, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) - t3new_bbbbbb += einsum(x681, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - del x681 - x682 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x682 += einsum(t2.bbbb, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0000000000000204 - x682 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -1.0 - x683 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x683 += einsum(x682, (0, 1, 2, 3), x7, (0, 4, 2, 5), (4, 1, 5, 3)) * 0.4999999999999949 - del x7, x682 - x684 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x684 += einsum(x111, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.49999999999999983 - del x111 - x684 += einsum(x683, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x683 - x685 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x685 += einsum(x684, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 1, 6, 7, 3), (4, 5, 0, 6, 7, 2)) * 12.000000000000123 - del x684 - x686 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x686 += einsum(t2.abab, (0, 1, 2, 3), x11, (0, 4, 2, 5), (1, 3, 4, 5)) * 0.5 - del x11 - x687 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x687 += einsum(v.aabb.ovov, (0, 1, 2, 3), x315, (2, 4, 3, 5), (4, 5, 0, 1)) - del x315 - x688 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x688 += einsum(x686, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x686 - x688 += einsum(x687, (0, 1, 2, 3), (0, 1, 2, 3)) - del x687 - x689 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x689 += einsum(x688, (0, 1, 2, 3), t3.babbab, (4, 2, 5, 6, 3, 7), (0, 4, 5, 1, 6, 7)) * 4.00000000000004 - del x688 - x690 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x690 += einsum(x685, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) - del x685 - x690 += einsum(x689, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) - del x689 - t3new_bbbbbb += einsum(x690, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - t3new_bbbbbb += einsum(x690, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - t3new_bbbbbb += einsum(x690, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - t3new_bbbbbb += einsum(x690, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 4, 5)) - t3new_bbbbbb += einsum(x690, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 3, 5)) * -1.0 - t3new_bbbbbb += einsum(x690, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) - t3new_bbbbbb += einsum(x690, (0, 1, 2, 3, 4, 5), (2, 1, 0, 3, 4, 5)) * -1.0 - t3new_bbbbbb += einsum(x690, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 3, 5)) - t3new_bbbbbb += einsum(x690, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -1.0 - del x690 - x691 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x691 += einsum(x184, (0, 1, 2, 3), t3.bbbbbb, (4, 2, 3, 5, 6, 7), (0, 4, 1, 5, 6, 7)) - del x184 - t3new_bbbbbb += einsum(x691, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) * 6.0 - t3new_bbbbbb += einsum(x691, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) * -6.0 - t3new_bbbbbb += einsum(x691, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 5, 3)) * -6.0 - t3new_bbbbbb += einsum(x691, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * 6.0 - t3new_bbbbbb += einsum(x691, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 5, 3)) * 6.0 - t3new_bbbbbb += einsum(x691, (0, 1, 2, 3, 4, 5), (2, 1, 0, 4, 5, 3)) * -6.0 - del x691 - x692 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x692 += einsum(t1.bb, (0, 1), v.bbbb.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - x693 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x693 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 1, 3), (0, 4, 5, 2)) - x694 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x694 += einsum(x692, (0, 1, 2, 3), (0, 2, 1, 3)) - del x692 - x694 += einsum(x693, (0, 1, 2, 3), (0, 2, 1, 3)) * 2.0 - del x693 - x694 += einsum(x186, (0, 1, 2, 3), (0, 2, 1, 3)) - del x186 - x695 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x695 += einsum(t1.bb, (0, 1), x171, (2, 3, 0, 4), (3, 2, 4, 1)) - del x171 - x696 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x696 += einsum(t2.bbbb, (0, 1, 2, 3), x412, (4, 5, 1, 3), (4, 5, 0, 2)) * 2.0 - del x412 - x697 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x697 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x697 += einsum(x177, (0, 1, 2, 3), (1, 0, 2, 3)) - del x177 - x698 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x698 += einsum(t1.bb, (0, 1), x697, (2, 3, 1, 4), (2, 3, 0, 4)) - del x697 - x699 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x699 += einsum(v.bbbb.ooov, (0, 1, 2, 3), x113, (1, 4, 3, 5), (4, 0, 2, 5)) * 2.0 - del x113 - x700 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x700 += einsum(x695, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x695 - x700 += einsum(x187, (0, 1, 2, 3), (0, 1, 2, 3)) - del x187 - x700 += einsum(x696, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x696 - x700 += einsum(x698, (0, 1, 2, 3), (2, 1, 0, 3)) - del x698 - x700 += einsum(x699, (0, 1, 2, 3), (0, 1, 2, 3)) - del x699 - x701 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x701 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x701 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - x701 += einsum(x694, (0, 1, 2, 3), (0, 1, 2, 3)) - x701 += einsum(x694, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x694 - x701 += einsum(x700, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x701 += einsum(x700, (0, 1, 2, 3), (1, 0, 2, 3)) - del x700 - x701 += einsum(x185, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x701 += einsum(x185, (0, 1, 2, 3), (1, 0, 2, 3)) - del x185 - x701 += einsum(x170, (0, 1, 2, 3), (2, 1, 0, 3)) - del x170 - x701 += einsum(x480, (0, 1, 2, 3), (1, 0, 2, 3)) - del x480 - x702 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x702 += einsum(t2.bbbb, (0, 1, 2, 3), x701, (4, 5, 1, 6), (4, 5, 0, 6, 2, 3)) * -2.0 - del x701 - t3new_bbbbbb += einsum(x702, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 4, 3)) - t3new_bbbbbb += einsum(x702, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - t3new_bbbbbb += einsum(x702, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 3, 4)) - t3new_bbbbbb += einsum(x702, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 4, 3)) - t3new_bbbbbb += einsum(x702, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) - t3new_bbbbbb += einsum(x702, (0, 1, 2, 3, 4, 5), (0, 1, 2, 5, 3, 4)) * -1.0 - t3new_bbbbbb += einsum(x702, (0, 1, 2, 3, 4, 5), (0, 2, 1, 5, 4, 3)) * -1.0 - t3new_bbbbbb += einsum(x702, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 5, 4)) * -1.0 - t3new_bbbbbb += einsum(x702, (0, 1, 2, 3, 4, 5), (2, 0, 1, 5, 3, 4)) * -1.0 - del x702 - - t1new.aa = t1new_aa - t1new.bb = t1new_bb - t2new.aaaa = t2new_aaaa - t2new.abab = t2new_abab - t2new.bbbb = t2new_bbbb - t3new.aaaaaa = t3new_aaaaaa - t3new.abaaba = t3new_abaaba - t3new.babbab = t3new_babbab - t3new.bbbbbb = t3new_bbbbbb - - return {"t1new": t1new, "t2new": t2new, "t3new": t3new} - -def update_lams(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, l1=None, l2=None, l3=None, **kwargs): - l1new = Namespace() - l2new = Namespace() - l3new = Namespace() - - # L amplitudes - l1new_bb = np.zeros((nvir[1], nocc[1]), dtype=types[float]) - l1new_bb += einsum(f.bb.ov, (0, 1), (1, 0)) - l1new_bb += einsum(l2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (3, 0, 4, 1), (4, 2)) * -2.0 - l1new_aa = np.zeros((nvir[0], nocc[0]), dtype=types[float]) - l1new_aa += einsum(f.aa.ov, (0, 1), (1, 0)) - l2new_aaaa = np.zeros((nvir[0], nvir[0], nocc[0], nocc[0]), dtype=types[float]) - l2new_aaaa += einsum(l2.aaaa, (0, 1, 2, 3), v.aaaa.vvvv, (4, 1, 5, 0), (4, 5, 2, 3)) * -2.0 - l2new_abab = np.zeros((nvir[0], nvir[1], nocc[0], nocc[1]), dtype=types[float]) - l2new_abab += einsum(l1.aa, (0, 1), v.aabb.vvov, (2, 0, 3, 4), (2, 4, 1, 3)) - l2new_abab += einsum(v.aabb.ovov, (0, 1, 2, 3), (1, 3, 0, 2)) - l2new_abab += einsum(l1.bb, (0, 1), v.aabb.ovvv, (2, 3, 4, 0), (3, 4, 2, 1)) - l2new_abab += einsum(l2.abab, (0, 1, 2, 3), v.aabb.vvvv, (4, 0, 5, 1), (4, 5, 2, 3)) - l2new_bbbb = np.zeros((nvir[1], nvir[1], nocc[1], nocc[1]), dtype=types[float]) - l2new_bbbb += einsum(l2.bbbb, (0, 1, 2, 3), v.bbbb.vvvv, (4, 0, 5, 1), (4, 5, 2, 3)) * 2.0 - l3new_aaaaaa = np.zeros((nvir[0], nvir[0], nvir[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (0, 5, 3, 1, 2, 4)) * -1.0 - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (0, 3, 5, 1, 2, 4)) - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (5, 0, 3, 1, 2, 4)) - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (3, 0, 5, 1, 2, 4)) * -1.0 - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (5, 3, 0, 1, 2, 4)) * -1.0 - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (3, 5, 0, 1, 2, 4)) - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (0, 5, 3, 2, 1, 4)) - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (0, 3, 5, 2, 1, 4)) * -1.0 - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (5, 0, 3, 2, 1, 4)) * -1.0 - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (3, 0, 5, 2, 1, 4)) - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (5, 3, 0, 2, 1, 4)) - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (3, 5, 0, 2, 1, 4)) * -1.0 - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (0, 5, 3, 2, 4, 1)) * -1.0 - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (0, 3, 5, 2, 4, 1)) - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (5, 0, 3, 2, 4, 1)) - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (3, 0, 5, 2, 4, 1)) * -1.0 - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (5, 3, 0, 2, 4, 1)) * -1.0 - l3new_aaaaaa += einsum(l1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (3, 5, 0, 2, 4, 1)) - l3new_babbab = np.zeros((nvir[1], nvir[0], nvir[1], nocc[1], nocc[0], nocc[1]), dtype=types[float]) - l3new_babbab += einsum(v.bbbb.vvvv, (0, 1, 2, 3), l3.babbab, (3, 4, 1, 5, 6, 7), (0, 4, 2, 5, 6, 7)) * -2.0 - l3new_abaaba = np.zeros((nvir[0], nvir[1], nvir[0], nocc[0], nocc[1], nocc[0]), dtype=types[float]) - l3new_abaaba += einsum(v.aaaa.vvvv, (0, 1, 2, 3), l3.abaaba, (1, 4, 3, 5, 6, 7), (0, 4, 2, 5, 6, 7)) * 2.0 - l3new_bbbbbb = np.zeros((nvir[1], nvir[1], nvir[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (0, 5, 3, 1, 2, 4)) * -1.0 - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (0, 3, 5, 1, 2, 4)) - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (5, 0, 3, 1, 2, 4)) - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (3, 0, 5, 1, 2, 4)) * -1.0 - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (5, 3, 0, 1, 2, 4)) * -1.0 - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (3, 5, 0, 1, 2, 4)) - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (0, 5, 3, 2, 1, 4)) - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (0, 3, 5, 2, 1, 4)) * -1.0 - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (5, 0, 3, 2, 1, 4)) * -1.0 - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (3, 0, 5, 2, 1, 4)) - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (5, 3, 0, 2, 1, 4)) - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (3, 5, 0, 2, 1, 4)) * -1.0 - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (0, 5, 3, 2, 4, 1)) * -1.0 - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (0, 3, 5, 2, 4, 1)) - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (5, 0, 3, 2, 4, 1)) - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (3, 0, 5, 2, 4, 1)) * -1.0 - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (5, 3, 0, 2, 4, 1)) * -1.0 - l3new_bbbbbb += einsum(l1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (3, 5, 0, 2, 4, 1)) - x0 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x0 += einsum(t2.bbbb, (0, 1, 2, 3), l3.bbbbbb, (4, 5, 3, 6, 0, 1), (6, 4, 5, 2)) - l1new_bb += einsum(v.bbbb.vvvv, (0, 1, 2, 3), x0, (4, 3, 1, 2), (0, 4)) * -6.0 - x1 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x1 += einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - x2 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x2 += einsum(t1.bb, (0, 1), x1, (2, 3, 4, 1), (3, 2, 4, 0)) - l1new_bb += einsum(v.bbbb.ooov, (0, 1, 2, 3), x2, (4, 1, 0, 2), (3, 4)) * -2.0 - x3 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x3 += einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - x4 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x4 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x4 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x4 += einsum(x3, (0, 1, 2, 3), (0, 1, 2, 3)) - x4 += einsum(x3, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x5 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x5 += einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 4, 1), (0, 4, 2, 3)) - l2new_abab += einsum(x1, (0, 1, 2, 3), x5, (1, 2, 4, 5), (5, 3, 4, 0)) * -2.0 - x6 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x6 += einsum(v.aabb.ovoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x6 += einsum(x5, (0, 1, 2, 3), (0, 1, 2, 3)) - l2new_abab += einsum(l1.bb, (0, 1), x6, (1, 2, 3, 4), (4, 0, 3, 2)) * -1.0 - x7 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x7 += einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (3, 4, 0, 2)) - x8 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x8 += einsum(v.aabb.ooov, (0, 1, 2, 3), (2, 3, 0, 1)) - x8 += einsum(x7, (0, 1, 2, 3), (0, 1, 3, 2)) - x9 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x9 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - x10 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x10 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x10 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x11 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x11 += einsum(t2.bbbb, (0, 1, 2, 3), x10, (1, 4, 3, 5), (0, 4, 2, 5)) * 2.0 - x12 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x12 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x12 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) - x13 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x13 += einsum(t1.bb, (0, 1), x12, (2, 3, 1, 4), (0, 2, 3, 4)) - x14 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x14 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x14 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x14 += einsum(x9, (0, 1, 2, 3), (0, 1, 2, 3)) - x14 += einsum(x11, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x14 += einsum(x13, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x15 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x15 += einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (3, 4, 0, 2)) - l2new_abab += einsum(l2.aaaa, (0, 1, 2, 3), x15, (4, 5, 3, 1), (0, 5, 2, 4)) * 2.0 - x16 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x16 += einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (4, 5, 0, 2)) - x17 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x17 += einsum(t2.abab, (0, 1, 2, 3), x10, (1, 4, 3, 5), (4, 5, 0, 2)) - x18 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x18 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x18 += einsum(x15, (0, 1, 2, 3), (0, 1, 2, 3)) - x18 += einsum(x16, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x18 += einsum(x17, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x19 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x19 += einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - x20 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x20 += einsum(t1.bb, (0, 1), x10, (0, 2, 1, 3), (2, 3)) - x21 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x21 += einsum(f.bb.ov, (0, 1), (0, 1)) - x21 += einsum(x19, (0, 1), (0, 1)) - x21 += einsum(x20, (0, 1), (0, 1)) * -1.0 - l2new_abab += einsum(l1.aa, (0, 1), x21, (2, 3), (0, 3, 1, 2)) - l3new_babbab += einsum(x21, (0, 1), l2.abab, (2, 3, 4, 5), (1, 2, 3, 0, 4, 5)) - l3new_babbab += einsum(x21, (0, 1), l2.abab, (2, 3, 4, 5), (3, 2, 1, 5, 4, 0)) - l3new_babbab += einsum(x21, (0, 1), l2.abab, (2, 3, 4, 5), (3, 2, 1, 0, 4, 5)) * -1.0 - l3new_babbab += einsum(x21, (0, 1), l2.abab, (2, 3, 4, 5), (1, 2, 3, 5, 4, 0)) * -1.0 - l3new_abaaba += einsum(x21, (0, 1), l2.aaaa, (2, 3, 4, 5), (2, 1, 3, 4, 0, 5)) * 2.0 - l3new_bbbbbb += einsum(x21, (0, 1), l2.bbbb, (2, 3, 4, 5), (2, 3, 1, 4, 5, 0)) * 2.0 - l3new_bbbbbb += einsum(x21, (0, 1), l2.bbbb, (2, 3, 4, 5), (2, 3, 1, 0, 4, 5)) * 2.0 - l3new_bbbbbb += einsum(x21, (0, 1), l2.bbbb, (2, 3, 4, 5), (2, 1, 3, 4, 0, 5)) * 2.0 - l3new_bbbbbb += einsum(x21, (0, 1), l2.bbbb, (2, 3, 4, 5), (1, 2, 3, 4, 5, 0)) * 2.0 - l3new_bbbbbb += einsum(x21, (0, 1), l2.bbbb, (2, 3, 4, 5), (1, 2, 3, 0, 4, 5)) * 2.0 - l3new_bbbbbb += einsum(x21, (0, 1), l2.bbbb, (2, 3, 4, 5), (2, 3, 1, 4, 0, 5)) * -2.0 - l3new_bbbbbb += einsum(x21, (0, 1), l2.bbbb, (2, 3, 4, 5), (2, 1, 3, 4, 5, 0)) * -2.0 - l3new_bbbbbb += einsum(x21, (0, 1), l2.bbbb, (2, 3, 4, 5), (2, 1, 3, 0, 4, 5)) * -2.0 - l3new_bbbbbb += einsum(x21, (0, 1), l2.bbbb, (2, 3, 4, 5), (1, 2, 3, 4, 0, 5)) * -2.0 - x22 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x22 += einsum(t1.bb, (0, 1), v.aabb.vvov, (2, 3, 4, 1), (0, 4, 2, 3)) - x23 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x23 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 5, 3), (1, 5, 2, 4)) - x24 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x24 += einsum(v.aabb.vvoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x24 += einsum(x22, (0, 1, 2, 3), (0, 1, 3, 2)) - x24 += einsum(x23, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x25 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x25 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - x26 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x26 += einsum(t1.bb, (0, 1), x3, (2, 3, 4, 1), (0, 2, 3, 4)) - x27 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x27 += einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - x28 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x28 += einsum(v.bbbb.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x28 += einsum(x25, (0, 1, 2, 3), (3, 1, 2, 0)) - x28 += einsum(x26, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x28 += einsum(x27, (0, 1, 2, 3), (2, 0, 3, 1)) * -1.0 - x28 += einsum(x27, (0, 1, 2, 3), (3, 0, 2, 1)) - x29 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x29 += einsum(t1.aa, (0, 1), v.aabb.ovoo, (2, 1, 3, 4), (3, 4, 0, 2)) - x30 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x30 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 5, 3), (1, 5, 0, 4)) - x31 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x31 += einsum(v.aabb.ooov, (0, 1, 2, 3), (2, 3, 0, 1)) - x31 += einsum(x7, (0, 1, 2, 3), (0, 1, 2, 3)) - l2new_abab += einsum(l1.aa, (0, 1), x31, (2, 3, 1, 4), (0, 3, 4, 2)) * -1.0 - x32 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x32 += einsum(t1.bb, (0, 1), x31, (2, 1, 3, 4), (0, 2, 3, 4)) - x33 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x33 += einsum(v.aabb.oooo, (0, 1, 2, 3), (2, 3, 0, 1)) - x33 += einsum(x29, (0, 1, 2, 3), (1, 0, 3, 2)) - x33 += einsum(x30, (0, 1, 2, 3), (0, 1, 3, 2)) - x33 += einsum(x32, (0, 1, 2, 3), (0, 1, 3, 2)) - x34 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x34 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.babbab, (4, 5, 6, 3, 7, 1), (4, 6, 0, 2, 5, 7)) * -1.0 - l2new_bbbb += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), x34, (3, 5, 6, 7, 4, 1), (0, 2, 6, 7)) * 1.9999999999999203 - x35 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x35 += einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 6, 3), (1, 4, 5, 6, 0, 2)) - x36 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x36 += einsum(t2.abab, (0, 1, 2, 3), x3, (4, 5, 6, 3), (4, 1, 6, 5, 0, 2)) - x37 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x37 += einsum(x34, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -0.9999999999999601 - del x34 - x37 += einsum(x35, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) - x37 += einsum(x35, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x35 - x37 += einsum(x36, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x37 += einsum(x36, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x36 - x38 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x38 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 5, 6, 7, 1, 3), (4, 6, 2, 7, 5, 0)) - l2new_abab += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), x38, (5, 3, 6, 2, 4, 7), (1, 0, 7, 6)) * 1.9999999999999194 - x39 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x39 += einsum(v.aabb.ovoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x39 += einsum(x5, (0, 1, 2, 3), (1, 0, 2, 3)) - x40 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x40 += einsum(t2.abab, (0, 1, 2, 3), x39, (4, 5, 6, 2), (1, 4, 5, 3, 0, 6)) - x41 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x41 += einsum(x38, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * 0.9999999999999597 - x41 += einsum(t2.bbbb, (0, 1, 2, 3), x31, (4, 3, 5, 6), (0, 1, 4, 2, 6, 5)) - x41 += einsum(x40, (0, 1, 2, 3, 4, 5), (2, 0, 1, 3, 5, 4)) * -1.0 - x42 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x42 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), t3.babbab, (4, 5, 6, 3, 7, 1), (0, 4, 6, 2, 5, 7)) * -0.9999999999999601 - x42 += einsum(v.aabb.vvov, (0, 1, 2, 3), t3.babbab, (4, 5, 6, 7, 1, 3), (2, 4, 6, 7, 5, 0)) * -0.9999999999999597 - x42 += einsum(x4, (0, 1, 2, 3), t3.babbab, (4, 5, 1, 6, 7, 3), (2, 4, 0, 6, 5, 7)) * -2.0 - x42 += einsum(x6, (0, 1, 2, 3), t3.abaaba, (4, 5, 2, 6, 7, 3), (1, 5, 0, 7, 4, 6)) * -2.0 - x42 += einsum(x8, (0, 1, 2, 3), t3.babbab, (4, 2, 5, 6, 7, 1), (0, 4, 5, 6, 3, 7)) - x42 += einsum(t2.abab, (0, 1, 2, 3), x14, (4, 5, 6, 3), (5, 1, 4, 6, 0, 2)) - x42 += einsum(t2.bbbb, (0, 1, 2, 3), x18, (4, 3, 5, 6), (4, 0, 1, 2, 5, 6)) * -1.0 - x42 += einsum(x21, (0, 1), t3.babbab, (2, 3, 4, 5, 6, 1), (0, 2, 4, 5, 3, 6)) * -0.9999999999999597 - x42 += einsum(t2.abab, (0, 1, 2, 3), x24, (4, 5, 2, 6), (5, 1, 4, 3, 0, 6)) * -1.0 - x42 += einsum(t2.abab, (0, 1, 2, 3), x28, (1, 4, 5, 6), (5, 6, 4, 3, 0, 2)) * -1.0 - x42 += einsum(t2.abab, (0, 1, 2, 3), x33, (4, 5, 0, 6), (5, 1, 4, 3, 6, 2)) - x42 += einsum(t1.bb, (0, 1), x37, (2, 3, 4, 0, 5, 6), (4, 3, 2, 1, 5, 6)) - del x37 - x42 += einsum(t1.aa, (0, 1), x41, (2, 3, 4, 5, 0, 6), (4, 3, 2, 5, 6, 1)) * -1.0 - del x41 - l1new_bb += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), x42, (6, 3, 5, 2, 4, 1), (0, 6)) * -2.0 - del x42 - x43 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x43 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x43 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x43 += einsum(x3, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x43 += einsum(x3, (0, 1, 2, 3), (0, 2, 1, 3)) - x44 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x44 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 5, 6, 7, 3, 1), (5, 2, 4, 6, 0, 7)) - l2new_abab += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), x44, (4, 6, 5, 3, 7, 2), (0, 1, 7, 6)) * 1.9999999999999194 - x45 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x45 += einsum(t2.aaaa, (0, 1, 2, 3), x39, (4, 5, 6, 3), (4, 5, 0, 1, 6, 2)) * -1.0 - x46 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x46 += einsum(x44, (0, 1, 2, 3, 4, 5), (0, 1, 3, 4, 2, 5)) * 0.9999999999999597 - x46 += einsum(t2.abab, (0, 1, 2, 3), x31, (4, 3, 5, 6), (1, 4, 0, 6, 5, 2)) * -1.0 - x46 += einsum(x45, (0, 1, 2, 3, 4, 5), (1, 0, 3, 4, 2, 5)) * -1.0 - x47 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x47 += einsum(v.aabb.vvov, (0, 1, 2, 3), t3.abaaba, (4, 5, 6, 7, 3, 1), (2, 5, 4, 6, 7, 0)) * -1.9999999999999194 - x47 += einsum(x43, (0, 1, 2, 3), t3.abaaba, (4, 2, 5, 6, 3, 7), (1, 0, 4, 5, 6, 7)) * -1.0 - x47 += einsum(x6, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 2, 6, 7, 3), (1, 0, 4, 5, 6, 7)) * -3.0 - x47 += einsum(x8, (0, 1, 2, 3), t3.abaaba, (4, 5, 2, 6, 1, 7), (0, 5, 4, 3, 6, 7)) * 2.0 - x47 += einsum(t2.abab, (0, 1, 2, 3), x18, (4, 3, 5, 6), (4, 1, 0, 5, 2, 6)) * -2.0 - del x18 - x47 += einsum(x21, (0, 1), t3.abaaba, (2, 3, 4, 5, 1, 6), (0, 3, 2, 4, 5, 6)) * -0.9999999999999601 - x47 += einsum(t2.aaaa, (0, 1, 2, 3), x24, (4, 5, 3, 6), (5, 4, 0, 1, 2, 6)) * -2.0 - del x24 - x47 += einsum(t2.aaaa, (0, 1, 2, 3), x33, (4, 5, 1, 6), (5, 4, 0, 6, 2, 3)) * 2.0 - del x33 - x47 += einsum(t1.aa, (0, 1), x46, (2, 3, 4, 0, 5, 6), (3, 2, 4, 5, 6, 1)) * -2.0 - del x46 - l1new_bb += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), x47, (6, 4, 3, 5, 0, 2), (1, 6)) - del x47 - x48 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x48 += einsum(v.bbbb.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x48 += einsum(x25, (0, 1, 2, 3), (3, 1, 2, 0)) - x48 += einsum(x26, (0, 1, 2, 3), (3, 1, 2, 0)) - x48 += einsum(x27, (0, 1, 2, 3), (2, 1, 3, 0)) - x48 += einsum(x27, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - x49 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x49 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 6, 7, 3, 1), (4, 5, 6, 0, 2, 7)) * -1.0 - l2new_bbbb += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), x49, (5, 4, 3, 6, 7, 2), (0, 1, 6, 7)) * -5.9999999999997575 - x50 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x50 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - x51 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x51 += einsum(t2.bbbb, (0, 1, 2, 3), x3, (4, 5, 6, 3), (4, 0, 1, 6, 5, 2)) - x52 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x52 += einsum(x49, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -0.9999999999999596 - del x49 - x52 += einsum(x50, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - x52 += einsum(x50, (0, 1, 2, 3, 4, 5), (0, 1, 3, 4, 2, 5)) - del x50 - x52 += einsum(x51, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) * -1.0 - x52 += einsum(x51, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 3, 5)) - del x51 - x53 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x53 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 6, 7, 1, 3), (0, 4, 5, 6, 7, 2)) * -0.9999999999999596 - x53 += einsum(x43, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 2, 6, 7, 3), (1, 4, 0, 5, 6, 7)) * -1.5 - del x43 - x53 += einsum(x6, (0, 1, 2, 3), t3.babbab, (4, 2, 5, 6, 3, 7), (1, 4, 0, 5, 6, 7)) * -0.5 - x53 += einsum(t2.bbbb, (0, 1, 2, 3), x14, (4, 5, 6, 3), (5, 0, 4, 1, 2, 6)) - del x14 - x53 += einsum(x21, (0, 1), t3.bbbbbb, (2, 3, 4, 5, 6, 1), (0, 2, 3, 4, 5, 6)) * 0.4999999999999798 - x53 += einsum(t2.bbbb, (0, 1, 2, 3), x48, (1, 4, 5, 6), (5, 0, 6, 4, 2, 3)) - x53 += einsum(t1.bb, (0, 1), x52, (2, 3, 4, 5, 0, 6), (5, 3, 4, 2, 6, 1)) - del x52 - l1new_bb += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), x53, (6, 3, 5, 4, 2, 1), (0, 6)) * -6.0 - del x53 - x54 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x54 += einsum(l2.bbbb, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 0, 4, 5)) - x55 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x55 += einsum(l2.abab, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 0), (3, 1, 4, 5)) - x56 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x56 += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.babbab, (4, 6, 5, 1, 7, 2), (3, 0, 6, 7)) - x57 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x57 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 5, 4, 7, 2, 1), (3, 0, 6, 7)) - x58 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x58 += einsum(t1.aa, (0, 1), l3.babbab, (2, 1, 3, 4, 5, 6), (4, 6, 2, 3, 5, 0)) - x59 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x59 += einsum(t2.abab, (0, 1, 2, 3), x58, (4, 1, 5, 3, 0, 6), (4, 5, 6, 2)) - x60 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x60 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (6, 3, 5, 7, 0, 2), (4, 1, 6, 7)) - x61 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x61 += einsum(t1.aa, (0, 1), l3.abaaba, (2, 3, 1, 4, 5, 6), (5, 3, 4, 6, 0, 2)) - x62 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x62 += einsum(t2.aaaa, (0, 1, 2, 3), x61, (4, 5, 0, 1, 6, 3), (4, 5, 6, 2)) * -1.0 - x63 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x63 += einsum(t1.aa, (0, 1), l2.abab, (1, 2, 3, 4), (4, 2, 3, 0)) - l2new_abab += einsum(x5, (0, 1, 2, 3), x63, (0, 4, 5, 2), (3, 4, 5, 1)) - x64 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x64 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 2, 3, 5, 6, 1), (5, 4, 6, 0)) - x65 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x65 += einsum(t2.aaaa, (0, 1, 2, 3), l3.abaaba, (2, 4, 3, 5, 6, 1), (6, 4, 5, 0)) - x66 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x66 += einsum(x63, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x66 += einsum(x64, (0, 1, 2, 3), (0, 1, 2, 3)) - x66 += einsum(x65, (0, 1, 2, 3), (0, 1, 2, 3)) - l2new_abab += einsum(v.aabb.ovvv, (0, 1, 2, 3), x66, (4, 3, 5, 0), (1, 2, 5, 4)) * -2.0 - l2new_abab += einsum(v.aabb.ovoo, (0, 1, 2, 3), x66, (3, 4, 5, 0), (1, 4, 5, 2)) * 2.0 - x67 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x67 += einsum(l2.abab, (0, 1, 2, 3), (3, 1, 2, 0)) - x67 += einsum(x54, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x67 += einsum(x55, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x67 += einsum(x56, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x67 += einsum(x57, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - x67 += einsum(x59, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x67 += einsum(x60, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x67 += einsum(x62, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x67 += einsum(t1.aa, (0, 1), x66, (2, 3, 0, 4), (2, 3, 4, 1)) * -2.0 - l1new_bb += einsum(v.aabb.ovvv, (0, 1, 2, 3), x67, (4, 3, 0, 1), (2, 4)) - del x67 - x68 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x68 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 5, 3, 6, 0, 1), (6, 4, 5, 2)) - x69 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x69 += einsum(t2.aaaa, (0, 1, 2, 3), l3.abaaba, (4, 5, 3, 0, 6, 1), (6, 5, 4, 2)) - x70 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x70 += einsum(t1.aa, (0, 1), l2.abab, (2, 3, 0, 4), (4, 3, 2, 1)) * 0.5 - x70 += einsum(x68, (0, 1, 2, 3), (0, 1, 2, 3)) - x70 += einsum(x69, (0, 1, 2, 3), (0, 1, 2, 3)) - l1new_bb += einsum(v.aabb.vvvv, (0, 1, 2, 3), x70, (4, 3, 0, 1), (2, 4)) * 2.0 - del x70 - x71 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x71 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x71 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) - x72 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x72 += einsum(t1.bb, (0, 1), l3.bbbbbb, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - l3new_babbab += einsum(v.aabb.ovoo, (0, 1, 2, 3), x72, (4, 2, 5, 3, 6, 7), (6, 1, 7, 5, 0, 4)) * -6.0 - l3new_babbab += einsum(x5, (0, 1, 2, 3), x72, (0, 4, 5, 1, 6, 7), (7, 3, 6, 4, 2, 5)) * 6.0 - x73 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x73 += einsum(t2.bbbb, (0, 1, 2, 3), x72, (0, 4, 1, 5, 6, 3), (4, 5, 6, 2)) - x74 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x74 += einsum(t1.bb, (0, 1), l3.babbab, (2, 3, 1, 4, 5, 6), (4, 6, 0, 2, 5, 3)) - l2new_abab += einsum(x22, (0, 1, 2, 3), x74, (0, 4, 1, 5, 6, 3), (2, 5, 6, 4)) * 2.0 - x75 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x75 += einsum(t2.abab, (0, 1, 2, 3), x74, (4, 1, 5, 6, 0, 2), (4, 5, 6, 3)) - x76 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x76 += einsum(t2.bbbb, (0, 1, 2, 3), l3.bbbbbb, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) - x77 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x77 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 2, 3, 5, 0, 6), (5, 6, 1, 4)) - x78 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x78 += einsum(x1, (0, 1, 2, 3), (1, 0, 2, 3)) - x78 += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) * -3.0 - x78 += einsum(x77, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - l1new_bb += einsum(v.bbbb.oovv, (0, 1, 2, 3), x78, (0, 4, 1, 3), (2, 4)) * -2.0 - x79 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x79 += einsum(x73, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x79 += einsum(x75, (0, 1, 2, 3), (0, 1, 2, 3)) - x79 += einsum(t1.bb, (0, 1), x78, (0, 2, 3, 4), (2, 3, 4, 1)) - l1new_bb += einsum(x71, (0, 1, 2, 3), x79, (4, 0, 2, 1), (3, 4)) * 2.0 - del x79 - x80 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x80 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x80 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x81 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x81 += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - x82 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x82 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 5), (3, 4, 1, 5)) - x83 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x83 += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (6, 4, 5, 7, 1, 2), (3, 6, 0, 7)) - x84 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x84 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 4, 5, 7, 1, 2), (3, 6, 0, 7)) - x85 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x85 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 6, 5, 0, 7, 2), (4, 6, 1, 7)) - x86 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x86 += einsum(x81, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - x86 += einsum(x82, (0, 1, 2, 3), (0, 1, 2, 3)) - x86 += einsum(x83, (0, 1, 2, 3), (0, 1, 2, 3)) * 9.0 - x86 += einsum(x84, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - x86 += einsum(x85, (0, 1, 2, 3), (0, 1, 2, 3)) - l1new_bb += einsum(x80, (0, 1, 2, 3), x86, (4, 0, 2, 1), (3, 4)) - del x86 - x87 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x87 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 5, 1), (3, 4, 0, 5)) - x88 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x88 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 4, 5, 0, 7, 2), (3, 6, 1, 7)) - x89 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x89 += einsum(t2.abab, (0, 1, 2, 3), x74, (4, 1, 5, 3, 0, 6), (4, 5, 6, 2)) * -1.0 - x90 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x90 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 6, 5, 7, 1, 2), (4, 6, 0, 7)) - x91 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x91 += einsum(t1.bb, (0, 1), l3.abaaba, (2, 1, 3, 4, 5, 6), (5, 0, 4, 6, 2, 3)) - l3new_abaaba += einsum(x21, (0, 1), x91, (2, 0, 3, 4, 5, 6), (5, 1, 6, 4, 2, 3)) * 2.0 - x92 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x92 += einsum(t2.aaaa, (0, 1, 2, 3), x91, (4, 5, 0, 1, 3, 6), (4, 5, 6, 2)) * -1.0 - x93 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x93 += einsum(t1.bb, (0, 1), l2.abab, (2, 1, 3, 4), (4, 0, 3, 2)) - l2new_abab += einsum(x7, (0, 1, 2, 3), x93, (4, 0, 2, 5), (5, 1, 3, 4)) - x94 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x94 += einsum(t2.bbbb, (0, 1, 2, 3), l3.babbab, (2, 4, 3, 5, 6, 1), (5, 0, 6, 4)) - x95 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x95 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 3, 2, 5, 6, 0), (6, 1, 5, 4)) - x96 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x96 += einsum(x93, (0, 1, 2, 3), (0, 1, 2, 3)) - x96 += einsum(x94, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x96 += einsum(x95, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x97 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x97 += einsum(x87, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x97 += einsum(x88, (0, 1, 2, 3), (0, 1, 2, 3)) - x97 += einsum(x89, (0, 1, 2, 3), (0, 1, 3, 2)) - x97 += einsum(x90, (0, 1, 2, 3), (0, 1, 2, 3)) - x97 += einsum(x92, (0, 1, 2, 3), (0, 1, 3, 2)) - x97 += einsum(t1.aa, (0, 1), x96, (2, 3, 0, 4), (2, 3, 1, 4)) * 0.5 - l1new_bb += einsum(v.aabb.vvov, (0, 1, 2, 3), x97, (4, 2, 1, 0), (3, 4)) * -2.0 - del x97 - x98 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x98 += einsum(t1.bb, (0, 1), x58, (2, 3, 4, 1, 5, 6), (2, 3, 0, 4, 5, 6)) - x99 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x99 += einsum(t1.bb, (0, 1), x61, (2, 1, 3, 4, 5, 6), (2, 0, 3, 4, 5, 6)) - x100 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x100 += einsum(x68, (0, 1, 2, 3), (0, 1, 2, 3)) - del x68 - x100 += einsum(x69, (0, 1, 2, 3), (0, 1, 2, 3)) - del x69 - l2new_abab += einsum(v.aabb.ovvv, (0, 1, 2, 3), x100, (4, 3, 5, 1), (5, 2, 0, 4)) * -2.0 - l2new_abab += einsum(x100, (0, 1, 2, 3), x6, (0, 4, 5, 3), (2, 1, 5, 4)) * 2.0 - x101 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x101 += einsum(x63, (0, 1, 2, 3), (0, 1, 2, 3)) - x101 += einsum(x64, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x101 += einsum(x65, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - l1new_bb += einsum(v.aabb.oovv, (0, 1, 2, 3), x101, (4, 3, 0, 1), (2, 4)) * -1.0 - x102 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x102 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 5, 0, 1), (3, 5, 2, 4)) - x103 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x103 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 7, 5, 0, 1, 2), (3, 6, 4, 7)) - x104 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x104 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 7, 5, 0, 1, 2), (4, 7, 3, 6)) - x105 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x105 += einsum(t1.bb, (0, 1), x101, (2, 1, 3, 4), (0, 2, 3, 4)) - x106 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x106 += einsum(x94, (0, 1, 2, 3), (0, 1, 2, 3)) - x106 += einsum(x95, (0, 1, 2, 3), (0, 1, 2, 3)) - x107 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x107 += einsum(t1.aa, (0, 1), x106, (2, 3, 4, 1), (2, 3, 0, 4)) * 2.0 - x108 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x108 += einsum(x102, (0, 1, 2, 3), (0, 1, 2, 3)) - x108 += einsum(x103, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.9999999999999194 - x108 += einsum(x104, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.9999999999999194 - x108 += einsum(x105, (0, 1, 2, 3), (1, 0, 2, 3)) - x108 += einsum(x107, (0, 1, 2, 3), (0, 1, 3, 2)) - l2new_abab += einsum(v.aabb.ovov, (0, 1, 2, 3), x108, (4, 2, 5, 0), (1, 3, 5, 4)) - x109 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x109 += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 0, 1), (2, 4)) - x110 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x110 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - x111 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x111 += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (6, 4, 5, 0, 1, 2), (3, 6)) - x112 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x112 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 4, 5, 0, 1, 2), (3, 6)) - x113 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x113 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 6, 5, 0, 1, 2), (4, 6)) - x114 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x114 += einsum(x109, (0, 1), (0, 1)) - x114 += einsum(x110, (0, 1), (0, 1)) * 0.5 - x114 += einsum(x111, (0, 1), (0, 1)) * 1.4999999999999394 - x114 += einsum(x112, (0, 1), (0, 1)) * 0.9999999999999597 - x114 += einsum(x113, (0, 1), (0, 1)) * 0.49999999999998007 - x115 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x115 += einsum(l1.bb, (0, 1), t2.abab, (2, 3, 4, 0), (1, 3, 2, 4)) - x115 += einsum(x93, (0, 1, 2, 3), (0, 1, 2, 3)) - x115 += einsum(l2.bbbb, (0, 1, 2, 3), t3.babbab, (4, 5, 3, 0, 6, 1), (2, 4, 5, 6)) * 2.0 - x115 += einsum(x94, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x115 += einsum(l2.abab, (0, 1, 2, 3), t3.abaaba, (4, 5, 2, 6, 1, 0), (3, 5, 4, 6)) * 2.0 - x115 += einsum(x95, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x115 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x72, (6, 0, 2, 7, 5, 3), (6, 7, 1, 4)) * -3.0 - x115 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x74, (6, 1, 7, 4, 2, 5), (6, 7, 0, 3)) * -4.0 - x115 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x58, (6, 2, 5, 3, 1, 7), (6, 0, 7, 4)) * 2.0 - x115 += einsum(t2.abab, (0, 1, 2, 3), x98, (4, 1, 5, 3, 0, 6), (4, 5, 6, 2)) * 2.0 - x115 += einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), x91, (6, 7, 2, 1, 5, 4), (6, 7, 0, 3)) * 3.0 - x115 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x61, (6, 4, 2, 0, 7, 5), (6, 1, 7, 3)) * -2.0 - x115 += einsum(t2.aaaa, (0, 1, 2, 3), x99, (4, 5, 1, 0, 6, 3), (4, 5, 6, 2)) * -2.0 - x115 += einsum(t2.abab, (0, 1, 2, 3), x100, (4, 3, 2, 5), (4, 1, 0, 5)) * -2.0 - x115 += einsum(t2.abab, (0, 1, 2, 3), x78, (1, 4, 5, 3), (4, 5, 0, 2)) * -2.0 - x115 += einsum(t2.aaaa, (0, 1, 2, 3), x96, (4, 5, 1, 3), (4, 5, 0, 2)) * 2.0 - x115 += einsum(t2.abab, (0, 1, 2, 3), x101, (4, 3, 0, 5), (4, 1, 5, 2)) * -1.0 - x115 += einsum(t1.aa, (0, 1), x108, (2, 3, 0, 4), (2, 3, 4, 1)) * -1.0 - x115 += einsum(t1.aa, (0, 1), x114, (2, 3), (2, 3, 0, 1)) * 2.0 - l1new_bb += einsum(v.aabb.ovov, (0, 1, 2, 3), x115, (4, 2, 0, 1), (3, 4)) * -1.0 - del x115 - x116 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x116 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 2, 5, 6, 0, 1), (6, 4, 5, 3)) - x117 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x117 += einsum(t1.bb, (0, 1), l2.bbbb, (2, 3, 4, 0), (4, 2, 3, 1)) - x117 += einsum(x116, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - l1new_bb += einsum(v.bbbb.vvvv, (0, 1, 2, 3), x117, (4, 1, 2, 3), (0, 4)) * 2.0 - del x117 - x118 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x118 += einsum(t1.aa, (0, 1), v.aabb.vvoo, (2, 1, 3, 4), (3, 4, 0, 2)) - x119 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x119 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 5, 3), (1, 5, 0, 4)) - x120 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x120 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.babbab, (4, 5, 2, 1, 6, 3), (4, 0, 5, 6)) - x121 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x121 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 5, 0, 6, 3, 1), (5, 2, 4, 6)) - x122 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x122 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x122 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - x122 += einsum(x3, (0, 1, 2, 3), (1, 0, 2, 3)) - x122 += einsum(x3, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x123 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x123 += einsum(t2.abab, (0, 1, 2, 3), x122, (4, 5, 1, 3), (4, 5, 0, 2)) - x124 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x124 += einsum(t2.aaaa, (0, 1, 2, 3), x39, (4, 5, 1, 3), (4, 5, 0, 2)) * 2.0 - x125 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x125 += einsum(t2.abab, (0, 1, 2, 3), x8, (4, 3, 0, 5), (1, 4, 5, 2)) - x126 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x126 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x126 += einsum(x15, (0, 1, 2, 3), (0, 1, 2, 3)) - x127 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x127 += einsum(t1.bb, (0, 1), x126, (2, 1, 3, 4), (0, 2, 3, 4)) - x128 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x128 += einsum(v.aabb.oooo, (0, 1, 2, 3), (2, 3, 0, 1)) - x128 += einsum(x29, (0, 1, 2, 3), (1, 0, 3, 2)) - x128 += einsum(x30, (0, 1, 2, 3), (1, 0, 3, 2)) - x128 += einsum(x32, (0, 1, 2, 3), (1, 0, 3, 2)) - del x32 - x129 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x129 += einsum(t1.aa, (0, 1), x128, (2, 3, 0, 4), (2, 3, 4, 1)) - x130 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x130 += einsum(v.aabb.ovoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x130 += einsum(x118, (0, 1, 2, 3), (1, 0, 2, 3)) - x130 += einsum(x119, (0, 1, 2, 3), (0, 1, 2, 3)) - x130 += einsum(x120, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x130 += einsum(x121, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x130 += einsum(x123, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x130 += einsum(x124, (0, 1, 2, 3), (1, 0, 2, 3)) - x130 += einsum(x125, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x130 += einsum(x21, (0, 1), t2.abab, (2, 3, 4, 1), (3, 0, 2, 4)) - x130 += einsum(x127, (0, 1, 2, 3), (0, 1, 2, 3)) - x130 += einsum(x129, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - l1new_bb += einsum(l2.abab, (0, 1, 2, 3), x130, (3, 4, 2, 0), (1, 4)) * -1.0 - del x130 - x131 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x131 += einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), x72, (6, 2, 1, 7, 4, 5), (6, 7, 0, 3)) * -1.0 - x132 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x132 += einsum(t1.bb, (0, 1), x72, (2, 3, 4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - x133 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x133 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x74, (6, 2, 7, 5, 1, 4), (6, 7, 0, 3)) * -1.0 - x134 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x134 += einsum(t1.bb, (0, 1), x74, (2, 3, 4, 1, 5, 6), (2, 3, 0, 4, 5, 6)) - x135 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x135 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x91, (6, 7, 0, 2, 3, 5), (6, 7, 1, 4)) - x136 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x136 += einsum(x0, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x136 += einsum(x116, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.3333333333333333 - x137 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x137 += einsum(x1, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x137 += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x137 += einsum(x77, (0, 1, 2, 3), (0, 1, 2, 3)) - l2new_abab += einsum(v.aabb.ovoo, (0, 1, 2, 3), x137, (2, 4, 3, 5), (1, 5, 0, 4)) * 2.0 - x138 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x138 += einsum(t2.bbbb, (0, 1, 2, 3), x137, (4, 1, 5, 3), (0, 4, 5, 2)) * 4.0 - x139 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x139 += einsum(x93, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x139 += einsum(x94, (0, 1, 2, 3), (0, 1, 2, 3)) - del x94 - x139 += einsum(x95, (0, 1, 2, 3), (0, 1, 2, 3)) - del x95 - l1new_aa += einsum(v.aabb.vvoo, (0, 1, 2, 3), x139, (2, 3, 4, 1), (0, 4)) * -2.0 - l2new_abab += einsum(v.aabb.vvov, (0, 1, 2, 3), x139, (4, 2, 5, 1), (0, 3, 5, 4)) * -2.0 - l2new_abab += einsum(v.aabb.ooov, (0, 1, 2, 3), x139, (4, 2, 1, 5), (5, 3, 0, 4)) * 2.0 - l2new_abab += einsum(x21, (0, 1), x139, (2, 0, 3, 4), (4, 1, 3, 2)) * -2.0 - x140 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x140 += einsum(t2.abab, (0, 1, 2, 3), x139, (4, 5, 0, 2), (1, 4, 5, 3)) * 2.0 - x141 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x141 += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - x142 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x142 += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (6, 7, 5, 0, 1, 2), (3, 4, 6, 7)) - x143 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x143 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 4, 7, 0, 1, 2), (3, 5, 6, 7)) - l2new_bbbb += einsum(v.bbbb.ovov, (0, 1, 2, 3), x143, (4, 5, 0, 2), (1, 3, 4, 5)) * 1.9999999999999203 - x144 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x144 += einsum(x141, (0, 1, 2, 3), (1, 0, 3, 2)) - x144 += einsum(x142, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.9999999999998788 - x144 += einsum(x143, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.9999999999999601 - x144 += einsum(t1.bb, (0, 1), x137, (2, 3, 4, 1), (2, 3, 0, 4)) - x145 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x145 += einsum(x1, (0, 1, 2, 3), (1, 0, 2, 3)) * -2.0 - x145 += einsum(l2.bbbb, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 3, 6, 0, 1), (4, 2, 5, 6)) * 6.0 - x145 += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) * 6.0 - x145 += einsum(x77, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x145 += einsum(x131, (0, 1, 2, 3), (2, 0, 1, 3)) * 9.0 - x145 += einsum(t2.bbbb, (0, 1, 2, 3), x132, (4, 0, 1, 5, 6, 3), (5, 4, 6, 2)) * 6.0 - x145 += einsum(x133, (0, 1, 2, 3), (2, 0, 1, 3)) * 4.0 - x145 += einsum(t2.abab, (0, 1, 2, 3), x134, (4, 1, 5, 6, 0, 2), (5, 4, 6, 3)) * 2.0 - x145 += einsum(x135, (0, 1, 2, 3), (2, 0, 1, 3)) - x145 += einsum(t2.bbbb, (0, 1, 2, 3), x136, (4, 3, 2, 5), (0, 4, 1, 5)) * -6.0 - x145 += einsum(x138, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x145 += einsum(x140, (0, 1, 2, 3), (0, 1, 2, 3)) - x145 += einsum(t1.bb, (0, 1), x144, (0, 2, 3, 4), (4, 2, 3, 1)) * 2.0 - del x144 - x145 += einsum(t1.bb, (0, 1), x114, (2, 3), (0, 2, 3, 1)) * 2.0 - l1new_bb += einsum(v.bbbb.ovov, (0, 1, 2, 3), x145, (0, 4, 2, 1), (3, 4)) * -1.0 - del x145 - x146 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x146 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - x147 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x147 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 2, 6, 1, 3), (4, 5, 0, 6)) - x148 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x148 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 0, 5, 6, 1, 3), (4, 5, 2, 6)) - x149 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x149 += einsum(t2.bbbb, (0, 1, 2, 3), x4, (4, 5, 1, 3), (0, 4, 5, 2)) * 2.0 - del x4 - x150 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x150 += einsum(t2.abab, (0, 1, 2, 3), x6, (4, 5, 0, 2), (1, 4, 5, 3)) - x151 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x151 += einsum(x21, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) * -1.0 - x152 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x152 += einsum(t1.bb, (0, 1), v.bbbb.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x153 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x153 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x153 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x153 += einsum(x152, (0, 1, 2, 3), (0, 1, 2, 3)) - x154 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x154 += einsum(t1.bb, (0, 1), x153, (2, 3, 1, 4), (0, 2, 3, 4)) - del x153 - x155 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x155 += einsum(t1.bb, (0, 1), x28, (0, 2, 3, 4), (2, 3, 4, 1)) - del x28 - x156 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x156 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x156 += einsum(x146, (0, 1, 2, 3), (2, 1, 0, 3)) - x156 += einsum(x147, (0, 1, 2, 3), (2, 1, 0, 3)) * -3.0 - x156 += einsum(x148, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - x156 += einsum(x149, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x156 += einsum(x150, (0, 1, 2, 3), (2, 0, 1, 3)) - x156 += einsum(x151, (0, 1, 2, 3), (2, 1, 0, 3)) - x156 += einsum(x154, (0, 1, 2, 3), (2, 1, 0, 3)) - x156 += einsum(x155, (0, 1, 2, 3), (1, 2, 0, 3)) - l1new_bb += einsum(l2.bbbb, (0, 1, 2, 3), x156, (4, 2, 3, 1), (0, 4)) * 2.0 - del x156 - x157 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x157 += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) - x157 += einsum(x77, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.3333333333333333 - x158 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x158 += einsum(t1.bb, (0, 1), x157, (2, 3, 4, 1), (0, 2, 3, 4)) - x159 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x159 += einsum(l1.bb, (0, 1), t2.bbbb, (2, 3, 4, 0), (1, 2, 3, 4)) * 2.0 - x159 += einsum(l2.abab, (0, 1, 2, 3), t3.babbab, (4, 2, 5, 6, 0, 1), (3, 4, 5, 6)) * 2.0 - x159 += einsum(x131, (0, 1, 2, 3), (0, 2, 1, 3)) * 9.0 - del x131 - x159 += einsum(x133, (0, 1, 2, 3), (0, 2, 1, 3)) * 4.0 - del x133 - x159 += einsum(x135, (0, 1, 2, 3), (0, 2, 1, 3)) - del x135 - x159 += einsum(x138, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x138 - x159 += einsum(x140, (0, 1, 2, 3), (1, 0, 2, 3)) - del x140 - x159 += einsum(t1.bb, (0, 1), x158, (2, 3, 0, 4), (3, 4, 2, 1)) * -6.0 - x159 += einsum(t1.bb, (0, 1), x114, (2, 3), (2, 0, 3, 1)) * 2.0 - del x114 - l1new_bb += einsum(v.bbbb.ovov, (0, 1, 2, 3), x159, (4, 0, 2, 3), (1, 4)) - del x159 - x160 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x160 += einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - x161 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x161 += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) - x162 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x162 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - x163 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x163 += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (3, 4, 5, 6, 1, 2), (0, 6)) - x164 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x164 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 4, 5, 6, 1, 2), (0, 6)) - x165 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x165 += einsum(x160, (0, 1), (0, 1)) - x165 += einsum(x161, (0, 1), (0, 1)) * 2.0 - x165 += einsum(x162, (0, 1), (0, 1)) - x165 += einsum(x163, (0, 1), (0, 1)) * 2.9999999999998788 - x165 += einsum(x164, (0, 1), (0, 1)) * 1.9999999999999194 - l1new_bb += einsum(x165, (0, 1), x12, (2, 3, 1, 0), (3, 2)) * -1.0 - del x165 - x166 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x166 += einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) - x167 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x167 += einsum(l1.aa, (0, 1), t2.abab, (1, 2, 0, 3), (2, 3)) - x168 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x168 += einsum(l2.bbbb, (0, 1, 2, 3), t3.bbbbbb, (4, 2, 3, 5, 0, 1), (4, 5)) - x169 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x169 += einsum(l2.abab, (0, 1, 2, 3), t3.babbab, (4, 2, 3, 5, 0, 1), (4, 5)) - x170 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x170 += einsum(l2.aaaa, (0, 1, 2, 3), t3.abaaba, (2, 4, 3, 0, 5, 1), (4, 5)) - x171 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x171 += einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), x72, (0, 1, 2, 6, 4, 5), (6, 3)) - x172 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x172 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x74, (0, 2, 6, 5, 1, 4), (6, 3)) * -1.0 - x173 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x173 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x91, (1, 6, 0, 2, 3, 5), (6, 4)) - x174 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x174 += einsum(x1, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x174 += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.9999999999999996 - x174 += einsum(x77, (0, 1, 2, 3), (0, 1, 2, 3)) - x175 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x175 += einsum(l1.bb, (0, 1), t1.bb, (2, 0), (1, 2)) - x176 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x176 += einsum(x175, (0, 1), (0, 1)) - x176 += einsum(x109, (0, 1), (0, 1)) * 2.0 - x176 += einsum(x110, (0, 1), (0, 1)) - x176 += einsum(x111, (0, 1), (0, 1)) * 2.9999999999998783 - x176 += einsum(x112, (0, 1), (0, 1)) * 1.9999999999999192 - x176 += einsum(x113, (0, 1), (0, 1)) * 0.99999999999996 - x177 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x177 += einsum(t1.bb, (0, 1), (0, 1)) * -0.5000000000000202 - x177 += einsum(x166, (0, 1), (0, 1)) * -1.0000000000000404 - x177 += einsum(x167, (0, 1), (0, 1)) * -0.5000000000000202 - x177 += einsum(x168, (0, 1), (0, 1)) * -1.5000000000000604 - x177 += einsum(x169, (0, 1), (0, 1)) * -1.0000000000000404 - x177 += einsum(x170, (0, 1), (0, 1)) * -0.5000000000000202 - x177 += einsum(x171, (0, 1), (0, 1)) * 1.4999999999999998 - x177 += einsum(x172, (0, 1), (0, 1)) - x177 += einsum(x173, (0, 1), (0, 1)) * 0.5000000000000002 - x177 += einsum(t2.bbbb, (0, 1, 2, 3), x174, (0, 1, 4, 3), (4, 2)) * -1.0000000000000404 - del x174 - x177 += einsum(t2.abab, (0, 1, 2, 3), x139, (1, 4, 0, 2), (4, 3)) * 1.0000000000000404 - x177 += einsum(t1.bb, (0, 1), x176, (0, 2), (2, 1)) * 0.5000000000000202 - del x176 - x178 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x178 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x178 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - l1new_bb += einsum(x177, (0, 1), x178, (0, 2, 1, 3), (3, 2)) * -1.9999999999999194 - del x177, x178 - x179 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x179 += einsum(l1.aa, (0, 1), t1.aa, (1, 2), (0, 2)) - x180 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x180 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - x181 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x181 += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) - x182 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x182 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 4, 5, 0, 6, 2), (1, 6)) - x183 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x183 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 4, 5, 6, 1, 2), (0, 6)) - x184 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x184 += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (3, 4, 5, 6, 1, 2), (0, 6)) - x185 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x185 += einsum(x179, (0, 1), (0, 1)) * 1.00000000000004 - x185 += einsum(x180, (0, 1), (0, 1)) * 1.00000000000004 - x185 += einsum(x181, (0, 1), (0, 1)) * 2.00000000000008 - x185 += einsum(x182, (0, 1), (0, 1)) - x185 += einsum(x183, (0, 1), (0, 1)) * 1.9999999999999991 - x185 += einsum(x184, (0, 1), (1, 0)) * 2.9999999999999982 - l1new_bb += einsum(x185, (0, 1), v.aabb.vvov, (1, 0, 2, 3), (3, 2)) * 0.9999999999999601 - del x185 - x186 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x186 += einsum(l1.bb, (0, 1), t2.abab, (2, 1, 3, 0), (2, 3)) - x187 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x187 += einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) - x188 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x188 += einsum(l2.bbbb, (0, 1, 2, 3), t3.babbab, (2, 4, 3, 0, 5, 1), (4, 5)) - x189 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x189 += einsum(l2.abab, (0, 1, 2, 3), t3.abaaba, (4, 3, 2, 5, 1, 0), (4, 5)) - x190 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x190 += einsum(l2.aaaa, (0, 1, 2, 3), t3.aaaaaa, (4, 2, 3, 5, 0, 1), (4, 5)) - x191 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x191 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x58, (0, 2, 3, 5, 1, 6), (6, 4)) - x192 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x192 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x61, (1, 4, 0, 2, 6, 5), (6, 3)) * -1.0 - x193 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x193 += einsum(t1.aa, (0, 1), l3.aaaaaa, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - l3new_abaaba += einsum(v.aabb.ooov, (0, 1, 2, 3), x193, (4, 0, 5, 1, 6, 7), (6, 3, 7, 5, 2, 4)) * -6.0 - l3new_abaaba += einsum(x7, (0, 1, 2, 3), x193, (2, 4, 5, 3, 6, 7), (6, 1, 7, 4, 0, 5)) * -6.0 - x194 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x194 += einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), x193, (0, 1, 2, 6, 4, 5), (6, 3)) - x195 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x195 += einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - l2new_abab += einsum(x195, (0, 1, 2, 3), x7, (4, 5, 1, 2), (3, 5, 0, 4)) * -2.0 - x196 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x196 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 3, 2, 5, 1, 6), (5, 6, 0, 4)) - x197 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x197 += einsum(t2.aaaa, (0, 1, 2, 3), l3.aaaaaa, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) - x198 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x198 += einsum(x195, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.33333333333333337 - x198 += einsum(x196, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.33333333333333337 - x198 += einsum(x197, (0, 1, 2, 3), (0, 1, 2, 3)) - x199 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x199 += einsum(l1.aa, (0, 1), t1.aa, (2, 0), (1, 2)) - x200 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x200 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - x201 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x201 += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (2, 4)) - x202 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x202 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 6, 5, 0, 1, 2), (4, 6)) - x203 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x203 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 4, 5, 0, 1, 2), (3, 6)) - x204 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x204 += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (6, 4, 5, 0, 1, 2), (3, 6)) - x205 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x205 += einsum(x199, (0, 1), (0, 1)) - x205 += einsum(x200, (0, 1), (0, 1)) - x205 += einsum(x201, (0, 1), (0, 1)) * 2.0 - x205 += einsum(x202, (0, 1), (0, 1)) * 0.99999999999996 - x205 += einsum(x203, (0, 1), (0, 1)) * 1.9999999999999192 - x205 += einsum(x204, (0, 1), (0, 1)) * 2.9999999999998783 - x206 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x206 += einsum(l1.aa, (0, 1), (1, 0)) * -1.00000000000004 - x206 += einsum(t1.aa, (0, 1), (0, 1)) * -1.00000000000004 - x206 += einsum(x186, (0, 1), (0, 1)) * -1.00000000000004 - x206 += einsum(x187, (0, 1), (0, 1)) * -2.00000000000008 - x206 += einsum(x188, (0, 1), (0, 1)) * -1.00000000000004 - x206 += einsum(x189, (0, 1), (0, 1)) * -2.00000000000008 - x206 += einsum(x190, (0, 1), (0, 1)) * -3.0000000000001195 - x206 += einsum(x191, (0, 1), (0, 1)) - x206 += einsum(x192, (0, 1), (0, 1)) * 1.9999999999999991 - x206 += einsum(x194, (0, 1), (0, 1)) * 2.9999999999999982 - x206 += einsum(t2.abab, (0, 1, 2, 3), x66, (1, 3, 0, 4), (4, 2)) * 2.00000000000008 - x206 += einsum(t2.aaaa, (0, 1, 2, 3), x198, (0, 1, 4, 3), (4, 2)) * -6.000000000000239 - x206 += einsum(t1.aa, (0, 1), x205, (0, 2), (2, 1)) * 1.00000000000004 - l1new_bb += einsum(x206, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (3, 2)) * -0.9999999999999601 - del x206 - x207 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x207 += einsum(x102, (0, 1, 2, 3), (0, 1, 2, 3)) - x207 += einsum(x103, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.9999999999999194 - x207 += einsum(x104, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.9999999999999194 - x207 += einsum(x105, (0, 1, 2, 3), (1, 0, 3, 2)) - del x105 - x207 += einsum(x107, (0, 1, 2, 3), (0, 1, 2, 3)) - del x107 - l1new_bb += einsum(v.aabb.ooov, (0, 1, 2, 3), x207, (4, 2, 1, 0), (3, 4)) - del x207 - x208 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x208 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x208 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - l2new_abab += einsum(x208, (0, 1, 2, 3), x96, (0, 1, 4, 5), (5, 3, 4, 2)) * -1.0 - l3new_abaaba += einsum(x208, (0, 1, 2, 3), x91, (0, 1, 4, 5, 6, 7), (6, 3, 7, 5, 2, 4)) * 2.0 - x209 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x209 += einsum(t1.bb, (0, 1), x157, (2, 3, 4, 1), (2, 3, 0, 4)) * 3.0 - l1new_bb += einsum(x208, (0, 1, 2, 3), x209, (4, 0, 2, 1), (3, 4)) * 2.0 - del x209 - x210 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x210 += einsum(x141, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.00000000000004 - x210 += einsum(x142, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.9999999999999982 - x210 += einsum(x143, (0, 1, 2, 3), (0, 1, 3, 2)) - del x143 - l1new_bb += einsum(v.bbbb.ooov, (0, 1, 2, 3), x210, (1, 4, 2, 0), (3, 4)) * 1.9999999999999203 - del x210 - x211 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x211 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 4, 5, 0, 6, 2), (1, 6)) - l1new_bb += einsum(x211, (0, 1), x71, (2, 3, 0, 1), (3, 2)) * -0.9999999999999601 - x212 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x212 += einsum(x175, (0, 1), (0, 1)) * 0.5 - x212 += einsum(x109, (0, 1), (0, 1)) - x212 += einsum(x110, (0, 1), (0, 1)) * 0.5 - x212 += einsum(x111, (0, 1), (0, 1)) * 1.4999999999999394 - x212 += einsum(x112, (0, 1), (0, 1)) * 0.9999999999999597 - x213 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x213 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x213 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - l1new_bb += einsum(x212, (0, 1), x213, (0, 2, 1, 3), (3, 2)) * -2.0 - del x212 - l1new_bb += einsum(x113, (0, 1), x213, (0, 1, 2, 3), (3, 2)) * 0.9999999999999601 - x214 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x214 += einsum(x199, (0, 1), (0, 1)) - x214 += einsum(x200, (0, 1), (0, 1)) - x214 += einsum(x201, (0, 1), (0, 1)) * 2.0 - x214 += einsum(x202, (0, 1), (0, 1)) * 0.9999999999999601 - x214 += einsum(x203, (0, 1), (0, 1)) * 1.9999999999999194 - x214 += einsum(x204, (0, 1), (1, 0)) * 2.9999999999998788 - l1new_bb += einsum(x214, (0, 1), v.aabb.ooov, (1, 0, 2, 3), (3, 2)) * -1.0 - del x214 - x215 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x215 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x215 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - l1new_bb += einsum(l1.bb, (0, 1), x215, (1, 2, 0, 3), (3, 2)) * -1.0 - del x215 - x216 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x216 += einsum(t1.aa, (0, 1), v.aabb.ovvv, (0, 1, 2, 3), (2, 3)) - x217 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x217 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x217 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x218 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x218 += einsum(f.bb.vv, (0, 1), (0, 1)) - x218 += einsum(x216, (0, 1), (1, 0)) - x218 += einsum(t1.bb, (0, 1), x217, (0, 2, 1, 3), (3, 2)) * -1.0 - l1new_bb += einsum(l1.bb, (0, 1), x218, (0, 2), (2, 1)) - del x218 - x219 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x219 += einsum(t1.aa, (0, 1), v.aabb.ovoo, (0, 1, 2, 3), (2, 3)) - x220 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x220 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 2, 1, 3), (0, 4)) - x221 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x221 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - x222 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x222 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x222 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - x223 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x223 += einsum(t1.bb, (0, 1), x222, (2, 3, 0, 1), (2, 3)) - del x222 - x224 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x224 += einsum(t1.bb, (0, 1), x21, (2, 1), (0, 2)) - x225 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x225 += einsum(f.bb.oo, (0, 1), (0, 1)) - x225 += einsum(x219, (0, 1), (1, 0)) - x225 += einsum(x220, (0, 1), (0, 1)) * 2.0 - x225 += einsum(x221, (0, 1), (0, 1)) - x225 += einsum(x223, (0, 1), (1, 0)) * -1.0 - x225 += einsum(x224, (0, 1), (0, 1)) - del x224 - l1new_bb += einsum(l1.bb, (0, 1), x225, (1, 2), (0, 2)) * -1.0 - l2new_abab += einsum(x225, (0, 1), l2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -1.0 - l3new_abaaba += einsum(x225, (0, 1), l3.abaaba, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) * -2.0 - del x225 - x226 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x226 += einsum(x175, (0, 1), (0, 1)) * 0.5000000000000202 - x226 += einsum(x109, (0, 1), (0, 1)) * 1.0000000000000404 - x226 += einsum(x110, (0, 1), (0, 1)) * 0.5000000000000202 - x226 += einsum(x111, (0, 1), (0, 1)) * 1.4999999999999998 - x226 += einsum(x112, (0, 1), (0, 1)) - x226 += einsum(x113, (0, 1), (0, 1)) * 0.5000000000000002 - l1new_bb += einsum(f.bb.ov, (0, 1), x226, (2, 0), (1, 2)) * -1.9999999999999194 - del x226 - x227 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x227 += einsum(x19, (0, 1), (0, 1)) - x227 += einsum(x20, (0, 1), (0, 1)) * -1.0 - l1new_bb += einsum(x175, (0, 1), x227, (1, 2), (2, 0)) * -1.0 - x228 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x228 += einsum(t2.aaaa, (0, 1, 2, 3), l3.aaaaaa, (4, 5, 3, 6, 0, 1), (6, 4, 5, 2)) - l1new_aa += einsum(v.aaaa.vvvv, (0, 1, 2, 3), x228, (4, 1, 2, 3), (0, 4)) * 6.0 - x229 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x229 += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (6, 7, 5, 0, 1, 2), (3, 4, 6, 7)) - l1new_aa += einsum(v.aaaa.ooov, (0, 1, 2, 3), x229, (1, 4, 2, 0), (3, 4)) * -5.9999999999997575 - x230 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x230 += einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - x231 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x231 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x231 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x231 += einsum(x230, (0, 1, 2, 3), (0, 1, 2, 3)) - x231 += einsum(x230, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x232 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x232 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - x233 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x233 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - x233 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x234 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x234 += einsum(t2.aaaa, (0, 1, 2, 3), x233, (1, 4, 5, 3), (0, 4, 2, 5)) * 2.0 - x235 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x235 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x235 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) - x236 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x236 += einsum(t1.aa, (0, 1), x235, (2, 3, 1, 4), (0, 2, 3, 4)) - x237 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x237 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x237 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x237 += einsum(x232, (0, 1, 2, 3), (0, 1, 2, 3)) - x237 += einsum(x234, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x237 += einsum(x236, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x238 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x238 += einsum(t1.bb, (0, 1), v.aabb.ovvv, (2, 3, 4, 1), (0, 4, 2, 3)) - l2new_abab += einsum(l2.bbbb, (0, 1, 2, 3), x238, (3, 1, 4, 5), (5, 0, 4, 2)) * 2.0 - x239 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x239 += einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 2, 4, 5)) - x240 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x240 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x240 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x241 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x241 += einsum(t2.abab, (0, 1, 2, 3), x240, (0, 4, 2, 5), (1, 3, 4, 5)) - x242 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x242 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x242 += einsum(x238, (0, 1, 2, 3), (0, 1, 2, 3)) - x242 += einsum(x239, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x242 += einsum(x241, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x243 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x243 += einsum(t1.bb, (0, 1), v.aabb.ovov, (2, 3, 0, 1), (2, 3)) - x244 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x244 += einsum(t1.aa, (0, 1), x240, (0, 2, 1, 3), (2, 3)) - x245 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x245 += einsum(f.aa.ov, (0, 1), (0, 1)) - x245 += einsum(x243, (0, 1), (0, 1)) - x245 += einsum(x244, (0, 1), (0, 1)) * -1.0 - l2new_abab += einsum(x245, (0, 1), x66, (2, 3, 4, 0), (1, 3, 4, 2)) * -2.0 - l2new_abab += einsum(l1.bb, (0, 1), x245, (2, 3), (3, 0, 2, 1)) - l3new_aaaaaa += einsum(x245, (0, 1), l2.aaaa, (2, 3, 4, 5), (2, 3, 1, 4, 5, 0)) * 2.0 - l3new_aaaaaa += einsum(x245, (0, 1), l2.aaaa, (2, 3, 4, 5), (2, 3, 1, 0, 4, 5)) * 2.0 - l3new_aaaaaa += einsum(x245, (0, 1), l2.aaaa, (2, 3, 4, 5), (2, 1, 3, 4, 0, 5)) * 2.0 - l3new_aaaaaa += einsum(x245, (0, 1), l2.aaaa, (2, 3, 4, 5), (1, 2, 3, 4, 5, 0)) * 2.0 - l3new_aaaaaa += einsum(x245, (0, 1), l2.aaaa, (2, 3, 4, 5), (1, 2, 3, 0, 4, 5)) * 2.0 - l3new_aaaaaa += einsum(x245, (0, 1), l2.aaaa, (2, 3, 4, 5), (2, 3, 1, 4, 0, 5)) * -2.0 - l3new_aaaaaa += einsum(x245, (0, 1), l2.aaaa, (2, 3, 4, 5), (2, 1, 3, 4, 5, 0)) * -2.0 - l3new_aaaaaa += einsum(x245, (0, 1), l2.aaaa, (2, 3, 4, 5), (2, 1, 3, 0, 4, 5)) * -2.0 - l3new_aaaaaa += einsum(x245, (0, 1), l2.aaaa, (2, 3, 4, 5), (1, 2, 3, 4, 0, 5)) * -2.0 - l3new_babbab += einsum(x245, (0, 1), x58, (2, 3, 4, 5, 6, 0), (4, 1, 5, 3, 6, 2)) * 2.0 - l3new_babbab += einsum(x245, (0, 1), l2.bbbb, (2, 3, 4, 5), (2, 1, 3, 4, 0, 5)) * 2.0 - l3new_abaaba += einsum(x245, (0, 1), l2.abab, (2, 3, 4, 5), (1, 3, 2, 0, 5, 4)) - l3new_abaaba += einsum(x245, (0, 1), l2.abab, (2, 3, 4, 5), (2, 3, 1, 4, 5, 0)) - l3new_abaaba += einsum(x245, (0, 1), l2.abab, (2, 3, 4, 5), (2, 3, 1, 0, 5, 4)) * -1.0 - l3new_abaaba += einsum(x245, (0, 1), l2.abab, (2, 3, 4, 5), (1, 3, 2, 4, 5, 0)) * -1.0 - x246 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x246 += einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (3, 4, 0, 2)) - l2new_abab += einsum(x246, (0, 1, 2, 3), x61, (4, 1, 2, 5, 3, 6), (6, 0, 5, 4)) * 2.0 - x247 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x247 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 5), (3, 5, 0, 4)) - x248 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x248 += einsum(v.aabb.oovv, (0, 1, 2, 3), (2, 3, 0, 1)) - x248 += einsum(x246, (0, 1, 2, 3), (1, 0, 2, 3)) - x248 += einsum(x247, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x249 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x249 += einsum(t1.bb, (0, 1), x8, (2, 1, 3, 4), (0, 2, 3, 4)) - x250 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x250 += einsum(v.aabb.oooo, (0, 1, 2, 3), (2, 3, 0, 1)) - x250 += einsum(x29, (0, 1, 2, 3), (1, 0, 2, 3)) - x250 += einsum(x30, (0, 1, 2, 3), (1, 0, 2, 3)) - x250 += einsum(x249, (0, 1, 2, 3), (1, 0, 3, 2)) - x251 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x251 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 5, 3), (0, 1, 4, 5)) - x252 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x252 += einsum(t1.aa, (0, 1), x230, (2, 3, 4, 1), (0, 2, 3, 4)) - x253 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x253 += einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - x254 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x254 += einsum(v.aaaa.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x254 += einsum(x251, (0, 1, 2, 3), (3, 1, 2, 0)) - x254 += einsum(x252, (0, 1, 2, 3), (3, 1, 2, 0)) - x254 += einsum(x253, (0, 1, 2, 3), (2, 1, 3, 0)) - x254 += einsum(x253, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - x255 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x255 += einsum(x44, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * 0.9999999999999597 - del x44 - x255 += einsum(t2.abab, (0, 1, 2, 3), x8, (4, 3, 5, 6), (1, 4, 0, 6, 5, 2)) * -1.0 - x255 += einsum(x45, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x45 - x256 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x256 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.abaaba, (4, 5, 6, 3, 7, 1), (5, 7, 4, 6, 0, 2)) * -1.0 - l2new_aaaa += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), x256, (4, 1, 5, 3, 6, 7), (0, 2, 6, 7)) * -1.9999999999999203 - x257 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x257 += einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ooov, (4, 5, 6, 2), (1, 3, 0, 4, 5, 6)) - x258 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x258 += einsum(t2.abab, (0, 1, 2, 3), x230, (4, 5, 6, 2), (1, 3, 4, 0, 6, 5)) - x259 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x259 += einsum(x256, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * 0.9999999999999601 - del x256 - x259 += einsum(x257, (0, 1, 2, 3, 4, 5), (0, 1, 4, 2, 3, 5)) - x259 += einsum(x257, (0, 1, 2, 3, 4, 5), (0, 1, 4, 2, 5, 3)) * -1.0 - del x257 - x259 += einsum(x258, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - x259 += einsum(x258, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - del x258 - x260 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x260 += einsum(v.aabb.ovvv, (0, 1, 2, 3), t3.abaaba, (4, 5, 6, 7, 3, 1), (5, 2, 0, 4, 6, 7)) * -0.9999999999999597 - x260 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), t3.abaaba, (4, 5, 6, 3, 7, 1), (5, 7, 0, 4, 6, 2)) * -0.9999999999999601 - x260 += einsum(x231, (0, 1, 2, 3), t3.abaaba, (4, 5, 1, 6, 7, 3), (5, 7, 2, 4, 0, 6)) * -2.0 - x260 += einsum(x31, (0, 1, 2, 3), t3.babbab, (4, 5, 0, 6, 7, 1), (4, 6, 3, 5, 2, 7)) * -2.0 - x260 += einsum(x39, (0, 1, 2, 3), t3.abaaba, (4, 0, 5, 6, 7, 3), (1, 7, 2, 4, 5, 6)) - x260 += einsum(t2.abab, (0, 1, 2, 3), x237, (4, 5, 6, 2), (1, 3, 5, 0, 4, 6)) - x260 += einsum(t2.aaaa, (0, 1, 2, 3), x242, (4, 5, 6, 3), (4, 5, 6, 0, 1, 2)) * -1.0 - x260 += einsum(x245, (0, 1), t3.abaaba, (2, 3, 4, 5, 6, 1), (3, 6, 0, 2, 4, 5)) * -0.9999999999999597 - x260 += einsum(t2.abab, (0, 1, 2, 3), x248, (3, 4, 5, 6), (1, 4, 6, 0, 5, 2)) * -1.0 - x260 += einsum(t2.abab, (0, 1, 2, 3), x250, (1, 4, 5, 6), (4, 3, 6, 0, 5, 2)) - x260 += einsum(t2.abab, (0, 1, 2, 3), x254, (0, 4, 5, 6), (1, 3, 5, 4, 6, 2)) - x260 += einsum(t1.bb, (0, 1), x255, (2, 0, 3, 4, 5, 6), (2, 1, 5, 3, 4, 6)) * -1.0 - del x255 - x260 += einsum(t1.aa, (0, 1), x259, (2, 3, 4, 5, 0, 6), (2, 3, 6, 5, 4, 1)) * -1.0 - del x259 - l1new_aa += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), x260, (4, 1, 6, 5, 3, 2), (0, 6)) * 2.0 - del x260 - x261 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x261 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x261 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - x261 += einsum(x230, (0, 1, 2, 3), (1, 0, 2, 3)) - x261 += einsum(x230, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x262 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x262 += einsum(x38, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 0.9999999999999597 - del x38 - x262 += einsum(t2.bbbb, (0, 1, 2, 3), x8, (4, 3, 5, 6), (0, 1, 4, 2, 6, 5)) - x262 += einsum(x40, (0, 1, 2, 3, 4, 5), (0, 2, 1, 3, 4, 5)) - del x40 - x263 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x263 += einsum(v.aabb.ovvv, (0, 1, 2, 3), t3.babbab, (4, 5, 6, 7, 1, 3), (4, 6, 7, 2, 0, 5)) * -0.9999999999999597 - x263 += einsum(x261, (0, 1, 2, 3), t3.babbab, (4, 0, 5, 6, 3, 7), (4, 5, 6, 7, 2, 1)) * -0.5 - x263 += einsum(x31, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 0, 6, 7, 1), (4, 5, 6, 7, 3, 2)) * -1.5 - x263 += einsum(x39, (0, 1, 2, 3), t3.babbab, (4, 5, 0, 6, 3, 7), (4, 1, 6, 7, 2, 5)) - x263 += einsum(t2.abab, (0, 1, 2, 3), x242, (4, 5, 6, 2), (1, 4, 3, 5, 6, 0)) * -1.0 - del x242 - x263 += einsum(x245, (0, 1), t3.babbab, (2, 3, 4, 5, 1, 6), (2, 4, 5, 6, 0, 3)) * -0.49999999999998007 - x263 += einsum(t2.bbbb, (0, 1, 2, 3), x248, (3, 4, 5, 6), (0, 1, 2, 4, 6, 5)) * -1.0 - del x248 - x263 += einsum(t2.bbbb, (0, 1, 2, 3), x250, (1, 4, 5, 6), (0, 4, 2, 3, 6, 5)) - del x250 - x263 += einsum(t1.bb, (0, 1), x262, (2, 3, 0, 4, 5, 6), (2, 3, 4, 1, 6, 5)) - del x262 - l1new_aa += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), x263, (3, 5, 0, 2, 6, 4), (1, 6)) * 2.0 - del x263 - x264 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x264 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x264 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x264 += einsum(x230, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x264 += einsum(x230, (0, 1, 2, 3), (2, 0, 1, 3)) - x265 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x265 += einsum(v.aaaa.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x265 += einsum(x251, (0, 1, 2, 3), (3, 1, 2, 0)) * -1.0 - x265 += einsum(x252, (0, 1, 2, 3), (2, 1, 3, 0)) - x265 += einsum(x253, (0, 1, 2, 3), (2, 0, 3, 1)) - x265 += einsum(x253, (0, 1, 2, 3), (3, 0, 2, 1)) * -1.0 - x266 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x266 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 6, 7, 1, 3), (4, 5, 6, 0, 2, 7)) - l2new_aaaa += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), x266, (3, 4, 5, 6, 7, 2), (0, 1, 6, 7)) * 5.9999999999997575 - x267 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x267 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 5, 6, 3), (0, 1, 4, 5, 6, 2)) - x268 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x268 += einsum(t2.aaaa, (0, 1, 2, 3), x230, (4, 5, 6, 3), (4, 0, 1, 6, 5, 2)) - x269 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x269 += einsum(x266, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -0.9999999999999596 - del x266 - x269 += einsum(x267, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - x269 += einsum(x267, (0, 1, 2, 3, 4, 5), (0, 1, 3, 4, 2, 5)) - del x267 - x269 += einsum(x268, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) * -1.0 - x269 += einsum(x268, (0, 1, 2, 3, 4, 5), (1, 2, 0, 4, 3, 5)) - del x268 - x270 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x270 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 6, 7, 3, 1), (0, 4, 5, 6, 7, 2)) * -0.9999999999999596 - x270 += einsum(x264, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 0, 6, 7, 3), (2, 4, 1, 5, 6, 7)) * -1.5 - del x264 - x270 += einsum(x31, (0, 1, 2, 3), t3.abaaba, (4, 0, 5, 6, 1, 7), (3, 4, 2, 5, 6, 7)) * 0.5 - x270 += einsum(t2.aaaa, (0, 1, 2, 3), x237, (4, 5, 6, 3), (5, 0, 4, 1, 2, 6)) * -1.0 - del x237 - x270 += einsum(x245, (0, 1), t3.aaaaaa, (2, 3, 4, 5, 6, 1), (0, 2, 3, 4, 5, 6)) * -0.4999999999999798 - x270 += einsum(t2.aaaa, (0, 1, 2, 3), x265, (1, 4, 5, 6), (5, 0, 4, 6, 2, 3)) * -1.0 - del x265 - x270 += einsum(t1.aa, (0, 1), x269, (2, 3, 4, 5, 0, 6), (5, 3, 4, 2, 6, 1)) * -1.0 - del x269 - l1new_aa += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), x270, (6, 4, 3, 5, 2, 1), (0, 6)) * 6.0 - del x270 - x271 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x271 += einsum(l2.abab, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (4, 5, 2, 0)) - x272 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x272 += einsum(l2.aaaa, (0, 1, 2, 3), t2.abab, (3, 4, 1, 5), (4, 5, 2, 0)) - x273 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x273 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (6, 3, 5, 7, 0, 2), (6, 7, 4, 1)) - x274 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x274 += einsum(t2.bbbb, (0, 1, 2, 3), x74, (0, 1, 4, 3, 5, 6), (4, 2, 5, 6)) * -1.0 - x275 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x275 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 5, 4, 7, 2, 1), (6, 7, 3, 0)) - x276 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x276 += einsum(t2.abab, (0, 1, 2, 3), x91, (1, 4, 5, 0, 2, 6), (4, 3, 5, 6)) * -1.0 - x277 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x277 += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.abaaba, (4, 6, 5, 1, 7, 2), (6, 7, 3, 0)) - x278 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x278 += einsum(l2.abab, (0, 1, 2, 3), (3, 1, 2, 0)) - x278 += einsum(x271, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x278 += einsum(x272, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x278 += einsum(x273, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x278 += einsum(x274, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x278 += einsum(x275, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - x278 += einsum(x276, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x278 += einsum(x277, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x278 += einsum(t1.bb, (0, 1), x96, (0, 2, 3, 4), (2, 1, 3, 4)) * -1.0 - l1new_aa += einsum(v.aabb.vvov, (0, 1, 2, 3), x278, (2, 3, 4, 1), (0, 4)) - del x278 - x279 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x279 += einsum(t2.bbbb, (0, 1, 2, 3), l3.babbab, (4, 5, 3, 0, 6, 1), (4, 2, 6, 5)) - x280 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x280 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 5, 2, 6, 1, 0), (5, 3, 6, 4)) - x281 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x281 += einsum(t1.bb, (0, 1), l2.abab, (2, 3, 4, 0), (3, 1, 4, 2)) * 0.5 - x281 += einsum(x279, (0, 1, 2, 3), (0, 1, 2, 3)) - x281 += einsum(x280, (0, 1, 2, 3), (0, 1, 2, 3)) - l1new_aa += einsum(v.aabb.vvvv, (0, 1, 2, 3), x281, (2, 3, 4, 1), (0, 4)) * 2.0 - del x281 - x282 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x282 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 0, 5)) - x283 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x283 += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 5, 1), (2, 4, 0, 5)) - x284 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x284 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 6, 5, 0, 7, 2), (4, 6, 1, 7)) - x285 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x285 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 4, 5, 7, 1, 2), (3, 6, 0, 7)) - x286 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x286 += einsum(t2.abab, (0, 1, 2, 3), x61, (1, 3, 0, 4, 5, 6), (4, 5, 6, 2)) * -1.0 - x287 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x287 += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (6, 4, 5, 7, 1, 2), (3, 6, 0, 7)) - x288 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x288 += einsum(t2.aaaa, (0, 1, 2, 3), x193, (4, 0, 1, 5, 6, 3), (4, 5, 6, 2)) * -1.0 - x289 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x289 += einsum(x195, (0, 1, 2, 3), (1, 0, 2, 3)) - x289 += einsum(x196, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x289 += einsum(x197, (0, 1, 2, 3), (0, 1, 2, 3)) * -3.0 - x290 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x290 += einsum(x282, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.1111111111111111 - x290 += einsum(x283, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.4444444444444444 - x290 += einsum(x284, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.1111111111111111 - x290 += einsum(x285, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.4444444444444444 - x290 += einsum(x286, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.2222222222222222 - x290 += einsum(x287, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x290 += einsum(x288, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.6666666666666666 - x290 += einsum(t1.aa, (0, 1), x289, (0, 2, 3, 4), (2, 3, 1, 4)) * 0.2222222222222222 - l1new_aa += einsum(v.aaaa.ovvv, (0, 1, 2, 3), x290, (4, 0, 2, 3), (1, 4)) * 9.0 - del x290 - x291 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x291 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 5), (1, 5, 2, 4)) - x292 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x292 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 6, 5, 7, 1, 2), (0, 7, 4, 6)) - x293 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x293 += einsum(t2.bbbb, (0, 1, 2, 3), x58, (0, 1, 4, 3, 5, 6), (4, 2, 5, 6)) - x294 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x294 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 4, 5, 0, 7, 2), (1, 7, 3, 6)) - x295 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x295 += einsum(t2.abab, (0, 1, 2, 3), x61, (1, 4, 0, 5, 6, 2), (4, 3, 5, 6)) - x296 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x296 += einsum(x291, (0, 1, 2, 3), (0, 1, 2, 3)) - x296 += einsum(x292, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x296 += einsum(x293, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - x296 += einsum(x294, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x296 += einsum(x295, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - x296 += einsum(t1.bb, (0, 1), x101, (0, 2, 3, 4), (1, 2, 3, 4)) - l1new_aa += einsum(v.aabb.ovvv, (0, 1, 2, 3), x296, (3, 2, 4, 0), (1, 4)) * -1.0 - del x296 - x297 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x297 += einsum(x279, (0, 1, 2, 3), (0, 1, 2, 3)) - del x279 - x297 += einsum(x280, (0, 1, 2, 3), (0, 1, 2, 3)) - del x280 - l2new_abab += einsum(x297, (0, 1, 2, 3), x71, (4, 5, 0, 1), (3, 5, 2, 4)) * -2.0 - del x71 - l2new_abab += einsum(v.aabb.vvov, (0, 1, 2, 3), x297, (4, 3, 5, 1), (0, 4, 5, 2)) * -2.0 - l2new_abab += einsum(x297, (0, 1, 2, 3), x31, (4, 1, 2, 5), (3, 0, 5, 4)) * 2.0 - x298 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x298 += einsum(x200, (0, 1), (0, 1)) - x298 += einsum(x201, (0, 1), (0, 1)) * 2.0 - x298 += einsum(x202, (0, 1), (0, 1)) * 0.9999999999999601 - x298 += einsum(x203, (0, 1), (0, 1)) * 1.9999999999999194 - x298 += einsum(x204, (0, 1), (0, 1)) * 2.9999999999998788 - x299 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x299 += einsum(l1.aa, (0, 1), t2.abab, (2, 3, 0, 4), (3, 4, 1, 2)) - x299 += einsum(x63, (0, 1, 2, 3), (0, 1, 2, 3)) - x299 += einsum(l2.abab, (0, 1, 2, 3), t3.babbab, (4, 5, 3, 6, 0, 1), (4, 6, 2, 5)) * 2.0 - x299 += einsum(x64, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x299 += einsum(l2.aaaa, (0, 1, 2, 3), t3.abaaba, (4, 5, 3, 0, 6, 1), (5, 6, 2, 4)) * 2.0 - x299 += einsum(x65, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x299 += einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), x58, (2, 1, 5, 4, 6, 7), (0, 3, 6, 7)) * 3.0 - x299 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x74, (2, 0, 6, 5, 7, 4), (6, 3, 7, 1)) * -2.0 - x299 += einsum(t2.bbbb, (0, 1, 2, 3), x98, (1, 0, 4, 3, 5, 6), (4, 2, 5, 6)) * -2.0 - x299 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x61, (2, 5, 6, 1, 7, 4), (0, 3, 6, 7)) * -4.0 - x299 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x91, (1, 6, 7, 2, 5, 3), (6, 4, 7, 0)) * 2.0 - x299 += einsum(t2.abab, (0, 1, 2, 3), x99, (1, 4, 5, 0, 6, 2), (4, 3, 5, 6)) * 2.0 - x299 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x193, (6, 0, 2, 7, 5, 3), (1, 4, 6, 7)) * -3.0 - x299 += einsum(t2.abab, (0, 1, 2, 3), x297, (3, 4, 5, 2), (1, 4, 5, 0)) * -2.0 - x299 += einsum(t2.bbbb, (0, 1, 2, 3), x101, (1, 3, 4, 5), (0, 2, 4, 5)) * 2.0 - x299 += einsum(t2.abab, (0, 1, 2, 3), x96, (1, 4, 5, 2), (4, 3, 5, 0)) * -1.0 - x299 += einsum(t2.abab, (0, 1, 2, 3), x289, (0, 4, 5, 2), (1, 3, 4, 5)) * -2.0 - x299 += einsum(t1.bb, (0, 1), x108, (0, 2, 3, 4), (2, 1, 3, 4)) * -1.0 - del x108 - x299 += einsum(t1.bb, (0, 1), x298, (2, 3), (0, 1, 2, 3)) - l1new_aa += einsum(v.aabb.ovov, (0, 1, 2, 3), x299, (2, 3, 4, 0), (1, 4)) * -1.0 - del x299 - x300 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x300 += einsum(x195, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.3333333333333333 - x300 += einsum(x196, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.3333333333333333 - x300 += einsum(x197, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - l1new_aa += einsum(v.aaaa.oovv, (0, 1, 2, 3), x300, (1, 4, 0, 3), (2, 4)) * -6.0 - x301 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x301 += einsum(l2.aaaa, (0, 1, 2, 3), (2, 3, 0, 1)) * -0.3333333333333333 - x301 += einsum(x286, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.3333333333333333 - x301 += einsum(x288, (0, 1, 2, 3), (0, 1, 2, 3)) - x301 += einsum(t1.aa, (0, 1), x300, (0, 2, 3, 4), (2, 3, 4, 1)) - l1new_aa += einsum(v.aaaa.ovvv, (0, 1, 2, 3), x301, (4, 0, 3, 1), (2, 4)) * -6.0 - del x301 - x302 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x302 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 3, 5, 6, 1, 0), (6, 4, 5, 2)) - x303 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x303 += einsum(t1.aa, (0, 1), l2.aaaa, (2, 3, 4, 0), (4, 2, 3, 1)) - x303 += einsum(x302, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - l1new_aa += einsum(v.aaaa.vvvv, (0, 1, 2, 3), x303, (4, 3, 1, 2), (0, 4)) * -2.0 - del x303 - x304 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x304 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (4, 2, 5, 3), (1, 5, 0, 4)) - x305 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x305 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 5, 2, 6, 1, 3), (4, 6, 5, 0)) - x306 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x306 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.abaaba, (4, 5, 2, 3, 6, 1), (5, 6, 4, 0)) * -1.0 - x307 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x307 += einsum(t2.abab, (0, 1, 2, 3), x261, (4, 5, 0, 2), (1, 3, 4, 5)) - del x261 - x308 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x308 += einsum(t2.bbbb, (0, 1, 2, 3), x8, (1, 3, 4, 5), (0, 2, 4, 5)) * 2.0 - x309 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x309 += einsum(t2.abab, (0, 1, 2, 3), x39, (1, 4, 5, 2), (4, 3, 0, 5)) - x310 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x310 += einsum(x245, (0, 1), t2.abab, (2, 3, 1, 4), (3, 4, 2, 0)) - x311 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x311 += einsum(v.aabb.oovv, (0, 1, 2, 3), (2, 3, 0, 1)) - x311 += einsum(x246, (0, 1, 2, 3), (1, 0, 3, 2)) - x312 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x312 += einsum(t1.bb, (0, 1), x311, (1, 2, 3, 4), (0, 2, 3, 4)) - del x311 - x313 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x313 += einsum(t1.bb, (0, 1), x128, (0, 2, 3, 4), (2, 1, 3, 4)) - x314 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x314 += einsum(v.aabb.ooov, (0, 1, 2, 3), (2, 3, 0, 1)) - x314 += einsum(x7, (0, 1, 2, 3), (0, 1, 2, 3)) - x314 += einsum(x304, (0, 1, 2, 3), (0, 1, 2, 3)) - x314 += einsum(x305, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x314 += einsum(x306, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x314 += einsum(x307, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x314 += einsum(x308, (0, 1, 2, 3), (0, 1, 3, 2)) - x314 += einsum(x309, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x314 += einsum(x310, (0, 1, 2, 3), (0, 1, 2, 3)) - x314 += einsum(x312, (0, 1, 2, 3), (0, 1, 3, 2)) - x314 += einsum(x313, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - l1new_aa += einsum(l2.abab, (0, 1, 2, 3), x314, (3, 1, 2, 4), (0, 4)) * -1.0 - del x314 - x315 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x315 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovvv, (4, 2, 5, 3), (0, 1, 4, 5)) - x316 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x316 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 2, 5, 6, 3, 1), (4, 5, 0, 6)) - x317 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x317 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 2, 6, 1, 3), (4, 5, 0, 6)) - x318 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x318 += einsum(t1.aa, (0, 1), v.aaaa.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x319 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x319 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x319 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x319 += einsum(x318, (0, 1, 2, 3), (0, 1, 2, 3)) - x320 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x320 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - x320 += einsum(x315, (0, 1, 2, 3), (2, 1, 0, 3)) - x320 += einsum(x316, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - x320 += einsum(x317, (0, 1, 2, 3), (2, 1, 0, 3)) * -3.0 - x320 += einsum(t2.aaaa, (0, 1, 2, 3), x231, (4, 5, 1, 3), (5, 0, 4, 2)) * -2.0 - x320 += einsum(t2.abab, (0, 1, 2, 3), x31, (1, 3, 4, 5), (5, 0, 4, 2)) - x320 += einsum(x245, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) - x320 += einsum(t1.aa, (0, 1), x319, (2, 3, 1, 4), (3, 2, 0, 4)) - x320 += einsum(t1.aa, (0, 1), x254, (0, 2, 3, 4), (3, 2, 4, 1)) * -1.0 - l1new_aa += einsum(l2.aaaa, (0, 1, 2, 3), x320, (4, 3, 2, 1), (0, 4)) * -2.0 - del x320 - x321 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x321 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x58, (0, 2, 3, 5, 6, 7), (6, 7, 1, 4)) - x322 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x322 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x61, (1, 4, 6, 2, 7, 5), (6, 7, 0, 3)) * -1.0 - x323 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x323 += einsum(t1.aa, (0, 1), x61, (2, 3, 4, 5, 6, 1), (2, 3, 4, 5, 0, 6)) - x324 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x324 += einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), x193, (6, 2, 1, 7, 4, 5), (6, 7, 0, 3)) * -1.0 - x325 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x325 += einsum(t1.aa, (0, 1), x193, (2, 3, 4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - x326 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x326 += einsum(x195, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.3333333333333333 - x326 += einsum(x196, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.3333333333333333 - x326 += einsum(x197, (0, 1, 2, 3), (0, 1, 2, 3)) - x327 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x327 += einsum(x195, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x327 += einsum(x196, (0, 1, 2, 3), (0, 1, 2, 3)) - x327 += einsum(x197, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - l2new_abab += einsum(v.aabb.ooov, (0, 1, 2, 3), x327, (0, 4, 1, 5), (5, 3, 4, 2)) * 2.0 - x328 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x328 += einsum(x229, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x328 += einsum(t1.aa, (0, 1), x327, (2, 3, 4, 1), (2, 3, 0, 4)) * 0.3333333333333468 - x329 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x329 += einsum(l1.aa, (0, 1), t2.aaaa, (2, 3, 4, 0), (1, 2, 3, 4)) * 0.3333333333333333 - x329 += einsum(x195, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.3333333333333333 - x329 += einsum(l2.abab, (0, 1, 2, 3), t3.abaaba, (4, 3, 5, 6, 1, 0), (2, 4, 5, 6)) * 0.3333333333333333 - x329 += einsum(x196, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.3333333333333333 - x329 += einsum(x197, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x329 += einsum(x321, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.16666666666666666 - x329 += einsum(x322, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.6666666666666666 - x329 += einsum(t2.abab, (0, 1, 2, 3), x323, (1, 3, 4, 0, 5, 6), (4, 6, 5, 2)) * -0.3333333333333333 - x329 += einsum(x324, (0, 1, 2, 3), (0, 2, 1, 3)) * 1.5 - x329 += einsum(t2.aaaa, (0, 1, 2, 3), x228, (4, 3, 2, 5), (4, 0, 1, 5)) * -1.0 - x329 += einsum(t2.aaaa, (0, 1, 2, 3), x325, (4, 0, 1, 5, 6, 3), (4, 6, 5, 2)) * -1.0 - x329 += einsum(t2.abab, (0, 1, 2, 3), x66, (1, 3, 4, 5), (4, 0, 5, 2)) * 0.3333333333333333 - x329 += einsum(t2.aaaa, (0, 1, 2, 3), x326, (4, 1, 5, 3), (4, 0, 5, 2)) * -2.0 - x329 += einsum(t1.aa, (0, 1), x328, (2, 0, 3, 4), (2, 4, 3, 1)) * -0.9999999999999596 - del x328 - x329 += einsum(t1.aa, (0, 1), x298, (2, 3), (2, 0, 3, 1)) * 0.16666666666666666 - l1new_aa += einsum(v.aaaa.ovov, (0, 1, 2, 3), x329, (4, 2, 0, 3), (1, 4)) * -6.0 - del x329 - x330 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x330 += einsum(x282, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.1111111111111111 - x330 += einsum(x283, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.4444444444444444 - x330 += einsum(x284, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.1111111111111111 - x330 += einsum(x285, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.4444444444444444 - x330 += einsum(x287, (0, 1, 2, 3), (0, 1, 2, 3)) - l1new_aa += einsum(v.aaaa.ovvv, (0, 1, 2, 3), x330, (4, 0, 3, 1), (2, 4)) * 9.0 - del x330 - x331 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x331 += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 5, 0, 1), (2, 3, 4, 5)) - x332 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x332 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 4, 7, 0, 1, 2), (3, 5, 6, 7)) - x333 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x333 += einsum(x196, (0, 1, 2, 3), (0, 1, 2, 3)) - x333 += einsum(x197, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x334 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x334 += einsum(t1.aa, (0, 1), x333, (2, 3, 4, 1), (0, 2, 3, 4)) - x335 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x335 += einsum(x331, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - x335 += einsum(x332, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.9999999999999601 - x335 += einsum(x334, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - x336 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x336 += einsum(l2.aaaa, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 3, 6, 0, 1), (2, 4, 5, 6)) * 0.5 - x336 += einsum(x321, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.08333333333333333 - del x321 - x336 += einsum(x322, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.3333333333333333 - del x322 - x336 += einsum(t2.aaaa, (0, 1, 2, 3), x302, (4, 2, 3, 5), (4, 0, 1, 5)) * 0.16666666666666666 - x336 += einsum(x324, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.75 - del x324 - x336 += einsum(t2.abab, (0, 1, 2, 3), x66, (1, 3, 4, 5), (4, 0, 5, 2)) * 0.16666666666666666 - x336 += einsum(t2.aaaa, (0, 1, 2, 3), x326, (4, 1, 5, 3), (4, 0, 5, 2)) * -1.0 - x336 += einsum(t1.aa, (0, 1), x335, (0, 2, 3, 4), (2, 4, 3, 1)) * -0.16666666666666666 - del x335 - x336 += einsum(t1.aa, (0, 1), x298, (2, 3), (2, 0, 3, 1)) * 0.08333333333333333 - del x298 - l1new_aa += einsum(v.aaaa.ovov, (0, 1, 2, 3), x336, (4, 2, 0, 1), (3, 4)) * 12.0 - del x336 - x337 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x337 += einsum(t1.aa, (0, 1), (0, 1)) * -0.5000000000000202 - x337 += einsum(x186, (0, 1), (0, 1)) * -0.5000000000000202 - del x186 - x337 += einsum(x187, (0, 1), (0, 1)) * -1.0000000000000404 - del x187 - x337 += einsum(x188, (0, 1), (0, 1)) * -0.5000000000000202 - del x188 - x337 += einsum(x189, (0, 1), (0, 1)) * -1.0000000000000404 - del x189 - x337 += einsum(x190, (0, 1), (0, 1)) * -1.5000000000000604 - del x190 - x337 += einsum(x191, (0, 1), (0, 1)) * 0.5000000000000002 - del x191 - x337 += einsum(x192, (0, 1), (0, 1)) - del x192 - x337 += einsum(x194, (0, 1), (0, 1)) * 1.4999999999999998 - del x194 - x337 += einsum(t2.abab, (0, 1, 2, 3), x66, (1, 3, 0, 4), (4, 2)) * 1.0000000000000404 - x337 += einsum(t2.aaaa, (0, 1, 2, 3), x198, (0, 1, 4, 3), (4, 2)) * -3.000000000000121 - del x198 - x337 += einsum(t1.aa, (0, 1), x205, (0, 2), (2, 1)) * 0.5000000000000202 - del x205 - l1new_aa += einsum(x337, (0, 1), x240, (0, 2, 1, 3), (3, 2)) * 1.9999999999999194 - del x337 - x338 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x338 += einsum(x179, (0, 1), (0, 1)) * 0.5 - del x179 - x338 += einsum(x180, (0, 1), (0, 1)) * 0.5 - x338 += einsum(x181, (0, 1), (0, 1)) - x338 += einsum(x182, (0, 1), (0, 1)) * 0.49999999999998007 - x339 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x339 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x339 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - l1new_aa += einsum(x338, (0, 1), x339, (2, 1, 0, 3), (3, 2)) * -2.0 - del x338 - l2new_abab += einsum(x100, (0, 1, 2, 3), x339, (4, 3, 2, 5), (5, 1, 4, 0)) * -2.0 - x340 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x340 += einsum(x160, (0, 1), (0, 1)) * 0.5 - del x160 - x340 += einsum(x161, (0, 1), (0, 1)) - x340 += einsum(x162, (0, 1), (0, 1)) * 0.5 - x340 += einsum(x163, (0, 1), (0, 1)) * 1.4999999999999394 - x340 += einsum(x164, (0, 1), (1, 0)) * 0.9999999999999597 - x340 += einsum(x211, (0, 1), (0, 1)) * 0.49999999999998007 - l1new_aa += einsum(x340, (0, 1), v.aabb.ovvv, (2, 3, 1, 0), (3, 2)) * 2.0 - del x340 - x341 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x341 += einsum(x175, (0, 1), (0, 1)) - x341 += einsum(x109, (0, 1), (0, 1)) * 2.0 - x341 += einsum(x110, (0, 1), (0, 1)) - x341 += einsum(x111, (0, 1), (0, 1)) * 2.9999999999998788 - x341 += einsum(x112, (0, 1), (0, 1)) * 1.9999999999999194 - x341 += einsum(x113, (0, 1), (0, 1)) * 0.9999999999999601 - l2new_abab += einsum(x341, (0, 1), v.aabb.ovov, (2, 3, 1, 4), (3, 4, 2, 0)) * -1.0 - x342 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x342 += einsum(l1.bb, (0, 1), (1, 0)) * -1.0 - x342 += einsum(t1.bb, (0, 1), (0, 1)) * -1.0 - x342 += einsum(x166, (0, 1), (0, 1)) * -2.0 - del x166 - x342 += einsum(x167, (0, 1), (0, 1)) * -1.0 - del x167 - x342 += einsum(x168, (0, 1), (0, 1)) * -3.0 - del x168 - x342 += einsum(x169, (0, 1), (0, 1)) * -2.0 - del x169 - x342 += einsum(x170, (0, 1), (0, 1)) * -1.0 - del x170 - x342 += einsum(x171, (0, 1), (0, 1)) * 2.9999999999998788 - del x171 - x342 += einsum(x172, (0, 1), (0, 1)) * 1.9999999999999194 - del x172 - x342 += einsum(x173, (0, 1), (0, 1)) * 0.9999999999999601 - del x173 - x342 += einsum(t2.bbbb, (0, 1, 2, 3), x137, (0, 1, 4, 3), (4, 2)) * -2.0 - x342 += einsum(t2.abab, (0, 1, 2, 3), x139, (1, 4, 0, 2), (4, 3)) * 2.0 - x342 += einsum(t1.bb, (0, 1), x341, (0, 2), (2, 1)) - l1new_aa += einsum(x342, (0, 1), v.aabb.ovov, (2, 3, 0, 1), (3, 2)) * -1.0 - del x342 - x343 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x343 += einsum(x102, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5000000000000202 - del x102 - x343 += einsum(x103, (0, 1, 2, 3), (0, 1, 2, 3)) - del x103 - x343 += einsum(x104, (0, 1, 2, 3), (0, 1, 2, 3)) - del x104 - x343 += einsum(t1.bb, (0, 1), x101, (2, 1, 3, 4), (0, 2, 3, 4)) * 0.5000000000000202 - x343 += einsum(t1.aa, (0, 1), x106, (2, 3, 4, 1), (3, 2, 4, 0)) * 1.0000000000000404 - l1new_aa += einsum(v.aabb.ovoo, (0, 1, 2, 3), x343, (3, 2, 4, 0), (1, 4)) * 1.9999999999999194 - del x343 - x344 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x344 += einsum(x183, (0, 1), (0, 1)) - x344 += einsum(x184, (0, 1), (0, 1)) * 1.4999999999999998 - l1new_aa += einsum(x344, (0, 1), x339, (2, 1, 0, 3), (3, 2)) * -1.9999999999999194 - del x344 - x345 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x345 += einsum(x331, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.3333333333333333 - x345 += einsum(x332, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.33333333333332005 - x345 += einsum(t1.aa, (0, 1), x327, (2, 3, 4, 1), (0, 2, 3, 4)) * 0.3333333333333333 - l1new_aa += einsum(v.aaaa.ooov, (0, 1, 2, 3), x345, (0, 4, 1, 2), (3, 4)) * -6.0 - del x345 - x346 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x346 += einsum(t1.aa, (0, 1), x333, (2, 3, 4, 1), (2, 3, 0, 4)) * 0.3333333333333333 - l1new_aa += einsum(v.aaaa.ooov, (0, 1, 2, 3), x346, (4, 1, 2, 0), (3, 4)) * 6.0 - del x346 - x347 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x347 += einsum(x199, (0, 1), (0, 1)) * 0.3333333333333468 - x347 += einsum(x200, (0, 1), (0, 1)) * 0.3333333333333468 - x347 += einsum(x201, (0, 1), (0, 1)) * 0.6666666666666936 - x347 += einsum(x202, (0, 1), (0, 1)) * 0.33333333333333354 - x347 += einsum(x204, (0, 1), (0, 1)) - x348 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x348 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x348 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) - l1new_aa += einsum(x347, (0, 1), x348, (0, 2, 1, 3), (3, 2)) * -2.9999999999998788 - del x347 - l1new_aa += einsum(x203, (0, 1), x348, (0, 1, 2, 3), (3, 2)) * 1.9999999999999194 - l2new_abab += einsum(x348, (0, 1, 2, 3), x66, (4, 5, 0, 1), (3, 5, 2, 4)) * 2.0 - l3new_babbab += einsum(x348, (0, 1, 2, 3), x58, (4, 5, 6, 7, 0, 2), (6, 3, 7, 5, 1, 4)) * 2.0 - x349 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x349 += einsum(x175, (0, 1), (0, 1)) * 0.5 - del x175 - x349 += einsum(x109, (0, 1), (0, 1)) - del x109 - x349 += einsum(x110, (0, 1), (0, 1)) * 0.5 - del x110 - x349 += einsum(x111, (0, 1), (0, 1)) * 1.4999999999999394 - del x111 - x349 += einsum(x112, (0, 1), (1, 0)) * 0.9999999999999597 - del x112 - x349 += einsum(x113, (0, 1), (1, 0)) * 0.49999999999998007 - del x113 - l1new_aa += einsum(x349, (0, 1), v.aabb.ovoo, (2, 3, 1, 0), (3, 2)) * -2.0 - del x349 - x350 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x350 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x350 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - l1new_aa += einsum(l1.aa, (0, 1), x350, (1, 2, 0, 3), (3, 2)) * -1.0 - del x350 - x351 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x351 += einsum(t1.bb, (0, 1), v.aabb.vvov, (2, 3, 0, 1), (2, 3)) - x352 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x352 += einsum(f.aa.vv, (0, 1), (0, 1)) - x352 += einsum(x351, (0, 1), (1, 0)) - x352 += einsum(t1.aa, (0, 1), x235, (0, 1, 2, 3), (3, 2)) * -1.0 - l1new_aa += einsum(l1.aa, (0, 1), x352, (0, 2), (2, 1)) - del x352 - x353 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x353 += einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 1), (2, 3)) - x354 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x354 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - x355 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x355 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 1, 3), (0, 4)) - x356 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x356 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x356 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - x357 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x357 += einsum(t1.aa, (0, 1), x356, (2, 3, 0, 1), (2, 3)) - del x356 - x358 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x358 += einsum(t1.aa, (0, 1), x245, (2, 1), (0, 2)) - x359 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x359 += einsum(f.aa.oo, (0, 1), (0, 1)) - x359 += einsum(x353, (0, 1), (1, 0)) - x359 += einsum(x354, (0, 1), (0, 1)) - x359 += einsum(x355, (0, 1), (0, 1)) * 2.0 - x359 += einsum(x357, (0, 1), (1, 0)) * -1.0 - x359 += einsum(x358, (0, 1), (0, 1)) - del x358 - l1new_aa += einsum(l1.aa, (0, 1), x359, (1, 2), (0, 2)) * -1.0 - l2new_abab += einsum(x359, (0, 1), l2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1.0 - l3new_babbab += einsum(x359, (0, 1), l3.babbab, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) * -2.0 - del x359 - x360 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x360 += einsum(x199, (0, 1), (0, 1)) * 0.3333333333333468 - x360 += einsum(x200, (0, 1), (0, 1)) * 0.3333333333333468 - x360 += einsum(x201, (0, 1), (0, 1)) * 0.6666666666666936 - x360 += einsum(x202, (0, 1), (0, 1)) * 0.33333333333333354 - x360 += einsum(x203, (0, 1), (0, 1)) * 0.6666666666666667 - x360 += einsum(x204, (0, 1), (0, 1)) - l1new_aa += einsum(f.aa.ov, (0, 1), x360, (2, 0), (1, 2)) * -2.9999999999998788 - del x360 - x361 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x361 += einsum(x243, (0, 1), (0, 1)) - del x243 - x361 += einsum(x244, (0, 1), (0, 1)) * -1.0 - del x244 - l1new_aa += einsum(x199, (0, 1), x361, (1, 2), (2, 0)) * -1.0 - x362 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x362 += einsum(l1.aa, (0, 1), v.aaaa.ovvv, (2, 3, 4, 0), (1, 2, 3, 4)) - x363 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x363 += einsum(l2.abab, (0, 1, 2, 3), x238, (3, 1, 4, 5), (2, 4, 0, 5)) - x364 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x364 += einsum(x5, (0, 1, 2, 3), x93, (0, 1, 4, 5), (4, 2, 5, 3)) - x365 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x365 += einsum(x302, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.3333333333333333 - x365 += einsum(x228, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - l2new_abab += einsum(v.aabb.vvov, (0, 1, 2, 3), x365, (4, 5, 0, 1), (5, 3, 4, 2)) * 6.0 - x366 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x366 += einsum(x339, (0, 1, 2, 3), x365, (4, 2, 5, 1), (0, 4, 3, 5)) * 6.0 - del x365 - x367 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x367 += einsum(x196, (0, 1, 2, 3), (0, 1, 2, 3)) - del x196 - x367 += einsum(x197, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0000000000000004 - del x197 - x368 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x368 += einsum(t1.aa, (0, 1), x367, (2, 0, 3, 4), (2, 3, 1, 4)) * 0.22222222222223104 - del x367 - x369 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x369 += einsum(x282, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.11111111111111552 - x369 += einsum(x283, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.4444444444444621 - x369 += einsum(x284, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.11111111111111108 - x369 += einsum(x285, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.44444444444444453 - x369 += einsum(x286, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.22222222222223104 - x369 += einsum(x287, (0, 1, 2, 3), (0, 1, 2, 3)) - x369 += einsum(x288, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.6666666666666932 - x369 += einsum(x368, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x368 - x370 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x370 += einsum(x233, (0, 1, 2, 3), x369, (4, 0, 5, 3), (1, 4, 2, 5)) * 8.999999999999643 - del x369 - x371 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x371 += einsum(t1.bb, (0, 1), x106, (0, 2, 3, 4), (2, 1, 3, 4)) * 2.0 - x372 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x372 += einsum(l2.abab, (0, 1, 2, 3), (3, 1, 2, 0)) - x372 += einsum(x271, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x372 += einsum(x272, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x372 += einsum(x273, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.999999999999881 - x372 += einsum(x274, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x372 += einsum(x275, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.999999999999842 - x372 += einsum(x276, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x372 += einsum(x277, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.999999999999881 - x372 += einsum(x371, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x371 - x373 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x373 += einsum(v.aabb.ovov, (0, 1, 2, 3), x372, (2, 3, 4, 5), (0, 4, 1, 5)) - del x372 - x374 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x374 += einsum(v.aabb.ovvv, (0, 1, 2, 3), x297, (2, 3, 4, 5), (0, 4, 1, 5)) * 2.0 - x375 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x375 += einsum(t1.aa, (0, 1), x339, (2, 1, 3, 4), (0, 2, 3, 4)) - x376 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x376 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x376 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x376 += einsum(x375, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x375 - x377 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x377 += einsum(l2.aaaa, (0, 1, 2, 3), x376, (3, 4, 5, 1), (2, 4, 0, 5)) * 2.0 - del x376 - x378 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x378 += einsum(x327, (0, 1, 2, 3), x348, (1, 4, 2, 5), (0, 4, 3, 5)) * 2.0 - del x327 - x379 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x379 += einsum(x180, (0, 1), (0, 1)) - x379 += einsum(x181, (0, 1), (0, 1)) * 2.0 - x379 += einsum(x182, (0, 1), (0, 1)) * 0.9999999999999601 - x379 += einsum(x183, (0, 1), (0, 1)) * 1.9999999999999194 - x379 += einsum(x184, (0, 1), (0, 1)) * 2.9999999999998788 - x380 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x380 += einsum(x379, (0, 1), v.aaaa.ovov, (2, 1, 3, 4), (2, 3, 0, 4)) - del x379 - x381 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x381 += einsum(v.aabb.ovoo, (0, 1, 2, 3), x96, (2, 3, 4, 5), (0, 4, 1, 5)) - x382 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x382 += einsum(x230, (0, 1, 2, 3), (0, 1, 2, 3)) - x382 += einsum(x230, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x383 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x383 += einsum(x195, (0, 1, 2, 3), x382, (0, 4, 2, 5), (1, 4, 3, 5)) * 2.0 - x384 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x384 += einsum(x199, (0, 1), (0, 1)) - x384 += einsum(x200, (0, 1), (0, 1)) - x384 += einsum(x201, (0, 1), (0, 1)) * 2.0 - x384 += einsum(x202, (0, 1), (0, 1)) * 0.9999999999999601 - x384 += einsum(x203, (0, 1), (0, 1)) * 1.9999999999999194 - x384 += einsum(x204, (0, 1), (0, 1)) * 2.9999999999998788 - x385 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x385 += einsum(x384, (0, 1), v.aaaa.ovov, (2, 3, 1, 4), (0, 2, 4, 3)) - del x384 - x386 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x386 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x386 += einsum(x230, (0, 1, 2, 3), (0, 1, 2, 3)) - x387 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x387 += einsum(l1.aa, (0, 1), x386, (1, 2, 3, 4), (2, 3, 0, 4)) - x388 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x388 += einsum(f.aa.ov, (0, 1), l1.aa, (2, 3), (0, 3, 1, 2)) - x388 += einsum(x362, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x362 - x388 += einsum(x363, (0, 1, 2, 3), (0, 1, 2, 3)) - del x363 - x388 += einsum(x364, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x364 - x388 += einsum(x366, (0, 1, 2, 3), (1, 0, 3, 2)) - del x366 - x388 += einsum(x370, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x370 - x388 += einsum(x373, (0, 1, 2, 3), (1, 0, 3, 2)) - del x373 - x388 += einsum(x374, (0, 1, 2, 3), (1, 0, 3, 2)) - del x374 - x388 += einsum(x377, (0, 1, 2, 3), (0, 1, 2, 3)) - del x377 - x388 += einsum(x378, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x378 - x388 += einsum(x380, (0, 1, 2, 3), (1, 0, 2, 3)) - del x380 - x388 += einsum(x381, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x381 - x388 += einsum(x383, (0, 1, 2, 3), (0, 1, 2, 3)) - del x383 - x388 += einsum(x385, (0, 1, 2, 3), (0, 1, 3, 2)) - del x385 - x388 += einsum(x387, (0, 1, 2, 3), (0, 1, 2, 3)) - del x387 - x388 += einsum(l1.aa, (0, 1), x361, (2, 3), (1, 2, 0, 3)) - l2new_aaaa += einsum(x388, (0, 1, 2, 3), (2, 3, 0, 1)) - l2new_aaaa += einsum(x388, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - l2new_aaaa += einsum(x388, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - l2new_aaaa += einsum(x388, (0, 1, 2, 3), (3, 2, 1, 0)) - del x388 - x389 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x389 += einsum(f.aa.ov, (0, 1), t1.aa, (2, 1), (0, 2)) - x390 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x390 += einsum(x389, (0, 1), l2.aaaa, (2, 3, 4, 1), (0, 4, 2, 3)) - x391 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x391 += einsum(l2.aaaa, (0, 1, 2, 3), x253, (2, 4, 3, 5), (4, 5, 0, 1)) - x392 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x392 += einsum(f.aa.ov, (0, 1), t2.abab, (2, 3, 1, 4), (3, 4, 0, 2)) - x393 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x393 += einsum(x392, (0, 1, 2, 3), l3.abaaba, (4, 1, 5, 6, 0, 3), (2, 6, 4, 5)) - del x392 - x394 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x394 += einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) - x395 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x395 += einsum(x394, (0, 1, 2, 3), l3.aaaaaa, (4, 5, 3, 6, 1, 2), (0, 6, 4, 5)) * -1.0 - del x394 - x396 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x396 += einsum(x361, (0, 1), t2.abab, (2, 3, 1, 4), (3, 4, 2, 0)) - x397 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x397 += einsum(v.aabb.ooov, (0, 1, 2, 3), (2, 3, 0, 1)) - x397 += einsum(x7, (0, 1, 2, 3), (0, 1, 2, 3)) - x397 += einsum(x304, (0, 1, 2, 3), (0, 1, 2, 3)) - x397 += einsum(x305, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.999999999999921 - x397 += einsum(x306, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.99999999999992 - x397 += einsum(x307, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x397 += einsum(x308, (0, 1, 2, 3), (0, 1, 3, 2)) - x397 += einsum(x309, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x397 += einsum(x396, (0, 1, 2, 3), (0, 1, 2, 3)) - del x396 - x397 += einsum(x312, (0, 1, 2, 3), (0, 1, 3, 2)) - x397 += einsum(x313, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x398 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x398 += einsum(x397, (0, 1, 2, 3), l3.abaaba, (4, 1, 5, 6, 0, 2), (6, 3, 4, 5)) * -2.0 - del x397 - x399 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x399 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x399 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x399 += einsum(x230, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x399 += einsum(x230, (0, 1, 2, 3), (0, 2, 1, 3)) - x400 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x400 += einsum(t2.aaaa, (0, 1, 2, 3), x399, (4, 1, 5, 3), (0, 4, 5, 2)) * 2.0 - del x399 - x401 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x401 += einsum(t2.abab, (0, 1, 2, 3), x8, (1, 3, 4, 5), (0, 4, 5, 2)) - x402 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x402 += einsum(x361, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) * -1.0 - x403 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x403 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x403 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x403 += einsum(x318, (0, 1, 2, 3), (1, 0, 2, 3)) - del x318 - x404 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x404 += einsum(t1.aa, (0, 1), x403, (2, 3, 1, 4), (0, 2, 3, 4)) - del x403 - x405 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x405 += einsum(v.aaaa.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x405 += einsum(x251, (0, 1, 2, 3), (3, 1, 0, 2)) - x405 += einsum(x252, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - x405 += einsum(x253, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x405 += einsum(x253, (0, 1, 2, 3), (3, 0, 2, 1)) - x406 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x406 += einsum(t1.aa, (0, 1), x405, (0, 2, 3, 4), (2, 3, 4, 1)) - del x405 - x407 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x407 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x407 += einsum(x315, (0, 1, 2, 3), (1, 0, 2, 3)) - x407 += einsum(x316, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.9999999999999606 - x407 += einsum(x317, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.999999999999881 - x407 += einsum(x400, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x400 - x407 += einsum(x401, (0, 1, 2, 3), (0, 2, 1, 3)) - del x401 - x407 += einsum(x402, (0, 1, 2, 3), (1, 0, 2, 3)) - del x402 - x407 += einsum(x404, (0, 1, 2, 3), (2, 0, 1, 3)) - del x404 - x407 += einsum(x406, (0, 1, 2, 3), (1, 0, 2, 3)) - del x406 - x408 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x408 += einsum(x407, (0, 1, 2, 3), l3.aaaaaa, (4, 5, 3, 6, 0, 1), (6, 2, 4, 5)) * -6.0 - del x407 - x409 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x409 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x409 += einsum(x230, (0, 1, 2, 3), (0, 2, 1, 3)) - x410 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x410 += einsum(x302, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x302 - x410 += einsum(x228, (0, 1, 2, 3), (0, 2, 1, 3)) * -3.0 - del x228 - x411 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x411 += einsum(x409, (0, 1, 2, 3), x410, (0, 4, 5, 3), (1, 2, 4, 5)) * 2.0 - del x409 - x412 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x412 += einsum(t1.aa, (0, 1), x361, (2, 1), (0, 2)) - x413 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x413 += einsum(x353, (0, 1), (1, 0)) - del x353 - x413 += einsum(x354, (0, 1), (0, 1)) - del x354 - x413 += einsum(x355, (0, 1), (0, 1)) * 2.0 - del x355 - x413 += einsum(x357, (0, 1), (1, 0)) * -1.0 - del x357 - x413 += einsum(x412, (0, 1), (0, 1)) - del x412 - x414 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x414 += einsum(x413, (0, 1), l2.aaaa, (2, 3, 4, 0), (4, 1, 2, 3)) * -2.0 - x415 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x415 += einsum(x390, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - del x390 - x415 += einsum(x391, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x391 - x415 += einsum(x393, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - del x393 - x415 += einsum(x395, (0, 1, 2, 3), (0, 1, 3, 2)) * 6.0 - del x395 - x415 += einsum(x398, (0, 1, 2, 3), (0, 1, 3, 2)) - del x398 - x415 += einsum(x408, (0, 1, 2, 3), (0, 1, 2, 3)) - del x408 - x415 += einsum(x411, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x411 - x415 += einsum(x414, (0, 1, 2, 3), (0, 1, 3, 2)) - del x414 - l2new_aaaa += einsum(x415, (0, 1, 2, 3), (3, 2, 0, 1)) - l2new_aaaa += einsum(x415, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - del x415 - x416 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x416 += einsum(f.aa.vv, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - x417 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x417 += einsum(x22, (0, 1, 2, 3), x91, (0, 1, 4, 5, 6, 3), (4, 5, 6, 2)) - x418 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x418 += einsum(t1.bb, (0, 1), v.aabb.vvvv, (2, 3, 4, 1), (0, 4, 2, 3)) - x419 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x419 += einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.vvov, (4, 5, 1, 3), (0, 2, 4, 5)) - x420 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x420 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 4, 5, 3), (1, 5, 2, 4)) - x421 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x421 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 0, 2, 5, 6, 3), (4, 5, 6, 1)) - x422 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x422 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.abaaba, (0, 4, 2, 5, 6, 1), (4, 6, 5, 3)) * -1.0 - x423 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x423 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x423 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 2, 3, 1)) - x424 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x424 += einsum(t2.abab, (0, 1, 2, 3), x423, (0, 2, 4, 5), (1, 3, 4, 5)) - del x423 - x425 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x425 += einsum(t2.abab, (0, 1, 2, 3), x39, (1, 4, 0, 5), (4, 3, 2, 5)) - x426 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x426 += einsum(v.aabb.vvov, (0, 1, 2, 3), (2, 3, 0, 1)) - x426 += einsum(x418, (0, 1, 2, 3), (0, 1, 3, 2)) - x426 += einsum(x419, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - x426 += einsum(x420, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x426 += einsum(x421, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.999999999999921 - x426 += einsum(x422, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.99999999999992 - x426 += einsum(x424, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x424 - x426 += einsum(x425, (0, 1, 2, 3), (0, 1, 3, 2)) - x427 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x427 += einsum(x426, (0, 1, 2, 3), l3.abaaba, (4, 1, 3, 5, 0, 6), (5, 6, 4, 2)) * -2.0 - del x426 - x428 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x428 += einsum(t1.aa, (0, 1), v.aaaa.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x429 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x429 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 5, 1, 3), (0, 2, 4, 5)) - x430 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x430 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 2, 0, 5, 3, 6), (4, 5, 6, 1)) - x431 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x431 += einsum(v.aaaa.ovov, (0, 1, 2, 3), t3.aaaaaa, (4, 0, 2, 5, 6, 3), (4, 5, 6, 1)) - x432 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x432 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) - x432 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x433 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x433 += einsum(t2.aaaa, (0, 1, 2, 3), x432, (1, 3, 4, 5), (0, 2, 4, 5)) * 2.0 - x434 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x434 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x434 += einsum(x230, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x435 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x435 += einsum(t2.aaaa, (0, 1, 2, 3), x434, (0, 4, 1, 5), (4, 2, 3, 5)) - x436 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x436 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x436 += einsum(x428, (0, 1, 2, 3), (0, 2, 3, 1)) - x436 += einsum(x429, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x436 += einsum(x430, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.9999999999999606 - x436 += einsum(x431, (0, 1, 2, 3), (0, 2, 1, 3)) * -2.999999999999881 - x436 += einsum(x433, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x433 - x436 += einsum(x435, (0, 1, 2, 3), (0, 2, 1, 3)) - del x435 - x437 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x437 += einsum(x436, (0, 1, 2, 3), l3.aaaaaa, (4, 1, 2, 5, 6, 0), (5, 6, 4, 3)) * -6.0 - del x436 - x438 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x438 += einsum(t1.bb, (0, 1), x39, (0, 2, 3, 4), (2, 1, 3, 4)) - x439 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x439 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x439 += einsum(x238, (0, 1, 2, 3), (0, 1, 2, 3)) - x439 += einsum(x239, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x439 += einsum(x241, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x241 - x439 += einsum(x438, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x438 - l2new_abab += einsum(x439, (0, 1, 2, 3), x58, (0, 4, 5, 1, 6, 2), (3, 5, 6, 4)) * 2.0 - x440 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x440 += einsum(x439, (0, 1, 2, 3), x61, (0, 1, 4, 5, 2, 6), (4, 5, 6, 3)) * 2.0 - del x439 - x441 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x441 += einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - x442 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x442 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x442 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x442 += einsum(x441, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x441 - x442 += einsum(x232, (0, 1, 2, 3), (0, 1, 2, 3)) - x442 += einsum(x234, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x443 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x443 += einsum(x442, (0, 1, 2, 3), x193, (4, 5, 0, 1, 2, 6), (4, 5, 6, 3)) * 6.0 - del x442 - x444 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x444 += einsum(t1.aa, (0, 1), x230, (2, 3, 0, 4), (2, 3, 1, 4)) - x445 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x445 += einsum(t1.aa, (0, 1), x235, (2, 1, 3, 4), (0, 2, 3, 4)) - x446 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x446 += einsum(x444, (0, 1, 2, 3), (0, 1, 2, 3)) - del x444 - x446 += einsum(x445, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - l2new_abab += einsum(x446, (0, 1, 2, 3), x61, (4, 5, 0, 6, 1, 2), (3, 5, 6, 4)) * 2.0 - x447 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x447 += einsum(x446, (0, 1, 2, 3), x193, (4, 5, 0, 1, 2, 6), (4, 5, 6, 3)) * 6.0 - del x446 - x448 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x448 += einsum(v.aabb.vvoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x448 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - l2new_abab += einsum(x448, (0, 1, 2, 3), x74, (0, 4, 1, 5, 6, 2), (3, 5, 6, 4)) * 2.0 - x449 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x449 += einsum(x448, (0, 1, 2, 3), x91, (0, 1, 4, 5, 2, 6), (4, 5, 6, 3)) * 2.0 - del x448 - x450 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x450 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), x326, (4, 5, 0, 3), (4, 5, 1, 2)) * 6.0 - x451 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x451 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - x452 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x452 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 3, 1, 4), (2, 4)) * -1.0 - x453 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x453 += einsum(t1.aa, (0, 1), x339, (0, 1, 2, 3), (2, 3)) - del x339 - x454 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x454 += einsum(x351, (0, 1), (1, 0)) * -1.0 - x454 += einsum(x451, (0, 1), (1, 0)) - x454 += einsum(x452, (0, 1), (1, 0)) * 2.0 - x454 += einsum(x453, (0, 1), (1, 0)) * -1.0 - del x453 - x455 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x455 += einsum(x454, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 2, 0)) * -2.0 - x456 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x456 += einsum(v.aaaa.ovov, (0, 1, 2, 3), x334, (0, 4, 5, 2), (4, 5, 3, 1)) * 2.0 - del x334 - x457 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x457 += einsum(x361, (0, 1), x289, (2, 3, 0, 4), (2, 3, 4, 1)) * 2.0 - x458 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x458 += einsum(f.aa.ov, (0, 1), x300, (2, 3, 0, 4), (2, 3, 4, 1)) * 6.0 - del x300 - x459 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x459 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x459 += einsum(x416, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0 - del x416 - x459 += einsum(x417, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x417 - x459 += einsum(x427, (0, 1, 2, 3), (1, 0, 3, 2)) - del x427 - x459 += einsum(x437, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x437 - x459 += einsum(x440, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x440 - x459 += einsum(x443, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x443 - x459 += einsum(x447, (0, 1, 2, 3), (0, 1, 3, 2)) - del x447 - x459 += einsum(x449, (0, 1, 2, 3), (0, 1, 3, 2)) - del x449 - x459 += einsum(x450, (0, 1, 2, 3), (0, 1, 3, 2)) - del x450 - x459 += einsum(x455, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x455 - x459 += einsum(x456, (0, 1, 2, 3), (0, 1, 2, 3)) - del x456 - x459 += einsum(x457, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x457 - x459 += einsum(x458, (0, 1, 2, 3), (1, 0, 2, 3)) - del x458 - l2new_aaaa += einsum(x459, (0, 1, 2, 3), (3, 2, 0, 1)) - l2new_aaaa += einsum(x459, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - del x459 - x460 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x460 += einsum(f.aa.oo, (0, 1), l2.aaaa, (2, 3, 4, 1), (0, 4, 2, 3)) - l2new_aaaa += einsum(x460, (0, 1, 2, 3), (3, 2, 0, 1)) * -2.0 - l2new_aaaa += einsum(x460, (0, 1, 2, 3), (3, 2, 1, 0)) * 2.0 - del x460 - x461 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x461 += einsum(x331, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.3333333333333468 - del x331 - x461 += einsum(t1.aa, (0, 1), x195, (2, 3, 4, 1), (2, 3, 4, 0)) * 0.3333333333333468 - del x195 - x461 += einsum(x332, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.33333333333333354 - del x332 - x461 += einsum(x229, (0, 1, 2, 3), (0, 1, 3, 2)) - del x229 - l2new_aaaa += einsum(v.aaaa.ovov, (0, 1, 2, 3), x461, (4, 5, 0, 2), (3, 1, 5, 4)) * -5.9999999999997575 - del x461 - x462 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x462 += einsum(v.aaaa.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x462 += einsum(x251, (0, 1, 2, 3), (1, 3, 0, 2)) * -1.0 - x462 += einsum(x252, (0, 1, 2, 3), (0, 3, 1, 2)) - l2new_aaaa += einsum(l2.aaaa, (0, 1, 2, 3), x462, (2, 4, 3, 5), (0, 1, 4, 5)) * -2.0 - x463 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x463 += einsum(t1.aa, (0, 1), v.aabb.vvvv, (2, 1, 3, 4), (3, 4, 0, 2)) - x464 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x464 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 5), (3, 5, 0, 4)) - x465 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x465 += einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovvv, (1, 3, 4, 5), (4, 5, 0, 2)) - x466 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x466 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.babbab, (0, 4, 2, 5, 6, 3), (5, 1, 4, 6)) - x467 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x467 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.abaaba, (4, 2, 0, 5, 6, 1), (6, 3, 4, 5)) - x468 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x468 += einsum(t2.abab, (0, 1, 2, 3), x217, (1, 4, 3, 5), (4, 5, 0, 2)) - x469 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x469 += einsum(t2.abab, (0, 1, 2, 3), x8, (1, 4, 0, 5), (3, 4, 5, 2)) - x470 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x470 += einsum(v.aabb.ovvv, (0, 1, 2, 3), (2, 3, 0, 1)) - x470 += einsum(x463, (0, 1, 2, 3), (1, 0, 2, 3)) - x470 += einsum(x464, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x470 += einsum(x465, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - x470 += einsum(x466, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.99999999999992 - x470 += einsum(x467, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.999999999999921 - x470 += einsum(x468, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x470 += einsum(x469, (0, 1, 2, 3), (0, 1, 2, 3)) - l2new_abab += einsum(x470, (0, 1, 2, 3), l3.abaaba, (4, 0, 3, 5, 6, 2), (4, 1, 5, 6)) * 2.0 - del x470 - x471 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x471 += einsum(v.aabb.vvov, (0, 1, 2, 3), (2, 3, 0, 1)) - x471 += einsum(x418, (0, 1, 2, 3), (0, 1, 3, 2)) - del x418 - x471 += einsum(x419, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - del x419 - x471 += einsum(x420, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x420 - x471 += einsum(x421, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.999999999999921 - del x421 - x471 += einsum(x422, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.99999999999992 - del x422 - x471 += einsum(t2.abab, (0, 1, 2, 3), x235, (0, 2, 4, 5), (1, 3, 5, 4)) * -1.0 - x471 += einsum(x425, (0, 1, 2, 3), (0, 1, 2, 3)) - del x425 - l2new_abab += einsum(x471, (0, 1, 2, 3), l3.babbab, (4, 2, 1, 5, 6, 0), (3, 4, 6, 5)) * 2.0 - del x471 - x472 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x472 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.5 - x472 += einsum(x428, (0, 1, 2, 3), (0, 3, 2, 1)) * -0.5 - del x428 - x472 += einsum(x429, (0, 1, 2, 3), (0, 1, 3, 2)) * -0.5 - del x429 - x472 += einsum(x430, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.49999999999998 - del x430 - x472 += einsum(x431, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.4999999999999405 - del x431 - x472 += einsum(t2.aaaa, (0, 1, 2, 3), x432, (1, 3, 4, 5), (0, 2, 5, 4)) * -1.0 - del x432 - x472 += einsum(t2.aaaa, (0, 1, 2, 3), x434, (0, 4, 1, 5), (4, 2, 3, 5)) * -0.5 - del x434 - l2new_abab += einsum(x472, (0, 1, 2, 3), l3.abaaba, (1, 4, 2, 5, 6, 0), (3, 4, 5, 6)) * 4.0 - del x472 - x473 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x473 += einsum(t1.bb, (0, 1), v.bbbb.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - x474 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x474 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovvv, (0, 2, 4, 5), (1, 3, 4, 5)) - x475 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x475 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t3.bbbbbb, (4, 0, 2, 5, 6, 3), (4, 5, 6, 1)) - x476 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x476 += einsum(v.aabb.ovov, (0, 1, 2, 3), t3.babbab, (4, 0, 2, 5, 1, 6), (4, 5, 6, 3)) - x477 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x477 += einsum(t2.bbbb, (0, 1, 2, 3), x217, (1, 3, 4, 5), (0, 2, 4, 5)) * 2.0 - x478 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x478 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x478 += einsum(x3, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x479 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x479 += einsum(t2.bbbb, (0, 1, 2, 3), x478, (0, 4, 1, 5), (4, 2, 3, 5)) * -1.0 - del x478 - x480 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x480 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x480 += einsum(x473, (0, 1, 2, 3), (0, 2, 3, 1)) - x480 += einsum(x474, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x480 += einsum(x475, (0, 1, 2, 3), (0, 2, 1, 3)) * -2.999999999999881 - x480 += einsum(x476, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.99999999999996 - x480 += einsum(x477, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x480 += einsum(x479, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - l2new_abab += einsum(x480, (0, 1, 2, 3), l3.babbab, (1, 4, 2, 5, 6, 0), (4, 3, 6, 5)) * 2.0 - del x480 - x481 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x481 += einsum(v.aabb.ooov, (0, 1, 2, 3), (2, 3, 0, 1)) - x481 += einsum(x7, (0, 1, 2, 3), (0, 1, 2, 3)) - x481 += einsum(x304, (0, 1, 2, 3), (0, 1, 2, 3)) - del x304 - x481 += einsum(x305, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.999999999999921 - del x305 - x481 += einsum(x306, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.99999999999992 - del x306 - x481 += einsum(x307, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x307 - x481 += einsum(x308, (0, 1, 2, 3), (0, 1, 3, 2)) - del x308 - x481 += einsum(x309, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x309 - x481 += einsum(x310, (0, 1, 2, 3), (0, 1, 2, 3)) - del x310 - x481 += einsum(x312, (0, 1, 2, 3), (0, 1, 3, 2)) - del x312 - x481 += einsum(x313, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x313 - l2new_abab += einsum(x481, (0, 1, 2, 3), l3.babbab, (4, 5, 1, 6, 2, 0), (5, 4, 3, 6)) * -2.0 - del x481 - x482 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x482 += einsum(v.aabb.ovoo, (0, 1, 2, 3), (2, 3, 0, 1)) * 0.5 - x482 += einsum(x118, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.5 - x482 += einsum(x119, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x482 += einsum(x120, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.99999999999996 - x482 += einsum(x121, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.9999999999999605 - x482 += einsum(t2.abab, (0, 1, 2, 3), x122, (4, 5, 1, 3), (5, 4, 0, 2)) * -0.5 - del x122 - x482 += einsum(t2.aaaa, (0, 1, 2, 3), x39, (4, 5, 1, 3), (5, 4, 0, 2)) - x482 += einsum(t2.abab, (0, 1, 2, 3), x8, (4, 3, 0, 5), (1, 4, 5, 2)) * -0.5 - x482 += einsum(x21, (0, 1), t2.abab, (2, 3, 4, 1), (3, 0, 2, 4)) * 0.5 - del x21 - x482 += einsum(t1.bb, (0, 1), x126, (2, 1, 3, 4), (0, 2, 3, 4)) * 0.5 - del x126 - x482 += einsum(t1.aa, (0, 1), x128, (2, 3, 0, 4), (3, 2, 4, 1)) * -0.5 - del x128 - l2new_abab += einsum(x482, (0, 1, 2, 3), l3.abaaba, (4, 5, 3, 6, 0, 2), (4, 5, 6, 1)) * -4.0 - del x482 - x483 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x483 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * 0.3333333333333466 - x483 += einsum(x315, (0, 1, 2, 3), (2, 1, 0, 3)) * 0.3333333333333466 - del x315 - x483 += einsum(x316, (0, 1, 2, 3), (2, 1, 0, 3)) * -0.33333333333333326 - del x316 - x483 += einsum(x317, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x317 - x483 += einsum(t2.aaaa, (0, 1, 2, 3), x231, (4, 5, 1, 3), (5, 0, 4, 2)) * -0.6666666666666932 - del x231 - x483 += einsum(t2.abab, (0, 1, 2, 3), x31, (1, 3, 4, 5), (5, 0, 4, 2)) * 0.3333333333333466 - x483 += einsum(x245, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) * 0.3333333333333466 - del x245 - x483 += einsum(t1.aa, (0, 1), x319, (2, 3, 1, 4), (3, 2, 0, 4)) * 0.3333333333333466 - del x319 - x483 += einsum(t1.aa, (0, 1), x254, (0, 2, 3, 4), (3, 2, 4, 1)) * -0.3333333333333466 - del x254 - l2new_abab += einsum(x483, (0, 1, 2, 3), l3.abaaba, (4, 5, 3, 1, 6, 2), (4, 5, 0, 6)) * 5.999999999999762 - del x483 - x484 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x484 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x484 += einsum(x146, (0, 1, 2, 3), (2, 1, 0, 3)) - x484 += einsum(x147, (0, 1, 2, 3), (2, 1, 0, 3)) * -2.999999999999881 - x484 += einsum(x148, (0, 1, 2, 3), (2, 1, 0, 3)) * -0.99999999999996 - x484 += einsum(x149, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - x484 += einsum(x150, (0, 1, 2, 3), (2, 0, 1, 3)) - del x150 - x484 += einsum(x151, (0, 1, 2, 3), (2, 1, 0, 3)) - del x151 - x484 += einsum(x154, (0, 1, 2, 3), (2, 1, 0, 3)) - del x154 - x484 += einsum(x155, (0, 1, 2, 3), (1, 2, 0, 3)) - del x155 - l2new_abab += einsum(x484, (0, 1, 2, 3), l3.babbab, (4, 5, 3, 1, 6, 2), (5, 4, 6, 0)) * 2.0 - del x484 - x485 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x485 += einsum(t1.aa, (0, 1), x8, (2, 3, 0, 4), (2, 3, 4, 1)) - del x8 - x486 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x486 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x486 += einsum(x15, (0, 1, 2, 3), (0, 1, 2, 3)) - x486 += einsum(x16, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x486 += einsum(x17, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x17 - x486 += einsum(x485, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x485 - l2new_abab += einsum(x486, (0, 1, 2, 3), x91, (4, 0, 2, 5, 6, 3), (6, 1, 5, 4)) * 2.0 - x487 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x487 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x487 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x487 += einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 3, 0, 4), (2, 3, 1, 4)) - x487 += einsum(x232, (0, 1, 2, 3), (0, 1, 2, 3)) - x487 += einsum(x234, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x234 - l2new_abab += einsum(x487, (0, 1, 2, 3), x61, (4, 5, 0, 6, 1, 2), (3, 5, 6, 4)) * -2.0 - del x487 - x488 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x488 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x488 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x488 += einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 3, 0, 4), (2, 3, 1, 4)) - x488 += einsum(x9, (0, 1, 2, 3), (0, 1, 2, 3)) - x488 += einsum(x11, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - l2new_abab += einsum(x488, (0, 1, 2, 3), x74, (0, 4, 1, 2, 5, 6), (6, 3, 5, 4)) * -2.0 - del x488 - x489 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x489 += einsum(t1.bb, (0, 1), x12, (2, 1, 3, 4), (0, 2, 3, 4)) - x490 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x490 += einsum(t1.bb, (0, 1), x3, (2, 3, 0, 4), (2, 3, 1, 4)) - x490 += einsum(x489, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - l2new_abab += einsum(x490, (0, 1, 2, 3), x74, (0, 4, 1, 2, 5, 6), (6, 3, 5, 4)) * 2.0 - del x490 - x491 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x491 += einsum(x271, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5000000000000198 - del x271 - x491 += einsum(x272, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5000000000000198 - del x272 - x491 += einsum(x273, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.7499999999999999 - del x273 - x491 += einsum(x274, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5000000000000198 - del x274 - x491 += einsum(x275, (0, 1, 2, 3), (0, 1, 2, 3)) - del x275 - x491 += einsum(x276, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5000000000000198 - del x276 - x491 += einsum(x277, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.7499999999999999 - del x277 - x491 += einsum(t1.bb, (0, 1), x106, (0, 2, 3, 4), (2, 1, 3, 4)) * -0.5000000000000198 - l2new_abab += einsum(x10, (0, 1, 2, 3), x491, (0, 2, 4, 5), (5, 3, 4, 1)) * -3.999999999999842 - del x491 - x492 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x492 += einsum(v.aabb.oovv, (0, 1, 2, 3), (2, 3, 0, 1)) - x492 += einsum(x247, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - l2new_abab += einsum(x492, (0, 1, 2, 3), x61, (4, 0, 2, 5, 3, 6), (6, 1, 5, 4)) * 2.0 - x493 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x493 += einsum(l2.aaaa, (0, 1, 2, 3), (2, 3, 0, 1)) - x493 += einsum(x282, (0, 1, 2, 3), (1, 0, 3, 2)) * 0.5 - del x282 - x493 += einsum(x283, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0 - del x283 - x493 += einsum(x284, (0, 1, 2, 3), (1, 0, 3, 2)) * 0.49999999999998 - del x284 - x493 += einsum(x285, (0, 1, 2, 3), (1, 0, 3, 2)) * 1.999999999999921 - del x285 - x493 += einsum(x286, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x286 - x493 += einsum(x287, (0, 1, 2, 3), (1, 0, 3, 2)) * 4.4999999999998215 - del x287 - x493 += einsum(x288, (0, 1, 2, 3), (1, 0, 3, 2)) * -3.0 - del x288 - x493 += einsum(t1.aa, (0, 1), x333, (0, 2, 3, 4), (3, 2, 1, 4)) - del x333 - l2new_abab += einsum(v.aabb.ovov, (0, 1, 2, 3), x493, (0, 4, 1, 5), (5, 3, 4, 2)) * 2.0 - del x493 - x494 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x494 += einsum(x64, (0, 1, 2, 3), (0, 1, 2, 3)) - del x64 - x494 += einsum(x65, (0, 1, 2, 3), (0, 1, 2, 3)) - del x65 - x495 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x495 += einsum(t1.aa, (0, 1), x494, (2, 3, 0, 4), (2, 3, 4, 1)) * 2.0 - x496 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x496 += einsum(l2.abab, (0, 1, 2, 3), (3, 1, 2, 0)) - x496 += einsum(x54, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x496 += einsum(x55, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x496 += einsum(x56, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.999999999999881 - x496 += einsum(x57, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.999999999999842 - x496 += einsum(x59, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x496 += einsum(x60, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.999999999999881 - x496 += einsum(x62, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x496 += einsum(x495, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x495 - l2new_abab += einsum(v.aaaa.ovov, (0, 1, 2, 3), x496, (4, 5, 2, 3), (1, 5, 0, 4)) - x497 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x497 += einsum(l2.bbbb, (0, 1, 2, 3), (2, 3, 0, 1)) * 2.0 - x497 += einsum(x81, (0, 1, 2, 3), (1, 0, 3, 2)) * 4.0 - x497 += einsum(x82, (0, 1, 2, 3), (1, 0, 3, 2)) - x497 += einsum(x83, (0, 1, 2, 3), (1, 0, 3, 2)) * 8.999999999999643 - x497 += einsum(x73, (0, 1, 2, 3), (1, 0, 3, 2)) * -6.0 - x497 += einsum(x84, (0, 1, 2, 3), (1, 0, 3, 2)) * 3.999999999999842 - x497 += einsum(x75, (0, 1, 2, 3), (1, 0, 3, 2)) * -2.0 - x497 += einsum(x85, (0, 1, 2, 3), (1, 0, 3, 2)) * 0.99999999999996 - x497 += einsum(t1.bb, (0, 1), x157, (0, 2, 3, 4), (3, 2, 1, 4)) * 6.0 - l2new_abab += einsum(v.aabb.ovov, (0, 1, 2, 3), x497, (2, 4, 3, 5), (1, 5, 0, 4)) - del x497 - x498 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x498 += einsum(x54, (0, 1, 2, 3), (0, 1, 2, 3)) - del x54 - x498 += einsum(x55, (0, 1, 2, 3), (0, 1, 2, 3)) - del x55 - x498 += einsum(x56, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.4999999999999405 - del x56 - x498 += einsum(x57, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.999999999999921 - del x57 - x498 += einsum(x59, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x59 - x498 += einsum(x60, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.4999999999999405 - del x60 - x498 += einsum(x62, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x62 - x498 += einsum(t1.aa, (0, 1), x494, (2, 3, 0, 4), (2, 3, 4, 1)) * -1.0 - l2new_abab += einsum(v.aaaa.ovov, (0, 1, 2, 3), x498, (4, 5, 2, 1), (3, 5, 0, 4)) * -2.0 - del x498 - x499 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x499 += einsum(x0, (0, 1, 2, 3), (0, 2, 1, 3)) * -3.0 - x499 += einsum(x116, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - l2new_abab += einsum(v.aabb.ovvv, (0, 1, 2, 3), x499, (4, 5, 2, 3), (1, 5, 0, 4)) * 2.0 - x500 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x500 += einsum(x291, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x291 - x500 += einsum(x292, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.99999999999996 - del x292 - x500 += einsum(x293, (0, 1, 2, 3), (0, 1, 2, 3)) - del x293 - x500 += einsum(x294, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.99999999999996 - del x294 - x500 += einsum(x295, (0, 1, 2, 3), (0, 1, 2, 3)) - del x295 - x500 += einsum(t1.bb, (0, 1), x494, (0, 2, 3, 4), (2, 1, 3, 4)) - del x494 - l2new_abab += einsum(v.aabb.ovov, (0, 1, 2, 3), x500, (4, 3, 5, 0), (1, 4, 5, 2)) * 2.0 - del x500 - x501 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x501 += einsum(x87, (0, 1, 2, 3), (0, 1, 2, 3)) - del x87 - x501 += einsum(x88, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.99999999999992 - del x88 - x501 += einsum(x89, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x89 - x501 += einsum(x90, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.99999999999992 - del x90 - x501 += einsum(x92, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x92 - x501 += einsum(t1.aa, (0, 1), x106, (2, 3, 0, 4), (2, 3, 4, 1)) * 2.0 - del x106 - l2new_abab += einsum(v.aabb.ovov, (0, 1, 2, 3), x501, (4, 2, 5, 1), (5, 3, 0, 4)) - del x501 - x502 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x502 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x502 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x502 += einsum(x489, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x489 - l2new_abab += einsum(l2.abab, (0, 1, 2, 3), x502, (3, 4, 1, 5), (0, 5, 2, 4)) * -1.0 - del x502 - x503 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x503 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) - x503 += einsum(x445, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x445 - l2new_abab += einsum(l2.abab, (0, 1, 2, 3), x503, (2, 4, 0, 5), (5, 1, 4, 3)) * -1.0 - del x503 - x504 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x504 += einsum(v.aabb.oovv, (0, 1, 2, 3), (2, 3, 0, 1)) - x504 += einsum(x246, (0, 1, 2, 3), (1, 0, 2, 3)) - l2new_abab += einsum(l2.abab, (0, 1, 2, 3), x504, (1, 4, 2, 5), (0, 4, 5, 3)) * -1.0 - del x504 - x505 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x505 += einsum(v.aabb.vvoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x505 += einsum(x22, (0, 1, 2, 3), (0, 1, 3, 2)) - l2new_abab += einsum(l2.abab, (0, 1, 2, 3), x505, (3, 4, 0, 5), (5, 1, 2, 4)) * -1.0 - del x505 - x506 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x506 += einsum(v.aabb.oooo, (0, 1, 2, 3), (2, 3, 0, 1)) - x506 += einsum(x29, (0, 1, 2, 3), (1, 0, 2, 3)) - del x29 - x506 += einsum(x30, (0, 1, 2, 3), (0, 1, 2, 3)) - del x30 - x506 += einsum(x249, (0, 1, 2, 3), (0, 1, 3, 2)) - del x249 - l2new_abab += einsum(l2.abab, (0, 1, 2, 3), x506, (3, 4, 2, 5), (0, 1, 5, 4)) - x507 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x507 += einsum(t1.aa, (0, 1), x235, (0, 2, 1, 3), (2, 3)) - del x235 - x508 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x508 += einsum(f.aa.vv, (0, 1), (0, 1)) * -1.0 - x508 += einsum(x351, (0, 1), (1, 0)) * -1.0 - del x351 - x508 += einsum(x451, (0, 1), (0, 1)) - del x451 - x508 += einsum(x452, (0, 1), (0, 1)) * 2.0 - del x452 - x508 += einsum(x507, (0, 1), (1, 0)) * -1.0 - del x507 - l2new_abab += einsum(x508, (0, 1), l2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -1.0 - l3new_babbab += einsum(x508, (0, 1), l3.babbab, (2, 0, 3, 4, 5, 6), (2, 1, 3, 4, 5, 6)) * -2.0 - del x508 - x509 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x509 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 4, 1, 3), (2, 4)) - x510 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x510 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 4), (3, 4)) - x511 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x511 += einsum(t1.bb, (0, 1), x217, (0, 1, 2, 3), (2, 3)) - del x217 - x512 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x512 += einsum(f.bb.vv, (0, 1), (0, 1)) * -1.0 - x512 += einsum(x216, (0, 1), (1, 0)) * -1.0 - x512 += einsum(x509, (0, 1), (0, 1)) * 2.0 - x512 += einsum(x510, (0, 1), (0, 1)) - x512 += einsum(x511, (0, 1), (1, 0)) * -1.0 - del x511 - l2new_abab += einsum(x512, (0, 1), l2.abab, (2, 0, 3, 4), (2, 1, 3, 4)) * -1.0 - l3new_abaaba += einsum(x512, (0, 1), l3.abaaba, (2, 0, 3, 4, 5, 6), (2, 1, 3, 4, 5, 6)) * -2.0 - del x512 - x513 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x513 += einsum(x180, (0, 1), (0, 1)) * 1.00000000000004 - del x180 - x513 += einsum(x181, (0, 1), (0, 1)) * 2.00000000000008 - del x181 - x513 += einsum(x182, (0, 1), (0, 1)) - del x182 - x513 += einsum(x183, (0, 1), (0, 1)) * 1.9999999999999991 - del x183 - x513 += einsum(x184, (0, 1), (0, 1)) * 2.9999999999999982 - del x184 - l2new_abab += einsum(x513, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 4, 2, 3)) * -0.9999999999999601 - del x513 - x514 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x514 += einsum(x161, (0, 1), (0, 1)) * 2.0 - x514 += einsum(x162, (0, 1), (0, 1)) - x514 += einsum(x163, (0, 1), (0, 1)) * 2.9999999999998788 - x514 += einsum(x164, (0, 1), (0, 1)) * 1.9999999999999194 - x514 += einsum(x211, (0, 1), (0, 1)) * 0.9999999999999601 - l2new_abab += einsum(x514, (0, 1), v.aabb.ovov, (2, 3, 4, 1), (3, 0, 2, 4)) * -1.0 - del x514 - x515 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x515 += einsum(x230, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x515 += einsum(x230, (0, 1, 2, 3), (0, 2, 1, 3)) - l2new_abab += einsum(x515, (0, 1, 2, 3), x63, (4, 5, 0, 1), (3, 5, 2, 4)) * -1.0 - l3new_babbab += einsum(x515, (0, 1, 2, 3), x58, (4, 5, 6, 7, 0, 1), (6, 3, 7, 5, 2, 4)) * 2.0 - x516 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x516 += einsum(x3, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x516 += einsum(x3, (0, 1, 2, 3), (0, 2, 1, 3)) - l2new_abab += einsum(x516, (0, 1, 2, 3), x93, (0, 2, 4, 5), (5, 3, 4, 1)) - del x93 - l3new_abaaba += einsum(x516, (0, 1, 2, 3), x91, (0, 1, 4, 5, 6, 7), (6, 3, 7, 5, 2, 4)) * 2.0 - x517 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x517 += einsum(x199, (0, 1), (0, 1)) * 1.00000000000004 - del x199 - x517 += einsum(x200, (0, 1), (0, 1)) * 1.00000000000004 - del x200 - x517 += einsum(x201, (0, 1), (0, 1)) * 2.00000000000008 - del x201 - x517 += einsum(x202, (0, 1), (0, 1)) - del x202 - x517 += einsum(x203, (0, 1), (0, 1)) * 1.9999999999999991 - del x203 - x517 += einsum(x204, (0, 1), (0, 1)) * 2.9999999999999982 - del x204 - l2new_abab += einsum(x517, (0, 1), v.aabb.ovov, (1, 2, 3, 4), (2, 4, 0, 3)) * -0.9999999999999601 - del x517 - x518 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x518 += einsum(l1.bb, (0, 1), v.bbbb.ovvv, (2, 3, 4, 0), (1, 2, 3, 4)) - x519 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x519 += einsum(l2.abab, (0, 1, 2, 3), x15, (4, 5, 2, 0), (3, 4, 1, 5)) - x520 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x520 += einsum(x63, (0, 1, 2, 3), x7, (4, 5, 2, 3), (0, 4, 1, 5)) - del x63 - x521 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x521 += einsum(x499, (0, 1, 2, 3), x80, (4, 3, 1, 5), (4, 0, 5, 2)) * 2.0 - del x499 - x522 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x522 += einsum(t1.bb, (0, 1), x157, (2, 0, 3, 4), (2, 3, 1, 4)) * 3.0 - del x157 - x523 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x523 += einsum(x81, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x81 - x523 += einsum(x82, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x82 - x523 += einsum(x83, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.4999999999998215 - del x83 - x523 += einsum(x73, (0, 1, 2, 3), (0, 1, 2, 3)) * -3.0 - del x73 - x523 += einsum(x84, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.999999999999921 - del x84 - x523 += einsum(x75, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x75 - x523 += einsum(x85, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.49999999999998 - del x85 - x523 += einsum(x522, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x522 - x524 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x524 += einsum(x10, (0, 1, 2, 3), x523, (4, 0, 5, 2), (1, 4, 3, 5)) * 2.0 - del x523 - x525 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x525 += einsum(v.aabb.ovov, (0, 1, 2, 3), x496, (4, 5, 0, 1), (2, 4, 3, 5)) - del x496 - x526 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x526 += einsum(v.aabb.vvov, (0, 1, 2, 3), x100, (4, 5, 0, 1), (2, 4, 3, 5)) * 2.0 - x527 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x527 += einsum(t1.bb, (0, 1), x80, (2, 1, 3, 4), (0, 2, 3, 4)) - del x80 - x528 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x528 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 3, 1)) - x528 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x528 += einsum(x527, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x527 - x529 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x529 += einsum(l2.bbbb, (0, 1, 2, 3), x528, (3, 4, 5, 1), (2, 4, 0, 5)) * 2.0 - del x528 - x530 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x530 += einsum(x1, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.3333333333333333 - x530 += einsum(x76, (0, 1, 2, 3), (0, 1, 2, 3)) - del x76 - x530 += einsum(x77, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.3333333333333333 - del x77 - x531 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x531 += einsum(x213, (0, 1, 2, 3), x530, (4, 0, 2, 5), (1, 4, 3, 5)) * 6.0 - del x530 - x532 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x532 += einsum(x161, (0, 1), (0, 1)) - del x161 - x532 += einsum(x162, (0, 1), (0, 1)) * 0.5 - del x162 - x532 += einsum(x163, (0, 1), (0, 1)) * 1.4999999999999394 - del x163 - x532 += einsum(x164, (0, 1), (0, 1)) * 0.9999999999999597 - del x164 - x532 += einsum(x211, (0, 1), (0, 1)) * 0.49999999999998007 - del x211 - x533 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x533 += einsum(x532, (0, 1), v.bbbb.ovov, (2, 1, 3, 4), (2, 3, 4, 0)) * 2.0 - del x532 - x534 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x534 += einsum(v.aabb.ooov, (0, 1, 2, 3), x101, (4, 5, 0, 1), (2, 4, 3, 5)) - del x101 - x535 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x535 += einsum(x1, (0, 1, 2, 3), x516, (0, 2, 4, 5), (1, 4, 3, 5)) * 2.0 - del x1 - x536 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x536 += einsum(x341, (0, 1), v.bbbb.ovov, (2, 3, 1, 4), (2, 0, 4, 3)) - del x341 - x537 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x537 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x537 += einsum(x3, (0, 1, 2, 3), (0, 1, 2, 3)) - x538 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x538 += einsum(l1.bb, (0, 1), x537, (1, 2, 3, 4), (2, 3, 0, 4)) - x539 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x539 += einsum(f.bb.ov, (0, 1), l1.bb, (2, 3), (0, 3, 1, 2)) - x539 += einsum(x518, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x518 - x539 += einsum(x519, (0, 1, 2, 3), (0, 1, 2, 3)) - del x519 - x539 += einsum(x520, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x520 - x539 += einsum(x521, (0, 1, 2, 3), (1, 0, 3, 2)) - del x521 - x539 += einsum(x524, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x524 - x539 += einsum(x525, (0, 1, 2, 3), (1, 0, 3, 2)) - del x525 - x539 += einsum(x526, (0, 1, 2, 3), (1, 0, 3, 2)) - del x526 - x539 += einsum(x529, (0, 1, 2, 3), (0, 1, 2, 3)) - del x529 - x539 += einsum(x531, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x531 - x539 += einsum(x533, (0, 1, 2, 3), (1, 0, 3, 2)) - del x533 - x539 += einsum(x534, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x534 - x539 += einsum(x535, (0, 1, 2, 3), (0, 1, 2, 3)) - del x535 - x539 += einsum(x536, (0, 1, 2, 3), (1, 0, 3, 2)) - del x536 - x539 += einsum(x538, (0, 1, 2, 3), (0, 1, 2, 3)) - del x538 - x539 += einsum(l1.bb, (0, 1), x227, (2, 3), (1, 2, 0, 3)) - l2new_bbbb += einsum(x539, (0, 1, 2, 3), (2, 3, 0, 1)) - l2new_bbbb += einsum(x539, (0, 1, 2, 3), (3, 2, 0, 1)) * -1.0 - l2new_bbbb += einsum(x539, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - l2new_bbbb += einsum(x539, (0, 1, 2, 3), (3, 2, 1, 0)) - del x539 - x540 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x540 += einsum(f.bb.ov, (0, 1), t1.bb, (2, 1), (0, 2)) - x541 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x541 += einsum(x540, (0, 1), l2.bbbb, (2, 3, 4, 1), (0, 4, 2, 3)) - x542 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x542 += einsum(l2.bbbb, (0, 1, 2, 3), x27, (3, 2, 4, 5), (4, 5, 0, 1)) * -1.0 - x543 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x543 += einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) - x544 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x544 += einsum(x543, (0, 1, 2, 3), l3.bbbbbb, (4, 5, 3, 6, 1, 2), (0, 6, 4, 5)) * -1.0 - del x543 - x545 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x545 += einsum(f.bb.ov, (0, 1), t2.abab, (2, 3, 4, 1), (0, 3, 2, 4)) - x546 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x546 += einsum(x545, (0, 1, 2, 3), l3.babbab, (4, 3, 5, 6, 2, 1), (0, 6, 4, 5)) - del x545 - x547 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x547 += einsum(x227, (0, 1), t2.abab, (2, 3, 4, 1), (3, 0, 2, 4)) - x548 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x548 += einsum(v.aabb.ovoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x548 += einsum(x118, (0, 1, 2, 3), (1, 0, 2, 3)) - del x118 - x548 += einsum(x119, (0, 1, 2, 3), (0, 1, 2, 3)) - del x119 - x548 += einsum(x120, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.99999999999992 - del x120 - x548 += einsum(x121, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.999999999999921 - del x121 - x548 += einsum(x123, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x123 - x548 += einsum(x124, (0, 1, 2, 3), (1, 0, 2, 3)) - del x124 - x548 += einsum(x125, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x125 - x548 += einsum(x547, (0, 1, 2, 3), (0, 1, 2, 3)) - del x547 - x548 += einsum(x127, (0, 1, 2, 3), (0, 1, 2, 3)) - del x127 - x548 += einsum(x129, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x129 - x549 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x549 += einsum(x548, (0, 1, 2, 3), l3.babbab, (4, 3, 5, 6, 2, 0), (6, 1, 4, 5)) * -2.0 - del x548 - x550 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x550 += einsum(t2.abab, (0, 1, 2, 3), x39, (4, 5, 0, 2), (1, 4, 5, 3)) - del x39 - x551 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x551 += einsum(x227, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) * -1.0 - x552 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x552 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x552 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x552 += einsum(x152, (0, 1, 2, 3), (1, 0, 2, 3)) - del x152 - x553 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x553 += einsum(t1.bb, (0, 1), x552, (2, 3, 1, 4), (0, 2, 3, 4)) - del x552 - x554 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x554 += einsum(t1.bb, (0, 1), x48, (0, 2, 3, 4), (2, 3, 4, 1)) - del x48 - x555 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x555 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (2, 0, 1, 3)) - x555 += einsum(x146, (0, 1, 2, 3), (1, 0, 2, 3)) - del x146 - x555 += einsum(x147, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.999999999999881 - del x147 - x555 += einsum(x148, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.9999999999999606 - del x148 - x555 += einsum(x149, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x149 - x555 += einsum(x550, (0, 1, 2, 3), (0, 2, 1, 3)) - del x550 - x555 += einsum(x551, (0, 1, 2, 3), (1, 0, 2, 3)) - del x551 - x555 += einsum(x553, (0, 1, 2, 3), (2, 0, 1, 3)) - del x553 - x555 += einsum(x554, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x554 - x556 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x556 += einsum(x555, (0, 1, 2, 3), l3.bbbbbb, (4, 5, 3, 6, 0, 1), (6, 2, 4, 5)) * -6.0 - del x555 - x557 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x557 += einsum(v.bbbb.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x557 += einsum(x3, (0, 1, 2, 3), (0, 2, 1, 3)) - x558 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x558 += einsum(x136, (0, 1, 2, 3), x557, (0, 4, 5, 3), (4, 5, 1, 2)) * 6.0 - del x557 - x559 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x559 += einsum(t1.bb, (0, 1), x227, (2, 1), (0, 2)) - x560 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x560 += einsum(x219, (0, 1), (1, 0)) - x560 += einsum(x220, (0, 1), (0, 1)) * 2.0 - x560 += einsum(x221, (0, 1), (0, 1)) - x560 += einsum(x223, (0, 1), (1, 0)) * -1.0 - x560 += einsum(x559, (0, 1), (0, 1)) - del x559 - x561 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x561 += einsum(x560, (0, 1), l2.bbbb, (2, 3, 4, 0), (4, 1, 2, 3)) * -2.0 - x562 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x562 += einsum(x541, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - del x541 - x562 += einsum(x542, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x542 - x562 += einsum(x544, (0, 1, 2, 3), (0, 1, 3, 2)) * 6.0 - del x544 - x562 += einsum(x546, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.0 - del x546 - x562 += einsum(x549, (0, 1, 2, 3), (0, 1, 3, 2)) - del x549 - x562 += einsum(x556, (0, 1, 2, 3), (0, 1, 2, 3)) - del x556 - x562 += einsum(x558, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x558 - x562 += einsum(x561, (0, 1, 2, 3), (0, 1, 3, 2)) - del x561 - l2new_bbbb += einsum(x562, (0, 1, 2, 3), (3, 2, 0, 1)) - l2new_bbbb += einsum(x562, (0, 1, 2, 3), (3, 2, 1, 0)) * -1.0 - del x562 - x563 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x563 += einsum(f.bb.vv, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - x564 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x564 += einsum(x246, (0, 1, 2, 3), x58, (4, 5, 6, 1, 2, 3), (4, 5, 6, 0)) - x565 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x565 += einsum(v.aabb.ovvv, (0, 1, 2, 3), (2, 3, 0, 1)) - x565 += einsum(x463, (0, 1, 2, 3), (1, 0, 2, 3)) - del x463 - x565 += einsum(x464, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x464 - x565 += einsum(x465, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - del x465 - x565 += einsum(x466, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.99999999999992 - del x466 - x565 += einsum(x467, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.999999999999921 - del x467 - x565 += einsum(x468, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x468 - x565 += einsum(x469, (0, 1, 2, 3), (1, 0, 2, 3)) - del x469 - x566 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x566 += einsum(x565, (0, 1, 2, 3), l3.babbab, (4, 3, 1, 5, 2, 6), (5, 6, 4, 0)) * -2.0 - del x565 - x567 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x567 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), (0, 2, 1, 3)) - x567 += einsum(x473, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - del x473 - x567 += einsum(x474, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x474 - x567 += einsum(x475, (0, 1, 2, 3), (0, 2, 1, 3)) * -2.999999999999881 - del x475 - x567 += einsum(x476, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.9999999999999606 - del x476 - x567 += einsum(x477, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x477 - x567 += einsum(x479, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x479 - x568 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x568 += einsum(x567, (0, 1, 2, 3), l3.bbbbbb, (4, 1, 2, 5, 6, 0), (5, 6, 4, 3)) * -6.0 - del x567 - x569 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x569 += einsum(x486, (0, 1, 2, 3), x74, (4, 5, 0, 6, 2, 3), (4, 5, 6, 1)) * 2.0 - del x486 - x570 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x570 += einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - x571 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x571 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x571 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x571 += einsum(x570, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x570 - x571 += einsum(x9, (0, 1, 2, 3), (0, 1, 2, 3)) - x571 += einsum(x11, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x11 - x572 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x572 += einsum(x571, (0, 1, 2, 3), x72, (4, 5, 0, 1, 2, 6), (4, 5, 6, 3)) * 6.0 - del x571 - x573 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x573 += einsum(t1.bb, (0, 1), x3, (2, 0, 3, 4), (2, 3, 1, 4)) - x574 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x574 += einsum(x573, (0, 1, 2, 3), (0, 1, 2, 3)) - del x573 - x574 += einsum(x13, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x575 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x575 += einsum(x574, (0, 1, 2, 3), x72, (4, 5, 0, 1, 2, 6), (4, 5, 6, 3)) * 6.0 - del x574 - x576 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x576 += einsum(x492, (0, 1, 2, 3), x58, (4, 5, 0, 6, 2, 3), (4, 5, 6, 1)) * 2.0 - del x492 - x577 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x577 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), x137, (4, 5, 0, 3), (4, 5, 1, 2)) * 2.0 - x578 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x578 += einsum(t1.bb, (0, 1), x12, (0, 2, 1, 3), (2, 3)) - del x12 - x579 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x579 += einsum(x216, (0, 1), (1, 0)) * -1.0 - del x216 - x579 += einsum(x509, (0, 1), (1, 0)) * 2.0 - del x509 - x579 += einsum(x510, (0, 1), (1, 0)) - del x510 - x579 += einsum(x578, (0, 1), (0, 1)) * -1.0 - del x578 - x580 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x580 += einsum(x579, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 2, 0)) * -2.0 - x581 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x581 += einsum(v.bbbb.ovov, (0, 1, 2, 3), x158, (2, 4, 5, 0), (4, 5, 1, 3)) * 6.0 - del x158 - x582 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x582 += einsum(x227, (0, 1), x78, (2, 3, 0, 4), (2, 3, 4, 1)) * 2.0 - x583 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x583 += einsum(f.bb.ov, (0, 1), x78, (2, 3, 0, 4), (2, 3, 1, 4)) * 2.0 - x584 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x584 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x584 += einsum(x563, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0 - del x563 - x584 += einsum(x564, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x564 - x584 += einsum(x566, (0, 1, 2, 3), (1, 0, 3, 2)) - del x566 - x584 += einsum(x568, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x568 - x584 += einsum(x569, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x569 - x584 += einsum(x572, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x572 - x584 += einsum(x575, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x575 - x584 += einsum(x576, (0, 1, 2, 3), (0, 1, 3, 2)) - del x576 - x584 += einsum(x577, (0, 1, 2, 3), (0, 1, 3, 2)) - del x577 - x584 += einsum(x580, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x580 - x584 += einsum(x581, (0, 1, 2, 3), (0, 1, 2, 3)) - del x581 - x584 += einsum(x582, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x582 - x584 += einsum(x583, (0, 1, 2, 3), (1, 0, 3, 2)) - del x583 - l2new_bbbb += einsum(x584, (0, 1, 2, 3), (3, 2, 0, 1)) - l2new_bbbb += einsum(x584, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - del x584 - x585 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x585 += einsum(f.bb.oo, (0, 1), l2.bbbb, (2, 3, 4, 1), (0, 4, 2, 3)) - l2new_bbbb += einsum(x585, (0, 1, 2, 3), (3, 2, 0, 1)) * -2.0 - l2new_bbbb += einsum(x585, (0, 1, 2, 3), (3, 2, 1, 0)) * 2.0 - del x585 - x586 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x586 += einsum(v.bbbb.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x586 += einsum(x25, (0, 1, 2, 3), (1, 3, 2, 0)) - x586 += einsum(x26, (0, 1, 2, 3), (0, 2, 3, 1)) - l2new_bbbb += einsum(l2.bbbb, (0, 1, 2, 3), x586, (3, 4, 5, 2), (0, 1, 5, 4)) * 2.0 - x587 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x587 += einsum(x141, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.3333333333333468 - del x141 - x587 += einsum(x2, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.3333333333333468 - del x2 - x587 += einsum(x142, (0, 1, 2, 3), (0, 1, 3, 2)) - del x142 - l2new_bbbb += einsum(v.bbbb.ovov, (0, 1, 2, 3), x587, (4, 5, 2, 0), (1, 3, 5, 4)) * -5.9999999999997575 - del x587 - x588 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x588 += einsum(v.aabb.ovoo, (0, 1, 2, 3), x91, (2, 3, 4, 5, 6, 7), (4, 5, 0, 6, 7, 1)) - x589 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x589 += einsum(t2.aaaa, (0, 1, 2, 3), x233, (1, 4, 5, 3), (0, 4, 2, 5)) * 2.0000000000000204 - x590 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x590 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x590 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x590 += einsum(x232, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.00000000000001 - x590 += einsum(x589, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x589 - x590 += einsum(x236, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - x591 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x591 += einsum(x590, (0, 1, 2, 3), l3.aaaaaa, (4, 5, 2, 6, 7, 0), (6, 7, 1, 4, 5, 3)) * 6.0 - del x590 - x592 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x592 += einsum(t2.abab, (0, 1, 2, 3), x240, (0, 4, 2, 5), (1, 3, 4, 5)) * 1.00000000000001 - x593 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x593 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x593 += einsum(x238, (0, 1, 2, 3), (0, 1, 2, 3)) - x593 += einsum(x592, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x594 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x594 += einsum(x593, (0, 1, 2, 3), l3.abaaba, (4, 1, 5, 6, 0, 7), (6, 7, 2, 4, 5, 3)) * 2.0 - del x593 - x595 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x595 += einsum(x515, (0, 1, 2, 3), x193, (4, 5, 0, 1, 6, 7), (4, 5, 2, 6, 7, 3)) * 6.0 - del x515 - x596 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x596 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 1, 2, 3)) - x596 += einsum(v.aaaa.ooov, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x597 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x597 += einsum(x596, (0, 1, 2, 3), x193, (4, 5, 0, 1, 6, 7), (4, 5, 2, 6, 7, 3)) * 6.0 - del x596 - x598 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x598 += einsum(x588, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * 2.0 - del x588 - x598 += einsum(x591, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x591 - x598 += einsum(x594, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - del x594 - x598 += einsum(x595, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x595 - x598 += einsum(x597, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x597 - l3new_aaaaaa += einsum(x598, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) - l3new_aaaaaa += einsum(x598, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * -1.0 - l3new_aaaaaa += einsum(x598, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * -1.0 - l3new_aaaaaa += einsum(x598, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) * -1.0 - l3new_aaaaaa += einsum(x598, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) - l3new_aaaaaa += einsum(x598, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) - l3new_aaaaaa += einsum(x598, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 1, 0)) - l3new_aaaaaa += einsum(x598, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) * -1.0 - l3new_aaaaaa += einsum(x598, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) * -1.0 - del x598 - x599 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x599 += einsum(l2.aaaa, (0, 1, 2, 3), x230, (3, 4, 5, 6), (2, 4, 5, 0, 1, 6)) - del x230 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 1, 2)) * 2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) * 2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 1, 2)) * -2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * -2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * -2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) * 2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) * -2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * -2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 0, 2)) * 2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 0, 1)) * 2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 0, 1)) * 2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 0, 1)) * -2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) * 2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * 2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * -2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) * -2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) * -2.0 - l3new_aaaaaa += einsum(x599, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 1, 0)) * 2.0 - del x599 - x600 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x600 += einsum(l2.aaaa, (0, 1, 2, 3), v.aaaa.ovvv, (4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - x601 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x601 += einsum(v.aaaa.ovov, (0, 1, 2, 3), x326, (4, 5, 2, 6), (4, 5, 0, 6, 3, 1)) * 6.0 - del x326 - x602 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x602 += einsum(x600, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 2.0 - del x600 - x602 += einsum(x601, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - del x601 - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 0, 2)) * -1.0 - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) * -1.0 - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 0, 2)) * -1.0 - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) * -1.0 - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 2, 0)) - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -1.0 - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (3, 5, 4, 2, 1, 0)) * -1.0 - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 1, 0)) * -1.0 - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) - l3new_aaaaaa += einsum(x602, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 1, 0)) * -1.0 - del x602 - x603 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x603 += einsum(f.aa.vv, (0, 1), l3.aaaaaa, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - x604 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x604 += einsum(f.aa.ov, (0, 1), x193, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - x605 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x605 += einsum(v.aaaa.vvvv, (0, 1, 2, 3), l3.aaaaaa, (4, 1, 3, 5, 6, 7), (5, 6, 7, 4, 0, 2)) - x606 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x606 += einsum(x603, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -6.0 - del x603 - x606 += einsum(x604, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * 6.0 - del x604 - x606 += einsum(x605, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -6.0 - del x605 - l3new_aaaaaa += einsum(x606, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) - l3new_aaaaaa += einsum(x606, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) - l3new_aaaaaa += einsum(x606, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * -1.0 - del x606 - x607 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x607 += einsum(x462, (0, 1, 2, 3), l3.aaaaaa, (4, 5, 6, 7, 0, 2), (7, 1, 3, 4, 5, 6)) * -6.0 - del x462 - x608 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x608 += einsum(f.aa.oo, (0, 1), (0, 1)) - x608 += einsum(x389, (0, 1), (1, 0)) - del x389 - x609 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x609 += einsum(x608, (0, 1), l3.aaaaaa, (2, 3, 4, 5, 6, 0), (5, 6, 1, 2, 3, 4)) * 6.0 - x610 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x610 += einsum(x607, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 5, 3)) - del x607 - x610 += einsum(x609, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * -1.0 - del x609 - l3new_aaaaaa += einsum(x610, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) - l3new_aaaaaa += einsum(x610, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * -1.0 - l3new_aaaaaa += einsum(x610, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) - del x610 - x611 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x611 += einsum(t2.aaaa, (0, 1, 2, 3), l3.aaaaaa, (4, 2, 3, 5, 6, 7), (5, 6, 7, 0, 1, 4)) - x612 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x612 += einsum(x611, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x611 - x612 += einsum(x325, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x325 - x613 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x613 += einsum(v.aaaa.ovov, (0, 1, 2, 3), x612, (4, 5, 6, 0, 2, 7), (4, 5, 6, 7, 1, 3)) * 6.0 - del x612 - l3new_aaaaaa += einsum(x613, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 2, 0)) * -1.0 - l3new_aaaaaa += einsum(x613, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) - l3new_aaaaaa += einsum(x613, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * -1.0 - del x613 - x614 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x614 += einsum(l2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 3, 5, 6), (2, 4, 5, 0, 1, 6)) - x615 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x615 += einsum(v.aaaa.ovov, (0, 1, 2, 3), x410, (4, 5, 6, 1), (4, 0, 2, 5, 6, 3)) * 2.0 - x616 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x616 += einsum(x614, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -2.0 - del x614 - x616 += einsum(x615, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 3, 5)) - del x615 - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 1, 2)) - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) * -1.0 - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 1, 2)) * -1.0 - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 2, 1)) * -1.0 - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 2, 1)) - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) * -1.0 - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 0, 1)) - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 0, 1)) * -1.0 - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 0, 1)) * -1.0 - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -1.0 - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 1, 0)) * -1.0 - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) - l3new_aaaaaa += einsum(x616, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) - del x616 - x617 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x617 += einsum(x454, (0, 1), l3.aaaaaa, (2, 3, 1, 4, 5, 6), (4, 5, 6, 2, 3, 0)) * 6.0 - x618 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x618 += einsum(x361, (0, 1), x193, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 6, 1)) * 6.0 - x619 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x619 += einsum(x617, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) - del x617 - x619 += einsum(x618, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x618 - l3new_aaaaaa += einsum(x619, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) - l3new_aaaaaa += einsum(x619, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -1.0 - l3new_aaaaaa += einsum(x619, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - del x619 - x620 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x620 += einsum(x413, (0, 1), l3.aaaaaa, (2, 3, 4, 5, 6, 0), (5, 6, 1, 2, 3, 4)) * 6.0 - l3new_aaaaaa += einsum(x620, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - l3new_aaaaaa += einsum(x620, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - l3new_aaaaaa += einsum(x620, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) - del x620 - x621 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x621 += einsum(x253, (0, 1, 2, 3), l3.aaaaaa, (4, 5, 6, 7, 0, 1), (7, 2, 3, 4, 5, 6)) - l3new_aaaaaa += einsum(x621, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 1, 2)) * -6.0 - l3new_aaaaaa += einsum(x621, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * 6.0 - l3new_aaaaaa += einsum(x621, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) * 6.0 - l3new_aaaaaa += einsum(x621, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 0, 1)) * -6.0 - l3new_aaaaaa += einsum(x621, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) * -6.0 - l3new_aaaaaa += einsum(x621, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) * 6.0 - del x621 - x622 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x622 += einsum(x239, (0, 1, 2, 3), l3.abaaba, (4, 1, 5, 6, 0, 7), (6, 7, 2, 4, 5, 3)) - x623 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x623 += einsum(x5, (0, 1, 2, 3), x91, (0, 1, 4, 5, 6, 7), (4, 5, 2, 6, 7, 3)) - x624 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x624 += einsum(x622, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 4.00000000000004 - del x622 - x624 += einsum(x623, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -2.0 - del x623 - l3new_aaaaaa += einsum(x624, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) * -1.0 - l3new_aaaaaa += einsum(x624, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * -1.0 - l3new_aaaaaa += einsum(x624, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 0, 2)) - l3new_aaaaaa += einsum(x624, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) - l3new_aaaaaa += einsum(x624, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) - l3new_aaaaaa += einsum(x624, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * -1.0 - l3new_aaaaaa += einsum(x624, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) * -1.0 - l3new_aaaaaa += einsum(x624, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) * -1.0 - l3new_aaaaaa += einsum(x624, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 1, 0)) - del x624 - x625 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x625 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), x193, (4, 5, 6, 0, 7, 3), (4, 5, 6, 7, 1, 2)) * -1.0 - del x193 - l3new_aaaaaa += einsum(x625, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) * -6.0 - l3new_aaaaaa += einsum(x625, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 2, 0)) * 6.0 - l3new_aaaaaa += einsum(x625, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) * 6.0 - l3new_aaaaaa += einsum(x625, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -6.0 - l3new_aaaaaa += einsum(x625, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -6.0 - l3new_aaaaaa += einsum(x625, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * 6.0 - del x625 - x626 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x626 += einsum(l2.bbbb, (0, 1, 2, 3), v.aabb.ovoo, (4, 5, 6, 3), (2, 6, 0, 1, 4, 5)) - x627 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x627 += einsum(v.aabb.ovov, (0, 1, 2, 3), x116, (4, 5, 6, 3), (4, 2, 5, 6, 0, 1)) - del x116 - x628 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x628 += einsum(v.aabb.vvoo, (0, 1, 2, 3), (2, 3, 0, 1)) - x628 += einsum(x22, (0, 1, 2, 3), (0, 1, 3, 2)) - x628 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.00000000000001 - x629 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x629 += einsum(x628, (0, 1, 2, 3), l3.babbab, (4, 2, 5, 6, 7, 0), (6, 1, 4, 5, 7, 3)) * -2.0 - del x628 - x630 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x630 += einsum(x506, (0, 1, 2, 3), l3.babbab, (4, 5, 6, 7, 2, 0), (7, 1, 4, 6, 3, 5)) * -2.0 - x631 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x631 += einsum(x6, (0, 1, 2, 3), x58, (4, 0, 5, 6, 7, 2), (4, 1, 5, 6, 7, 3)) * 2.0 - x632 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x632 += einsum(t1.bb, (0, 1), x19, (2, 1), (0, 2)) - del x19 - x633 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x633 += einsum(x219, (0, 1), (1, 0)) - del x219 - x633 += einsum(x221, (0, 1), (0, 1)) - del x221 - x633 += einsum(x632, (0, 1), (0, 1)) - del x632 - x633 += einsum(x223, (0, 1), (1, 0)) * -1.0 - del x223 - x634 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x634 += einsum(x633, (0, 1), l3.babbab, (2, 3, 4, 5, 6, 0), (5, 1, 2, 4, 6, 3)) * -2.0 - del x633 - x635 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x635 += einsum(f.bb.oo, (0, 1), (0, 1)) - x635 += einsum(x540, (0, 1), (1, 0)) - del x540 - x636 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x636 += einsum(x635, (0, 1), l3.babbab, (2, 3, 4, 5, 6, 0), (5, 1, 2, 4, 6, 3)) * -2.0 - x637 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x637 += einsum(x626, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * 2.0 - del x626 - x637 += einsum(x627, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * 2.0 - del x627 - x637 += einsum(x629, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x629 - x637 += einsum(x630, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x630 - x637 += einsum(x631, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x631 - x637 += einsum(x634, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x634 - x637 += einsum(x636, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - del x636 - l3new_babbab += einsum(x637, (0, 1, 2, 3, 4, 5), (3, 5, 2, 0, 4, 1)) * -1.0 - l3new_babbab += einsum(x637, (0, 1, 2, 3, 4, 5), (3, 5, 2, 1, 4, 0)) - del x637 - x638 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x638 += einsum(l2.abab, (0, 1, 2, 3), v.bbbb.ovvv, (4, 5, 6, 1), (3, 4, 5, 6, 2, 0)) - x639 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x639 += einsum(l2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 0, 5, 6), (3, 5, 1, 6, 2, 4)) - x640 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x640 += einsum(v.aabb.ooov, (0, 1, 2, 3), x61, (4, 5, 6, 0, 1, 7), (4, 2, 5, 3, 6, 7)) - x641 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x641 += einsum(x7, (0, 1, 2, 3), x61, (4, 5, 2, 6, 3, 7), (4, 0, 5, 1, 6, 7)) * -1.0 - x642 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x642 += einsum(t2.bbbb, (0, 1, 2, 3), x10, (1, 4, 3, 5), (0, 4, 2, 5)) * 2.00000000000002 - x643 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x643 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x643 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x643 += einsum(x9, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.00000000000001 - x643 += einsum(x642, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x642 - x643 += einsum(x13, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - l3new_abaaba += einsum(x643, (0, 1, 2, 3), l3.abaaba, (4, 2, 5, 6, 0, 7), (4, 3, 5, 6, 1, 7)) * 2.0 - x644 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x644 += einsum(x643, (0, 1, 2, 3), l3.babbab, (4, 5, 2, 6, 7, 0), (6, 1, 4, 3, 7, 5)) * 2.0 - del x643 - x645 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x645 += einsum(t2.abab, (0, 1, 2, 3), x10, (1, 4, 3, 5), (4, 5, 0, 2)) * 1.00000000000001 - x646 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x646 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x646 += einsum(x15, (0, 1, 2, 3), (0, 1, 2, 3)) - x646 += einsum(x16, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.00000000000002 - x646 += einsum(x645, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x647 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x647 += einsum(x646, (0, 1, 2, 3), l3.abaaba, (4, 5, 3, 6, 7, 2), (7, 0, 5, 1, 6, 4)) * 2.0 - x648 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x648 += einsum(x516, (0, 1, 2, 3), x74, (4, 0, 1, 5, 6, 7), (4, 2, 5, 3, 6, 7)) * 2.0 - del x516 - x649 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x649 += einsum(x213, (0, 1, 2, 3), x74, (4, 0, 2, 5, 6, 7), (4, 1, 5, 3, 6, 7)) * 2.0 - del x213 - x650 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x650 += einsum(v.bbbb.ovov, (0, 1, 2, 3), x297, (4, 1, 5, 6), (0, 2, 3, 4, 5, 6)) * 2.0 - x651 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x651 += einsum(v.aabb.ovov, (0, 1, 2, 3), x100, (4, 5, 6, 1), (2, 4, 3, 5, 0, 6)) * 2.0 - x652 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x652 += einsum(v.bbbb.ovov, (0, 1, 2, 3), x96, (4, 2, 5, 6), (0, 4, 3, 1, 5, 6)) - del x96 - x653 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x653 += einsum(v.aabb.ovov, (0, 1, 2, 3), x66, (4, 5, 6, 0), (2, 4, 3, 5, 6, 1)) * 2.0 - x654 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x654 += einsum(l2.abab, (0, 1, 2, 3), x537, (3, 4, 5, 6), (4, 5, 1, 6, 2, 0)) - del x537 - x655 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x655 += einsum(l2.abab, (0, 1, 2, 3), x31, (4, 5, 2, 6), (3, 4, 1, 5, 6, 0)) - x656 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x656 += einsum(l1.bb, (0, 1), v.aabb.ovov, (2, 3, 4, 5), (1, 4, 0, 5, 2, 3)) - x656 += einsum(x638, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x638 - x656 += einsum(x639, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x639 - x656 += einsum(x640, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -2.0 - del x640 - x656 += einsum(x641, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -2.0 - del x641 - x656 += einsum(x644, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x644 - x656 += einsum(x647, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x647 - x656 += einsum(x648, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x648 - x656 += einsum(x649, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x649 - x656 += einsum(x650, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - del x650 - x656 += einsum(x651, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x651 - x656 += einsum(x652, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) - del x652 - x656 += einsum(x653, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x653 - x656 += einsum(x654, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x654 - x656 += einsum(x655, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x655 - l3new_babbab += einsum(x656, (0, 1, 2, 3, 4, 5), (2, 5, 3, 0, 4, 1)) - l3new_babbab += einsum(x656, (0, 1, 2, 3, 4, 5), (3, 5, 2, 0, 4, 1)) * -1.0 - l3new_babbab += einsum(x656, (0, 1, 2, 3, 4, 5), (2, 5, 3, 1, 4, 0)) * -1.0 - l3new_babbab += einsum(x656, (0, 1, 2, 3, 4, 5), (3, 5, 2, 1, 4, 0)) - del x656 - x657 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x657 += einsum(l2.bbbb, (0, 1, 2, 3), v.aabb.ovvv, (4, 5, 6, 1), (2, 3, 0, 6, 4, 5)) - x658 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x658 += einsum(f.bb.vv, (0, 1), l3.babbab, (2, 3, 1, 4, 5, 6), (4, 6, 0, 2, 5, 3)) - x659 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x659 += einsum(f.bb.ov, (0, 1), x74, (2, 3, 0, 4, 5, 6), (2, 3, 1, 4, 5, 6)) - x660 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x660 += einsum(v.aabb.vvvv, (0, 1, 2, 3), l3.babbab, (4, 1, 3, 5, 6, 7), (5, 7, 4, 2, 6, 0)) - x661 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x661 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), x74, (4, 5, 0, 3, 6, 7), (4, 5, 1, 2, 6, 7)) * -1.0 - x662 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x662 += einsum(v.aabb.vvov, (0, 1, 2, 3), x74, (4, 5, 2, 6, 7, 1), (4, 5, 6, 3, 7, 0)) - x663 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x663 += einsum(v.aabb.ovvv, (0, 1, 2, 3), x58, (4, 5, 6, 3, 7, 0), (4, 5, 6, 2, 7, 1)) - x664 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x664 += einsum(v.aabb.oovv, (0, 1, 2, 3), (2, 3, 0, 1)) * 0.99999999999999 - x664 += einsum(x246, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.99999999999999 - del x246 - x664 += einsum(x247, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x247 - x665 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x665 += einsum(x664, (0, 1, 2, 3), l3.babbab, (4, 5, 0, 6, 2, 7), (6, 7, 4, 1, 3, 5)) * -2.00000000000002 - x666 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x666 += einsum(x579, (0, 1), l3.babbab, (2, 3, 1, 4, 5, 6), (4, 6, 2, 0, 5, 3)) * -2.0 - x667 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x667 += einsum(x31, (0, 1, 2, 3), x74, (4, 5, 0, 6, 2, 7), (4, 5, 6, 1, 3, 7)) * 2.0 - x668 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x668 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 2, 3, 5, 6, 7), (5, 7, 1, 4, 6, 0)) - x669 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x669 += einsum(x668, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x668 - x669 += einsum(x98, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x98 - x670 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x670 += einsum(v.aabb.ovov, (0, 1, 2, 3), x669, (4, 5, 2, 6, 7, 0), (4, 5, 3, 6, 7, 1)) * 2.0 - del x669 - x671 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x671 += einsum(x227, (0, 1), x74, (2, 3, 0, 4, 5, 6), (2, 3, 4, 1, 5, 6)) * 2.0 - x672 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x672 += einsum(v.aabb.ovov, (0, 1, 2, 3), x78, (4, 5, 2, 6), (4, 5, 3, 6, 0, 1)) * 2.0 - del x78 - x673 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x673 += einsum(l1.aa, (0, 1), v.bbbb.ovov, (2, 3, 4, 5), (2, 4, 3, 5, 1, 0)) * -1.0 - x673 += einsum(x657, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * 2.0 - del x657 - x673 += einsum(x658, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -2.0 - del x658 - x673 += einsum(x659, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * 2.0 - del x659 - x673 += einsum(x660, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * 2.0 - del x660 - x673 += einsum(x661, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -2.0 - del x661 - x673 += einsum(x662, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -2.0 - del x662 - x673 += einsum(x663, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -2.0 - del x663 - x673 += einsum(x665, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x665 - x673 += einsum(x666, (0, 1, 2, 3, 4, 5), (1, 0, 3, 2, 4, 5)) * -1.0 - del x666 - x673 += einsum(x667, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x667 - x673 += einsum(x670, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x670 - x673 += einsum(x671, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x671 - x673 += einsum(x672, (0, 1, 2, 3, 4, 5), (1, 0, 2, 3, 4, 5)) * -1.0 - del x672 - l3new_babbab += einsum(x673, (0, 1, 2, 3, 4, 5), (3, 5, 2, 0, 4, 1)) - l3new_babbab += einsum(x673, (0, 1, 2, 3, 4, 5), (2, 5, 3, 0, 4, 1)) * -1.0 - del x673 - x674 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x674 += einsum(l2.bbbb, (0, 1, 2, 3), x5, (3, 4, 5, 6), (2, 4, 0, 1, 5, 6)) - x675 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x675 += einsum(v.aabb.ovov, (0, 1, 2, 3), x0, (4, 5, 6, 3), (4, 2, 5, 6, 0, 1)) * -1.0 - del x0 - x676 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x676 += einsum(t1.bb, (0, 1), x20, (2, 1), (0, 2)) * -1.0 - del x20 - x677 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x677 += einsum(x220, (0, 1), (0, 1)) * 2.0 - del x220 - x677 += einsum(x676, (0, 1), (0, 1)) - del x676 - x678 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x678 += einsum(x677, (0, 1), l3.babbab, (2, 3, 4, 5, 6, 0), (5, 1, 2, 4, 6, 3)) * -2.0 - del x677 - x679 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x679 += einsum(x674, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 2.0 - del x674 - x679 += einsum(x675, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * 6.0 - del x675 - x679 += einsum(x678, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x678 - l3new_babbab += einsum(x679, (0, 1, 2, 3, 4, 5), (3, 5, 2, 0, 4, 1)) - l3new_babbab += einsum(x679, (0, 1, 2, 3, 4, 5), (3, 5, 2, 1, 4, 0)) * -1.0 - del x679 - x680 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x680 += einsum(t2.aaaa, (0, 1, 2, 3), x233, (1, 4, 5, 3), (0, 4, 2, 5)) * 2.00000000000002 - del x233 - x681 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x681 += einsum(v.aaaa.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x681 += einsum(v.aaaa.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x681 += einsum(x232, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.00000000000001 - del x232 - x681 += einsum(x680, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x680 - x681 += einsum(x236, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x236 - l3new_babbab += einsum(x681, (0, 1, 2, 3), l3.babbab, (4, 2, 5, 6, 0, 7), (4, 3, 5, 6, 1, 7)) * 2.0 - x682 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x682 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) * 0.4999999999999949 - x682 += einsum(x238, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.4999999999999949 - x682 += einsum(x239, (0, 1, 2, 3), (0, 1, 2, 3)) - x682 += einsum(t2.abab, (0, 1, 2, 3), x240, (0, 4, 2, 5), (1, 3, 4, 5)) * -0.49999999999999983 - del x240 - l3new_babbab += einsum(x682, (0, 1, 2, 3), l3.bbbbbb, (4, 5, 1, 6, 7, 0), (4, 3, 5, 6, 2, 7)) * 12.000000000000123 - del x682 - x683 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x683 += einsum(v.bbbb.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x683 += einsum(x25, (0, 1, 2, 3), (1, 3, 0, 2)) - del x25 - x683 += einsum(x26, (0, 1, 2, 3), (0, 2, 1, 3)) - del x26 - x683 += einsum(x27, (0, 1, 2, 3), (2, 1, 0, 3)) - x683 += einsum(x27, (0, 1, 2, 3), (2, 3, 0, 1)) * -1.0 - l3new_babbab += einsum(x683, (0, 1, 2, 3), l3.babbab, (4, 5, 6, 2, 7, 0), (4, 5, 6, 1, 7, 3)) * -2.0 - del x683 - x684 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x684 += einsum(t2.bbbb, (0, 1, 2, 3), l3.babbab, (2, 4, 3, 5, 6, 7), (5, 7, 0, 1, 6, 4)) - x684 += einsum(x134, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x134 - l3new_babbab += einsum(v.bbbb.ovov, (0, 1, 2, 3), x684, (4, 5, 2, 0, 6, 7), (1, 7, 3, 5, 6, 4)) * 2.0 - del x684 - x685 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x685 += einsum(l2.aaaa, (0, 1, 2, 3), v.aabb.vvov, (4, 1, 5, 6), (5, 6, 2, 3, 0, 4)) - x686 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x686 += einsum(f.aa.vv, (0, 1), l3.abaaba, (2, 3, 1, 4, 5, 6), (5, 3, 4, 6, 0, 2)) - x687 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x687 += einsum(f.aa.ov, (0, 1), x61, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) - x688 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x688 += einsum(v.aabb.vvvv, (0, 1, 2, 3), l3.abaaba, (4, 3, 1, 5, 6, 7), (6, 2, 5, 7, 4, 0)) - x689 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x689 += einsum(v.aabb.vvov, (0, 1, 2, 3), x91, (4, 2, 5, 6, 7, 1), (4, 3, 5, 6, 7, 0)) - x690 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x690 += einsum(v.aaaa.ovvv, (0, 1, 2, 3), x61, (4, 5, 6, 7, 0, 3), (4, 5, 6, 7, 1, 2)) * -1.0 - x691 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x691 += einsum(v.aabb.ovvv, (0, 1, 2, 3), x61, (4, 3, 5, 6, 0, 7), (4, 2, 5, 6, 7, 1)) - x692 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x692 += einsum(v.aabb.vvoo, (0, 1, 2, 3), (2, 3, 0, 1)) * 0.99999999999999 - x692 += einsum(x22, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.99999999999999 - del x22 - x692 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x23 - x693 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x693 += einsum(x692, (0, 1, 2, 3), l3.abaaba, (4, 5, 2, 6, 0, 7), (1, 5, 6, 7, 4, 3)) * -2.00000000000002 - del x692 - x694 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x694 += einsum(x454, (0, 1), l3.abaaba, (2, 3, 1, 4, 5, 6), (5, 3, 4, 6, 2, 0)) * -2.0 - del x454 - x695 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x695 += einsum(x6, (0, 1, 2, 3), x61, (0, 4, 5, 6, 2, 7), (1, 4, 5, 6, 7, 3)) * 2.0 - x696 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x696 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 3, 2, 5, 6, 7), (6, 1, 5, 7, 0, 4)) - x697 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x697 += einsum(x696, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x696 - x697 += einsum(x99, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x99 - x698 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x698 += einsum(v.aabb.ovov, (0, 1, 2, 3), x697, (4, 2, 5, 6, 0, 7), (4, 3, 5, 6, 1, 7)) * 2.0 - del x697 - x699 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x699 += einsum(x361, (0, 1), x61, (2, 3, 4, 5, 0, 6), (2, 3, 4, 5, 6, 1)) * 2.0 - del x361 - x700 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x700 += einsum(v.aabb.ovov, (0, 1, 2, 3), x289, (4, 5, 0, 6), (2, 3, 4, 5, 1, 6)) * 2.0 - del x289 - x701 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x701 += einsum(l1.bb, (0, 1), v.aaaa.ovov, (2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) * -1.0 - x701 += einsum(x685, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -2.0 - del x685 - x701 += einsum(x686, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * 2.0 - del x686 - x701 += einsum(x687, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -2.0 - del x687 - x701 += einsum(x688, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -2.0 - del x688 - x701 += einsum(x689, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * 2.0 - del x689 - x701 += einsum(x690, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * 2.0 - del x690 - x701 += einsum(x691, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * 2.0 - del x691 - x701 += einsum(x693, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x693 - x701 += einsum(x694, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x694 - x701 += einsum(x695, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x695 - x701 += einsum(x698, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x698 - x701 += einsum(x699, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x699 - x701 += einsum(x700, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0 - del x700 - l3new_abaaba += einsum(x701, (0, 1, 2, 3, 4, 5), (5, 1, 4, 2, 0, 3)) - l3new_abaaba += einsum(x701, (0, 1, 2, 3, 4, 5), (4, 1, 5, 2, 0, 3)) * -1.0 - del x701 - x702 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x702 += einsum(l2.aaaa, (0, 1, 2, 3), v.aabb.ooov, (4, 3, 5, 6), (5, 6, 2, 4, 0, 1)) - x703 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x703 += einsum(x664, (0, 1, 2, 3), l3.abaaba, (4, 0, 5, 6, 7, 2), (7, 1, 6, 3, 4, 5)) * -2.00000000000002 - del x664 - x704 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x704 += einsum(x506, (0, 1, 2, 3), l3.abaaba, (4, 5, 6, 7, 0, 2), (1, 5, 7, 3, 4, 6)) * -2.0 - del x506 - x705 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x705 += einsum(x31, (0, 1, 2, 3), x91, (4, 0, 2, 5, 6, 7), (4, 1, 5, 3, 6, 7)) * 2.0 - del x31, x91 - x706 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x706 += einsum(x413, (0, 1), l3.abaaba, (2, 3, 4, 5, 6, 0), (6, 3, 5, 1, 2, 4)) * -2.0 - del x413 - x707 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x707 += einsum(v.aabb.ovov, (0, 1, 2, 3), x410, (4, 5, 6, 1), (2, 3, 0, 4, 5, 6)) * 2.0 - del x410 - x708 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x708 += einsum(x608, (0, 1), l3.abaaba, (2, 3, 4, 5, 6, 0), (6, 3, 5, 1, 2, 4)) * -2.0 - del x608 - x709 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x709 += einsum(x702, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * 2.0 - del x702 - x709 += einsum(x703, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - del x703 - x709 += einsum(x704, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - del x704 - x709 += einsum(x705, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - del x705 - x709 += einsum(x706, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -1.0 - del x706 - x709 += einsum(x707, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x707 - x709 += einsum(x708, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x708 - l3new_abaaba += einsum(x709, (0, 1, 2, 3, 4, 5), (5, 1, 4, 2, 0, 3)) * -1.0 - l3new_abaaba += einsum(x709, (0, 1, 2, 3, 4, 5), (5, 1, 4, 3, 0, 2)) - del x709 - x710 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x710 += einsum(l2.abab, (0, 1, 2, 3), v.aabb.ovvv, (4, 5, 6, 1), (3, 6, 2, 4, 0, 5)) - x711 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x711 += einsum(l2.abab, (0, 1, 2, 3), v.aaaa.ovvv, (4, 5, 6, 0), (3, 1, 2, 4, 5, 6)) - x712 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x712 += einsum(v.aabb.ovoo, (0, 1, 2, 3), x74, (4, 2, 3, 5, 6, 7), (4, 5, 6, 0, 7, 1)) - x713 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x713 += einsum(x5, (0, 1, 2, 3), x74, (0, 4, 1, 5, 6, 7), (4, 5, 6, 2, 7, 3)) * -1.0 - del x5, x74 - x714 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x714 += einsum(x681, (0, 1, 2, 3), l3.abaaba, (4, 5, 2, 6, 7, 0), (7, 5, 6, 1, 4, 3)) * 2.0 - del x681 - x715 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x715 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x715 += einsum(x238, (0, 1, 2, 3), (0, 1, 2, 3)) - del x238 - x715 += einsum(x239, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.00000000000002 - del x239 - x715 += einsum(x592, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x592 - x716 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x716 += einsum(x715, (0, 1, 2, 3), l3.babbab, (4, 5, 1, 6, 7, 0), (6, 4, 7, 2, 5, 3)) * 2.0 - del x715 - x717 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x717 += einsum(x382, (0, 1, 2, 3), x61, (4, 5, 0, 6, 2, 7), (4, 5, 6, 1, 7, 3)) * 2.0 - del x382 - x718 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x718 += einsum(x348, (0, 1, 2, 3), x61, (4, 5, 0, 6, 2, 7), (4, 5, 6, 1, 7, 3)) * 2.0 - del x61, x348 - x719 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x719 += einsum(v.aabb.ovov, (0, 1, 2, 3), x297, (4, 3, 5, 6), (2, 4, 0, 5, 1, 6)) * 2.0 - del x297 - x720 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x720 += einsum(v.aaaa.ovov, (0, 1, 2, 3), x100, (4, 5, 6, 1), (4, 5, 0, 2, 6, 3)) * 2.0 - del x100 - x721 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x721 += einsum(v.aabb.ovov, (0, 1, 2, 3), x139, (4, 2, 5, 6), (4, 3, 0, 5, 1, 6)) * 2.0 - del x139 - x722 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x722 += einsum(v.aaaa.ovov, (0, 1, 2, 3), x66, (4, 5, 6, 2), (4, 5, 6, 0, 3, 1)) * 2.0 - del x66 - x723 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x723 += einsum(l2.abab, (0, 1, 2, 3), x6, (3, 4, 5, 6), (4, 1, 2, 5, 0, 6)) - del x6 - x724 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x724 += einsum(l2.abab, (0, 1, 2, 3), x386, (2, 4, 5, 6), (3, 1, 4, 5, 0, 6)) - del x386 - x725 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x725 += einsum(l1.aa, (0, 1), v.aabb.ovov, (2, 3, 4, 5), (4, 5, 1, 2, 0, 3)) - x725 += einsum(x710, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x710 - x725 += einsum(x711, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x711 - x725 += einsum(x712, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -2.0 - del x712 - x725 += einsum(x713, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -2.0 - del x713 - x725 += einsum(x714, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x714 - x725 += einsum(x716, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x716 - x725 += einsum(x717, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x717 - x725 += einsum(x718, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x718 - x725 += einsum(x719, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x719 - x725 += einsum(x720, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) - del x720 - x725 += einsum(x721, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * -1.0 - del x721 - x725 += einsum(x722, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) - del x722 - x725 += einsum(x723, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * -1.0 - del x723 - x725 += einsum(x724, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x724 - l3new_abaaba += einsum(x725, (0, 1, 2, 3, 4, 5), (4, 1, 5, 2, 0, 3)) - l3new_abaaba += einsum(x725, (0, 1, 2, 3, 4, 5), (5, 1, 4, 2, 0, 3)) * -1.0 - l3new_abaaba += einsum(x725, (0, 1, 2, 3, 4, 5), (4, 1, 5, 3, 0, 2)) * -1.0 - l3new_abaaba += einsum(x725, (0, 1, 2, 3, 4, 5), (5, 1, 4, 3, 0, 2)) - del x725 - x726 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x726 += einsum(l2.aaaa, (0, 1, 2, 3), x7, (4, 5, 3, 6), (4, 5, 2, 6, 0, 1)) - l3new_abaaba += einsum(x726, (0, 1, 2, 3, 4, 5), (5, 1, 4, 2, 0, 3)) * 2.0 - l3new_abaaba += einsum(x726, (0, 1, 2, 3, 4, 5), (5, 1, 4, 3, 0, 2)) * -2.0 - del x726 - x727 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x727 += einsum(v.aabb.ovov, (0, 1, 2, 3), (2, 3, 0, 1)) - x727 += einsum(x15, (0, 1, 2, 3), (0, 1, 2, 3)) - del x15 - x727 += einsum(x16, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0000000000000204 - del x16 - x727 += einsum(x645, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x645 - l3new_abaaba += einsum(x727, (0, 1, 2, 3), l3.aaaaaa, (4, 5, 3, 6, 7, 2), (4, 1, 5, 6, 0, 7)) * 6.0 - del x727 - x728 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x728 += einsum(v.aaaa.oooo, (0, 1, 2, 3), (0, 1, 2, 3)) - x728 += einsum(x251, (0, 1, 2, 3), (1, 3, 2, 0)) - del x251 - x728 += einsum(x252, (0, 1, 2, 3), (0, 2, 3, 1)) - del x252 - x728 += einsum(x253, (0, 1, 2, 3), (2, 1, 3, 0)) - x728 += einsum(x253, (0, 1, 2, 3), (2, 3, 1, 0)) * -1.0 - del x253 - l3new_abaaba += einsum(x728, (0, 1, 2, 3), l3.abaaba, (4, 5, 6, 3, 7, 0), (4, 5, 6, 2, 7, 1)) * 2.0 - del x728 - x729 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x729 += einsum(t2.aaaa, (0, 1, 2, 3), l3.abaaba, (2, 4, 3, 5, 6, 7), (6, 4, 5, 7, 0, 1)) - x729 += einsum(x323, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) - del x323 - l3new_abaaba += einsum(v.aaaa.ovov, (0, 1, 2, 3), x729, (4, 5, 6, 7, 2, 0), (1, 5, 3, 7, 4, 6)) * 2.0 - del x729 - x730 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x730 += einsum(v.aabb.ooov, (0, 1, 2, 3), x58, (4, 5, 6, 7, 0, 1), (4, 5, 2, 6, 7, 3)) - x731 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x731 += einsum(x7, (0, 1, 2, 3), x58, (4, 5, 6, 7, 2, 3), (4, 5, 0, 6, 7, 1)) - del x7, x58 - x732 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x732 += einsum(t2.bbbb, (0, 1, 2, 3), x10, (1, 4, 3, 5), (0, 4, 2, 5)) * 2.0000000000000204 - del x10 - x733 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x733 += einsum(v.bbbb.ovov, (0, 1, 2, 3), (0, 2, 1, 3)) - x733 += einsum(v.bbbb.oovv, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - x733 += einsum(x9, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.00000000000001 - del x9 - x733 += einsum(x732, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x732 - x733 += einsum(x13, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x13 - x734 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x734 += einsum(x733, (0, 1, 2, 3), l3.bbbbbb, (4, 5, 2, 6, 7, 0), (6, 7, 1, 4, 5, 3)) * 6.0 - del x733 - x735 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x735 += einsum(x646, (0, 1, 2, 3), l3.babbab, (4, 3, 5, 6, 2, 7), (6, 7, 0, 4, 5, 1)) * 2.0 - del x646 - x736 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x736 += einsum(x3, (0, 1, 2, 3), (0, 1, 2, 3)) - x736 += einsum(x3, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x737 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x737 += einsum(x736, (0, 1, 2, 3), x72, (4, 5, 0, 2, 6, 7), (4, 5, 1, 6, 7, 3)) * 6.0 - del x736 - x738 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x738 += einsum(x208, (0, 1, 2, 3), x72, (4, 5, 0, 1, 6, 7), (4, 5, 2, 6, 7, 3)) * 6.0 - del x208 - x739 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x739 += einsum(x730, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * 2.0 - del x730 - x739 += einsum(x731, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * 2.0 - del x731 - x739 += einsum(x734, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) - del x734 - x739 += einsum(x735, (0, 1, 2, 3, 4, 5), (1, 0, 2, 4, 3, 5)) - del x735 - x739 += einsum(x737, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x737 - x739 += einsum(x738, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) - del x738 - l3new_bbbbbb += einsum(x739, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) - l3new_bbbbbb += einsum(x739, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * -1.0 - l3new_bbbbbb += einsum(x739, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) * -1.0 - l3new_bbbbbb += einsum(x739, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) * -1.0 - l3new_bbbbbb += einsum(x739, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) - l3new_bbbbbb += einsum(x739, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) - l3new_bbbbbb += einsum(x739, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 1, 0)) - l3new_bbbbbb += einsum(x739, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) * -1.0 - l3new_bbbbbb += einsum(x739, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) * -1.0 - del x739 - x740 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x740 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), x72, (4, 5, 6, 0, 7, 3), (4, 5, 6, 7, 1, 2)) * -1.0 - l3new_bbbbbb += einsum(x740, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) * -6.0 - l3new_bbbbbb += einsum(x740, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 2, 0)) * 6.0 - l3new_bbbbbb += einsum(x740, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) * 6.0 - l3new_bbbbbb += einsum(x740, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -6.0 - l3new_bbbbbb += einsum(x740, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -6.0 - l3new_bbbbbb += einsum(x740, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * 6.0 - del x740 - x741 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x741 += einsum(x579, (0, 1), l3.bbbbbb, (2, 3, 1, 4, 5, 6), (4, 5, 6, 2, 3, 0)) * 6.0 - del x579 - x742 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x742 += einsum(x227, (0, 1), x72, (2, 3, 4, 0, 5, 6), (2, 3, 4, 5, 6, 1)) * 6.0 - del x227 - x743 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x743 += einsum(x741, (0, 1, 2, 3, 4, 5), (1, 2, 0, 3, 4, 5)) - del x741 - x743 += einsum(x742, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x742 - l3new_bbbbbb += einsum(x743, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) - l3new_bbbbbb += einsum(x743, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -1.0 - l3new_bbbbbb += einsum(x743, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - del x743 - x744 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x744 += einsum(x586, (0, 1, 2, 3), l3.bbbbbb, (4, 5, 6, 7, 0, 3), (7, 1, 2, 4, 5, 6)) * -6.0 - del x586 - x745 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x745 += einsum(x635, (0, 1), l3.bbbbbb, (2, 3, 4, 5, 6, 0), (5, 6, 1, 2, 3, 4)) * 6.0 - del x635 - x746 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x746 += einsum(x744, (0, 1, 2, 3, 4, 5), (0, 2, 1, 4, 5, 3)) - del x744 - x746 += einsum(x745, (0, 1, 2, 3, 4, 5), (2, 0, 1, 4, 5, 3)) * -1.0 - del x745 - l3new_bbbbbb += einsum(x746, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) - l3new_bbbbbb += einsum(x746, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * -1.0 - l3new_bbbbbb += einsum(x746, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) - del x746 - x747 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x747 += einsum(l2.bbbb, (0, 1, 2, 3), x3, (3, 4, 5, 6), (2, 4, 5, 0, 1, 6)) - del x3 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 1, 2)) * 2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) * 2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 1, 2)) * -2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * -2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) * -2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (5, 4, 3, 0, 2, 1)) * 2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) * -2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) * -2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 0, 2)) * 2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 0, 1)) * 2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 0, 1)) * 2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 0, 1)) * -2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) * 2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * 2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * -2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) * -2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) * -2.0 - l3new_bbbbbb += einsum(x747, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 1, 0)) * 2.0 - del x747 - x748 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x748 += einsum(l2.bbbb, (0, 1, 2, 3), v.bbbb.ovvv, (4, 5, 6, 1), (2, 3, 4, 0, 5, 6)) - x749 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x749 += einsum(v.bbbb.ovov, (0, 1, 2, 3), x137, (4, 5, 2, 6), (0, 4, 5, 3, 1, 6)) * 2.0 - del x137 - x750 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x750 += einsum(x748, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 2.0 - del x748 - x750 += einsum(x749, (0, 1, 2, 3, 4, 5), (1, 2, 0, 5, 4, 3)) * -1.0 - del x749 - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 0, 2)) * -1.0 - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) * -1.0 - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 0, 2)) * -1.0 - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) * -1.0 - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (3, 5, 4, 1, 2, 0)) - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -1.0 - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (3, 5, 4, 2, 1, 0)) * -1.0 - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 1, 0)) * -1.0 - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) - l3new_bbbbbb += einsum(x750, (0, 1, 2, 3, 4, 5), (5, 4, 3, 2, 1, 0)) * -1.0 - del x750 - x751 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x751 += einsum(f.bb.vv, (0, 1), l3.bbbbbb, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - x752 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x752 += einsum(f.bb.ov, (0, 1), x72, (2, 3, 4, 0, 5, 6), (2, 3, 4, 1, 5, 6)) - del x72 - x753 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x753 += einsum(v.bbbb.vvvv, (0, 1, 2, 3), l3.bbbbbb, (4, 3, 1, 5, 6, 7), (5, 6, 7, 4, 0, 2)) * -1.0 - x754 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x754 += einsum(x751, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -6.0 - del x751 - x754 += einsum(x752, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * 6.0 - del x752 - x754 += einsum(x753, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 5, 4)) * -6.0 - del x753 - l3new_bbbbbb += einsum(x754, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) - l3new_bbbbbb += einsum(x754, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) - l3new_bbbbbb += einsum(x754, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * -1.0 - del x754 - x755 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x755 += einsum(x27, (0, 1, 2, 3), l3.bbbbbb, (4, 5, 6, 7, 0, 1), (7, 2, 3, 4, 5, 6)) - del x27 - l3new_bbbbbb += einsum(x755, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 1, 2)) * -6.0 - l3new_bbbbbb += einsum(x755, (0, 1, 2, 3, 4, 5), (3, 4, 5, 0, 2, 1)) * 6.0 - l3new_bbbbbb += einsum(x755, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 0, 2)) * 6.0 - l3new_bbbbbb += einsum(x755, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 0, 1)) * -6.0 - l3new_bbbbbb += einsum(x755, (0, 1, 2, 3, 4, 5), (3, 4, 5, 1, 2, 0)) * -6.0 - l3new_bbbbbb += einsum(x755, (0, 1, 2, 3, 4, 5), (3, 4, 5, 2, 1, 0)) * 6.0 - del x755 - x756 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x756 += einsum(x560, (0, 1), l3.bbbbbb, (2, 3, 4, 5, 6, 0), (5, 6, 1, 2, 3, 4)) * 6.0 - del x560 - l3new_bbbbbb += einsum(x756, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - l3new_bbbbbb += einsum(x756, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - l3new_bbbbbb += einsum(x756, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) - del x756 - x757 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x757 += einsum(l2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 3, 5, 6), (2, 4, 5, 0, 1, 6)) - x758 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x758 += einsum(v.bbbb.ovov, (0, 1, 2, 3), x136, (4, 5, 6, 1), (0, 2, 4, 3, 5, 6)) * 6.0 - del x136 - x759 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x759 += einsum(x757, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -2.0 - del x757 - x759 += einsum(x758, (0, 1, 2, 3, 4, 5), (2, 1, 0, 5, 4, 3)) - del x758 - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 1, 2)) - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 1, 2)) * -1.0 - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 1, 2)) * -1.0 - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 3, 5, 0, 2, 1)) * -1.0 - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 5, 3, 0, 2, 1)) - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (5, 3, 4, 0, 2, 1)) - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 0, 2)) * -1.0 - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 0, 2)) - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 0, 2)) - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 0, 1)) - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 0, 1)) * -1.0 - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 0, 1)) * -1.0 - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) * -1.0 - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (5, 3, 4, 1, 2, 0)) * -1.0 - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 3, 5, 2, 1, 0)) * -1.0 - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (4, 5, 3, 2, 1, 0)) - l3new_bbbbbb += einsum(x759, (0, 1, 2, 3, 4, 5), (5, 3, 4, 2, 1, 0)) - del x759 - x760 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x760 += einsum(t2.bbbb, (0, 1, 2, 3), l3.bbbbbb, (4, 2, 3, 5, 6, 7), (5, 6, 7, 0, 1, 4)) - x761 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x761 += einsum(x760, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x760 - x761 += einsum(x132, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0 - del x132 - x762 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x762 += einsum(v.bbbb.ovov, (0, 1, 2, 3), x761, (4, 5, 6, 0, 2, 7), (4, 5, 6, 1, 3, 7)) * 6.0 - del x761 - l3new_bbbbbb += einsum(x762, (0, 1, 2, 3, 4, 5), (5, 4, 3, 1, 2, 0)) * -1.0 - l3new_bbbbbb += einsum(x762, (0, 1, 2, 3, 4, 5), (4, 5, 3, 1, 2, 0)) - l3new_bbbbbb += einsum(x762, (0, 1, 2, 3, 4, 5), (4, 3, 5, 1, 2, 0)) * -1.0 - del x762 - - l1new.aa = l1new_aa - l1new.bb = l1new_bb - l2new.aaaa = l2new_aaaa - l2new.abab = l2new_abab - l2new.bbbb = l2new_bbbb - l3new.aaaaaa = l3new_aaaaaa - l3new.abaaba = l3new_abaaba - l3new.babbab = l3new_babbab - l3new.bbbbbb = l3new_bbbbbb - - return {"l1new": l1new, "l2new": l2new, "l3new": l3new} - -def make_rdm1_f(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, l1=None, l2=None, l3=None, **kwargs): - rdm1_f = Namespace() - - delta = Namespace(aa=Namespace(), bb=Namespace()) - delta.aa = Namespace(oo=np.eye(nocc[0]), vv=np.eye(nvir[0])) - delta.bb = Namespace(oo=np.eye(nocc[1]), vv=np.eye(nvir[1])) - - # RDM1 - rdm1_f_aa_oo = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - rdm1_f_aa_oo += einsum(delta.aa.oo, (0, 1), (0, 1)) - rdm1_f_bb_oo = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - rdm1_f_bb_oo += einsum(delta.bb.oo, (0, 1), (0, 1)) - rdm1_f_aa_ov = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - rdm1_f_aa_ov += einsum(l1.bb, (0, 1), t2.abab, (2, 1, 3, 0), (2, 3)) - rdm1_f_aa_ov += einsum(l2.abab, (0, 1, 2, 3), t3.abaaba, (4, 3, 2, 5, 1, 0), (4, 5)) * 2.0 - rdm1_f_aa_ov += einsum(l2.aaaa, (0, 1, 2, 3), t3.aaaaaa, (4, 2, 3, 5, 0, 1), (4, 5)) * 3.0 - rdm1_f_aa_ov += einsum(t1.aa, (0, 1), (0, 1)) - rdm1_f_aa_ov += einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) * 2.0 - rdm1_f_aa_ov += einsum(l2.bbbb, (0, 1, 2, 3), t3.babbab, (2, 4, 3, 0, 5, 1), (4, 5)) - rdm1_f_bb_ov = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - rdm1_f_bb_ov += einsum(t1.bb, (0, 1), (0, 1)) - rdm1_f_bb_ov += einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) * 2.0 - rdm1_f_bb_ov += einsum(l2.abab, (0, 1, 2, 3), t3.babbab, (4, 2, 3, 5, 0, 1), (4, 5)) * 2.0 - rdm1_f_bb_ov += einsum(l1.aa, (0, 1), t2.abab, (1, 2, 0, 3), (2, 3)) - rdm1_f_bb_ov += einsum(l2.bbbb, (0, 1, 2, 3), t3.bbbbbb, (4, 2, 3, 5, 0, 1), (4, 5)) * 3.0 - rdm1_f_bb_ov += einsum(l2.aaaa, (0, 1, 2, 3), t3.abaaba, (2, 4, 3, 0, 5, 1), (4, 5)) - rdm1_f_aa_vo = np.zeros((nvir[0], nocc[0]), dtype=types[float]) - rdm1_f_aa_vo += einsum(l1.aa, (0, 1), (0, 1)) - rdm1_f_bb_vo = np.zeros((nvir[1], nocc[1]), dtype=types[float]) - rdm1_f_bb_vo += einsum(l1.bb, (0, 1), (0, 1)) - rdm1_f_aa_vv = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - rdm1_f_aa_vv += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 4, 5, 0, 6, 2), (1, 6)) * 0.9999999999999601 - rdm1_f_aa_vv += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - rdm1_f_aa_vv += einsum(l1.aa, (0, 1), t1.aa, (1, 2), (0, 2)) - rdm1_f_aa_vv += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 4, 5, 6, 1, 2), (0, 6)) * 1.9999999999999194 - rdm1_f_aa_vv += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (3, 4, 5, 6, 1, 2), (0, 6)) * 2.9999999999998788 - rdm1_f_aa_vv += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) * 2.0 - rdm1_f_bb_vv = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - rdm1_f_bb_vv += einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - rdm1_f_bb_vv += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 4, 5, 6, 1, 2), (0, 6)) * 1.9999999999999194 - rdm1_f_bb_vv += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - rdm1_f_bb_vv += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 4, 5, 0, 6, 2), (1, 6)) * 0.9999999999999601 - rdm1_f_bb_vv += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) * 2.0 - rdm1_f_bb_vv += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (3, 4, 5, 6, 1, 2), (0, 6)) * 2.9999999999998788 - x0 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x0 += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (6, 4, 5, 0, 1, 2), (3, 6)) - rdm1_f_aa_oo += einsum(x0, (0, 1), (1, 0)) * -2.9999999999998788 - x1 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x1 += einsum(l1.aa, (0, 1), t1.aa, (2, 0), (1, 2)) - rdm1_f_aa_oo += einsum(x1, (0, 1), (1, 0)) * -1.0 - x2 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x2 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - rdm1_f_aa_oo += einsum(x2, (0, 1), (1, 0)) * -1.0 - x3 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x3 += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (2, 4)) - rdm1_f_aa_oo += einsum(x3, (0, 1), (1, 0)) * -2.0 - x4 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x4 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 4, 5, 0, 1, 2), (3, 6)) - rdm1_f_aa_oo += einsum(x4, (0, 1), (1, 0)) * -1.9999999999999194 - x5 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x5 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 6, 5, 0, 1, 2), (4, 6)) - rdm1_f_aa_oo += einsum(x5, (0, 1), (1, 0)) * -0.9999999999999601 - x6 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x6 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 6, 5, 0, 1, 2), (4, 6)) - rdm1_f_bb_oo += einsum(x6, (0, 1), (1, 0)) * -0.9999999999999601 - x7 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x7 += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 0, 1), (2, 4)) - rdm1_f_bb_oo += einsum(x7, (0, 1), (1, 0)) * -2.0 - x8 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x8 += einsum(l1.bb, (0, 1), t1.bb, (2, 0), (1, 2)) - rdm1_f_bb_oo += einsum(x8, (0, 1), (1, 0)) * -1.0 - x9 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x9 += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (6, 4, 5, 0, 1, 2), (3, 6)) - rdm1_f_bb_oo += einsum(x9, (0, 1), (1, 0)) * -2.9999999999998788 - x10 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x10 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 4, 5, 0, 1, 2), (3, 6)) - rdm1_f_bb_oo += einsum(x10, (0, 1), (1, 0)) * -1.9999999999999194 - x11 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x11 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - rdm1_f_bb_oo += einsum(x11, (0, 1), (1, 0)) * -1.0 - x12 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x12 += einsum(t1.aa, (0, 1), l3.aaaaaa, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - rdm1_f_aa_ov += einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), x12, (0, 1, 2, 6, 4, 5), (6, 3)) * -2.9999999999998788 - del x12 - x13 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x13 += einsum(t1.aa, (0, 1), l3.babbab, (2, 1, 3, 4, 5, 6), (4, 6, 2, 3, 5, 0)) - rdm1_f_aa_ov += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x13, (0, 2, 5, 3, 1, 6), (6, 4)) * 0.9999999999999601 - del x13 - x14 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x14 += einsum(t1.aa, (0, 1), l3.abaaba, (2, 3, 1, 4, 5, 6), (5, 3, 4, 6, 0, 2)) - rdm1_f_aa_ov += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x14, (1, 4, 2, 0, 6, 5), (6, 3)) * -1.9999999999999194 - del x14 - x15 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x15 += einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - x15 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 3, 2, 5, 1, 6), (5, 6, 0, 4)) - x15 += einsum(t2.aaaa, (0, 1, 2, 3), l3.aaaaaa, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) * 3.0 - rdm1_f_aa_ov += einsum(t2.aaaa, (0, 1, 2, 3), x15, (0, 1, 4, 3), (4, 2)) * 2.0 - del x15 - x16 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x16 += einsum(t1.aa, (0, 1), l2.abab, (1, 2, 3, 4), (4, 2, 3, 0)) * 0.5 - x16 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 2, 3, 5, 6, 1), (5, 4, 6, 0)) - x16 += einsum(t2.aaaa, (0, 1, 2, 3), l3.abaaba, (2, 4, 3, 5, 6, 1), (6, 4, 5, 0)) - rdm1_f_aa_ov += einsum(t2.abab, (0, 1, 2, 3), x16, (1, 3, 0, 4), (4, 2)) * -2.0 - del x16 - x17 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x17 += einsum(x1, (0, 1), (0, 1)) * 0.3333333333333468 - del x1 - x17 += einsum(x2, (0, 1), (0, 1)) * 0.3333333333333468 - del x2 - x17 += einsum(x3, (0, 1), (0, 1)) * 0.6666666666666936 - del x3 - x17 += einsum(x5, (0, 1), (0, 1)) * 0.33333333333333354 - del x5 - x17 += einsum(x4, (0, 1), (0, 1)) * 0.6666666666666667 - del x4 - x17 += einsum(x0, (0, 1), (0, 1)) - del x0 - rdm1_f_aa_ov += einsum(t1.aa, (0, 1), x17, (0, 2), (2, 1)) * -2.9999999999998788 - del x17 - x18 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x18 += einsum(t1.bb, (0, 1), l3.abaaba, (2, 1, 3, 4, 5, 6), (5, 0, 4, 6, 2, 3)) - rdm1_f_bb_ov += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x18, (1, 6, 0, 2, 3, 5), (6, 4)) * -0.9999999999999601 - del x18 - x19 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x19 += einsum(t1.bb, (0, 1), l3.babbab, (2, 3, 1, 4, 5, 6), (4, 6, 0, 2, 5, 3)) - rdm1_f_bb_ov += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x19, (0, 2, 6, 5, 1, 4), (6, 3)) * 1.9999999999999194 - del x19 - x20 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x20 += einsum(t1.bb, (0, 1), l3.bbbbbb, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - rdm1_f_bb_ov += einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), x20, (0, 1, 2, 6, 5, 4), (6, 3)) * 2.9999999999998788 - del x20 - x21 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x21 += einsum(t1.bb, (0, 1), l2.abab, (2, 1, 3, 4), (4, 0, 3, 2)) - x21 += einsum(t2.bbbb, (0, 1, 2, 3), l3.babbab, (2, 4, 3, 5, 6, 1), (5, 0, 6, 4)) * 2.0 - x21 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 3, 2, 5, 6, 0), (6, 1, 5, 4)) * 2.0 - rdm1_f_bb_ov += einsum(t2.abab, (0, 1, 2, 3), x21, (1, 4, 0, 2), (4, 3)) * -1.0 - del x21 - x22 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x22 += einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) * 0.3333333333333333 - x22 += einsum(t2.bbbb, (0, 1, 2, 3), l3.bbbbbb, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) - x22 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 2, 3, 5, 0, 6), (5, 6, 1, 4)) * 0.3333333333333333 - rdm1_f_bb_ov += einsum(t2.bbbb, (0, 1, 2, 3), x22, (0, 1, 4, 3), (4, 2)) * 6.0 - del x22 - x23 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x23 += einsum(x8, (0, 1), (0, 1)) * 1.00000000000004 - del x8 - x23 += einsum(x7, (0, 1), (0, 1)) * 2.00000000000008 - del x7 - x23 += einsum(x11, (0, 1), (0, 1)) * 1.00000000000004 - del x11 - x23 += einsum(x9, (0, 1), (0, 1)) * 2.9999999999999982 - del x9 - x23 += einsum(x10, (0, 1), (0, 1)) * 1.9999999999999991 - del x10 - x23 += einsum(x6, (0, 1), (0, 1)) - del x6 - rdm1_f_bb_ov += einsum(t1.bb, (0, 1), x23, (0, 2), (2, 1)) * -0.9999999999999601 - del x23 - - rdm1_f_aa = np.block([[rdm1_f_aa_oo, rdm1_f_aa_ov], [rdm1_f_aa_vo, rdm1_f_aa_vv]]) - rdm1_f_bb = np.block([[rdm1_f_bb_oo, rdm1_f_bb_ov], [rdm1_f_bb_vo, rdm1_f_bb_vv]]) - - rdm1_f.aa = rdm1_f_aa - rdm1_f.bb = rdm1_f_bb - - return rdm1_f - -def make_rdm2_f(f=None, v=None, nocc=None, nvir=None, t1=None, t2=None, t3=None, l1=None, l2=None, l3=None, **kwargs): - rdm2_f = Namespace() - - delta = Namespace(aa=Namespace(), bb=Namespace()) - delta.aa = Namespace(oo=np.eye(nocc[0]), vv=np.eye(nvir[0])) - delta.bb = Namespace(oo=np.eye(nocc[1]), vv=np.eye(nvir[1])) - - # RDM2 - rdm2_f_aaaa_oooo = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - rdm2_f_aaaa_oooo += einsum(delta.aa.oo, (0, 1), delta.aa.oo, (2, 3), (0, 2, 1, 3)) - rdm2_f_aaaa_oooo += einsum(delta.aa.oo, (0, 1), delta.aa.oo, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_bbbb_oooo = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - rdm2_f_bbbb_oooo += einsum(delta.bb.oo, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2_f_bbbb_oooo += einsum(delta.bb.oo, (0, 1), delta.bb.oo, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_aaaa_ovoo = np.zeros((nocc[0], nvir[0], nocc[0], nocc[0]), dtype=types[float]) - rdm2_f_aaaa_ovoo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (0, 2, 1, 3)) - rdm2_f_aaaa_ovoo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_abab_ovoo = np.zeros((nocc[0], nvir[1], nocc[0], nocc[1]), dtype=types[float]) - rdm2_f_abab_ovoo += einsum(delta.aa.oo, (0, 1), l1.bb, (2, 3), (0, 2, 1, 3)) - rdm2_f_bbbb_ovoo = np.zeros((nocc[1], nvir[1], nocc[1], nocc[1]), dtype=types[float]) - rdm2_f_bbbb_ovoo += einsum(delta.bb.oo, (0, 1), l1.bb, (2, 3), (0, 2, 1, 3)) - rdm2_f_bbbb_ovoo += einsum(delta.bb.oo, (0, 1), l1.bb, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_aaaa_vooo = np.zeros((nvir[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - rdm2_f_aaaa_vooo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_aaaa_vooo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (2, 0, 3, 1)) - rdm2_f_abab_vooo = np.zeros((nvir[0], nocc[1], nocc[0], nocc[1]), dtype=types[float]) - rdm2_f_abab_vooo += einsum(delta.bb.oo, (0, 1), l1.aa, (2, 3), (2, 0, 3, 1)) - rdm2_f_bbbb_vooo = np.zeros((nvir[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - rdm2_f_bbbb_vooo += einsum(delta.bb.oo, (0, 1), l1.bb, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_bbbb_vooo += einsum(delta.bb.oo, (0, 1), l1.bb, (2, 3), (2, 0, 3, 1)) - rdm2_f_aaaa_oovv = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - rdm2_f_aaaa_oovv += einsum(l1.bb, (0, 1), t3.abaaba, (2, 1, 3, 4, 0, 5), (2, 3, 4, 5)) * 2.0 - rdm2_f_aaaa_oovv += einsum(t2.aaaa, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - rdm2_f_aaaa_oovv += einsum(l1.aa, (0, 1), t3.aaaaaa, (2, 3, 1, 4, 5, 0), (2, 3, 4, 5)) * 6.0 - rdm2_f_abab_oovv = np.zeros((nocc[0], nocc[1], nvir[0], nvir[1]), dtype=types[float]) - rdm2_f_abab_oovv += einsum(t2.abab, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_abab_oovv += einsum(l1.bb, (0, 1), t3.babbab, (2, 3, 1, 4, 5, 0), (3, 2, 5, 4)) * 2.0 - rdm2_f_abab_oovv += einsum(l1.aa, (0, 1), t3.abaaba, (2, 3, 1, 4, 5, 0), (2, 3, 4, 5)) * 2.0 - rdm2_f_bbbb_oovv = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - rdm2_f_bbbb_oovv += einsum(l1.bb, (0, 1), t3.bbbbbb, (2, 3, 1, 4, 5, 0), (2, 3, 4, 5)) * 6.0 - rdm2_f_bbbb_oovv += einsum(t2.bbbb, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - rdm2_f_bbbb_oovv += einsum(l1.aa, (0, 1), t3.babbab, (2, 1, 3, 4, 0, 5), (2, 3, 4, 5)) * 2.0 - rdm2_f_bbbb_oovv += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_bbbb_oovv += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2_f_aaaa_ovov = np.zeros((nocc[0], nvir[0], nocc[0], nvir[0]), dtype=types[float]) - rdm2_f_aaaa_ovov += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_bbbb_ovov = np.zeros((nocc[1], nvir[1], nocc[1], nvir[1]), dtype=types[float]) - rdm2_f_bbbb_ovov += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_aaaa_ovvo = np.zeros((nocc[0], nvir[0], nvir[0], nocc[0]), dtype=types[float]) - rdm2_f_aaaa_ovvo += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - rdm2_f_abab_ovvo = np.zeros((nocc[0], nvir[1], nvir[0], nocc[1]), dtype=types[float]) - rdm2_f_abab_ovvo += einsum(l1.bb, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - rdm2_f_bbbb_ovvo = np.zeros((nocc[1], nvir[1], nvir[1], nocc[1]), dtype=types[float]) - rdm2_f_bbbb_ovvo += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) - rdm2_f_aaaa_voov = np.zeros((nvir[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - rdm2_f_aaaa_voov += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - rdm2_f_abab_voov = np.zeros((nvir[0], nocc[1], nocc[0], nvir[1]), dtype=types[float]) - rdm2_f_abab_voov += einsum(l1.aa, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2_f_bbbb_voov = np.zeros((nvir[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - rdm2_f_bbbb_voov += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2_f_aaaa_vovo = np.zeros((nvir[0], nocc[0], nvir[0], nocc[0]), dtype=types[float]) - rdm2_f_aaaa_vovo += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_bbbb_vovo = np.zeros((nvir[1], nocc[1], nvir[1], nocc[1]), dtype=types[float]) - rdm2_f_bbbb_vovo += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_aaaa_vvoo = np.zeros((nvir[0], nvir[0], nocc[0], nocc[0]), dtype=types[float]) - rdm2_f_aaaa_vvoo += einsum(l2.aaaa, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - rdm2_f_abab_vvoo = np.zeros((nvir[0], nvir[1], nocc[0], nocc[1]), dtype=types[float]) - rdm2_f_abab_vvoo += einsum(l2.abab, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_bbbb_vvoo = np.zeros((nvir[1], nvir[1], nocc[1], nocc[1]), dtype=types[float]) - rdm2_f_bbbb_vvoo += einsum(l2.bbbb, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - rdm2_f_abab_ovvv = np.zeros((nocc[0], nvir[1], nvir[0], nvir[1]), dtype=types[float]) - rdm2_f_abab_ovvv += einsum(l1.bb, (0, 1), t2.abab, (2, 1, 3, 4), (2, 0, 3, 4)) - rdm2_f_abab_ovvv += einsum(l2.bbbb, (0, 1, 2, 3), t3.babbab, (2, 4, 3, 5, 6, 1), (4, 0, 6, 5)) * 2.0 - rdm2_f_abab_ovvv += einsum(l2.abab, (0, 1, 2, 3), t3.abaaba, (4, 3, 2, 5, 6, 0), (4, 1, 5, 6)) * 2.0 - rdm2_f_abab_vovv = np.zeros((nvir[0], nocc[1], nvir[0], nvir[1]), dtype=types[float]) - rdm2_f_abab_vovv += einsum(l2.abab, (0, 1, 2, 3), t3.babbab, (4, 2, 3, 5, 6, 1), (0, 4, 6, 5)) * 2.0 - rdm2_f_abab_vovv += einsum(l1.aa, (0, 1), t2.abab, (1, 2, 3, 4), (0, 2, 3, 4)) - rdm2_f_abab_vovv += einsum(l2.aaaa, (0, 1, 2, 3), t3.abaaba, (2, 4, 3, 5, 6, 1), (0, 4, 5, 6)) * 2.0 - rdm2_f_abab_vvov = np.zeros((nvir[0], nvir[1], nocc[0], nvir[1]), dtype=types[float]) - rdm2_f_abab_vvov += einsum(t1.bb, (0, 1), l2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) - rdm2_f_aaaa_vvvv = np.zeros((nvir[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - rdm2_f_aaaa_vvvv += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 4, 5, 6, 1, 7), (0, 2, 6, 7)) * 2.0000000000000404 - rdm2_f_aaaa_vvvv += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (3, 4, 5, 6, 7, 2), (0, 1, 6, 7)) * 6.000000000000116 - rdm2_f_aaaa_vvvv += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 5), (0, 1, 4, 5)) * 2.0 - rdm2_f_abab_vvvv = np.zeros((nvir[0], nvir[1], nvir[0], nvir[1]), dtype=types[float]) - rdm2_f_abab_vvvv += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 4, 5, 6, 7, 2), (1, 0, 7, 6)) * 2.0000000000000404 - rdm2_f_abab_vvvv += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 4, 5, 6, 7, 2), (0, 1, 6, 7)) * 2.0000000000000404 - rdm2_f_abab_vvvv += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 5), (0, 1, 4, 5)) - rdm2_f_bbbb_vvvv = np.zeros((nvir[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - rdm2_f_bbbb_vvvv += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 4, 5, 6, 1, 7), (0, 2, 6, 7)) * 2.0000000000000404 - rdm2_f_bbbb_vvvv += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 5), (0, 1, 4, 5)) * 2.0 - rdm2_f_bbbb_vvvv += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (3, 4, 5, 6, 7, 2), (0, 1, 6, 7)) * 6.000000000000116 - x0 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x0 += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 5, 0, 1), (2, 3, 4, 5)) - rdm2_f_aaaa_oooo += einsum(x0, (0, 1, 2, 3), (3, 2, 1, 0)) * 2.0 - x1 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x1 += einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - rdm2_f_aaaa_ovoo += einsum(x1, (0, 1, 2, 3), (2, 3, 1, 0)) * -2.0 - rdm2_f_aaaa_vooo += einsum(x1, (0, 1, 2, 3), (3, 2, 1, 0)) * 2.0 - x2 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x2 += einsum(t1.aa, (0, 1), x1, (2, 3, 4, 1), (2, 3, 0, 4)) - rdm2_f_aaaa_oooo += einsum(x2, (0, 1, 2, 3), (2, 3, 1, 0)) * -2.0 - x3 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x3 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 4, 7, 0, 1, 2), (3, 5, 6, 7)) - rdm2_f_aaaa_oooo += einsum(x3, (0, 1, 2, 3), (2, 3, 1, 0)) * -2.0000000000000404 - x4 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x4 += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (6, 7, 5, 0, 1, 2), (3, 4, 6, 7)) - rdm2_f_aaaa_oooo += einsum(x4, (0, 1, 2, 3), (2, 3, 1, 0)) * -6.000000000000116 - x5 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x5 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - x6 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x6 += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (2, 4)) - x7 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x7 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 6, 5, 0, 1, 2), (4, 6)) - x8 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x8 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 4, 5, 0, 1, 2), (3, 6)) - x9 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x9 += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (6, 4, 5, 0, 1, 2), (3, 6)) - x10 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x10 += einsum(x5, (0, 1), (0, 1)) - x10 += einsum(x6, (0, 1), (0, 1)) * 2.0 - x10 += einsum(x7, (0, 1), (0, 1)) * 0.9999999999999601 - x10 += einsum(x8, (0, 1), (0, 1)) * 1.9999999999999194 - x10 += einsum(x9, (0, 1), (0, 1)) * 2.9999999999998788 - rdm2_f_aaaa_oooo += einsum(delta.aa.oo, (0, 1), x10, (2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_aaaa_oooo += einsum(delta.aa.oo, (0, 1), x10, (2, 3), (0, 3, 2, 1)) - rdm2_f_aaaa_oooo += einsum(delta.aa.oo, (0, 1), x10, (2, 3), (3, 0, 1, 2)) - rdm2_f_aaaa_oooo += einsum(delta.aa.oo, (0, 1), x10, (2, 3), (3, 0, 2, 1)) * -1.0 - del x10 - x11 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x11 += einsum(l1.aa, (0, 1), t1.aa, (2, 0), (1, 2)) - rdm2_f_aaaa_oooo += einsum(delta.aa.oo, (0, 1), x11, (2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_aaaa_oooo += einsum(delta.aa.oo, (0, 1), x11, (2, 3), (3, 0, 1, 2)) - rdm2_f_aaaa_oooo += einsum(delta.aa.oo, (0, 1), x11, (2, 3), (0, 3, 2, 1)) - rdm2_f_aaaa_oooo += einsum(delta.aa.oo, (0, 1), x11, (2, 3), (3, 0, 2, 1)) * -1.0 - x12 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x12 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 3, 2, 5, 1, 6), (5, 6, 0, 4)) - rdm2_f_aaaa_ovoo += einsum(x12, (0, 1, 2, 3), (2, 3, 1, 0)) * -2.0 - rdm2_f_aaaa_vooo += einsum(x12, (0, 1, 2, 3), (3, 2, 1, 0)) * 2.0 - x13 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x13 += einsum(t2.aaaa, (0, 1, 2, 3), l3.aaaaaa, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) - rdm2_f_aaaa_ovoo += einsum(x13, (0, 1, 2, 3), (2, 3, 1, 0)) * -6.0 - rdm2_f_aaaa_vooo += einsum(x13, (0, 1, 2, 3), (3, 2, 1, 0)) * 6.0 - x14 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x14 += einsum(x12, (0, 1, 2, 3), (0, 1, 2, 3)) - x14 += einsum(x13, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x15 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x15 += einsum(t1.aa, (0, 1), x14, (2, 3, 4, 1), (0, 2, 3, 4)) * 2.0 - rdm2_f_aaaa_oooo += einsum(x15, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - rdm2_f_aaaa_oooo += einsum(x15, (0, 1, 2, 3), (3, 0, 2, 1)) - del x15 - x16 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x16 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 7, 5, 0, 1, 2), (4, 7, 3, 6)) - rdm2_f_abab_oooo = np.zeros((nocc[0], nocc[1], nocc[0], nocc[1]), dtype=types[float]) - rdm2_f_abab_oooo += einsum(x16, (0, 1, 2, 3), (3, 1, 2, 0)) * 2.0000000000000404 - x17 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x17 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 7, 5, 0, 1, 2), (3, 6, 4, 7)) - rdm2_f_abab_oooo += einsum(x17, (0, 1, 2, 3), (3, 1, 2, 0)) * 2.0000000000000404 - x18 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x18 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 5, 0, 1), (3, 5, 2, 4)) - rdm2_f_abab_oooo += einsum(x18, (0, 1, 2, 3), (3, 1, 2, 0)) - x19 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x19 += einsum(t1.aa, (0, 1), l2.abab, (1, 2, 3, 4), (4, 2, 3, 0)) - rdm2_f_abab_ovoo += einsum(x19, (0, 1, 2, 3), (3, 1, 2, 0)) * -1.0 - x20 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x20 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 2, 3, 5, 6, 1), (5, 4, 6, 0)) - rdm2_f_abab_ovoo += einsum(x20, (0, 1, 2, 3), (3, 1, 2, 0)) * -2.0 - x21 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x21 += einsum(t2.aaaa, (0, 1, 2, 3), l3.abaaba, (2, 4, 3, 5, 6, 1), (6, 4, 5, 0)) - rdm2_f_abab_ovoo += einsum(x21, (0, 1, 2, 3), (3, 1, 2, 0)) * -2.0 - x22 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x22 += einsum(x19, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x22 += einsum(x20, (0, 1, 2, 3), (0, 1, 2, 3)) - x22 += einsum(x21, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_abab_oooo += einsum(t1.bb, (0, 1), x22, (2, 1, 3, 4), (4, 0, 3, 2)) * 2.0 - rdm2_f_abab_ooov = np.zeros((nocc[0], nocc[1], nocc[0], nvir[1]), dtype=types[float]) - rdm2_f_abab_ooov += einsum(t2.bbbb, (0, 1, 2, 3), x22, (1, 3, 4, 5), (5, 0, 4, 2)) * -4.0 - rdm2_f_abab_oovo = np.zeros((nocc[0], nocc[1], nvir[0], nocc[1]), dtype=types[float]) - rdm2_f_abab_oovo += einsum(t2.abab, (0, 1, 2, 3), x22, (4, 3, 0, 5), (5, 1, 2, 4)) * 2.0 - rdm2_f_abab_ovvo += einsum(t1.aa, (0, 1), x22, (2, 3, 0, 4), (4, 3, 1, 2)) * -2.0 - rdm2_f_abab_ovvv += einsum(t2.abab, (0, 1, 2, 3), x22, (1, 4, 0, 5), (5, 4, 2, 3)) * -2.0 - x23 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x23 += einsum(t2.bbbb, (0, 1, 2, 3), l3.babbab, (2, 4, 3, 5, 6, 1), (5, 0, 6, 4)) - rdm2_f_abab_vooo += einsum(x23, (0, 1, 2, 3), (3, 1, 2, 0)) * -2.0 - x24 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x24 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 3, 2, 5, 6, 0), (6, 1, 5, 4)) - rdm2_f_abab_vooo += einsum(x24, (0, 1, 2, 3), (3, 1, 2, 0)) * -2.0 - x25 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x25 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x25 += einsum(x24, (0, 1, 2, 3), (0, 1, 2, 3)) - x26 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x26 += einsum(t1.aa, (0, 1), x25, (2, 3, 4, 1), (2, 3, 0, 4)) * 2.0 - rdm2_f_abab_oooo += einsum(x26, (0, 1, 2, 3), (2, 1, 3, 0)) - x27 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x27 += einsum(delta.aa.oo, (0, 1), (0, 1)) * -1.0 - x27 += einsum(x11, (0, 1), (0, 1)) - x27 += einsum(x5, (0, 1), (0, 1)) - x27 += einsum(x6, (0, 1), (0, 1)) * 2.0 - x27 += einsum(x7, (0, 1), (0, 1)) * 0.9999999999999601 - x27 += einsum(x8, (0, 1), (0, 1)) * 1.9999999999999194 - x27 += einsum(x9, (0, 1), (0, 1)) * 2.9999999999998788 - rdm2_f_abab_oooo += einsum(delta.bb.oo, (0, 1), x27, (2, 3), (3, 0, 2, 1)) * -1.0 - del x27 - x28 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x28 += einsum(l1.bb, (0, 1), t1.bb, (2, 0), (1, 2)) - rdm2_f_bbbb_oooo += einsum(delta.bb.oo, (0, 1), x28, (2, 3), (0, 3, 1, 2)) * -1.0 - rdm2_f_bbbb_oooo += einsum(delta.bb.oo, (0, 1), x28, (2, 3), (3, 0, 1, 2)) - rdm2_f_bbbb_oooo += einsum(delta.bb.oo, (0, 1), x28, (2, 3), (0, 3, 2, 1)) - rdm2_f_bbbb_oooo += einsum(delta.bb.oo, (0, 1), x28, (2, 3), (3, 0, 2, 1)) * -1.0 - x29 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x29 += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 0, 1), (2, 4)) - x30 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x30 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - x31 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x31 += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (6, 4, 5, 0, 1, 2), (3, 6)) - x32 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x32 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 4, 5, 0, 1, 2), (3, 6)) - x33 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x33 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 6, 5, 0, 1, 2), (4, 6)) - x34 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x34 += einsum(x28, (0, 1), (0, 1)) * 0.5 - x34 += einsum(x29, (0, 1), (0, 1)) - x34 += einsum(x30, (0, 1), (0, 1)) * 0.5 - x34 += einsum(x31, (0, 1), (0, 1)) * 1.4999999999999394 - x34 += einsum(x32, (0, 1), (0, 1)) * 0.9999999999999597 - x34 += einsum(x33, (0, 1), (0, 1)) * 0.49999999999998007 - rdm2_f_abab_oooo += einsum(delta.aa.oo, (0, 1), x34, (2, 3), (0, 3, 1, 2)) * -2.0 - rdm2_f_abab_oovo += einsum(t1.aa, (0, 1), x34, (2, 3), (0, 3, 1, 2)) * -2.0 - del x34 - x35 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x35 += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (6, 7, 5, 0, 1, 2), (3, 4, 6, 7)) - rdm2_f_bbbb_oooo += einsum(x35, (0, 1, 2, 3), (2, 3, 1, 0)) * -6.000000000000116 - x36 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x36 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 4, 7, 0, 1, 2), (3, 5, 6, 7)) - rdm2_f_bbbb_oooo += einsum(x36, (0, 1, 2, 3), (2, 3, 1, 0)) * -2.0000000000000404 - x37 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x37 += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - rdm2_f_bbbb_oooo += einsum(x37, (0, 1, 2, 3), (3, 2, 1, 0)) * 2.0 - x38 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x38 += einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - rdm2_f_bbbb_ovoo += einsum(x38, (0, 1, 2, 3), (2, 3, 1, 0)) * -2.0 - rdm2_f_bbbb_vooo += einsum(x38, (0, 1, 2, 3), (3, 2, 1, 0)) * 2.0 - x39 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x39 += einsum(t1.bb, (0, 1), x38, (2, 3, 4, 1), (2, 3, 0, 4)) - rdm2_f_bbbb_oooo += einsum(x39, (0, 1, 2, 3), (2, 3, 1, 0)) * -2.0 - x40 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x40 += einsum(t2.bbbb, (0, 1, 2, 3), l3.bbbbbb, (4, 2, 3, 5, 6, 1), (5, 6, 0, 4)) - rdm2_f_bbbb_ovoo += einsum(x40, (0, 1, 2, 3), (2, 3, 1, 0)) * -6.0 - rdm2_f_bbbb_vooo += einsum(x40, (0, 1, 2, 3), (3, 2, 1, 0)) * 6.0 - x41 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x41 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 2, 3, 5, 0, 6), (5, 6, 1, 4)) - rdm2_f_bbbb_ovoo += einsum(x41, (0, 1, 2, 3), (2, 3, 1, 0)) * -2.0 - rdm2_f_bbbb_vooo += einsum(x41, (0, 1, 2, 3), (3, 2, 1, 0)) * 2.0 - x42 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x42 += einsum(x40, (0, 1, 2, 3), (0, 1, 2, 3)) - x42 += einsum(x41, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.3333333333333333 - x43 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x43 += einsum(t1.bb, (0, 1), x42, (2, 3, 4, 1), (0, 2, 3, 4)) * 6.0 - rdm2_f_bbbb_oooo += einsum(x43, (0, 1, 2, 3), (0, 3, 2, 1)) * -1.0 - rdm2_f_bbbb_oooo += einsum(x43, (0, 1, 2, 3), (3, 0, 2, 1)) - del x43 - x44 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x44 += einsum(x29, (0, 1), (0, 1)) - x44 += einsum(x30, (0, 1), (0, 1)) * 0.5 - x44 += einsum(x31, (0, 1), (0, 1)) * 1.4999999999999394 - x44 += einsum(x32, (0, 1), (0, 1)) * 0.9999999999999597 - x44 += einsum(x33, (0, 1), (0, 1)) * 0.49999999999998007 - rdm2_f_bbbb_oooo += einsum(delta.bb.oo, (0, 1), x44, (2, 3), (0, 3, 1, 2)) * -2.0 - rdm2_f_bbbb_oooo += einsum(delta.bb.oo, (0, 1), x44, (2, 3), (0, 3, 2, 1)) * 2.0 - rdm2_f_bbbb_oooo += einsum(delta.bb.oo, (0, 1), x44, (2, 3), (3, 0, 1, 2)) * 2.0 - rdm2_f_bbbb_oooo += einsum(delta.bb.oo, (0, 1), x44, (2, 3), (3, 0, 2, 1)) * -2.0 - del x44 - x45 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x45 += einsum(t1.aa, (0, 1), l3.aaaaaa, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - x46 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x46 += einsum(t1.aa, (0, 1), x45, (2, 3, 4, 5, 1, 6), (3, 4, 2, 5, 0, 6)) - x47 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x47 += einsum(t2.aaaa, (0, 1, 2, 3), x46, (1, 0, 4, 5, 6, 3), (4, 6, 5, 2)) - rdm2_f_aaaa_ooov = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - rdm2_f_aaaa_ooov += einsum(x47, (0, 1, 2, 3), (1, 2, 0, 3)) * 6.0 - rdm2_f_aaaa_oovo = np.zeros((nocc[0], nocc[0], nvir[0], nocc[0]), dtype=types[float]) - rdm2_f_aaaa_oovo += einsum(x47, (0, 1, 2, 3), (1, 2, 3, 0)) * -6.0 - x48 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x48 += einsum(l2.aaaa, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 3, 6, 0, 1), (2, 4, 5, 6)) - rdm2_f_aaaa_ooov += einsum(x48, (0, 1, 2, 3), (1, 2, 0, 3)) * 6.0 - rdm2_f_aaaa_oovo += einsum(x48, (0, 1, 2, 3), (1, 2, 3, 0)) * -6.0 - x49 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x49 += einsum(l2.abab, (0, 1, 2, 3), t3.abaaba, (4, 3, 5, 6, 1, 0), (2, 4, 5, 6)) - rdm2_f_aaaa_ooov += einsum(x49, (0, 1, 2, 3), (1, 2, 0, 3)) * 2.0 - rdm2_f_aaaa_oovo += einsum(x49, (0, 1, 2, 3), (1, 2, 3, 0)) * -2.0 - x50 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x50 += einsum(l1.aa, (0, 1), t2.aaaa, (2, 3, 4, 0), (1, 2, 3, 4)) - rdm2_f_aaaa_ooov += einsum(x50, (0, 1, 2, 3), (2, 1, 0, 3)) * -2.0 - rdm2_f_aaaa_oovo += einsum(x50, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x51 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x51 += einsum(t1.aa, (0, 1), l3.abaaba, (2, 3, 1, 4, 5, 6), (5, 3, 4, 6, 0, 2)) - rdm2_f_abab_ovvv += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x51, (1, 6, 0, 2, 7, 5), (7, 6, 3, 4)) * 2.0000000000000404 - x52 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x52 += einsum(t1.aa, (0, 1), x51, (2, 3, 4, 5, 6, 1), (2, 3, 4, 5, 6, 0)) * -1.0 - x53 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x53 += einsum(t2.abab, (0, 1, 2, 3), x52, (1, 3, 4, 0, 5, 6), (4, 6, 5, 2)) * -1.0 - rdm2_f_aaaa_ooov += einsum(x53, (0, 1, 2, 3), (1, 2, 0, 3)) * 2.0 - rdm2_f_aaaa_oovo += einsum(x53, (0, 1, 2, 3), (1, 2, 3, 0)) * -2.0 - x54 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x54 += einsum(l1.bb, (0, 1), t2.abab, (2, 1, 3, 0), (2, 3)) - x55 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x55 += einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) - x56 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x56 += einsum(l2.bbbb, (0, 1, 2, 3), t3.babbab, (2, 4, 3, 0, 5, 1), (4, 5)) - x57 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x57 += einsum(l2.abab, (0, 1, 2, 3), t3.abaaba, (4, 3, 2, 5, 1, 0), (4, 5)) - x58 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x58 += einsum(l2.aaaa, (0, 1, 2, 3), t3.aaaaaa, (4, 2, 3, 5, 0, 1), (4, 5)) - x59 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x59 += einsum(t1.aa, (0, 1), l3.babbab, (2, 1, 3, 4, 5, 6), (4, 6, 2, 3, 5, 0)) - rdm2_f_abab_ovvv += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x59, (2, 0, 6, 5, 1, 7), (7, 6, 4, 3)) * 2.0000000000000404 - x60 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x60 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x59, (0, 2, 3, 5, 1, 6), (6, 4)) - x61 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x61 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x51, (1, 4, 0, 2, 6, 5), (6, 3)) * -1.0 - x62 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x62 += einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), x45, (0, 1, 2, 6, 4, 5), (6, 3)) - x63 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x63 += einsum(t2.abab, (0, 1, 2, 3), x22, (1, 3, 0, 4), (4, 2)) * 2.0 - x64 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x64 += einsum(x1, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.3333333333333333 - x64 += einsum(x12, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.3333333333333333 - x64 += einsum(x13, (0, 1, 2, 3), (0, 1, 2, 3)) - x65 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x65 += einsum(t2.aaaa, (0, 1, 2, 3), x64, (0, 1, 4, 3), (4, 2)) * -6.0 - x66 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x66 += einsum(x11, (0, 1), (0, 1)) - x66 += einsum(x5, (0, 1), (0, 1)) - x66 += einsum(x6, (0, 1), (0, 1)) * 2.0 - x66 += einsum(x7, (0, 1), (0, 1)) * 0.9999999999999601 - x66 += einsum(x8, (0, 1), (0, 1)) * 1.9999999999999194 - x66 += einsum(x9, (0, 1), (0, 1)) * 2.9999999999998788 - rdm2_f_abab_ooov += einsum(t1.bb, (0, 1), x66, (2, 3), (3, 0, 2, 1)) * -1.0 - x67 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x67 += einsum(t1.aa, (0, 1), x66, (0, 2), (2, 1)) - x68 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x68 += einsum(x54, (0, 1), (0, 1)) * -1.0 - x68 += einsum(x55, (0, 1), (0, 1)) * -2.0 - x68 += einsum(x56, (0, 1), (0, 1)) * -1.0 - x68 += einsum(x57, (0, 1), (0, 1)) * -2.0 - x68 += einsum(x58, (0, 1), (0, 1)) * -3.0 - x68 += einsum(x60, (0, 1), (0, 1)) * 0.9999999999999601 - x68 += einsum(x61, (0, 1), (0, 1)) * 1.9999999999999194 - x68 += einsum(x62, (0, 1), (0, 1)) * 2.9999999999998788 - x68 += einsum(x63, (0, 1), (0, 1)) - x68 += einsum(x65, (0, 1), (0, 1)) - x68 += einsum(x67, (0, 1), (0, 1)) - rdm2_f_aaaa_ooov += einsum(delta.aa.oo, (0, 1), x68, (2, 3), (0, 2, 1, 3)) * -1.0 - rdm2_f_aaaa_ooov += einsum(delta.aa.oo, (0, 1), x68, (2, 3), (2, 0, 1, 3)) - rdm2_f_aaaa_oovo += einsum(delta.aa.oo, (0, 1), x68, (2, 3), (0, 2, 3, 1)) - rdm2_f_aaaa_oovo += einsum(delta.aa.oo, (0, 1), x68, (2, 3), (2, 0, 3, 1)) * -1.0 - x69 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x69 += einsum(t2.abab, (0, 1, 2, 3), x20, (1, 3, 4, 5), (4, 0, 5, 2)) - x70 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x70 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x59, (2, 0, 3, 5, 6, 7), (6, 7, 1, 4)) * -1.0 - x71 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x71 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x51, (1, 4, 6, 2, 7, 5), (6, 7, 0, 3)) * -1.0 - x72 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x72 += einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), x45, (1, 2, 6, 7, 5, 4), (6, 7, 0, 3)) * -1.0 - x73 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x73 += einsum(t2.aaaa, (0, 1, 2, 3), x64, (1, 4, 5, 3), (0, 4, 5, 2)) * 12.0 - x74 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x74 += einsum(x19, (0, 1, 2, 3), (0, 1, 2, 3)) - x74 += einsum(x21, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x75 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x75 += einsum(t2.abab, (0, 1, 2, 3), x74, (1, 3, 4, 5), (0, 4, 5, 2)) - x76 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x76 += einsum(t1.aa, (0, 1), x14, (2, 3, 4, 1), (0, 2, 3, 4)) - x77 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x77 += einsum(t1.aa, (0, 1), x76, (2, 0, 3, 4), (3, 2, 4, 1)) * 2.0 - del x76 - x78 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x78 += einsum(delta.aa.oo, (0, 1), t1.aa, (2, 3), (0, 1, 2, 3)) - x78 += einsum(x69, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - x78 += einsum(x70, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x78 += einsum(x71, (0, 1, 2, 3), (1, 0, 2, 3)) * -4.0 - x78 += einsum(x72, (0, 1, 2, 3), (1, 0, 2, 3)) * -9.0 - x78 += einsum(x73, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x73 - x78 += einsum(x75, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - del x75 - x78 += einsum(x77, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x77 - x78 += einsum(t1.aa, (0, 1), x66, (2, 3), (0, 2, 3, 1)) - del x66 - rdm2_f_aaaa_ooov += einsum(x78, (0, 1, 2, 3), (0, 2, 1, 3)) - rdm2_f_aaaa_ooov += einsum(x78, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_aaaa_oovo += einsum(x78, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_aaaa_oovo += einsum(x78, (0, 1, 2, 3), (2, 0, 3, 1)) - del x78 - x79 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x79 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 3, 5, 6, 1, 0), (6, 4, 5, 2)) - rdm2_f_aaaa_vvov = np.zeros((nvir[0], nvir[0], nocc[0], nvir[0]), dtype=types[float]) - rdm2_f_aaaa_vvov += einsum(x79, (0, 1, 2, 3), (1, 2, 0, 3)) * 2.0 - rdm2_f_aaaa_vvvo = np.zeros((nvir[0], nvir[0], nvir[0], nocc[0]), dtype=types[float]) - rdm2_f_aaaa_vvvo += einsum(x79, (0, 1, 2, 3), (1, 2, 3, 0)) * -2.0 - x80 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x80 += einsum(t2.aaaa, (0, 1, 2, 3), l3.aaaaaa, (4, 5, 3, 6, 0, 1), (6, 4, 5, 2)) - rdm2_f_aaaa_vvov += einsum(x80, (0, 1, 2, 3), (1, 2, 0, 3)) * 6.0 - rdm2_f_aaaa_vvvo += einsum(x80, (0, 1, 2, 3), (1, 2, 3, 0)) * -6.0 - x81 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x81 += einsum(x79, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.3333333333333333 - x81 += einsum(x80, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - rdm2_f_abab_oovv += einsum(x81, (0, 1, 2, 3), t3.abaaba, (4, 5, 0, 1, 6, 2), (4, 5, 3, 6)) * 6.0 - x82 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x82 += einsum(t2.aaaa, (0, 1, 2, 3), x81, (4, 2, 3, 5), (0, 1, 4, 5)) * 6.0 - del x81 - rdm2_f_aaaa_ooov += einsum(x82, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_aaaa_oovo += einsum(x82, (0, 1, 2, 3), (1, 0, 3, 2)) - del x82 - x83 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x83 += einsum(x0, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.3333333333333269 - x83 += einsum(x2, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.3333333333333269 - x83 += einsum(x3, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.3333333333333336 - x83 += einsum(x4, (0, 1, 2, 3), (0, 1, 3, 2)) - x84 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x84 += einsum(t1.aa, (0, 1), x83, (0, 2, 3, 4), (2, 3, 4, 1)) * 6.000000000000116 - del x83 - rdm2_f_aaaa_ooov += einsum(x84, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_aaaa_oovo += einsum(x84, (0, 1, 2, 3), (2, 1, 3, 0)) - del x84 - x85 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x85 += einsum(t1.bb, (0, 1), l3.abaaba, (2, 1, 3, 4, 5, 6), (5, 0, 4, 6, 2, 3)) - rdm2_f_abab_vovv += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x85, (1, 6, 0, 2, 7, 5), (7, 6, 3, 4)) * -2.0000000000000404 - x86 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x86 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x85, (1, 6, 7, 2, 5, 3), (6, 4, 7, 0)) * -1.0 - rdm2_f_abab_ooov += einsum(x86, (0, 1, 2, 3), (3, 0, 2, 1)) * 2.0 - x87 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x87 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x51, (2, 5, 6, 1, 7, 4), (0, 3, 6, 7)) * -1.0 - rdm2_f_abab_ooov += einsum(x87, (0, 1, 2, 3), (3, 0, 2, 1)) * -4.0 - x88 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x88 += einsum(t1.bb, (0, 1), x51, (2, 1, 3, 4, 5, 6), (2, 0, 3, 4, 5, 6)) - x89 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x89 += einsum(t2.abab, (0, 1, 2, 3), x88, (1, 4, 5, 0, 6, 2), (4, 3, 5, 6)) * -1.0 - rdm2_f_abab_ooov += einsum(x89, (0, 1, 2, 3), (3, 0, 2, 1)) * 2.0 - x90 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x90 += einsum(t1.bb, (0, 1), l3.babbab, (2, 3, 1, 4, 5, 6), (4, 6, 0, 2, 5, 3)) - rdm2_f_abab_vovv += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x90, (2, 0, 6, 5, 1, 7), (7, 6, 4, 3)) * -2.0000000000000404 - x91 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x91 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x90, (2, 0, 6, 5, 7, 4), (6, 3, 7, 1)) - rdm2_f_abab_ooov += einsum(x91, (0, 1, 2, 3), (3, 0, 2, 1)) * 2.0 - x92 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x92 += einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), x59, (1, 2, 4, 5, 6, 7), (0, 3, 6, 7)) - rdm2_f_abab_ooov += einsum(x92, (0, 1, 2, 3), (3, 0, 2, 1)) * -3.0 - x93 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x93 += einsum(t1.bb, (0, 1), x59, (2, 3, 1, 4, 5, 6), (3, 2, 0, 4, 5, 6)) - x94 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x94 += einsum(t2.bbbb, (0, 1, 2, 3), x93, (1, 0, 4, 3, 5, 6), (4, 2, 5, 6)) - rdm2_f_abab_ooov += einsum(x94, (0, 1, 2, 3), (3, 0, 2, 1)) * 2.0 - x95 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x95 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x45, (6, 2, 0, 7, 5, 3), (1, 4, 6, 7)) - rdm2_f_abab_ooov += einsum(x95, (0, 1, 2, 3), (3, 0, 2, 1)) * -3.0 - x96 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x96 += einsum(l1.aa, (0, 1), t2.abab, (2, 3, 0, 4), (3, 4, 1, 2)) - rdm2_f_abab_ooov += einsum(x96, (0, 1, 2, 3), (3, 0, 2, 1)) * -1.0 - x97 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x97 += einsum(l2.aaaa, (0, 1, 2, 3), t3.abaaba, (4, 5, 3, 0, 6, 1), (5, 6, 2, 4)) - rdm2_f_abab_ooov += einsum(x97, (0, 1, 2, 3), (3, 0, 2, 1)) * -2.0 - x98 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x98 += einsum(l2.abab, (0, 1, 2, 3), t3.babbab, (4, 5, 3, 6, 0, 1), (4, 6, 2, 5)) - rdm2_f_abab_ooov += einsum(x98, (0, 1, 2, 3), (3, 0, 2, 1)) * -2.0 - x99 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x99 += einsum(t2.bbbb, (0, 1, 2, 3), l3.babbab, (4, 5, 3, 0, 6, 1), (4, 2, 6, 5)) - rdm2_f_abab_vvov += einsum(x99, (0, 1, 2, 3), (3, 0, 2, 1)) * 2.0 - x100 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x100 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 5, 2, 6, 1, 0), (5, 3, 6, 4)) - rdm2_f_abab_vvov += einsum(x100, (0, 1, 2, 3), (3, 0, 2, 1)) * 2.0 - x101 = np.zeros((nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x101 += einsum(x99, (0, 1, 2, 3), (0, 1, 2, 3)) - x101 += einsum(x100, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_abab_ooov += einsum(t2.abab, (0, 1, 2, 3), x101, (3, 4, 5, 2), (0, 1, 5, 4)) * 2.0 - rdm2_f_abab_ovvv += einsum(t2.aaaa, (0, 1, 2, 3), x101, (4, 5, 1, 3), (0, 4, 2, 5)) * 4.0 - rdm2_f_abab_vovv += einsum(t2.abab, (0, 1, 2, 3), x101, (3, 4, 0, 5), (5, 1, 2, 4)) * -2.0 - rdm2_f_abab_vvvv += einsum(t1.aa, (0, 1), x101, (2, 3, 0, 4), (4, 2, 1, 3)) * 2.0 - x102 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x102 += einsum(x1, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x102 += einsum(x12, (0, 1, 2, 3), (0, 1, 2, 3)) - x102 += einsum(x13, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - rdm2_f_abab_ooov += einsum(t2.abab, (0, 1, 2, 3), x102, (0, 4, 5, 2), (5, 1, 4, 3)) * -2.0 - rdm2_f_abab_oovv += einsum(x102, (0, 1, 2, 3), t3.abaaba, (0, 4, 1, 5, 6, 3), (2, 4, 5, 6)) * 2.0 - x103 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x103 += einsum(t1.bb, (0, 1), l2.abab, (2, 1, 3, 4), (4, 0, 3, 2)) - rdm2_f_abab_vooo += einsum(x103, (0, 1, 2, 3), (3, 1, 2, 0)) * -1.0 - x104 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x104 += einsum(x103, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - x104 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) - x104 += einsum(x24, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_abab_ooov += einsum(t2.abab, (0, 1, 2, 3), x104, (1, 4, 5, 2), (0, 4, 5, 3)) * 2.0 - rdm2_f_abab_oovo += einsum(t2.aaaa, (0, 1, 2, 3), x104, (4, 5, 1, 3), (0, 5, 2, 4)) * -4.0 - rdm2_f_abab_voov += einsum(t1.bb, (0, 1), x104, (0, 2, 3, 4), (4, 2, 3, 1)) * -2.0 - rdm2_f_abab_vovo = np.zeros((nvir[0], nocc[1], nvir[0], nocc[1]), dtype=types[float]) - rdm2_f_abab_vovo += einsum(t1.aa, (0, 1), x104, (2, 3, 0, 4), (4, 3, 1, 2)) * -2.0 - x105 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x105 += einsum(x19, (0, 1, 2, 3), (0, 1, 2, 3)) - x105 += einsum(x20, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x105 += einsum(x21, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - rdm2_f_abab_oovv += einsum(x105, (0, 1, 2, 3), t3.babbab, (4, 2, 0, 5, 6, 1), (3, 4, 6, 5)) * -2.0 - rdm2_f_abab_ovov = np.zeros((nocc[0], nvir[1], nocc[0], nvir[1]), dtype=types[float]) - rdm2_f_abab_ovov += einsum(t1.bb, (0, 1), x105, (0, 2, 3, 4), (4, 2, 3, 1)) * -1.0 - x106 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x106 += einsum(t1.bb, (0, 1), x105, (2, 1, 3, 4), (2, 0, 3, 4)) * 0.4999999999999899 - x107 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x107 += einsum(t1.aa, (0, 1), x25, (2, 3, 4, 1), (2, 3, 0, 4)) * 0.9999999999999798 - x108 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x108 += einsum(x18, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.4999999999999899 - x108 += einsum(x17, (0, 1, 2, 3), (0, 1, 2, 3)) - x108 += einsum(x16, (0, 1, 2, 3), (0, 1, 2, 3)) - x108 += einsum(x106, (0, 1, 2, 3), (0, 1, 2, 3)) - del x106 - x108 += einsum(x107, (0, 1, 2, 3), (0, 1, 3, 2)) - del x107 - rdm2_f_abab_ooov += einsum(t1.bb, (0, 1), x108, (0, 2, 3, 4), (4, 2, 3, 1)) * 2.0000000000000404 - rdm2_f_abab_oovo += einsum(t1.aa, (0, 1), x108, (2, 3, 0, 4), (4, 3, 1, 2)) * 2.0000000000000404 - del x108 - x109 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x109 += einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) - x110 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x110 += einsum(l1.aa, (0, 1), t2.abab, (1, 2, 0, 3), (2, 3)) - x111 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x111 += einsum(l2.bbbb, (0, 1, 2, 3), t3.bbbbbb, (4, 2, 3, 5, 0, 1), (4, 5)) - x112 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x112 += einsum(l2.abab, (0, 1, 2, 3), t3.babbab, (4, 2, 3, 5, 0, 1), (4, 5)) - x113 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x113 += einsum(l2.aaaa, (0, 1, 2, 3), t3.abaaba, (2, 4, 3, 0, 5, 1), (4, 5)) - x114 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x114 += einsum(t1.bb, (0, 1), l3.bbbbbb, (2, 3, 1, 4, 5, 6), (4, 5, 6, 0, 2, 3)) - x115 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x115 += einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), x114, (0, 1, 2, 6, 4, 5), (6, 3)) - x116 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x116 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x90, (2, 0, 6, 5, 1, 4), (6, 3)) - x117 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x117 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x85, (1, 6, 0, 2, 3, 5), (6, 4)) - x118 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x118 += einsum(x38, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x118 += einsum(x40, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x118 += einsum(x41, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_abab_oovo += einsum(t2.abab, (0, 1, 2, 3), x118, (1, 4, 5, 3), (0, 5, 2, 4)) * -2.0 - rdm2_f_abab_oovv += einsum(x118, (0, 1, 2, 3), t3.babbab, (0, 4, 1, 5, 6, 3), (4, 2, 6, 5)) * 2.0 - x119 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x119 += einsum(x28, (0, 1), (0, 1)) - x119 += einsum(x29, (0, 1), (0, 1)) * 2.0 - x119 += einsum(x30, (0, 1), (0, 1)) - x119 += einsum(x31, (0, 1), (0, 1)) * 2.9999999999998788 - x119 += einsum(x32, (0, 1), (0, 1)) * 1.9999999999999194 - x119 += einsum(x33, (0, 1), (0, 1)) * 0.9999999999999601 - rdm2_f_abab_oovv += einsum(x119, (0, 1), t2.abab, (2, 0, 3, 4), (2, 1, 3, 4)) * -1.0 - x120 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x120 += einsum(t1.bb, (0, 1), (0, 1)) * -1.0 - x120 += einsum(x109, (0, 1), (0, 1)) * -2.0 - x120 += einsum(x110, (0, 1), (0, 1)) * -1.0 - x120 += einsum(x111, (0, 1), (0, 1)) * -3.0 - x120 += einsum(x112, (0, 1), (0, 1)) * -2.0 - x120 += einsum(x113, (0, 1), (0, 1)) * -1.0 - x120 += einsum(x115, (0, 1), (0, 1)) * 2.9999999999998788 - x120 += einsum(x116, (0, 1), (0, 1)) * 1.9999999999999194 - x120 += einsum(x117, (0, 1), (0, 1)) * 0.9999999999999601 - x120 += einsum(t2.bbbb, (0, 1, 2, 3), x118, (0, 1, 4, 3), (4, 2)) * -2.0 - x120 += einsum(t2.abab, (0, 1, 2, 3), x104, (1, 4, 0, 2), (4, 3)) * 2.0 - x120 += einsum(t1.bb, (0, 1), x119, (0, 2), (2, 1)) - rdm2_f_abab_ooov += einsum(delta.aa.oo, (0, 1), x120, (2, 3), (0, 2, 1, 3)) * -1.0 - del x120 - x121 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x121 += einsum(l1.bb, (0, 1), t2.bbbb, (2, 3, 4, 0), (1, 2, 3, 4)) - rdm2_f_bbbb_ooov = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - rdm2_f_bbbb_ooov += einsum(x121, (0, 1, 2, 3), (2, 1, 0, 3)) * -2.0 - rdm2_f_bbbb_oovo = np.zeros((nocc[1], nocc[1], nvir[1], nocc[1]), dtype=types[float]) - rdm2_f_bbbb_oovo += einsum(x121, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x122 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x122 += einsum(t1.bb, (0, 1), x90, (2, 3, 4, 1, 5, 6), (2, 3, 4, 0, 5, 6)) * -1.0 - x123 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x123 += einsum(t2.abab, (0, 1, 2, 3), x122, (4, 1, 5, 6, 0, 2), (4, 6, 5, 3)) * -1.0 - rdm2_f_bbbb_ooov += einsum(x123, (0, 1, 2, 3), (1, 2, 0, 3)) * 2.0 - rdm2_f_bbbb_oovo += einsum(x123, (0, 1, 2, 3), (1, 2, 3, 0)) * -2.0 - x124 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x124 += einsum(l2.bbbb, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 3, 6, 0, 1), (2, 4, 5, 6)) - rdm2_f_bbbb_ooov += einsum(x124, (0, 1, 2, 3), (1, 2, 0, 3)) * 6.0 - rdm2_f_bbbb_oovo += einsum(x124, (0, 1, 2, 3), (1, 2, 3, 0)) * -6.0 - x125 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x125 += einsum(l2.abab, (0, 1, 2, 3), t3.babbab, (4, 2, 5, 6, 0, 1), (3, 4, 5, 6)) - rdm2_f_bbbb_ooov += einsum(x125, (0, 1, 2, 3), (1, 2, 0, 3)) * 2.0 - rdm2_f_bbbb_oovo += einsum(x125, (0, 1, 2, 3), (1, 2, 3, 0)) * -2.0 - x126 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x126 += einsum(t1.bb, (0, 1), x114, (2, 3, 4, 5, 1, 6), (3, 4, 2, 5, 0, 6)) - x127 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x127 += einsum(t2.bbbb, (0, 1, 2, 3), x126, (0, 1, 4, 5, 6, 3), (4, 6, 5, 2)) * -1.0 - rdm2_f_bbbb_ooov += einsum(x127, (0, 1, 2, 3), (1, 2, 0, 3)) * 6.0 - rdm2_f_bbbb_oovo += einsum(x127, (0, 1, 2, 3), (1, 2, 3, 0)) * -6.0 - x128 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x128 += einsum(t2.bbbb, (0, 1, 2, 3), x118, (0, 1, 4, 3), (4, 2)) * -1.0 - x129 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x129 += einsum(t2.abab, (0, 1, 2, 3), x104, (1, 4, 0, 2), (4, 3)) - del x104 - x130 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x130 += einsum(t1.bb, (0, 1), x119, (0, 2), (2, 1)) * 0.5 - x131 = np.zeros((nocc[1], nvir[1]), dtype=types[float]) - x131 += einsum(x109, (0, 1), (0, 1)) * -1.0 - del x109 - x131 += einsum(x110, (0, 1), (0, 1)) * -0.5 - del x110 - x131 += einsum(x111, (0, 1), (0, 1)) * -1.5 - del x111 - x131 += einsum(x112, (0, 1), (0, 1)) * -1.0 - del x112 - x131 += einsum(x113, (0, 1), (0, 1)) * -0.5 - del x113 - x131 += einsum(x115, (0, 1), (0, 1)) * 1.4999999999999394 - del x115 - x131 += einsum(x116, (0, 1), (0, 1)) * 0.9999999999999597 - del x116 - x131 += einsum(x117, (0, 1), (0, 1)) * 0.49999999999998007 - del x117 - x131 += einsum(x128, (0, 1), (0, 1)) - del x128 - x131 += einsum(x129, (0, 1), (0, 1)) - del x129 - x131 += einsum(x130, (0, 1), (0, 1)) - del x130 - rdm2_f_bbbb_ooov += einsum(delta.bb.oo, (0, 1), x131, (2, 3), (0, 2, 1, 3)) * -2.0 - rdm2_f_bbbb_ooov += einsum(delta.bb.oo, (0, 1), x131, (2, 3), (2, 0, 1, 3)) * 2.0 - rdm2_f_bbbb_oovo += einsum(delta.bb.oo, (0, 1), x131, (2, 3), (0, 2, 3, 1)) * 2.0 - rdm2_f_bbbb_oovo += einsum(delta.bb.oo, (0, 1), x131, (2, 3), (2, 0, 3, 1)) * -2.0 - rdm2_f_abab_oovv += einsum(t1.aa, (0, 1), x131, (2, 3), (0, 2, 1, 3)) * -2.0 - x132 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x132 += einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), x114, (6, 1, 2, 7, 4, 5), (6, 7, 0, 3)) - x133 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x133 += einsum(t1.bb, (0, 1), x40, (2, 3, 4, 1), (2, 3, 0, 4)) - x134 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x134 += einsum(t1.bb, (0, 1), x133, (0, 2, 3, 4), (2, 3, 4, 1)) * -1.0 - del x133 - x135 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x135 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x90, (6, 2, 7, 5, 1, 4), (6, 7, 0, 3)) * -1.0 - x136 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x136 += einsum(t2.abab, (0, 1, 2, 3), x24, (4, 5, 0, 2), (4, 1, 5, 3)) - x137 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x137 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x85, (6, 7, 0, 2, 5, 3), (6, 7, 1, 4)) * -1.0 - x138 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x138 += einsum(x38, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x138 += einsum(x40, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x139 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x139 += einsum(t2.bbbb, (0, 1, 2, 3), x138, (1, 4, 5, 3), (4, 5, 0, 2)) * 4.0 - del x138 - x140 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x140 += einsum(x103, (0, 1, 2, 3), (0, 1, 2, 3)) - x140 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x141 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x141 += einsum(t2.abab, (0, 1, 2, 3), x140, (4, 5, 0, 2), (4, 5, 1, 3)) - del x140 - x142 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x142 += einsum(t2.bbbb, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x142 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -1.0 - x143 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x143 += einsum(x142, (0, 1, 2, 3), x41, (4, 0, 5, 2), (1, 4, 5, 3)) * 2.0 - del x142 - x144 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x144 += einsum(delta.bb.oo, (0, 1), t1.bb, (2, 3), (0, 1, 2, 3)) - x144 += einsum(x132, (0, 1, 2, 3), (1, 0, 2, 3)) * -9.0 - x144 += einsum(x134, (0, 1, 2, 3), (1, 0, 2, 3)) * 6.0 - del x134 - x144 += einsum(x135, (0, 1, 2, 3), (1, 0, 2, 3)) * -4.0 - x144 += einsum(x136, (0, 1, 2, 3), (1, 0, 2, 3)) * 2.0 - x144 += einsum(x137, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x144 += einsum(x139, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x139 - x144 += einsum(x141, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x141 - x144 += einsum(x143, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x143 - x144 += einsum(t1.bb, (0, 1), x119, (2, 3), (0, 2, 3, 1)) - del x119 - rdm2_f_bbbb_ooov += einsum(x144, (0, 1, 2, 3), (0, 2, 1, 3)) - rdm2_f_bbbb_ooov += einsum(x144, (0, 1, 2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_bbbb_oovo += einsum(x144, (0, 1, 2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_bbbb_oovo += einsum(x144, (0, 1, 2, 3), (2, 0, 3, 1)) - del x144 - x145 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x145 += einsum(t2.bbbb, (0, 1, 2, 3), l3.bbbbbb, (4, 5, 3, 6, 0, 1), (6, 4, 5, 2)) - rdm2_f_bbbb_vvov = np.zeros((nvir[1], nvir[1], nocc[1], nvir[1]), dtype=types[float]) - rdm2_f_bbbb_vvov += einsum(x145, (0, 1, 2, 3), (1, 2, 0, 3)) * 6.0 - rdm2_f_bbbb_vvvo = np.zeros((nvir[1], nvir[1], nvir[1], nocc[1]), dtype=types[float]) - rdm2_f_bbbb_vvvo += einsum(x145, (0, 1, 2, 3), (1, 2, 3, 0)) * -6.0 - x146 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x146 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 2, 5, 6, 0, 1), (6, 4, 5, 3)) - rdm2_f_bbbb_vvov += einsum(x146, (0, 1, 2, 3), (1, 2, 0, 3)) * 2.0 - rdm2_f_bbbb_vvvo += einsum(x146, (0, 1, 2, 3), (1, 2, 3, 0)) * -2.0 - x147 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x147 += einsum(x145, (0, 1, 2, 3), (0, 2, 1, 3)) * -3.0 - x147 += einsum(x146, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - rdm2_f_abab_oovv += einsum(x147, (0, 1, 2, 3), t3.babbab, (4, 5, 0, 1, 6, 2), (5, 4, 6, 3)) * 2.0 - rdm2_f_abab_ovvv += einsum(t2.abab, (0, 1, 2, 3), x147, (1, 4, 3, 5), (0, 4, 2, 5)) * -2.0 - x148 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x148 += einsum(t2.bbbb, (0, 1, 2, 3), x147, (4, 2, 3, 5), (4, 0, 1, 5)) * 2.0 - del x147 - rdm2_f_bbbb_ooov += einsum(x148, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_bbbb_oovo += einsum(x148, (0, 1, 2, 3), (2, 1, 3, 0)) - del x148 - x149 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x149 += einsum(x37, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.9999999999999798 - x149 += einsum(x39, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.9999999999999798 - x149 += einsum(x35, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.999999999999998 - x149 += einsum(x36, (0, 1, 2, 3), (0, 1, 3, 2)) - x150 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x150 += einsum(t1.bb, (0, 1), x149, (0, 2, 3, 4), (2, 3, 4, 1)) * 2.0000000000000404 - del x149 - rdm2_f_bbbb_ooov += einsum(x150, (0, 1, 2, 3), (2, 1, 0, 3)) * -1.0 - rdm2_f_bbbb_oovo += einsum(x150, (0, 1, 2, 3), (2, 1, 3, 0)) - del x150 - x151 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x151 += einsum(l2.bbbb, (0, 1, 2, 3), t3.babbab, (4, 5, 3, 0, 6, 1), (2, 4, 5, 6)) - rdm2_f_abab_oovo += einsum(x151, (0, 1, 2, 3), (2, 1, 3, 0)) * -2.0 - x152 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x152 += einsum(l1.bb, (0, 1), t2.abab, (2, 3, 4, 0), (1, 3, 2, 4)) - rdm2_f_abab_oovo += einsum(x152, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x153 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x153 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x114, (0, 2, 6, 7, 3, 5), (6, 7, 1, 4)) - rdm2_f_abab_oovo += einsum(x153, (0, 1, 2, 3), (2, 1, 3, 0)) * -3.0 - x154 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x154 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x59, (2, 6, 3, 5, 1, 7), (6, 0, 7, 4)) * -1.0 - rdm2_f_abab_oovo += einsum(x154, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x155 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x155 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x90, (1, 6, 7, 4, 2, 5), (6, 7, 0, 3)) - rdm2_f_abab_oovo += einsum(x155, (0, 1, 2, 3), (2, 1, 3, 0)) * -4.0 - x156 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x156 += einsum(t2.abab, (0, 1, 2, 3), x93, (1, 4, 5, 3, 0, 6), (4, 5, 6, 2)) - rdm2_f_abab_oovo += einsum(x156, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x157 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x157 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x51, (6, 4, 0, 2, 7, 5), (6, 1, 7, 3)) * -1.0 - rdm2_f_abab_oovo += einsum(x157, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x158 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x158 += einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), x85, (6, 7, 1, 2, 4, 5), (6, 7, 0, 3)) - rdm2_f_abab_oovo += einsum(x158, (0, 1, 2, 3), (2, 1, 3, 0)) * -3.0 - x159 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x159 += einsum(t2.aaaa, (0, 1, 2, 3), x88, (4, 5, 1, 0, 6, 3), (4, 5, 6, 2)) - rdm2_f_abab_oovo += einsum(x159, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x160 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x160 += einsum(l2.abab, (0, 1, 2, 3), t3.abaaba, (4, 5, 2, 6, 1, 0), (3, 5, 4, 6)) - rdm2_f_abab_oovo += einsum(x160, (0, 1, 2, 3), (2, 1, 3, 0)) * -2.0 - x161 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x161 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 5, 3, 6, 0, 1), (6, 4, 5, 2)) - rdm2_f_abab_vvvo = np.zeros((nvir[0], nvir[1], nvir[0], nocc[1]), dtype=types[float]) - rdm2_f_abab_vvvo += einsum(x161, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x162 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x162 += einsum(t2.aaaa, (0, 1, 2, 3), l3.abaaba, (4, 5, 3, 0, 6, 1), (6, 5, 4, 2)) - rdm2_f_abab_vvvo += einsum(x162, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x163 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x163 += einsum(x161, (0, 1, 2, 3), (0, 1, 2, 3)) - x163 += einsum(x162, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_abab_oovo += einsum(t2.abab, (0, 1, 2, 3), x163, (4, 3, 2, 5), (0, 1, 5, 4)) * 2.0 - rdm2_f_abab_ovvv += einsum(t2.abab, (0, 1, 2, 3), x163, (1, 4, 2, 5), (0, 4, 5, 3)) * -2.0 - rdm2_f_abab_vovv += einsum(t2.bbbb, (0, 1, 2, 3), x163, (1, 3, 4, 5), (4, 0, 5, 2)) * 4.0 - x164 = np.zeros((nocc[0], nvir[0]), dtype=types[float]) - x164 += einsum(t1.aa, (0, 1), (0, 1)) * -1.0 - x164 += einsum(x54, (0, 1), (0, 1)) * -1.0 - del x54 - x164 += einsum(x55, (0, 1), (0, 1)) * -2.0 - del x55 - x164 += einsum(x56, (0, 1), (0, 1)) * -1.0 - del x56 - x164 += einsum(x57, (0, 1), (0, 1)) * -2.0 - del x57 - x164 += einsum(x58, (0, 1), (0, 1)) * -3.0 - del x58 - x164 += einsum(x60, (0, 1), (0, 1)) * 0.9999999999999601 - del x60 - x164 += einsum(x61, (0, 1), (0, 1)) * 1.9999999999999194 - del x61 - x164 += einsum(x62, (0, 1), (0, 1)) * 2.9999999999998788 - del x62 - x164 += einsum(x63, (0, 1), (0, 1)) - del x63 - x164 += einsum(x65, (0, 1), (0, 1)) - del x65 - x164 += einsum(x67, (0, 1), (0, 1)) - del x67 - rdm2_f_abab_oovo += einsum(delta.bb.oo, (0, 1), x164, (2, 3), (2, 0, 3, 1)) * -1.0 - rdm2_f_abab_oovv += einsum(t1.bb, (0, 1), x164, (2, 3), (2, 0, 3, 1)) * -1.0 - del x164 - x165 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x165 += einsum(t2.abab, (0, 1, 2, 3), x59, (4, 1, 5, 3, 0, 6), (4, 5, 6, 2)) - rdm2_f_abab_ovvo += einsum(x165, (0, 1, 2, 3), (2, 1, 3, 0)) * -2.0 - x166 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x166 += einsum(t2.abab, (0, 1, 2, 3), x165, (1, 3, 4, 5), (4, 0, 2, 5)) - x167 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x167 += einsum(l2.abab, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 0), (3, 1, 4, 5)) - rdm2_f_abab_ovvo += einsum(x167, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x168 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x168 += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.babbab, (4, 6, 5, 1, 7, 2), (3, 0, 6, 7)) - rdm2_f_abab_ovvo += einsum(x168, (0, 1, 2, 3), (2, 1, 3, 0)) * 3.0 - x169 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x169 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 5, 4, 7, 2, 1), (3, 0, 6, 7)) - rdm2_f_abab_ovvo += einsum(x169, (0, 1, 2, 3), (2, 1, 3, 0)) * 4.0 - x170 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x170 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (6, 3, 5, 7, 0, 2), (4, 1, 6, 7)) - rdm2_f_abab_ovvo += einsum(x170, (0, 1, 2, 3), (2, 1, 3, 0)) * 3.0 - x171 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x171 += einsum(x167, (0, 1, 2, 3), (0, 1, 2, 3)) - x171 += einsum(x168, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.5 - x171 += einsum(x169, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x171 += einsum(x170, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.5 - x172 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x172 += einsum(t2.abab, (0, 1, 2, 3), x171, (1, 3, 4, 5), (4, 0, 5, 2)) * 2.0 - del x171 - x173 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x173 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 6, 5, 0, 7, 2), (4, 6, 1, 7)) - rdm2_f_aaaa_ovov += einsum(x173, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_aaaa_ovvo += einsum(x173, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_aaaa_voov += einsum(x173, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_aaaa_vovo += einsum(x173, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x174 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x174 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 4, 5, 7, 1, 2), (3, 6, 0, 7)) - rdm2_f_aaaa_ovov += einsum(x174, (0, 1, 2, 3), (1, 2, 0, 3)) * -4.0 - rdm2_f_aaaa_ovvo += einsum(x174, (0, 1, 2, 3), (1, 2, 3, 0)) * 4.0 - rdm2_f_aaaa_voov += einsum(x174, (0, 1, 2, 3), (2, 1, 0, 3)) * 4.0 - rdm2_f_aaaa_vovo += einsum(x174, (0, 1, 2, 3), (2, 1, 3, 0)) * -4.0 - x175 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x175 += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (6, 4, 5, 7, 1, 2), (3, 6, 0, 7)) - rdm2_f_aaaa_ovov += einsum(x175, (0, 1, 2, 3), (1, 2, 0, 3)) * -9.0 - rdm2_f_aaaa_ovvo += einsum(x175, (0, 1, 2, 3), (1, 2, 3, 0)) * 9.0 - rdm2_f_aaaa_voov += einsum(x175, (0, 1, 2, 3), (2, 1, 0, 3)) * 9.0 - rdm2_f_aaaa_vovo += einsum(x175, (0, 1, 2, 3), (2, 1, 3, 0)) * -9.0 - x176 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x176 += einsum(x173, (0, 1, 2, 3), (0, 1, 2, 3)) - x176 += einsum(x174, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - x176 += einsum(x175, (0, 1, 2, 3), (0, 1, 2, 3)) * 9.0 - x177 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x177 += einsum(t2.aaaa, (0, 1, 2, 3), x176, (1, 4, 3, 5), (4, 0, 5, 2)) * 2.0 - del x176 - x178 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x178 += einsum(t2.abab, (0, 1, 2, 3), x51, (1, 3, 4, 0, 5, 6), (4, 5, 6, 2)) - rdm2_f_aaaa_ovov += einsum(x178, (0, 1, 2, 3), (1, 2, 0, 3)) * 2.0 - rdm2_f_aaaa_ovvo += einsum(x178, (0, 1, 2, 3), (1, 2, 3, 0)) * -2.0 - rdm2_f_aaaa_voov += einsum(x178, (0, 1, 2, 3), (2, 1, 0, 3)) * -2.0 - rdm2_f_aaaa_vovo += einsum(x178, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x179 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x179 += einsum(t2.aaaa, (0, 1, 2, 3), x45, (4, 1, 0, 5, 6, 3), (4, 5, 6, 2)) - rdm2_f_aaaa_ovov += einsum(x179, (0, 1, 2, 3), (1, 2, 0, 3)) * 6.0 - rdm2_f_aaaa_ovvo += einsum(x179, (0, 1, 2, 3), (1, 2, 3, 0)) * -6.0 - rdm2_f_aaaa_voov += einsum(x179, (0, 1, 2, 3), (2, 1, 0, 3)) * -6.0 - rdm2_f_aaaa_vovo += einsum(x179, (0, 1, 2, 3), (2, 1, 3, 0)) * 6.0 - x180 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x180 += einsum(t1.aa, (0, 1), x14, (2, 0, 3, 4), (2, 3, 1, 4)) - x181 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x181 += einsum(x178, (0, 1, 2, 3), (0, 1, 2, 3)) - x181 += einsum(x179, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x181 += einsum(x180, (0, 1, 2, 3), (0, 1, 3, 2)) - x182 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x182 += einsum(t2.aaaa, (0, 1, 2, 3), x181, (1, 4, 3, 5), (4, 0, 5, 2)) * 4.0 - del x181 - x183 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x183 += einsum(t2.aaaa, (0, 1, 2, 3), x51, (4, 5, 0, 1, 6, 3), (4, 5, 6, 2)) * -1.0 - rdm2_f_abab_ovvo += einsum(x183, (0, 1, 2, 3), (2, 1, 3, 0)) * -2.0 - x184 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x184 += einsum(t1.aa, (0, 1), x21, (2, 3, 0, 4), (2, 3, 4, 1)) - x185 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x185 += einsum(x183, (0, 1, 2, 3), (0, 1, 2, 3)) - x185 += einsum(x184, (0, 1, 2, 3), (0, 1, 2, 3)) - del x184 - x186 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x186 += einsum(t2.abab, (0, 1, 2, 3), x185, (1, 3, 4, 5), (4, 0, 5, 2)) * 2.0 - del x185 - x187 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x187 += einsum(t2.abab, (0, 1, 2, 3), x19, (1, 3, 4, 5), (4, 5, 0, 2)) - x188 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x188 += einsum(t2.aaaa, (0, 1, 2, 3), x1, (4, 1, 5, 3), (4, 5, 0, 2)) * -1.0 - x189 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x189 += einsum(x187, (0, 1, 2, 3), (0, 1, 2, 3)) - del x187 - x189 += einsum(x188, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - del x188 - x189 += einsum(x70, (0, 1, 2, 3), (0, 1, 2, 3)) - del x70 - x189 += einsum(x69, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - del x69 - x189 += einsum(x71, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - del x71 - x189 += einsum(x72, (0, 1, 2, 3), (0, 1, 2, 3)) * 9.0 - del x72 - x190 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x190 += einsum(t1.aa, (0, 1), x189, (0, 2, 3, 4), (2, 3, 4, 1)) - del x189 - x191 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x191 += einsum(x166, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - del x166 - x191 += einsum(x172, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x172 - x191 += einsum(x177, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x177 - x191 += einsum(x182, (0, 1, 2, 3), (0, 1, 2, 3)) - del x182 - x191 += einsum(x186, (0, 1, 2, 3), (0, 1, 2, 3)) - del x186 - x191 += einsum(x190, (0, 1, 2, 3), (0, 1, 3, 2)) - del x190 - x191 += einsum(t1.aa, (0, 1), x68, (2, 3), (0, 2, 1, 3)) - del x68 - rdm2_f_aaaa_oovv += einsum(x191, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_aaaa_oovv += einsum(x191, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_aaaa_oovv += einsum(x191, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_aaaa_oovv += einsum(x191, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x191 - x192 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x192 += einsum(x11, (0, 1), t2.aaaa, (2, 0, 3, 4), (1, 2, 3, 4)) - x193 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x193 += einsum(x74, (0, 1, 2, 3), t3.abaaba, (4, 0, 2, 5, 1, 6), (4, 3, 5, 6)) * -2.0 - del x74 - x194 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x194 += einsum(x1, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - x194 += einsum(x12, (0, 1, 2, 3), (0, 1, 2, 3)) - x195 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x195 += einsum(x194, (0, 1, 2, 3), t3.aaaaaa, (4, 0, 1, 5, 6, 3), (2, 4, 5, 6)) * -6.0 - del x194 - x196 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x196 += einsum(t1.aa, (0, 1), x14, (2, 3, 4, 1), (0, 2, 3, 4)) * 0.3333333333333333 - del x14 - x197 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x197 += einsum(t2.aaaa, (0, 1, 2, 3), (0, 1, 2, 3)) - x197 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - x198 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x198 += einsum(x196, (0, 1, 2, 3), x197, (1, 2, 4, 5), (0, 3, 4, 5)) * 6.0 - del x196, x197 - x199 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x199 += einsum(x5, (0, 1), (0, 1)) * 0.5000000000000203 - x199 += einsum(x6, (0, 1), (0, 1)) * 1.0000000000000406 - x199 += einsum(x8, (0, 1), (0, 1)) - x200 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x200 += einsum(x199, (0, 1), t2.aaaa, (2, 0, 3, 4), (1, 2, 3, 4)) * -3.999999999999838 - del x199 - x201 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x201 += einsum(x192, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x192 - x201 += einsum(x193, (0, 1, 2, 3), (1, 0, 3, 2)) - del x193 - x201 += einsum(x195, (0, 1, 2, 3), (0, 1, 2, 3)) - del x195 - x201 += einsum(x198, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x198 - x201 += einsum(x200, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x200 - rdm2_f_aaaa_oovv += einsum(x201, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_aaaa_oovv += einsum(x201, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x201 - x202 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x202 += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 5, 1), (2, 4, 0, 5)) - rdm2_f_aaaa_ovov += einsum(x202, (0, 1, 2, 3), (1, 2, 0, 3)) * -4.0 - rdm2_f_aaaa_ovvo += einsum(x202, (0, 1, 2, 3), (1, 2, 3, 0)) * 4.0 - rdm2_f_aaaa_voov += einsum(x202, (0, 1, 2, 3), (2, 1, 0, 3)) * 4.0 - rdm2_f_aaaa_vovo += einsum(x202, (0, 1, 2, 3), (2, 1, 3, 0)) * -4.0 - x203 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x203 += einsum(t2.aaaa, (0, 1, 2, 3), x202, (1, 4, 3, 5), (0, 4, 2, 5)) - x204 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x204 += einsum(x163, (0, 1, 2, 3), t3.abaaba, (4, 0, 5, 6, 1, 2), (4, 5, 3, 6)) * -4.0 - x205 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x205 += einsum(x79, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - del x79 - x205 += einsum(x80, (0, 1, 2, 3), (0, 2, 1, 3)) * -3.0 - del x80 - rdm2_f_abab_vovv += einsum(t2.abab, (0, 1, 2, 3), x205, (0, 4, 2, 5), (4, 1, 5, 3)) * -2.0 - x206 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x206 += einsum(x205, (0, 1, 2, 3), t3.aaaaaa, (4, 5, 0, 6, 1, 2), (4, 5, 3, 6)) * -6.0 - x207 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x207 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - x208 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x208 += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) - x209 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x209 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 4, 5, 0, 6, 2), (1, 6)) - x210 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x210 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 4, 5, 6, 1, 2), (0, 6)) - x211 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x211 += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.aaaaaa, (3, 4, 5, 6, 1, 2), (0, 6)) - x212 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x212 += einsum(x207, (0, 1), (0, 1)) - x212 += einsum(x208, (0, 1), (0, 1)) * 2.0 - x212 += einsum(x209, (0, 1), (0, 1)) * 0.9999999999999597 - x212 += einsum(x210, (0, 1), (0, 1)) * 1.999999999999919 - x212 += einsum(x211, (0, 1), (0, 1)) * 2.999999999999883 - x213 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x213 += einsum(x212, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 1, 4)) * -2.0 - del x212 - x214 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x214 += einsum(t2.aaaa, (0, 1, 2, 3), x205, (4, 2, 3, 5), (4, 0, 1, 5)) - x215 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x215 += einsum(x50, (0, 1, 2, 3), (0, 2, 1, 3)) - del x50 - x215 += einsum(x49, (0, 1, 2, 3), (0, 2, 1, 3)) - del x49 - x215 += einsum(x48, (0, 1, 2, 3), (0, 2, 1, 3)) * 3.0 - del x48 - x215 += einsum(x53, (0, 1, 2, 3), (0, 2, 1, 3)) - del x53 - x215 += einsum(x47, (0, 1, 2, 3), (0, 2, 1, 3)) * 3.0 - del x47 - x215 += einsum(x214, (0, 1, 2, 3), (0, 2, 1, 3)) - del x214 - x216 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x216 += einsum(t1.aa, (0, 1), x215, (0, 2, 3, 4), (2, 3, 4, 1)) * 2.0 - del x215 - x217 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x217 += einsum(x203, (0, 1, 2, 3), (0, 1, 2, 3)) * 8.0 - del x203 - x217 += einsum(x204, (0, 1, 2, 3), (1, 0, 2, 3)) - del x204 - x217 += einsum(x206, (0, 1, 2, 3), (0, 1, 2, 3)) - del x206 - x217 += einsum(x213, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x213 - x217 += einsum(x216, (0, 1, 2, 3), (1, 0, 3, 2)) - del x216 - rdm2_f_aaaa_oovv += einsum(x217, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_aaaa_oovv += einsum(x217, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x217 - x218 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x218 += einsum(l2.bbbb, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 0, 4, 5)) - rdm2_f_abab_ovvo += einsum(x218, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x219 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x219 += einsum(t2.abab, (0, 1, 2, 3), x218, (1, 3, 4, 5), (4, 0, 5, 2)) - x220 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x220 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - x220 += einsum(x219, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0 - del x219 - rdm2_f_aaaa_oovv += einsum(x220, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_aaaa_oovv += einsum(x220, (0, 1, 2, 3), (0, 1, 2, 3)) - del x220 - x221 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x221 += einsum(x20, (0, 1, 2, 3), t3.abaaba, (4, 0, 2, 5, 1, 6), (3, 4, 5, 6)) - x222 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x222 += einsum(x13, (0, 1, 2, 3), t3.aaaaaa, (4, 0, 1, 5, 6, 3), (2, 4, 5, 6)) - x223 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x223 += einsum(x7, (0, 1), (0, 1)) - x223 += einsum(x9, (0, 1), (0, 1)) * 3.000000000000004 - x224 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x224 += einsum(x223, (0, 1), t2.aaaa, (2, 0, 3, 4), (1, 2, 3, 4)) * -1.9999999999999194 - del x223 - x225 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x225 += einsum(x221, (0, 1, 2, 3), (0, 1, 3, 2)) * -4.0 - del x221 - x225 += einsum(x222, (0, 1, 2, 3), (0, 1, 2, 3)) * -18.0 - del x222 - x225 += einsum(x224, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x224 - rdm2_f_aaaa_oovv += einsum(x225, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_aaaa_oovv += einsum(x225, (0, 1, 2, 3), (1, 0, 3, 2)) - del x225 - x226 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x226 += einsum(t2.aaaa, (0, 1, 2, 3), l3.abaaba, (2, 4, 3, 5, 6, 7), (6, 4, 5, 7, 0, 1)) - x226 += einsum(x52, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 5, 4)) * 1.0000000000000606 - del x52 - rdm2_f_aaaa_oovv += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x226, (1, 4, 0, 2, 6, 7), (6, 7, 3, 5)) * 1.9999999999999194 - del x226 - x227 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x227 += einsum(t2.aaaa, (0, 1, 2, 3), l3.aaaaaa, (4, 2, 3, 5, 6, 7), (5, 6, 7, 0, 1, 4)) - x227 += einsum(x46, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0000000000000584 - del x46 - rdm2_f_aaaa_oovv += einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), x227, (0, 1, 2, 6, 7, 5), (6, 7, 3, 4)) * 5.999999999999766 - del x227 - x228 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x228 += einsum(x0, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0000000000000404 - x228 += einsum(x2, (0, 1, 2, 3), (0, 1, 3, 2)) * 1.0000000000000404 - x228 += einsum(x3, (0, 1, 2, 3), (0, 1, 3, 2)) - x228 += einsum(x4, (0, 1, 2, 3), (0, 1, 3, 2)) * 3.000000000000004 - rdm2_f_aaaa_oovv += einsum(t2.aaaa, (0, 1, 2, 3), x228, (0, 1, 4, 5), (5, 4, 2, 3)) * 1.9999999999999194 - del x228 - x229 = np.zeros((nocc[0], nocc[0], nocc[0], nocc[0]), dtype=types[float]) - x229 += einsum(x0, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.9999999999999799 - del x0 - x229 += einsum(x2, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.9999999999999799 - del x2 - x229 += einsum(x3, (0, 1, 2, 3), (0, 1, 3, 2)) - del x3 - x229 += einsum(x4, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.999999999999998 - del x4 - x230 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x230 += einsum(t1.aa, (0, 1), x229, (0, 2, 3, 4), (2, 4, 3, 1)) * -0.3333333333333336 - del x229 - rdm2_f_aaaa_oovv += einsum(t1.aa, (0, 1), x230, (0, 2, 3, 4), (2, 3, 4, 1)) * -6.000000000000116 - del x230 - x231 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x231 += einsum(t2.abab, (0, 1, 2, 3), l3.abaaba, (4, 3, 2, 5, 6, 7), (6, 1, 5, 7, 0, 4)) - x231 += einsum(x88, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0000000000000606 - del x88 - rdm2_f_abab_oovv += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x231, (1, 6, 0, 2, 7, 5), (7, 6, 3, 4)) * -1.9999999999999194 - del x231 - x232 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x232 += einsum(t2.abab, (0, 1, 2, 3), l3.babbab, (4, 2, 3, 5, 6, 7), (5, 7, 1, 4, 6, 0)) - x232 += einsum(x93, (0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5)) * 1.0000000000000606 - del x93 - rdm2_f_abab_oovv += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x232, (0, 2, 6, 5, 1, 7), (7, 6, 4, 3)) * -1.9999999999999194 - del x232 - x233 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x233 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), (1, 4, 0, 2, 3, 5)) - x233 += einsum(t1.aa, (0, 1), t2.abab, (2, 3, 4, 5), (3, 5, 0, 2, 4, 1)) * -0.5 - rdm2_f_abab_oovv += einsum(x101, (0, 1, 2, 3), x233, (4, 0, 2, 5, 3, 6), (5, 4, 6, 1)) * -4.0 - del x233 - x234 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x234 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), (0, 2, 3, 5, 1, 4)) - x234 += einsum(t1.bb, (0, 1), t2.abab, (2, 3, 4, 5), (0, 3, 5, 1, 2, 4)) * -0.5 - rdm2_f_abab_oovv += einsum(x163, (0, 1, 2, 3), x234, (0, 4, 1, 5, 6, 2), (6, 4, 3, 5)) * -4.0 - del x163, x234 - x235 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x235 += einsum(x103, (0, 1, 2, 3), (0, 1, 2, 3)) - x235 += einsum(x23, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x235 += einsum(x24, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x24 - rdm2_f_abab_oovv += einsum(x235, (0, 1, 2, 3), t3.abaaba, (4, 0, 2, 5, 6, 3), (4, 1, 5, 6)) * -2.0 - rdm2_f_abab_vovv += einsum(t2.abab, (0, 1, 2, 3), x235, (1, 4, 0, 5), (5, 4, 2, 3)) * -1.0 - x236 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x236 += einsum(l2.abab, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (4, 5, 2, 0)) - rdm2_f_abab_voov += einsum(x236, (0, 1, 2, 3), (3, 0, 2, 1)) * 2.0 - x237 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x237 += einsum(l2.aaaa, (0, 1, 2, 3), t2.abab, (3, 4, 1, 5), (4, 5, 2, 0)) - rdm2_f_abab_voov += einsum(x237, (0, 1, 2, 3), (3, 0, 2, 1)) * 2.0 - x238 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x238 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (6, 3, 5, 7, 0, 2), (6, 7, 4, 1)) - rdm2_f_abab_voov += einsum(x238, (0, 1, 2, 3), (3, 0, 2, 1)) * 3.0 - x239 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x239 += einsum(t2.bbbb, (0, 1, 2, 3), x90, (0, 1, 4, 3, 5, 6), (4, 2, 5, 6)) * -1.0 - rdm2_f_abab_voov += einsum(x239, (0, 1, 2, 3), (3, 0, 2, 1)) * -2.0 - x240 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x240 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 5, 4, 7, 2, 1), (6, 7, 3, 0)) - rdm2_f_abab_voov += einsum(x240, (0, 1, 2, 3), (3, 0, 2, 1)) * 4.0 - x241 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x241 += einsum(t2.abab, (0, 1, 2, 3), x85, (1, 4, 5, 0, 6, 2), (4, 3, 5, 6)) - rdm2_f_abab_voov += einsum(x241, (0, 1, 2, 3), (3, 0, 2, 1)) * -2.0 - x242 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x242 += einsum(l3.aaaaaa, (0, 1, 2, 3, 4, 5), t3.abaaba, (4, 6, 5, 1, 7, 2), (6, 7, 3, 0)) - rdm2_f_abab_voov += einsum(x242, (0, 1, 2, 3), (3, 0, 2, 1)) * 3.0 - x243 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x243 += einsum(x236, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.6666666666666666 - x243 += einsum(x237, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.6666666666666666 - x243 += einsum(x238, (0, 1, 2, 3), (0, 1, 2, 3)) - x243 += einsum(x239, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.6666666666666666 - x243 += einsum(x240, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.3333333333333333 - x243 += einsum(x241, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.6666666666666666 - x243 += einsum(x242, (0, 1, 2, 3), (0, 1, 2, 3)) - x243 += einsum(t1.bb, (0, 1), x25, (0, 2, 3, 4), (2, 1, 3, 4)) * -0.6666666666666666 - rdm2_f_abab_oovv += einsum(t2.aaaa, (0, 1, 2, 3), x243, (4, 5, 1, 3), (0, 4, 2, 5)) * 6.0 - del x243 - x244 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x244 += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - rdm2_f_bbbb_ovov += einsum(x244, (0, 1, 2, 3), (1, 2, 0, 3)) * -4.0 - rdm2_f_bbbb_ovvo += einsum(x244, (0, 1, 2, 3), (1, 2, 3, 0)) * 4.0 - rdm2_f_bbbb_voov += einsum(x244, (0, 1, 2, 3), (2, 1, 0, 3)) * 4.0 - rdm2_f_bbbb_vovo += einsum(x244, (0, 1, 2, 3), (2, 1, 3, 0)) * -4.0 - x245 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x245 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 5), (3, 4, 1, 5)) - rdm2_f_bbbb_ovov += einsum(x245, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_bbbb_ovvo += einsum(x245, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_bbbb_voov += einsum(x245, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_bbbb_vovo += einsum(x245, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x246 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x246 += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (6, 4, 5, 7, 1, 2), (3, 6, 0, 7)) - rdm2_f_bbbb_ovov += einsum(x246, (0, 1, 2, 3), (1, 2, 0, 3)) * -9.0 - rdm2_f_bbbb_ovvo += einsum(x246, (0, 1, 2, 3), (1, 2, 3, 0)) * 9.0 - rdm2_f_bbbb_voov += einsum(x246, (0, 1, 2, 3), (2, 1, 0, 3)) * 9.0 - rdm2_f_bbbb_vovo += einsum(x246, (0, 1, 2, 3), (2, 1, 3, 0)) * -9.0 - x247 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x247 += einsum(t2.bbbb, (0, 1, 2, 3), x114, (4, 1, 0, 5, 6, 3), (4, 5, 6, 2)) - rdm2_f_bbbb_ovov += einsum(x247, (0, 1, 2, 3), (1, 2, 0, 3)) * 6.0 - rdm2_f_bbbb_ovvo += einsum(x247, (0, 1, 2, 3), (1, 2, 3, 0)) * -6.0 - rdm2_f_bbbb_voov += einsum(x247, (0, 1, 2, 3), (2, 1, 0, 3)) * -6.0 - rdm2_f_bbbb_vovo += einsum(x247, (0, 1, 2, 3), (2, 1, 3, 0)) * 6.0 - x248 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x248 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 4, 5, 7, 1, 2), (3, 6, 0, 7)) - rdm2_f_bbbb_ovov += einsum(x248, (0, 1, 2, 3), (1, 2, 0, 3)) * -4.0 - rdm2_f_bbbb_ovvo += einsum(x248, (0, 1, 2, 3), (1, 2, 3, 0)) * 4.0 - rdm2_f_bbbb_voov += einsum(x248, (0, 1, 2, 3), (2, 1, 0, 3)) * 4.0 - rdm2_f_bbbb_vovo += einsum(x248, (0, 1, 2, 3), (2, 1, 3, 0)) * -4.0 - x249 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x249 += einsum(t2.abab, (0, 1, 2, 3), x90, (4, 1, 5, 6, 0, 2), (4, 5, 6, 3)) - rdm2_f_bbbb_ovov += einsum(x249, (0, 1, 2, 3), (1, 2, 0, 3)) * 2.0 - rdm2_f_bbbb_ovvo += einsum(x249, (0, 1, 2, 3), (1, 2, 3, 0)) * -2.0 - rdm2_f_bbbb_voov += einsum(x249, (0, 1, 2, 3), (2, 1, 0, 3)) * -2.0 - rdm2_f_bbbb_vovo += einsum(x249, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - x250 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x250 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 6, 5, 0, 7, 2), (4, 6, 1, 7)) - rdm2_f_bbbb_ovov += einsum(x250, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_bbbb_ovvo += einsum(x250, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_bbbb_voov += einsum(x250, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_bbbb_vovo += einsum(x250, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x251 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x251 += einsum(x244, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - x251 += einsum(x245, (0, 1, 2, 3), (0, 1, 2, 3)) - x251 += einsum(x246, (0, 1, 2, 3), (0, 1, 2, 3)) * 9.0 - x251 += einsum(x247, (0, 1, 2, 3), (0, 1, 2, 3)) * -6.0 - x251 += einsum(x248, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - x251 += einsum(x249, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x251 += einsum(x250, (0, 1, 2, 3), (0, 1, 2, 3)) - x251 += einsum(t1.bb, (0, 1), x42, (2, 0, 3, 4), (2, 3, 4, 1)) * -6.0 - rdm2_f_abab_oovv += einsum(t2.abab, (0, 1, 2, 3), x251, (1, 4, 3, 5), (0, 4, 2, 5)) - del x251 - x252 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x252 += einsum(x173, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - x252 += einsum(x174, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x252 += einsum(x178, (0, 1, 2, 3), (0, 1, 2, 3)) - x252 += einsum(x175, (0, 1, 2, 3), (0, 1, 2, 3)) * -4.5 - x252 += einsum(x179, (0, 1, 2, 3), (0, 1, 2, 3)) * 3.0 - x252 += einsum(x180, (0, 1, 2, 3), (0, 1, 3, 2)) - del x180 - rdm2_f_abab_oovv += einsum(t2.abab, (0, 1, 2, 3), x252, (0, 4, 2, 5), (4, 1, 5, 3)) * -2.0 - del x252 - x253 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x253 += einsum(x20, (0, 1, 2, 3), (0, 1, 2, 3)) - del x20 - x253 += einsum(x21, (0, 1, 2, 3), (0, 1, 2, 3)) - del x21 - x254 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x254 += einsum(x168, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.5 - x254 += einsum(x169, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - x254 += einsum(x165, (0, 1, 2, 3), (0, 1, 2, 3)) - x254 += einsum(x170, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.5 - x254 += einsum(x183, (0, 1, 2, 3), (0, 1, 2, 3)) - x254 += einsum(t1.aa, (0, 1), x253, (2, 3, 0, 4), (2, 3, 4, 1)) - rdm2_f_abab_oovv += einsum(t2.bbbb, (0, 1, 2, 3), x254, (1, 3, 4, 5), (4, 0, 5, 2)) * -4.0 - del x254 - x255 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x255 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 5, 1), (3, 4, 0, 5)) - rdm2_f_abab_vovo += einsum(x255, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x256 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x256 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (6, 4, 5, 0, 7, 2), (3, 6, 1, 7)) - rdm2_f_abab_vovo += einsum(x256, (0, 1, 2, 3), (2, 1, 3, 0)) * -2.0 - x257 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x257 += einsum(t2.abab, (0, 1, 2, 3), x90, (4, 1, 5, 3, 0, 6), (4, 5, 6, 2)) * -1.0 - rdm2_f_abab_vovo += einsum(x257, (0, 1, 2, 3), (2, 1, 3, 0)) * -2.0 - x258 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x258 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 6, 5, 7, 1, 2), (4, 6, 0, 7)) - rdm2_f_abab_vovo += einsum(x258, (0, 1, 2, 3), (2, 1, 3, 0)) * -2.0 - x259 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x259 += einsum(t2.aaaa, (0, 1, 2, 3), x85, (4, 5, 0, 1, 6, 3), (4, 5, 6, 2)) - del x85 - rdm2_f_abab_vovo += einsum(x259, (0, 1, 2, 3), (2, 1, 3, 0)) * -2.0 - x260 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x260 += einsum(x255, (0, 1, 2, 3), (0, 1, 2, 3)) - x260 += einsum(x256, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x260 += einsum(x257, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x260 += einsum(x258, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x260 += einsum(x259, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - x260 += einsum(t1.aa, (0, 1), x25, (2, 3, 0, 4), (2, 3, 4, 1)) * 2.0 - rdm2_f_abab_oovv += einsum(t2.abab, (0, 1, 2, 3), x260, (1, 4, 2, 5), (0, 4, 5, 3)) - del x260 - x261 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x261 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 6, 5, 7, 1, 2), (0, 7, 4, 6)) - rdm2_f_abab_ovov += einsum(x261, (0, 1, 2, 3), (3, 0, 2, 1)) * -2.0 - x262 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x262 += einsum(t2.bbbb, (0, 1, 2, 3), x59, (0, 1, 4, 3, 5, 6), (4, 2, 5, 6)) - del x59 - rdm2_f_abab_ovov += einsum(x262, (0, 1, 2, 3), (3, 0, 2, 1)) * -2.0 - x263 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x263 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (6, 4, 5, 0, 7, 2), (1, 7, 3, 6)) - rdm2_f_abab_ovov += einsum(x263, (0, 1, 2, 3), (3, 0, 2, 1)) * -2.0 - x264 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x264 += einsum(t2.abab, (0, 1, 2, 3), x51, (1, 4, 5, 0, 6, 2), (4, 3, 5, 6)) * -1.0 - rdm2_f_abab_ovov += einsum(x264, (0, 1, 2, 3), (3, 0, 2, 1)) * -2.0 - x265 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x265 += einsum(x261, (0, 1, 2, 3), (0, 1, 2, 3)) - x265 += einsum(x262, (0, 1, 2, 3), (0, 1, 2, 3)) - x265 += einsum(x263, (0, 1, 2, 3), (0, 1, 2, 3)) - x265 += einsum(x264, (0, 1, 2, 3), (0, 1, 2, 3)) - x265 += einsum(t1.bb, (0, 1), x253, (0, 2, 3, 4), (2, 1, 3, 4)) - del x253 - rdm2_f_abab_oovv += einsum(t2.abab, (0, 1, 2, 3), x265, (3, 4, 0, 5), (5, 1, 2, 4)) * 2.0 - del x265 - x266 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x266 += einsum(t1.bb, (0, 1), x105, (2, 1, 3, 4), (2, 0, 3, 4)) - del x105 - x267 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x267 += einsum(x18, (0, 1, 2, 3), (0, 1, 2, 3)) - x267 += einsum(x17, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.9999999999999194 - x267 += einsum(x16, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.9999999999999194 - x267 += einsum(x266, (0, 1, 2, 3), (0, 1, 2, 3)) - x267 += einsum(x26, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_abab_oovv += einsum(t2.abab, (0, 1, 2, 3), x267, (1, 4, 0, 5), (5, 4, 2, 3)) - del x267 - x268 = np.zeros((nocc[1], nocc[1], nocc[0], nocc[0]), dtype=types[float]) - x268 += einsum(x18, (0, 1, 2, 3), (0, 1, 2, 3)) - del x18 - x268 += einsum(x17, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.000000000000041 - del x17 - x268 += einsum(x16, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.000000000000041 - del x16 - x268 += einsum(x266, (0, 1, 2, 3), (0, 1, 2, 3)) - del x266 - x268 += einsum(x26, (0, 1, 2, 3), (0, 1, 3, 2)) - del x26 - x269 = np.zeros((nocc[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x269 += einsum(x96, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.3333333333333333 - del x96 - x269 += einsum(x98, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.6666666666666666 - del x98 - x269 += einsum(t2.abab, (0, 1, 2, 3), x103, (1, 4, 5, 2), (4, 3, 5, 0)) * 0.3333333333333333 - x269 += einsum(t2.bbbb, (0, 1, 2, 3), x19, (1, 3, 4, 5), (0, 2, 4, 5)) * -0.6666666666666666 - x269 += einsum(x97, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.6666666666666666 - del x97 - x269 += einsum(t2.abab, (0, 1, 2, 3), x1, (4, 0, 5, 2), (1, 3, 4, 5)) * 0.6666666666666666 - x269 += einsum(x91, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.6666666666666666 - del x91 - x269 += einsum(x92, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x92 - x269 += einsum(x94, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.6666666666666666 - del x94 - x269 += einsum(x86, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.6666666666666666 - del x86 - x269 += einsum(x87, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.3333333333333333 - del x87 - x269 += einsum(x89, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.6666666666666666 - del x89 - x269 += einsum(x95, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x95 - x269 += einsum(t1.bb, (0, 1), x268, (0, 2, 3, 4), (2, 1, 3, 4)) * 0.3333333333333333 - del x268 - rdm2_f_abab_oovv += einsum(t1.aa, (0, 1), x269, (2, 3, 0, 4), (4, 2, 1, 3)) * 3.0 - del x269 - x270 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x270 += einsum(x207, (0, 1), (0, 1)) * 0.3333333333333468 - x270 += einsum(x208, (0, 1), (0, 1)) * 0.6666666666666936 - x270 += einsum(x209, (0, 1), (0, 1)) * 0.33333333333333354 - x270 += einsum(x210, (0, 1), (0, 1)) * 0.6666666666666667 - x270 += einsum(x211, (0, 1), (0, 1)) - rdm2_f_abab_oovv += einsum(x270, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -2.9999999999998788 - del x270 - x271 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x271 += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) - x272 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x272 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - x273 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x273 += einsum(l3.bbbbbb, (0, 1, 2, 3, 4, 5), t3.bbbbbb, (3, 4, 5, 6, 1, 2), (0, 6)) - x274 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x274 += einsum(l3.babbab, (0, 1, 2, 3, 4, 5), t3.babbab, (3, 4, 5, 6, 1, 2), (0, 6)) - x275 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x275 += einsum(l3.abaaba, (0, 1, 2, 3, 4, 5), t3.abaaba, (3, 4, 5, 0, 6, 2), (1, 6)) - x276 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x276 += einsum(x271, (0, 1), (0, 1)) * 2.0 - x276 += einsum(x272, (0, 1), (0, 1)) - x276 += einsum(x273, (0, 1), (0, 1)) * 2.9999999999998788 - x276 += einsum(x274, (0, 1), (0, 1)) * 1.9999999999999194 - x276 += einsum(x275, (0, 1), (0, 1)) * 0.9999999999999601 - rdm2_f_abab_oovv += einsum(x276, (0, 1), t2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -1.0 - del x276 - x277 = np.zeros((nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x277 += einsum(x152, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x152 - x277 += einsum(x151, (0, 1, 2, 3), (0, 1, 2, 3)) - del x151 - x277 += einsum(t2.abab, (0, 1, 2, 3), x38, (4, 1, 5, 3), (4, 5, 0, 2)) * -1.0 - x277 += einsum(x160, (0, 1, 2, 3), (0, 1, 2, 3)) - del x160 - x277 += einsum(t2.aaaa, (0, 1, 2, 3), x103, (4, 5, 1, 3), (4, 5, 0, 2)) - x277 += einsum(t2.abab, (0, 1, 2, 3), x19, (4, 3, 0, 5), (4, 1, 5, 2)) * -0.5 - del x19 - x277 += einsum(x153, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.5 - del x153 - x277 += einsum(x155, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x155 - x277 += einsum(x154, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x154 - x277 += einsum(x156, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x156 - x277 += einsum(x158, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.5 - del x158 - x277 += einsum(x157, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x157 - x277 += einsum(x159, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x159 - rdm2_f_abab_oovv += einsum(t1.bb, (0, 1), x277, (0, 2, 3, 4), (3, 2, 4, 1)) * -2.0 - del x277 - x278 = np.zeros((nocc[0], nocc[0]), dtype=types[float]) - x278 += einsum(x11, (0, 1), (0, 1)) * 0.3333333333333468 - del x11 - x278 += einsum(x5, (0, 1), (0, 1)) * 0.3333333333333468 - del x5 - x278 += einsum(x6, (0, 1), (0, 1)) * 0.6666666666666936 - del x6 - x278 += einsum(x7, (0, 1), (0, 1)) * 0.33333333333333354 - del x7 - x278 += einsum(x8, (0, 1), (0, 1)) * 0.6666666666666667 - del x8 - x278 += einsum(x9, (0, 1), (0, 1)) - del x9 - rdm2_f_abab_oovv += einsum(x278, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -2.9999999999998788 - del x278 - x279 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x279 += einsum(t2.bbbb, (0, 1, 2, 3), x249, (1, 4, 3, 5), (4, 0, 2, 5)) * -1.0 - x280 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x280 += einsum(t2.abab, (0, 1, 2, 3), x241, (4, 5, 0, 2), (4, 1, 3, 5)) - x281 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x281 += einsum(x245, (0, 1, 2, 3), (0, 1, 2, 3)) - x281 += einsum(x246, (0, 1, 2, 3), (0, 1, 2, 3)) * 9.0 - x281 += einsum(x248, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - x281 += einsum(x250, (0, 1, 2, 3), (0, 1, 2, 3)) - x282 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x282 += einsum(t2.bbbb, (0, 1, 2, 3), x281, (1, 4, 3, 5), (4, 0, 5, 2)) * 2.0 - del x281 - x283 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x283 += einsum(x238, (0, 1, 2, 3), (0, 1, 2, 3)) - x283 += einsum(x240, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.3333333333333333 - x283 += einsum(x242, (0, 1, 2, 3), (0, 1, 2, 3)) - x284 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x284 += einsum(t2.abab, (0, 1, 2, 3), x283, (4, 5, 0, 2), (4, 1, 5, 3)) * 3.0 - del x283 - x285 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x285 += einsum(t1.bb, (0, 1), x40, (0, 2, 3, 4), (2, 3, 4, 1)) * -1.0 - x286 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x286 += einsum(x247, (0, 1, 2, 3), (0, 1, 2, 3)) - x286 += einsum(x285, (0, 1, 2, 3), (0, 1, 2, 3)) - del x285 - x287 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x287 += einsum(t2.bbbb, (0, 1, 2, 3), x286, (1, 4, 3, 5), (4, 0, 5, 2)) * 12.0 - del x286 - x288 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x288 += einsum(t1.bb, (0, 1), x23, (0, 2, 3, 4), (2, 1, 3, 4)) - del x23 - x289 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x289 += einsum(x239, (0, 1, 2, 3), (0, 1, 2, 3)) - x289 += einsum(x288, (0, 1, 2, 3), (0, 1, 2, 3)) - del x288 - x290 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x290 += einsum(t2.abab, (0, 1, 2, 3), x289, (4, 5, 0, 2), (4, 1, 5, 3)) * 2.0 - del x289 - x291 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x291 += einsum(t2.bbbb, (0, 1, 2, 3), x38, (4, 1, 5, 3), (4, 5, 0, 2)) * -1.0 - x292 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x292 += einsum(t2.abab, (0, 1, 2, 3), x103, (4, 5, 0, 2), (4, 5, 1, 3)) - x293 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x293 += einsum(t2.bbbb, (0, 1, 2, 3), x41, (1, 4, 5, 3), (4, 0, 5, 2)) * -1.0 - x294 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x294 += einsum(x291, (0, 1, 2, 3), (0, 1, 2, 3)) - del x291 - x294 += einsum(x292, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - del x292 - x294 += einsum(x132, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.25 - del x132 - x294 += einsum(x135, (0, 1, 2, 3), (0, 1, 2, 3)) - del x135 - x294 += einsum(x293, (0, 1, 2, 3), (0, 1, 2, 3)) - del x293 - x294 += einsum(x137, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - del x137 - x294 += einsum(x136, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x136 - x295 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x295 += einsum(t1.bb, (0, 1), x294, (0, 2, 3, 4), (2, 3, 4, 1)) * 4.0 - del x294 - x296 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x296 += einsum(x279, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - del x279 - x296 += einsum(x280, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - del x280 - x296 += einsum(x282, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x282 - x296 += einsum(x284, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x284 - x296 += einsum(x287, (0, 1, 2, 3), (0, 1, 2, 3)) - del x287 - x296 += einsum(x290, (0, 1, 2, 3), (0, 1, 2, 3)) - del x290 - x296 += einsum(x295, (0, 1, 2, 3), (0, 1, 3, 2)) - del x295 - x296 += einsum(t1.bb, (0, 1), x131, (2, 3), (0, 2, 1, 3)) * 2.0 - del x131 - rdm2_f_bbbb_oovv += einsum(x296, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_bbbb_oovv += einsum(x296, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_bbbb_oovv += einsum(x296, (0, 1, 2, 3), (1, 0, 2, 3)) - rdm2_f_bbbb_oovv += einsum(x296, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x296 - x297 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x297 += einsum(x42, (0, 1, 2, 3), t3.bbbbbb, (4, 0, 1, 5, 6, 3), (4, 2, 5, 6)) * -18.0 - x298 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x298 += einsum(x25, (0, 1, 2, 3), t3.babbab, (4, 2, 0, 5, 3, 6), (4, 1, 5, 6)) * -4.0 - del x25 - x299 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x299 += einsum(x31, (0, 1), (0, 1)) * 3.000000000000004 - del x31 - x299 += einsum(x32, (0, 1), (0, 1)) * 1.9999999999999996 - del x32 - x299 += einsum(x33, (0, 1), (0, 1)) - del x33 - x300 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x300 += einsum(x299, (0, 1), t2.bbbb, (2, 0, 3, 4), (1, 2, 3, 4)) * -1.9999999999999194 - del x299 - x301 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x301 += einsum(x297, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x297 - x301 += einsum(x298, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x298 - x301 += einsum(x300, (0, 1, 2, 3), (1, 0, 3, 2)) - del x300 - rdm2_f_bbbb_oovv += einsum(x301, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - rdm2_f_bbbb_oovv += einsum(x301, (0, 1, 2, 3), (1, 0, 2, 3)) - del x301 - x302 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x302 += einsum(t2.bbbb, (0, 1, 2, 3), x244, (1, 4, 3, 5), (4, 0, 5, 2)) - x303 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x303 += einsum(t2.abab, (0, 1, 2, 3), x237, (4, 5, 0, 2), (4, 1, 5, 3)) - x304 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x304 += einsum(x145, (0, 1, 2, 3), (0, 2, 1, 3)) * -1.0 - x304 += einsum(x146, (0, 1, 2, 3), (0, 2, 1, 3)) * -0.3333333333333333 - x305 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x305 += einsum(x304, (0, 1, 2, 3), t3.bbbbbb, (4, 5, 0, 6, 1, 2), (4, 5, 3, 6)) * -18.0 - x306 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x306 += einsum(x101, (0, 1, 2, 3), t3.babbab, (4, 2, 5, 6, 3, 0), (4, 5, 1, 6)) * -4.0 - del x101 - x307 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x307 += einsum(x271, (0, 1), (0, 1)) - x307 += einsum(x272, (0, 1), (0, 1)) * 0.5 - x307 += einsum(x273, (0, 1), (0, 1)) * 1.4999999999999416 - x307 += einsum(x274, (0, 1), (0, 1)) * 0.9999999999999595 - x307 += einsum(x275, (0, 1), (0, 1)) * 0.49999999999997985 - x308 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x308 += einsum(x307, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 1, 4)) * -4.0 - del x307 - x309 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x309 += einsum(t2.bbbb, (0, 1, 2, 3), x304, (4, 2, 3, 5), (4, 0, 1, 5)) * 3.0 - x310 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x310 += einsum(x121, (0, 1, 2, 3), (0, 2, 1, 3)) - del x121 - x310 += einsum(x124, (0, 1, 2, 3), (0, 2, 1, 3)) * 3.0 - del x124 - x310 += einsum(x125, (0, 1, 2, 3), (0, 2, 1, 3)) - del x125 - x310 += einsum(x127, (0, 1, 2, 3), (0, 2, 1, 3)) * 3.0 - del x127 - x310 += einsum(x123, (0, 1, 2, 3), (0, 2, 1, 3)) - del x123 - x310 += einsum(x309, (0, 1, 2, 3), (0, 2, 1, 3)) - del x309 - x311 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x311 += einsum(t1.bb, (0, 1), x310, (0, 2, 3, 4), (2, 3, 4, 1)) * 2.0 - del x310 - x312 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x312 += einsum(x302, (0, 1, 2, 3), (0, 1, 2, 3)) * 8.0 - del x302 - x312 += einsum(x303, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x303 - x312 += einsum(x305, (0, 1, 2, 3), (0, 1, 2, 3)) - del x305 - x312 += einsum(x306, (0, 1, 2, 3), (1, 0, 2, 3)) - del x306 - x312 += einsum(x308, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x308 - x312 += einsum(x311, (0, 1, 2, 3), (1, 0, 3, 2)) - del x311 - rdm2_f_bbbb_oovv += einsum(x312, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_bbbb_oovv += einsum(x312, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x312 - x313 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x313 += einsum(x28, (0, 1), t2.bbbb, (2, 0, 3, 4), (1, 2, 3, 4)) - del x28 - x314 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x314 += einsum(x38, (0, 1, 2, 3), t3.bbbbbb, (4, 1, 0, 5, 6, 3), (2, 4, 5, 6)) - x315 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x315 += einsum(x103, (0, 1, 2, 3), t3.babbab, (4, 2, 0, 5, 3, 6), (1, 4, 5, 6)) - del x103 - x316 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x316 += einsum(t1.bb, (0, 1), x42, (2, 3, 4, 1), (0, 2, 3, 4)) * 3.0 - x317 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x317 += einsum(t2.bbbb, (0, 1, 2, 3), x316, (4, 0, 1, 5), (4, 5, 2, 3)) * 2.0 - del x316 - x318 = np.zeros((nocc[1], nocc[1]), dtype=types[float]) - x318 += einsum(x29, (0, 1), (0, 1)) - del x29 - x318 += einsum(x30, (0, 1), (0, 1)) * 0.5 - del x30 - x319 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x319 += einsum(x318, (0, 1), t2.bbbb, (2, 0, 3, 4), (1, 2, 3, 4)) * -4.0 - del x318 - x320 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x320 += einsum(t1.bb, (0, 1), x42, (2, 3, 4, 1), (0, 2, 3, 4)) - del x42 - x321 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x321 += einsum(t1.bb, (0, 1), x320, (2, 3, 0, 4), (3, 2, 4, 1)) - del x320 - x322 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x322 += einsum(t1.bb, (0, 1), x321, (0, 2, 3, 4), (2, 3, 4, 1)) * 6.0 - del x321 - x323 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x323 += einsum(x313, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x313 - x323 += einsum(x314, (0, 1, 2, 3), (0, 1, 3, 2)) * -6.0 - del x314 - x323 += einsum(x315, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - del x315 - x323 += einsum(x317, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x317 - x323 += einsum(x319, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - del x319 - x323 += einsum(x322, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x322 - rdm2_f_bbbb_oovv += einsum(x323, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_bbbb_oovv += einsum(x323, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - del x323 - x324 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[0], nvir[0]), dtype=types[float]) - x324 += einsum(t2.bbbb, (0, 1, 2, 3), l3.babbab, (2, 4, 3, 5, 6, 7), (5, 7, 0, 1, 6, 4)) - x324 += einsum(x122, (0, 1, 2, 3, 4, 5), (0, 1, 3, 2, 4, 5)) * -1.0000000000000606 - del x122 - rdm2_f_bbbb_oovv += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x324, (0, 2, 6, 7, 1, 4), (6, 7, 3, 5)) * 1.9999999999999194 - del x324 - x325 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x325 += einsum(t2.bbbb, (0, 1, 2, 3), l3.bbbbbb, (4, 2, 3, 5, 6, 7), (5, 6, 7, 0, 1, 4)) - x325 += einsum(x126, (0, 1, 2, 3, 4, 5), (0, 1, 2, 4, 3, 5)) * -1.0000000000000584 - del x126 - rdm2_f_bbbb_oovv += einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), x325, (0, 1, 2, 6, 7, 5), (6, 7, 3, 4)) * 5.999999999999766 - del x325 - x326 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x326 += einsum(x37, (0, 1, 2, 3), (1, 0, 3, 2)) * -1.0 - x326 += einsum(x39, (0, 1, 2, 3), (0, 1, 3, 2)) - x326 += einsum(x35, (0, 1, 2, 3), (0, 1, 3, 2)) * 2.999999999999883 - x326 += einsum(x36, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.9999999999999597 - rdm2_f_bbbb_oovv += einsum(t2.bbbb, (0, 1, 2, 3), x326, (0, 1, 4, 5), (5, 4, 2, 3)) * 2.0 - del x326 - x327 = np.zeros((nocc[1], nocc[1], nocc[1], nocc[1]), dtype=types[float]) - x327 += einsum(x37, (0, 1, 2, 3), (1, 0, 3, 2)) * -0.3333333333333269 - del x37 - x327 += einsum(x39, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.3333333333333269 - del x39 - x327 += einsum(x35, (0, 1, 2, 3), (0, 1, 3, 2)) - del x35 - x327 += einsum(x36, (0, 1, 2, 3), (0, 1, 3, 2)) * 0.3333333333333336 - del x36 - x328 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x328 += einsum(t1.bb, (0, 1), x327, (0, 2, 3, 4), (2, 4, 3, 1)) * -1.0 - del x327 - rdm2_f_bbbb_oovv += einsum(t1.bb, (0, 1), x328, (0, 2, 3, 4), (2, 3, 4, 1)) * -6.000000000000116 - del x328 - x329 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x329 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 0, 5)) - rdm2_f_aaaa_ovov += einsum(x329, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_aaaa_ovvo += einsum(x329, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_aaaa_voov += einsum(x329, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_aaaa_vovo += einsum(x329, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - x330 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x330 += einsum(t1.aa, (0, 1), x64, (0, 2, 3, 4), (2, 3, 1, 4)) * 6.0 - del x64 - rdm2_f_aaaa_ovov += einsum(x330, (0, 1, 2, 3), (1, 3, 0, 2)) * -1.0 - rdm2_f_aaaa_voov += einsum(x330, (0, 1, 2, 3), (3, 1, 0, 2)) - del x330 - x331 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x331 += einsum(l1.aa, (0, 1), t1.aa, (1, 2), (0, 2)) - x332 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x332 += einsum(x331, (0, 1), (0, 1)) - x332 += einsum(x207, (0, 1), (0, 1)) - x332 += einsum(x208, (0, 1), (0, 1)) * 2.0 - x332 += einsum(x209, (0, 1), (0, 1)) * 0.9999999999999601 - x332 += einsum(x210, (0, 1), (0, 1)) * 1.9999999999999194 - x332 += einsum(x211, (0, 1), (0, 1)) * 2.9999999999998788 - rdm2_f_aaaa_ovov += einsum(delta.aa.oo, (0, 1), x332, (2, 3), (0, 2, 1, 3)) - rdm2_f_aaaa_ovvo += einsum(delta.aa.oo, (0, 1), x332, (2, 3), (0, 2, 3, 1)) * -1.0 - rdm2_f_aaaa_voov += einsum(delta.aa.oo, (0, 1), x332, (2, 3), (2, 0, 1, 3)) * -1.0 - rdm2_f_aaaa_vovo += einsum(delta.aa.oo, (0, 1), x332, (2, 3), (2, 0, 3, 1)) - x333 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x333 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 5), (1, 5, 2, 4)) - rdm2_f_abab_ovov += einsum(x333, (0, 1, 2, 3), (3, 0, 2, 1)) * -1.0 - x334 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x334 += einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - x335 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x335 += einsum(x334, (0, 1), (0, 1)) - x335 += einsum(x271, (0, 1), (0, 1)) * 2.0 - x335 += einsum(x272, (0, 1), (0, 1)) - x335 += einsum(x273, (0, 1), (0, 1)) * 2.9999999999998788 - x335 += einsum(x274, (0, 1), (0, 1)) * 1.9999999999999194 - x335 += einsum(x275, (0, 1), (0, 1)) * 0.9999999999999601 - rdm2_f_abab_ovov += einsum(delta.aa.oo, (0, 1), x335, (2, 3), (0, 2, 1, 3)) - rdm2_f_abab_ovvv += einsum(t1.aa, (0, 1), x335, (2, 3), (0, 2, 1, 3)) - x336 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x336 += einsum(t1.bb, (0, 1), x118, (0, 2, 3, 4), (2, 3, 4, 1)) * 2.0 - del x118 - rdm2_f_bbbb_ovov += einsum(x336, (0, 1, 2, 3), (1, 2, 0, 3)) * -1.0 - rdm2_f_bbbb_ovvo += einsum(x336, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_bbbb_voov += einsum(x336, (0, 1, 2, 3), (2, 1, 0, 3)) - rdm2_f_bbbb_vovo += einsum(x336, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - del x336 - x337 = np.zeros((nvir[1], nvir[1]), dtype=types[float]) - x337 += einsum(x334, (0, 1), (0, 1)) * 0.5000000000000202 - del x334 - x337 += einsum(x271, (0, 1), (0, 1)) * 1.0000000000000404 - del x271 - x337 += einsum(x272, (0, 1), (0, 1)) * 0.5000000000000202 - del x272 - x337 += einsum(x273, (0, 1), (0, 1)) * 1.4999999999999998 - del x273 - x337 += einsum(x274, (0, 1), (0, 1)) - del x274 - x337 += einsum(x275, (0, 1), (0, 1)) * 0.5000000000000002 - del x275 - rdm2_f_bbbb_ovov += einsum(delta.bb.oo, (0, 1), x337, (2, 3), (0, 2, 1, 3)) * 1.9999999999999194 - rdm2_f_bbbb_ovvo += einsum(delta.bb.oo, (0, 1), x337, (2, 3), (0, 2, 3, 1)) * -1.9999999999999194 - rdm2_f_bbbb_voov += einsum(delta.bb.oo, (0, 1), x337, (2, 3), (2, 0, 1, 3)) * -1.9999999999999194 - rdm2_f_bbbb_vovo += einsum(delta.bb.oo, (0, 1), x337, (2, 3), (2, 0, 3, 1)) * 1.9999999999999194 - del x337 - x338 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x338 += einsum(t1.aa, (0, 1), x102, (0, 2, 3, 4), (2, 3, 4, 1)) * 2.0 - rdm2_f_aaaa_ovvo += einsum(x338, (0, 1, 2, 3), (1, 2, 3, 0)) - rdm2_f_aaaa_vovo += einsum(x338, (0, 1, 2, 3), (2, 1, 3, 0)) * -1.0 - del x338 - x339 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x339 += einsum(x331, (0, 1), (0, 1)) * 1.00000000000004 - x339 += einsum(x207, (0, 1), (0, 1)) * 1.00000000000004 - x339 += einsum(x208, (0, 1), (0, 1)) * 2.00000000000008 - x339 += einsum(x209, (0, 1), (0, 1)) - x339 += einsum(x210, (0, 1), (0, 1)) * 1.9999999999999991 - x339 += einsum(x211, (0, 1), (0, 1)) * 2.9999999999999982 - rdm2_f_abab_vovo += einsum(delta.bb.oo, (0, 1), x339, (2, 3), (2, 0, 3, 1)) * 0.9999999999999601 - del x339 - x340 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x340 += einsum(t3.abaaba, (0, 1, 2, 3, 4, 5), x51, (1, 4, 0, 2, 6, 7), (6, 7, 3, 5)) - del x51 - rdm2_f_aaaa_ovvv = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - rdm2_f_aaaa_ovvv += einsum(x340, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0000000000000404 - rdm2_f_aaaa_vovv = np.zeros((nvir[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - rdm2_f_aaaa_vovv += einsum(x340, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0000000000000404 - del x340 - x341 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x341 += einsum(l2.aaaa, (0, 1, 2, 3), t3.aaaaaa, (4, 2, 3, 5, 6, 1), (4, 0, 5, 6)) - rdm2_f_aaaa_ovvv += einsum(x341, (0, 1, 2, 3), (0, 1, 3, 2)) * -6.0 - rdm2_f_aaaa_vovv += einsum(x341, (0, 1, 2, 3), (1, 0, 3, 2)) * 6.0 - del x341 - x342 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x342 += einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 4), (2, 0, 3, 4)) - rdm2_f_aaaa_ovvv += einsum(x342, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - rdm2_f_aaaa_vovv += einsum(x342, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0 - del x342 - x343 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x343 += einsum(l2.abab, (0, 1, 2, 3), t3.abaaba, (4, 3, 2, 5, 1, 6), (4, 0, 5, 6)) - rdm2_f_aaaa_ovvv += einsum(x343, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - rdm2_f_aaaa_vovv += einsum(x343, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0 - del x343 - x344 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x344 += einsum(t3.aaaaaa, (0, 1, 2, 3, 4, 5), x45, (0, 1, 2, 6, 7, 5), (6, 7, 3, 4)) * -1.0 - del x45 - rdm2_f_aaaa_ovvv += einsum(x344, (0, 1, 2, 3), (0, 1, 3, 2)) * -6.000000000000116 - rdm2_f_aaaa_vovv += einsum(x344, (0, 1, 2, 3), (1, 0, 3, 2)) * 6.000000000000116 - del x344 - x345 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x345 += einsum(t2.abab, (0, 1, 2, 3), x161, (1, 3, 4, 5), (0, 4, 2, 5)) - x346 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x346 += einsum(t2.abab, (0, 1, 2, 3), x162, (1, 3, 4, 5), (0, 4, 5, 2)) - x347 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x347 += einsum(t2.aaaa, (0, 1, 2, 3), x205, (1, 4, 3, 5), (0, 4, 5, 2)) * 4.0 - x348 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x348 += einsum(x329, (0, 1, 2, 3), (0, 1, 2, 3)) - del x329 - x348 += einsum(x202, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - del x202 - x348 += einsum(x173, (0, 1, 2, 3), (0, 1, 2, 3)) - del x173 - x348 += einsum(x174, (0, 1, 2, 3), (0, 1, 2, 3)) * 4.0 - del x174 - x348 += einsum(x178, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - del x178 - x348 += einsum(x175, (0, 1, 2, 3), (0, 1, 2, 3)) * 9.0 - del x175 - x348 += einsum(x179, (0, 1, 2, 3), (0, 1, 2, 3)) * -6.0 - del x179 - x349 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x349 += einsum(t1.aa, (0, 1), x348, (0, 2, 3, 4), (2, 3, 4, 1)) - del x348 - x350 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x350 += einsum(x345, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x345 - x350 += einsum(x346, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - del x346 - x350 += einsum(x347, (0, 1, 2, 3), (0, 1, 2, 3)) - del x347 - x350 += einsum(x349, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x349 - x350 += einsum(t1.aa, (0, 1), x332, (2, 3), (0, 2, 1, 3)) - del x332 - rdm2_f_aaaa_ovvv += einsum(x350, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_aaaa_ovvv += einsum(x350, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_aaaa_vovv += einsum(x350, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_aaaa_vovv += einsum(x350, (0, 1, 2, 3), (1, 0, 3, 2)) - del x350 - x351 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x351 += einsum(t2.aaaa, (0, 1, 2, 3), x102, (0, 1, 4, 5), (4, 5, 2, 3)) * 2.0 - del x102 - rdm2_f_aaaa_ovvv += einsum(x351, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_aaaa_vovv += einsum(x351, (0, 1, 2, 3), (1, 0, 3, 2)) - del x351 - x352 = np.zeros((nocc[0], nocc[0], nocc[0], nvir[0]), dtype=types[float]) - x352 += einsum(x1, (0, 1, 2, 3), (1, 0, 2, 3)) * 0.3333333333333333 - del x1 - x352 += einsum(x12, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.3333333333333333 - del x12 - x352 += einsum(x13, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x13 - x353 = np.zeros((nocc[0], nocc[0], nvir[0], nvir[0]), dtype=types[float]) - x353 += einsum(t1.aa, (0, 1), x352, (0, 2, 3, 4), (2, 3, 4, 1)) * 3.0 - del x352 - x354 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x354 += einsum(t1.aa, (0, 1), x353, (0, 2, 3, 4), (2, 3, 4, 1)) * 2.0 - del x353 - rdm2_f_aaaa_ovvv += einsum(x354, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_aaaa_vovv += einsum(x354, (0, 1, 2, 3), (1, 0, 2, 3)) - del x354 - x355 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x355 += einsum(x218, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.6666666666666666 - del x218 - x355 += einsum(x167, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.6666666666666666 - del x167 - x355 += einsum(x168, (0, 1, 2, 3), (0, 1, 2, 3)) - del x168 - x355 += einsum(x169, (0, 1, 2, 3), (0, 1, 2, 3)) * 1.3333333333333333 - del x169 - x355 += einsum(x165, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.6666666666666666 - del x165 - x355 += einsum(x170, (0, 1, 2, 3), (0, 1, 2, 3)) - del x170 - x355 += einsum(x183, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.6666666666666666 - del x183 - x355 += einsum(t1.aa, (0, 1), x22, (2, 3, 0, 4), (2, 3, 4, 1)) * -0.6666666666666666 - del x22 - rdm2_f_abab_ovvv += einsum(t1.bb, (0, 1), x355, (0, 2, 3, 4), (3, 2, 4, 1)) * 3.0 - del x355 - x356 = np.zeros((nvir[1], nvir[1], nocc[0], nocc[0]), dtype=types[float]) - x356 += einsum(x333, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x333 - x356 += einsum(x261, (0, 1, 2, 3), (0, 1, 2, 3)) - del x261 - x356 += einsum(x262, (0, 1, 2, 3), (0, 1, 2, 3)) - del x262 - x356 += einsum(x263, (0, 1, 2, 3), (0, 1, 2, 3)) - del x263 - x356 += einsum(x264, (0, 1, 2, 3), (0, 1, 2, 3)) - del x264 - rdm2_f_abab_ovvv += einsum(t1.aa, (0, 1), x356, (2, 3, 0, 4), (4, 2, 1, 3)) * -2.0 - del x356 - x357 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x357 += einsum(t3.babbab, (0, 1, 2, 3, 4, 5), x90, (0, 2, 6, 7, 1, 4), (6, 7, 3, 5)) - del x90 - rdm2_f_bbbb_ovvv = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - rdm2_f_bbbb_ovvv += einsum(x357, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0000000000000404 - rdm2_f_bbbb_vovv = np.zeros((nvir[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - rdm2_f_bbbb_vovv += einsum(x357, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0000000000000404 - del x357 - x358 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x358 += einsum(t3.bbbbbb, (0, 1, 2, 3, 4, 5), x114, (0, 1, 2, 6, 7, 5), (6, 7, 3, 4)) * -1.0 - del x114 - rdm2_f_bbbb_ovvv += einsum(x358, (0, 1, 2, 3), (0, 1, 3, 2)) * -6.000000000000116 - rdm2_f_bbbb_vovv += einsum(x358, (0, 1, 2, 3), (1, 0, 3, 2)) * 6.000000000000116 - del x358 - x359 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x359 += einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 4), (2, 0, 3, 4)) - rdm2_f_bbbb_ovvv += einsum(x359, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - rdm2_f_bbbb_vovv += einsum(x359, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0 - del x359 - x360 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x360 += einsum(l2.bbbb, (0, 1, 2, 3), t3.bbbbbb, (4, 2, 3, 5, 6, 1), (4, 0, 5, 6)) - rdm2_f_bbbb_ovvv += einsum(x360, (0, 1, 2, 3), (0, 1, 3, 2)) * -6.0 - rdm2_f_bbbb_vovv += einsum(x360, (0, 1, 2, 3), (1, 0, 3, 2)) * 6.0 - del x360 - x361 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x361 += einsum(l2.abab, (0, 1, 2, 3), t3.babbab, (4, 2, 3, 5, 0, 6), (4, 1, 5, 6)) - rdm2_f_bbbb_ovvv += einsum(x361, (0, 1, 2, 3), (0, 1, 3, 2)) * -2.0 - rdm2_f_bbbb_vovv += einsum(x361, (0, 1, 2, 3), (1, 0, 3, 2)) * 2.0 - del x361 - x362 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x362 += einsum(t2.bbbb, (0, 1, 2, 3), x145, (1, 4, 3, 5), (0, 4, 5, 2)) * -1.0 - del x145 - x363 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x363 += einsum(t2.bbbb, (0, 1, 2, 3), x146, (1, 4, 3, 5), (0, 4, 2, 5)) - del x146 - x364 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x364 += einsum(t2.abab, (0, 1, 2, 3), x99, (4, 5, 0, 2), (1, 4, 5, 3)) - del x99 - x365 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x365 += einsum(t2.abab, (0, 1, 2, 3), x100, (4, 5, 0, 2), (1, 4, 3, 5)) - del x100 - x366 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x366 += einsum(x244, (0, 1, 2, 3), (0, 1, 2, 3)) - del x244 - x366 += einsum(x245, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - del x245 - x366 += einsum(x246, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.25 - del x246 - x366 += einsum(x247, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.5 - del x247 - x366 += einsum(x248, (0, 1, 2, 3), (0, 1, 2, 3)) - del x248 - x366 += einsum(x249, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x249 - x366 += einsum(x250, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.25 - del x250 - x367 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x367 += einsum(t1.bb, (0, 1), x366, (0, 2, 3, 4), (2, 3, 4, 1)) * 4.0 - del x366 - x368 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x368 += einsum(x362, (0, 1, 2, 3), (0, 1, 2, 3)) * -12.0 - del x362 - x368 += einsum(x363, (0, 1, 2, 3), (0, 1, 2, 3)) * -4.0 - del x363 - x368 += einsum(x364, (0, 1, 2, 3), (0, 1, 2, 3)) * -2.0 - del x364 - x368 += einsum(x365, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x365 - x368 += einsum(x367, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - del x367 - x368 += einsum(t1.bb, (0, 1), x335, (2, 3), (0, 2, 1, 3)) - del x335 - rdm2_f_bbbb_ovvv += einsum(x368, (0, 1, 2, 3), (0, 1, 2, 3)) - rdm2_f_bbbb_ovvv += einsum(x368, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_bbbb_vovv += einsum(x368, (0, 1, 2, 3), (1, 0, 2, 3)) * -1.0 - rdm2_f_bbbb_vovv += einsum(x368, (0, 1, 2, 3), (1, 0, 3, 2)) - del x368 - x369 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x369 += einsum(x38, (0, 1, 2, 3), (1, 0, 2, 3)) * -0.3333333333333333 - x369 += einsum(x40, (0, 1, 2, 3), (0, 1, 2, 3)) - x369 += einsum(x41, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.3333333333333333 - x370 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x370 += einsum(t2.bbbb, (0, 1, 2, 3), x369, (0, 1, 4, 5), (4, 5, 2, 3)) * 6.0 - del x369 - rdm2_f_bbbb_ovvv += einsum(x370, (0, 1, 2, 3), (0, 1, 3, 2)) * -1.0 - rdm2_f_bbbb_vovv += einsum(x370, (0, 1, 2, 3), (1, 0, 3, 2)) - del x370 - x371 = np.zeros((nocc[1], nocc[1], nocc[1], nvir[1]), dtype=types[float]) - x371 += einsum(x38, (0, 1, 2, 3), (1, 0, 2, 3)) - del x38 - x371 += einsum(x40, (0, 1, 2, 3), (0, 1, 2, 3)) * -3.0 - del x40 - x371 += einsum(x41, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x41 - x372 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x372 += einsum(t1.bb, (0, 1), x371, (0, 2, 3, 4), (2, 3, 4, 1)) * 0.3333333333333333 - rdm2_f_bbbb_ovvv += einsum(t1.bb, (0, 1), x372, (0, 2, 3, 4), (2, 3, 4, 1)) * -6.0 - del x372 - x373 = np.zeros((nocc[1], nvir[1], nocc[0], nvir[0]), dtype=types[float]) - x373 += einsum(x236, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x236 - x373 += einsum(x237, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x237 - x373 += einsum(x238, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.75 - del x238 - x373 += einsum(x239, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x239 - x373 += einsum(x240, (0, 1, 2, 3), (0, 1, 2, 3)) - del x240 - x373 += einsum(x241, (0, 1, 2, 3), (0, 1, 2, 3)) * -0.5 - del x241 - x373 += einsum(x242, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.75 - del x242 - x373 += einsum(t1.bb, (0, 1), x235, (0, 2, 3, 4), (2, 1, 3, 4)) * -0.25 - del x235 - rdm2_f_abab_vovv += einsum(t1.aa, (0, 1), x373, (2, 3, 0, 4), (4, 2, 1, 3)) * 4.0 - del x373 - x374 = np.zeros((nocc[1], nocc[1], nvir[0], nvir[0]), dtype=types[float]) - x374 += einsum(x255, (0, 1, 2, 3), (0, 1, 2, 3)) * 0.5 - del x255 - x374 += einsum(x256, (0, 1, 2, 3), (0, 1, 2, 3)) - del x256 - x374 += einsum(x257, (0, 1, 2, 3), (0, 1, 2, 3)) - del x257 - x374 += einsum(x258, (0, 1, 2, 3), (0, 1, 2, 3)) - del x258 - x374 += einsum(x259, (0, 1, 2, 3), (0, 1, 2, 3)) - del x259 - rdm2_f_abab_vovv += einsum(t1.bb, (0, 1), x374, (0, 2, 3, 4), (3, 2, 4, 1)) * -2.0 - del x374 - x375 = np.zeros((nvir[0], nvir[0]), dtype=types[float]) - x375 += einsum(x331, (0, 1), (0, 1)) * 0.5000000000000202 - del x331 - x375 += einsum(x207, (0, 1), (0, 1)) * 0.5000000000000202 - del x207 - x375 += einsum(x208, (0, 1), (0, 1)) * 1.0000000000000404 - del x208 - x375 += einsum(x209, (0, 1), (0, 1)) * 0.5000000000000002 - del x209 - x375 += einsum(x210, (0, 1), (0, 1)) - del x210 - x375 += einsum(x211, (0, 1), (0, 1)) * 1.4999999999999998 - del x211 - rdm2_f_abab_vovv += einsum(t1.bb, (0, 1), x375, (2, 3), (2, 0, 3, 1)) * 1.9999999999999194 - del x375 - x376 = np.zeros((nocc[1], nocc[1], nvir[1], nvir[1]), dtype=types[float]) - x376 += einsum(t1.bb, (0, 1), x371, (0, 2, 3, 4), (2, 3, 4, 1)) - del x371 - rdm2_f_bbbb_vovv += einsum(t1.bb, (0, 1), x376, (0, 2, 3, 4), (3, 2, 1, 4)) * -2.0 - del x376 - x377 = np.zeros((nocc[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x377 += einsum(t1.aa, (0, 1), l2.aaaa, (2, 3, 4, 0), (4, 2, 3, 1)) - rdm2_f_aaaa_vvov += einsum(x377, (0, 1, 2, 3), (2, 1, 0, 3)) * -2.0 - rdm2_f_aaaa_vvvo += einsum(x377, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - rdm2_f_aaaa_vvvv += einsum(t1.aa, (0, 1), x377, (0, 2, 3, 4), (2, 3, 1, 4)) * 2.0 - del x377 - x378 = np.zeros((nocc[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x378 += einsum(t1.bb, (0, 1), l2.bbbb, (2, 3, 4, 0), (4, 2, 3, 1)) - rdm2_f_bbbb_vvov += einsum(x378, (0, 1, 2, 3), (2, 1, 0, 3)) * -2.0 - rdm2_f_bbbb_vvvo += einsum(x378, (0, 1, 2, 3), (2, 1, 3, 0)) * 2.0 - rdm2_f_bbbb_vvvv += einsum(t1.bb, (0, 1), x378, (0, 2, 3, 4), (2, 3, 1, 4)) * 2.0 - del x378 - x379 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x379 += einsum(t1.aa, (0, 1), l2.abab, (2, 3, 0, 4), (4, 3, 2, 1)) - rdm2_f_abab_vvvo += einsum(x379, (0, 1, 2, 3), (2, 1, 3, 0)) - x380 = np.zeros((nvir[0], nvir[0], nvir[0], nvir[0]), dtype=types[float]) - x380 += einsum(t1.aa, (0, 1), x205, (0, 2, 3, 4), (2, 3, 4, 1)) * 2.0 - del x205 - rdm2_f_aaaa_vvvv += einsum(x380, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_aaaa_vvvv += einsum(x380, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x380 - x381 = np.zeros((nocc[1], nvir[1], nvir[0], nvir[0]), dtype=types[float]) - x381 += einsum(x379, (0, 1, 2, 3), (0, 1, 2, 3)) - del x379 - x381 += einsum(x161, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x161 - x381 += einsum(x162, (0, 1, 2, 3), (0, 1, 2, 3)) * 2.0 - del x162 - rdm2_f_abab_vvvv += einsum(t1.bb, (0, 1), x381, (0, 2, 3, 4), (3, 2, 4, 1)) - del x381 - x382 = np.zeros((nvir[1], nvir[1], nvir[1], nvir[1]), dtype=types[float]) - x382 += einsum(t1.bb, (0, 1), x304, (0, 2, 3, 4), (2, 3, 4, 1)) * 6.0 - del x304 - rdm2_f_bbbb_vvvv += einsum(x382, (0, 1, 2, 3), (0, 1, 3, 2)) - rdm2_f_bbbb_vvvv += einsum(x382, (0, 1, 2, 3), (0, 1, 2, 3)) * -1.0 - del x382 - - rdm2_f_aaaa = pack_2e(rdm2_f_aaaa_oooo, rdm2_f_aaaa_ooov, rdm2_f_aaaa_oovo, rdm2_f_aaaa_ovoo, rdm2_f_aaaa_vooo, rdm2_f_aaaa_oovv, rdm2_f_aaaa_ovov, rdm2_f_aaaa_ovvo, rdm2_f_aaaa_voov, rdm2_f_aaaa_vovo, rdm2_f_aaaa_vvoo, rdm2_f_aaaa_ovvv, rdm2_f_aaaa_vovv, rdm2_f_aaaa_vvov, rdm2_f_aaaa_vvvo, rdm2_f_aaaa_vvvv) - rdm2_f_abab = pack_2e(rdm2_f_abab_oooo, rdm2_f_abab_ooov, rdm2_f_abab_oovo, rdm2_f_abab_ovoo, rdm2_f_abab_vooo, rdm2_f_abab_oovv, rdm2_f_abab_ovov, rdm2_f_abab_ovvo, rdm2_f_abab_voov, rdm2_f_abab_vovo, rdm2_f_abab_vvoo, rdm2_f_abab_ovvv, rdm2_f_abab_vovv, rdm2_f_abab_vvov, rdm2_f_abab_vvvo, rdm2_f_abab_vvvv) - rdm2_f_bbbb = pack_2e(rdm2_f_bbbb_oooo, rdm2_f_bbbb_ooov, rdm2_f_bbbb_oovo, rdm2_f_bbbb_ovoo, rdm2_f_bbbb_vooo, rdm2_f_bbbb_oovv, rdm2_f_bbbb_ovov, rdm2_f_bbbb_ovvo, rdm2_f_bbbb_voov, rdm2_f_bbbb_vovo, rdm2_f_bbbb_vvoo, rdm2_f_bbbb_ovvv, rdm2_f_bbbb_vovv, rdm2_f_bbbb_vvov, rdm2_f_bbbb_vvvo, rdm2_f_bbbb_vvvv) - - rdm2_f_aaaa = np.transpose(rdm2_f_aaaa, (0, 2, 1, 3)) - rdm2_f_aabb = np.transpose(rdm2_f_abab, (0, 2, 1, 3)) - rdm2_f_bbbb = np.transpose(rdm2_f_bbbb, (0, 2, 1, 3)) - - rdm2_f.aaaa = rdm2_f_aaaa - rdm2_f.aabb = rdm2_f_aabb - rdm2_f.bbbb = rdm2_f_bbbb - - return rdm2_f - diff --git a/ebcc/codegen/UDCD.py b/ebcc/codegen/UDCD.py deleted file mode 100644 index 1c1b33d3..00000000 --- a/ebcc/codegen/UDCD.py +++ /dev/null @@ -1,261 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:07:04.134849 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:07:04.663406. - - Parameters - ---------- - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - e_cc = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 1, 3), ()) - e_cc += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 3), ()) - e_cc += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 3, 1, 2), ()) * -1 - - return e_cc - -def update_amps(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:07:17.771827. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - tmp22 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp23 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 1, 3), (4, 0)) - tmp35 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.abab, (2, 4, 3, 5), (0, 4, 1, 5)) - tmp33 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp9 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (4, 1)) - tmp8 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 3, 1, 4), (2, 4)) * -1 - tmp0 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 1, 3), (4, 0)) - tmp1 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp14 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp17 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp27 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 4), (3, 4)) - tmp28 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 3, 1, 4), (2, 4)) * -1 - tmp36 = einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp38 = np.copy(f.bb.oo) - tmp38 += tmp22 * 0.5 - tmp38 += tmp23 - tmp45 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) * 2 - tmp45 += tmp35 - tmp47 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 1, 3))) - tmp47 += tmp33 - tmp12 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp10 = np.copy(f.aa.vv) * -1 - tmp10 += tmp8 - tmp10 += tmp9 * 0.5 - tmp5 = np.copy(f.aa.oo) - tmp5 += tmp0 - tmp5 += tmp1 * 0.5 - tmp15 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) - tmp15 += tmp14 - tmp18 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) * 2 - tmp18 += tmp17 - tmp2 = np.copy(f.aa.oo) * 2 - tmp2 += tmp0 * 2 - tmp2 += tmp1 - tmp42 = np.copy(f.bb.vv) * -1 - tmp42 += tmp27 * 0.5 - tmp42 += tmp28 - tmp44 = einsum(t2.abab, (0, 1, 2, 3), tmp36, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp39 = einsum(tmp38, (0, 1), t2.bbbb, (2, 1, 3, 4), (0, 2, 3, 4)) * -1 - del tmp38 - tmp46 = einsum(tmp45, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) * 0.5 - del tmp45 - tmp49 = einsum(v.bbbb.vvvv, (0, 1, 2, 3), t2.bbbb, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp41 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp48 = einsum(t2.bbbb, (0, 1, 2, 3), tmp47, (4, 1, 5, 3), (4, 0, 5, 2)) * 2 - del tmp47 - tmp43 = np.copy(f.bb.vv) * -2 - tmp43 += tmp27 - tmp43 += tmp28 * 2 - tmp40 = einsum(v.bbbb.oooo, (0, 1, 2, 3), t2.bbbb, (3, 1, 4, 5), (0, 2, 4, 5)) * -1 - tmp26 = np.copy(f.aa.vv) * -1 - tmp26 += np.transpose(tmp8, (1, 0)) - del tmp8 - tmp26 += np.transpose(tmp9, (1, 0)) * 0.5 - del tmp9 - tmp32 = einsum(v.aabb.vvvv, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp34 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 1, 3))) - tmp34 += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (4, 1, 5, 3)) * 0.5 - tmp34 += np.transpose(tmp33, (1, 0, 3, 2)) - del tmp33 - tmp30 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) * 2 - tmp30 += einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) * 2 - tmp30 += tmp17 - tmp25 = np.copy(f.aa.oo) - tmp25 += np.transpose(tmp0, (1, 0)) - del tmp0 - tmp25 += np.transpose(tmp1, (1, 0)) * 0.5 - del tmp1 - tmp24 = np.copy(f.bb.oo) - tmp24 += np.transpose(tmp22, (1, 0)) * 0.5 - del tmp22 - tmp24 += np.transpose(tmp23, (1, 0)) - del tmp23 - tmp31 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) - tmp31 += np.transpose(tmp14, (1, 0, 3, 2)) - del tmp14 - tmp31 += np.transpose(tmp12, (1, 0, 3, 2)) * 0.5 - tmp29 = np.copy(f.bb.vv) * -1 - tmp29 += np.transpose(tmp27, (1, 0)) * 0.5 - del tmp27 - tmp29 += np.transpose(tmp28, (1, 0)) - del tmp28 - tmp37 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp37 += tmp35 * 0.5 - del tmp35 - tmp37 += tmp36 - del tmp36 - tmp21 = einsum(v.aaaa.vvvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp11 = einsum(tmp10, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 4, 0)) * -2 - del tmp10 - tmp6 = einsum(tmp5, (0, 1), t2.aaaa, (2, 1, 3, 4), (2, 0, 3, 4)) * -1 - del tmp5 - tmp13 = einsum(tmp12, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp12 - tmp20 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp20 += tmp17 * 0.5 - del tmp17 - tmp16 = einsum(t2.aaaa, (0, 1, 2, 3), tmp15, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp15 - tmp19 = einsum(t2.abab, (0, 1, 2, 3), tmp18, (4, 1, 5, 3), (0, 4, 2, 5)) * 0.5 - del tmp18 - tmp4 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.oooo, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp7 = einsum(v.aaaa.oovv, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp3 = einsum(tmp2, (0, 1), t2.aaaa, (2, 1, 3, 4), (2, 0, 3, 4)) * -0.5 - del tmp2 - t2new.bbbb = np.copy(np.transpose(tmp39, (1, 0, 3, 2))) * -2 - t2new.bbbb += np.transpose(tmp40, (1, 0, 3, 2)) * 2 - del tmp40 - t2new.bbbb += np.transpose(tmp39, (0, 1, 3, 2)) * 2 - del tmp39 - t2new.bbbb += np.transpose(tmp41, (1, 0, 3, 2)) * -2 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp42, (4, 3), (0, 1, 4, 2)) * 2 - del tmp42 - t2new.bbbb += np.transpose(tmp41, (1, 0, 2, 3)) * 2 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp43, (4, 3), (0, 1, 2, 4)) * -1 - del tmp43 - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - t2new.bbbb += tmp44 * 2 - t2new.bbbb += np.transpose(tmp44, (1, 0, 3, 2)) * 2 - t2new.bbbb += tmp46 - t2new.bbbb += tmp48 - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 3, 1)) * -1 - t2new.bbbb += np.transpose(tmp44, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp44, (1, 0, 2, 3)) * -2 - del tmp44 - t2new.bbbb += np.transpose(tmp46, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp48, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp49, (1, 0, 3, 2)) * 2 - del tmp49 - t2new.bbbb += np.transpose(tmp46, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp48, (1, 0, 3, 2)) - t2new.bbbb += tmp41 * -2 - t2new.bbbb += np.transpose(tmp46, (1, 0, 2, 3)) * -1 - del tmp46 - t2new.bbbb += np.transpose(tmp48, (1, 0, 2, 3)) * -1 - del tmp48 - t2new.bbbb += np.transpose(tmp41, (0, 1, 3, 2)) * 2 - del tmp41 - t2new.abab = einsum(t2.abab, (0, 1, 2, 3), tmp24, (1, 4), (0, 4, 2, 3)) * -1 - del tmp24 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), v.aabb.oooo, (4, 0, 5, 1), (4, 5, 2, 3)) - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp25, (0, 4), (4, 1, 2, 3)) * -1 - del tmp25 - t2new.abab += einsum(v.aaaa.oovv, (0, 1, 2, 3), t2.abab, (1, 4, 3, 5), (0, 4, 2, 5)) * -1 - t2new.abab += einsum(tmp26, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1 - del tmp26 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), v.aabb.oovv, (4, 0, 5, 3), (4, 1, 2, 5)) * -1 - t2new.abab += einsum(tmp29, (0, 1), t2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -1 - del tmp29 - t2new.abab += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - t2new.abab += einsum(tmp30, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp30 - t2new.abab += einsum(tmp31, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp31 - t2new.abab += tmp32 - del tmp32 - t2new.abab += einsum(tmp34, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) - del tmp34 - t2new.abab += einsum(tmp37, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (4, 1, 5, 3)) * 2 - del tmp37 - t2new.abab += einsum(v.bbbb.oovv, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) * -1 - t2new.abab += einsum(v.aabb.vvoo, (0, 1, 2, 3), t2.abab, (4, 3, 1, 5), (4, 2, 0, 5)) * -1 - t2new.aaaa = np.copy(np.transpose(tmp3, (0, 1, 3, 2))) * -2 - del tmp3 - t2new.aaaa += np.transpose(tmp4, (1, 0, 3, 2)) * 2 - del tmp4 - t2new.aaaa += np.transpose(tmp6, (1, 0, 3, 2)) * 2 - del tmp6 - t2new.aaaa += np.transpose(tmp7, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp11, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp7, (1, 0, 2, 3)) * 2 - t2new.aaaa += np.transpose(tmp11, (1, 0, 2, 3)) * -1 - del tmp11 - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - t2new.aaaa += tmp13 * 2 - t2new.aaaa += np.transpose(tmp13, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp16, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp19, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 3, 1)) * -1 - t2new.aaaa += np.transpose(tmp13, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp13, (1, 0, 2, 3)) * -2 - del tmp13 - t2new.aaaa += np.transpose(tmp16, (1, 0, 2, 3)) * -1 - t2new.aaaa += einsum(tmp20, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (0, 4, 5, 2)) * -1 - del tmp20 - t2new.aaaa += np.transpose(tmp21, (1, 0, 3, 2)) * 2 - del tmp21 - t2new.aaaa += tmp16 - t2new.aaaa += tmp19 - t2new.aaaa += tmp7 * -2 - t2new.aaaa += np.transpose(tmp16, (0, 1, 3, 2)) * -1 - del tmp16 - t2new.aaaa += np.transpose(tmp19, (0, 1, 3, 2)) * -1 - del tmp19 - t2new.aaaa += np.transpose(tmp7, (0, 1, 3, 2)) * 2 - del tmp7 - - return {f"t2new": t2new} - diff --git a/ebcc/codegen/UDCSD.py b/ebcc/codegen/UDCSD.py deleted file mode 100644 index 9ec5f577..00000000 --- a/ebcc/codegen/UDCSD.py +++ /dev/null @@ -1,785 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:08:07.327242 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:08:08.616131. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp0 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp2 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) * -1 - tmp2 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp1 = np.copy(f.bb.ov) - tmp1 += einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - tmp1 += einsum(tmp0, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) * -0.5 - del tmp0 - tmp3 = np.copy(f.aa.ov) * 2 - tmp3 += einsum(tmp2, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) * -1 - del tmp2 - e_cc = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 2, 1, 3), ()) - e_cc += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 3), ()) - e_cc += einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 3, 1), ()) * -1 - e_cc += einsum(tmp1, (0, 1), t1.bb, (0, 1), ()) - del tmp1 - e_cc += einsum(t1.aa, (0, 1), tmp3, (0, 1), ()) * 0.5 - del tmp3 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:09:04.805710. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t1new : Namespace of arrays - Updated T1 residuals. - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - tmp14 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp14 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp7 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) * -1 - tmp7 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp22 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp15 = einsum(tmp14, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) - del tmp14 - tmp13 = einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 1, 2, 3), (2, 3)) - tmp152 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) - tmp152 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) * -1 - tmp8 = einsum(tmp7, (0, 1, 2, 3), t1.aa, (0, 3), (1, 2)) - del tmp7 - tmp2 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp0 = einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp53 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) * -1 - tmp53 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp173 = np.copy(v.bbbb.ooov) - tmp173 += np.transpose(v.bbbb.ovoo, (0, 2, 3, 1)) * -1 - tmp21 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 2, 1)) - tmp164 = np.copy(v.bbbb.ovvv) - tmp164 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) * -1 - tmp166 = np.copy(tmp22) * -1 - tmp166 += np.transpose(tmp22, (0, 2, 1, 3)) - tmp103 = np.copy(v.bbbb.ovvv) - tmp103 += np.transpose(v.bbbb.ovvv, (0, 2, 3, 1)) * -1 - tmp16 = np.copy(f.bb.ov) - tmp16 += tmp13 - tmp16 += tmp15 * -1 - del tmp15 - tmp153 = einsum(tmp152, (0, 1, 2, 3), t1.bb, (0, 2), (1, 3)) - del tmp152 - tmp29 = np.copy(v.bbbb.ooov) * -1 - tmp29 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) - tmp18 = np.copy(v.aaaa.ooov) - tmp18 += np.transpose(v.aaaa.ovoo, (0, 2, 3, 1)) * -1 - tmp42 = np.copy(v.aaaa.ovvv) - tmp42 += np.transpose(v.aaaa.ovvv, (0, 2, 3, 1)) * -1 - tmp9 = np.copy(f.aa.ov) - tmp9 += tmp2 - tmp9 += tmp8 * -1 - del tmp8 - tmp69 = np.copy(tmp0) - tmp69 += np.transpose(tmp0, (0, 2, 1, 3)) * -1 - tmp67 = np.copy(v.aaaa.ovvv) * -1 - tmp67 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) - tmp1 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp54 = einsum(t1.aa, (0, 1), tmp53, (0, 2, 3, 1), (2, 3)) - del tmp53 - tmp126 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp174 = einsum(tmp173, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) - del tmp173 - tmp111 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - tmp112 = einsum(tmp21, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) - tmp165 = einsum(tmp164, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) - del tmp164 - tmp167 = einsum(tmp166, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - del tmp166 - tmp115 = einsum(v.aabb.ovoo, (0, 1, 2, 3), t1.bb, (3, 4), (0, 2, 1, 4)) - tmp98 = einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 0, 2), (4, 1, 5, 3)) - tmp104 = einsum(tmp103, (0, 1, 2, 3), t1.bb, (0, 1), (2, 3)) - del tmp103 - tmp105 = einsum(tmp16, (0, 1), t1.bb, (0, 2), (2, 1)) - tmp102 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 4, 1, 3), (2, 4)) - tmp101 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 4), (3, 4)) - tmp100 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (0, 1, 2, 3), (2, 3)) - tmp179 = einsum(tmp22, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 2, 1)) - tmp154 = np.copy(f.bb.ov) - tmp154 += tmp13 - tmp154 += tmp153 * -1 - del tmp153 - tmp157 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp30 = einsum(t1.bb, (0, 1), tmp29, (2, 3, 0, 1), (2, 3)) - del tmp29 - tmp28 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (0, 1, 2, 3), (2, 3)) - tmp25 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp24 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp148 = einsum(v.bbbb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp6 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp5 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 3, 1, 2), (0, 4)) * -1 - tmp19 = einsum(t1.aa, (0, 1), tmp18, (0, 2, 3, 1), (2, 3)) - tmp17 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp40 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 4, 3), (4, 1)) - tmp39 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp43 = einsum(t1.aa, (0, 1), tmp42, (0, 1, 2, 3), (2, 3)) - del tmp42 - tmp41 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp44 = einsum(t1.aa, (0, 1), tmp9, (0, 2), (1, 2)) - tmp70 = einsum(t1.aa, (0, 1), tmp69, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp69 - tmp68 = einsum(tmp67, (0, 1, 2, 3), t1.aa, (4, 1), (4, 0, 2, 3)) - tmp81 = einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp80 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - tmp49 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp63 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.aa, (4, 1), (4, 2, 0, 3)) - tmp64 = einsum(tmp1, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - tmp55 = np.copy(f.aa.ov) - tmp55 += tmp2 - tmp55 += tmp54 * -1 - del tmp54 - tmp85 = einsum(tmp0, (0, 1, 2, 3), t1.aa, (4, 3), (0, 4, 2, 1)) - tmp58 = einsum(t1.aa, (0, 1), v.aaaa.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp77 = einsum(tmp18, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - del tmp18 - tmp37 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp175 = np.copy(v.bbbb.oovv) * -1 - tmp175 += tmp126 - tmp175 += tmp174 * -1 - del tmp174 - tmp181 = einsum(t1.bb, (0, 1), v.bbbb.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp159 = np.copy(v.bbbb.ovvv) - tmp159 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) * -1 - tmp160 = np.copy(tmp22) * -1 - tmp160 += np.transpose(tmp22, (0, 2, 1, 3)) - tmp136 = np.copy(tmp111) - tmp136 += tmp112 * -1 - tmp187 = np.copy(v.bbbb.ovvv) - tmp187 += einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 4), (0, 3, 1, 4)) - tmp168 = np.copy(np.transpose(tmp165, (0, 1, 3, 2))) * -1 - del tmp165 - tmp168 += tmp167 * -1 - del tmp167 - tmp177 = np.copy(tmp115) - tmp177 += tmp98 * -0.5 - tmp106 = np.copy(f.bb.vv) * -1 - tmp106 += np.transpose(tmp100, (1, 0)) * -1 - del tmp100 - tmp106 += np.transpose(tmp101, (1, 0)) * 0.5 - del tmp101 - tmp106 += np.transpose(tmp102, (1, 0)) - del tmp102 - tmp106 += np.transpose(tmp104, (1, 0)) * -1 - del tmp104 - tmp106 += np.transpose(tmp105, (1, 0)) - del tmp105 - tmp162 = np.copy(tmp111) * -1 - tmp162 += tmp112 - tmp183 = einsum(t1.bb, (0, 1), tmp179, (2, 3, 0, 4), (3, 2, 4, 1)) - tmp146 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp155 = einsum(tmp154, (0, 1), t1.bb, (2, 1), (2, 0)) - del tmp154 - tmp185 = einsum(tmp157, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) - tmp96 = np.copy(f.bb.oo) - tmp96 += np.transpose(tmp28, (1, 0)) - tmp96 += np.transpose(tmp24, (1, 0)) * 0.5 - tmp96 += np.transpose(tmp25, (1, 0)) - tmp96 += np.transpose(tmp30, (1, 0)) * -1 - tmp99 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp150 = einsum(t1.bb, (0, 1), tmp148, (2, 3, 4, 0), (2, 4, 3, 1)) - tmp123 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp113 = einsum(v.aabb.vvov, (0, 1, 2, 3), t1.bb, (4, 3), (4, 2, 0, 1)) - tmp121 = np.copy(v.aaaa.ooov) - tmp121 += np.transpose(v.aaaa.ooov, (0, 2, 1, 3)) * -1 - tmp38 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp130 = np.copy(np.transpose(v.aabb.vvov, (2, 0, 1, 3))) - tmp130 += einsum(t1.aa, (0, 1), v.aabb.ovov, (0, 2, 3, 4), (3, 1, 2, 4)) * -1 - tmp127 = np.copy(v.bbbb.ooov) - tmp127 += np.transpose(v.bbbb.ooov, (0, 2, 1, 3)) * -1 - tmp125 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 5), (1, 4, 3, 5)) - tmp133 = np.copy(v.bbbb.ovvv) * -1 - tmp133 += np.transpose(v.bbbb.ovvv, (0, 2, 1, 3)) - tmp134 = np.copy(tmp22) - tmp134 += np.transpose(tmp22, (0, 2, 1, 3)) * -1 - tmp35 = np.copy(f.aa.oo) - tmp35 += np.transpose(tmp17, (1, 0)) - tmp35 += np.transpose(tmp5, (1, 0)) - tmp35 += np.transpose(tmp6, (1, 0)) * 0.5 - tmp35 += np.transpose(tmp19, (1, 0)) * -1 - tmp45 = np.copy(f.aa.vv) * -1 - tmp45 += np.transpose(tmp39, (1, 0)) * -1 - del tmp39 - tmp45 += np.transpose(tmp40, (1, 0)) - del tmp40 - tmp45 += np.transpose(tmp41, (1, 0)) * 0.5 - del tmp41 - tmp45 += np.transpose(tmp43, (1, 0)) * -1 - del tmp43 - tmp45 += np.transpose(tmp44, (1, 0)) - del tmp44 - tmp71 = np.copy(np.transpose(tmp68, (0, 1, 3, 2))) * -1 - del tmp68 - tmp71 += tmp70 * -1 - tmp83 = np.copy(tmp80) * 2 - tmp83 += tmp81 * -1 - tmp33 = einsum(v.aaaa.oooo, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp51 = einsum(t1.aa, (0, 1), tmp49, (2, 3, 4, 0), (2, 4, 3, 1)) - tmp93 = np.copy(v.aaaa.ovvv) - tmp93 += einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 0, 4), (2, 4, 1, 3)) - tmp73 = np.copy(tmp63) - tmp73 += tmp64 * -1 - tmp56 = einsum(t1.aa, (0, 1), tmp55, (2, 1), (0, 2)) - del tmp55 - tmp87 = einsum(tmp85, (0, 1, 2, 3), t1.aa, (2, 4), (1, 0, 3, 4)) - tmp89 = einsum(t1.aa, (0, 1), tmp58, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp91 = einsum(v.aaaa.vvvv, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 1, 2)) - tmp60 = np.copy(v.aaaa.ovvv) * -1 - tmp60 += np.transpose(v.aaaa.ovvv, (0, 2, 1, 3)) - tmp61 = np.copy(tmp0) - tmp61 += np.transpose(tmp0, (0, 2, 1, 3)) * -1 - tmp47 = einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp78 = np.copy(v.aaaa.oovv) * -1 - tmp78 += tmp37 - tmp78 += tmp77 * -1 - del tmp77 - tmp65 = np.copy(tmp63) * -1 - del tmp63 - tmp65 += tmp64 - tmp10 = einsum(t1.aa, (0, 1), tmp9, (2, 1), (0, 2)) - tmp176 = einsum(tmp175, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (4, 0, 5, 2)) * 2 - del tmp175 - tmp182 = einsum(tmp181, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) - del tmp181 - tmp161 = einsum(tmp159, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 3, 1)) * -1 - del tmp159 - tmp161 += einsum(tmp160, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) * -1 - del tmp160 - tmp170 = einsum(t2.abab, (0, 1, 2, 3), tmp136, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp188 = np.copy(v.bbbb.vvvv) * -1 - tmp188 += einsum(t1.bb, (0, 1), tmp187, (0, 2, 3, 4), (2, 1, 4, 3)) - del tmp187 - tmp158 = einsum(tmp22, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - tmp171 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp169 = einsum(tmp168, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp168 - tmp178 = einsum(t2.abab, (0, 1, 2, 3), tmp177, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp177 - tmp145 = einsum(t2.bbbb, (0, 1, 2, 3), tmp106, (3, 4), (0, 1, 2, 4)) * -2 - tmp143 = einsum(v.bbbb.oooo, (0, 1, 2, 3), t2.bbbb, (3, 1, 4, 5), (0, 2, 4, 5)) * -1 - tmp180 = einsum(tmp179, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 5), (1, 0, 4, 5)) * -1 - del tmp179 - tmp163 = einsum(t2.abab, (0, 1, 2, 3), tmp162, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp162 - tmp184 = einsum(t1.bb, (0, 1), tmp183, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp183 - tmp147 = einsum(tmp146, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - del tmp146 - tmp156 = einsum(t2.bbbb, (0, 1, 2, 3), tmp155, (4, 1), (0, 4, 2, 3)) * -1 - del tmp155 - tmp149 = einsum(tmp148, (0, 1, 2, 3), t2.bbbb, (3, 2, 4, 5), (0, 1, 4, 5)) * -1 - del tmp148 - tmp142 = np.copy(t2.bbbb) - tmp142 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) * 2 - tmp144 = einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * 2 - tmp144 += t2.bbbb * -1 - tmp186 = einsum(t1.bb, (0, 1), tmp185, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp185 - tmp189 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 5, 3, 1), (4, 5, 0, 2)) * -1 - tmp107 = einsum(tmp16, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp141 = einsum(t2.bbbb, (0, 1, 2, 3), tmp96, (1, 4), (0, 4, 2, 3)) * -1 - tmp172 = einsum(t2.abab, (0, 1, 2, 3), tmp99, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp151 = einsum(tmp150, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 4, 3)) - del tmp150 - tmp124 = np.copy(tmp80) * -1 - tmp124 += tmp123 - tmp124 += tmp81 * 0.5 - tmp129 = np.copy(tmp115) * -1 - tmp129 += tmp98 * 0.5 - tmp129 += tmp99 - tmp118 = einsum(t1.aa, (0, 1), tmp113, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp114 = np.copy(np.transpose(tmp113, (0, 1, 3, 2))) - del tmp113 - tmp114 += einsum(tmp21, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 3, 4)) * -1 - tmp132 = einsum(tmp67, (0, 1, 2, 3), t1.aa, (4, 2), (4, 0, 1, 3)) * -1 - del tmp67 - tmp132 += np.transpose(tmp70, (0, 1, 3, 2)) - del tmp70 - tmp97 = np.copy(t2.abab) - tmp97 += einsum(t1.aa, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * 2 - tmp3 = np.copy(t2.abab) - tmp3 += einsum(t1.aa, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - tmp122 = np.copy(v.aaaa.oovv) * -1 - tmp122 += np.transpose(tmp37, (1, 0, 3, 2)) - tmp122 += np.transpose(tmp38, (1, 0, 3, 2)) * 0.5 - tmp122 += einsum(tmp121, (0, 1, 2, 3), t1.aa, (2, 4), (1, 0, 3, 4)) - del tmp121 - tmp120 = einsum(t1.aa, (0, 1), tmp21, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp109 = einsum(t1.aa, (0, 1), v.aabb.vvoo, (2, 1, 3, 4), (0, 3, 4, 2)) - tmp137 = einsum(t1.aa, (0, 1), v.aabb.ovvv, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp137 += einsum(tmp1, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) * -1 - tmp139 = einsum(v.aabb.oovv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp131 = np.copy(v.aabb.vvvv) - tmp131 += einsum(tmp130, (0, 1, 2, 3), t1.bb, (0, 4), (2, 1, 3, 4)) * -1 - del tmp130 - tmp108 = einsum(v.aabb.ooov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 1, 4, 2)) - tmp117 = np.copy(v.aabb.oovv) - tmp117 += einsum(t1.bb, (0, 1), v.aabb.ooov, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - tmp119 = np.copy(np.transpose(v.aabb.vvov, (2, 0, 1, 3))) - tmp119 += einsum(t1.bb, (0, 1), v.aabb.vvvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp128 = np.copy(v.bbbb.oovv) * -2 - tmp128 += np.transpose(tmp125, (1, 0, 3, 2)) - tmp128 += np.transpose(tmp126, (1, 0, 3, 2)) * 2 - tmp128 += einsum(tmp127, (0, 1, 2, 3), t1.bb, (2, 4), (1, 0, 3, 4)) * 2 - del tmp127 - tmp140 = einsum(t1.aa, (0, 1), tmp111, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp138 = einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp116 = np.copy(np.transpose(v.aabb.vvoo, (2, 3, 0, 1))) - tmp116 += einsum(v.aabb.ovoo, (0, 1, 2, 3), t1.aa, (0, 4), (2, 3, 1, 4)) * -1 - tmp110 = einsum(t1.aa, (0, 1), v.aabb.ovoo, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp135 = einsum(tmp133, (0, 1, 2, 3), t1.bb, (4, 2), (4, 0, 1, 3)) * -1 - del tmp133 - tmp135 += einsum(tmp134, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) - del tmp134 - tmp36 = einsum(tmp35, (0, 1), t2.aaaa, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - tmp46 = einsum(t2.aaaa, (0, 1, 2, 3), tmp45, (3, 4), (0, 1, 2, 4)) * -2 - tmp76 = einsum(t2.aaaa, (0, 1, 2, 3), tmp38, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp72 = einsum(t2.aaaa, (0, 1, 2, 3), tmp71, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp71 - tmp84 = einsum(t2.abab, (0, 1, 2, 3), tmp83, (4, 1, 5, 3), (0, 4, 2, 5)) * 0.5 - del tmp83 - tmp34 = einsum(tmp33, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp33 - tmp82 = np.copy(tmp80) - tmp82 += tmp81 * -0.5 - tmp75 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp52 = einsum(tmp51, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp51 - tmp50 = einsum(t2.aaaa, (0, 1, 2, 3), tmp49, (4, 5, 0, 1), (4, 5, 2, 3)) - del tmp49 - tmp32 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.oooo, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp95 = einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp94 = np.copy(v.aaaa.vvvv) - tmp94 += einsum(tmp93, (0, 1, 2, 3), t1.aa, (0, 4), (3, 4, 2, 1)) - del tmp93 - tmp86 = einsum(t2.aaaa, (0, 1, 2, 3), tmp85, (4, 5, 1, 0), (5, 4, 2, 3)) - del tmp85 - tmp74 = einsum(t2.abab, (0, 1, 2, 3), tmp73, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp57 = einsum(t2.aaaa, (0, 1, 2, 3), tmp56, (4, 1), (0, 4, 2, 3)) * -1 - tmp88 = einsum(tmp87, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp87 - tmp90 = einsum(t1.aa, (0, 1), tmp89, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp89 - tmp92 = einsum(t1.aa, (0, 1), tmp91, (2, 3, 1, 4), (0, 2, 3, 4)) - del tmp91 - tmp62 = einsum(t1.aa, (0, 1), tmp60, (2, 1, 3, 4), (0, 2, 4, 3)) * -1 - del tmp60 - tmp62 += einsum(tmp61, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - del tmp61 - tmp59 = einsum(t1.aa, (0, 1), tmp0, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp48 = einsum(t1.aa, (0, 1), tmp47, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp47 - tmp79 = einsum(t2.aaaa, (0, 1, 2, 3), tmp78, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp78 - tmp66 = einsum(t2.abab, (0, 1, 2, 3), tmp65, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp65 - tmp23 = np.copy(t2.bbbb) * 2 - tmp23 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) - tmp27 = np.copy(f.bb.vv) - tmp27 += einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (0, 3), (1, 2)) * -1 - tmp26 = np.copy(np.transpose(tmp24, (1, 0))) * 0.5 - del tmp24 - tmp26 += np.transpose(tmp25, (1, 0)) - del tmp25 - tmp26 += einsum(tmp16, (0, 1), t1.bb, (2, 1), (0, 2)) * 0.5 - tmp31 = np.copy(f.bb.oo) - tmp31 += np.transpose(tmp28, (1, 0)) - del tmp28 - tmp31 += np.transpose(tmp30, (1, 0)) * -1 - del tmp30 - tmp12 = np.copy(f.aa.vv) - tmp12 += einsum(t1.aa, (0, 1), v.aaaa.ovvv, (0, 2, 3, 1), (2, 3)) * -1 - tmp11 = np.copy(np.transpose(tmp5, (1, 0))) * 2 - del tmp5 - tmp11 += np.transpose(tmp6, (1, 0)) - del tmp6 - tmp11 += np.transpose(tmp10, (1, 0)) - tmp20 = np.copy(f.aa.oo) - tmp20 += np.transpose(tmp17, (1, 0)) - del tmp17 - tmp20 += np.transpose(tmp19, (1, 0)) * -1 - del tmp19 - tmp4 = np.copy(t2.aaaa) * 2 - tmp4 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - t2new.bbbb = np.copy(np.transpose(tmp141, (0, 1, 3, 2))) * -2 - t2new.bbbb += einsum(v.bbbb.oooo, (0, 1, 2, 3), tmp142, (3, 1, 4, 5), (0, 2, 5, 4)) * 0.5 - del tmp142 - t2new.bbbb += np.transpose(tmp143, (1, 0, 3, 2)) - del tmp143 - t2new.bbbb += np.transpose(tmp141, (1, 0, 3, 2)) * 2 - del tmp141 - t2new.bbbb += einsum(v.bbbb.oooo, (0, 1, 2, 3), tmp144, (3, 1, 4, 5), (0, 2, 5, 4)) * -0.5 - del tmp144 - t2new.bbbb += np.transpose(tmp126, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp125, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp145, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp126, (1, 0, 2, 3)) * -2 - t2new.bbbb += np.transpose(tmp125, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp145, (1, 0, 2, 3)) * -1 - del tmp145 - t2new.bbbb += np.transpose(tmp147, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp149, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp151, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp151, (1, 0, 3, 2)) * -1 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp107, (4, 1), (0, 4, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp147, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp156, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp147, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp149, (0, 1, 3, 2)) * 2 - del tmp149 - t2new.bbbb += tmp151 * -1 - t2new.bbbb += np.transpose(tmp151, (0, 1, 3, 2)) - del tmp151 - t2new.bbbb += np.transpose(tmp156, (1, 0, 3, 2)) * 2 - del tmp156 - t2new.bbbb += tmp147 - del tmp147 - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - t2new.bbbb += np.transpose(tmp157, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp158, (1, 0, 3, 2)) * -1 - t2new.bbbb += einsum(tmp161, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (4, 0, 2, 5)) * 2 - del tmp161 - t2new.bbbb += np.transpose(tmp163, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 3, 1)) * -1 - t2new.bbbb += tmp157 * -1 - t2new.bbbb += np.transpose(tmp158, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp169, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp170, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp171, (0, 1, 3, 2)) - t2new.bbbb += tmp172 * 2 - t2new.bbbb += np.transpose(tmp172, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp176, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp178, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp171, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp172, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp172, (1, 0, 2, 3)) * -2 - del tmp172 - t2new.bbbb += np.transpose(tmp176, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp178, (0, 1, 3, 2)) - t2new.bbbb += tmp171 * -1 - t2new.bbbb += np.transpose(tmp176, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp178, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp171, (1, 0, 2, 3)) - del tmp171 - t2new.bbbb += tmp176 - del tmp176 - t2new.bbbb += tmp178 * -1 - del tmp178 - t2new.bbbb += np.transpose(tmp157, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp180, (0, 1, 3, 2)) * -2 - del tmp180 - t2new.bbbb += tmp182 - t2new.bbbb += np.transpose(tmp182, (0, 1, 3, 2)) * -1 - del tmp182 - t2new.bbbb += tmp184 - t2new.bbbb += np.transpose(tmp184, (0, 1, 3, 2)) * -1 - del tmp184 - t2new.bbbb += np.transpose(tmp186, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp186, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp157, (1, 0, 3, 2)) * -1 - del tmp157 - t2new.bbbb += einsum(tmp188, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 3), (4, 5, 2, 1)) * 2 - del tmp188 - t2new.bbbb += np.transpose(tmp126, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp125, (0, 1, 3, 2)) * -1 - t2new.bbbb += tmp126 * 2 - del tmp126 - t2new.bbbb += tmp125 - del tmp125 - t2new.bbbb += np.transpose(tmp158, (1, 0, 2, 3)) - t2new.bbbb += tmp169 * -2 - t2new.bbbb += tmp163 * -1 - del tmp163 - t2new.bbbb += tmp158 * -1 - del tmp158 - t2new.bbbb += np.transpose(tmp169, (1, 0, 2, 3)) * 2 - del tmp169 - t2new.bbbb += np.transpose(tmp170, (1, 0, 2, 3)) * -1 - del tmp170 - t2new.bbbb += einsum(t1.bb, (0, 1), tmp189, (2, 3, 0, 4), (2, 3, 1, 4)) * -2 - del tmp189 - t2new.bbbb += tmp186 * -1 - t2new.bbbb += np.transpose(tmp186, (1, 0, 2, 3)) - del tmp186 - t2new.abab = einsum(t2.abab, (0, 1, 2, 3), tmp96, (1, 4), (0, 4, 2, 3)) * -1 - del tmp96 - t2new.abab += einsum(tmp97, (0, 1, 2, 3), v.aabb.oooo, (4, 0, 5, 1), (4, 5, 2, 3)) * 0.5 - del tmp97 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), v.aabb.oooo, (4, 0, 5, 1), (4, 5, 2, 3)) * 0.5 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp35, (0, 4), (4, 1, 2, 3)) * -1 - del tmp35 - t2new.abab += tmp98 - del tmp98 - t2new.abab += tmp99 * 2 - del tmp99 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp45, (2, 4), (0, 1, 4, 3)) * -1 - del tmp45 - t2new.abab += einsum(tmp106, (0, 1), t2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -1 - del tmp106 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp107, (4, 1), (0, 4, 2, 3)) * -1 - del tmp107 - t2new.abab += einsum(tmp3, (0, 1, 2, 3), tmp108, (0, 4, 5, 1), (4, 5, 2, 3)) - del tmp108 - t2new.abab += einsum(t1.bb, (0, 1), tmp109, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - del tmp109 - t2new.abab += einsum(tmp56, (0, 1), t2.abab, (1, 2, 3, 4), (0, 2, 3, 4)) * -1 - del tmp56 - t2new.abab += einsum(tmp3, (0, 1, 2, 3), tmp110, (4, 0, 1, 5), (4, 5, 2, 3)) - del tmp110 - t2new.abab += tmp111 - del tmp111 - t2new.abab += tmp112 * -1 - del tmp112 - t2new.abab += np.transpose(v.aabb.ovov, (0, 2, 1, 3)) - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp114, (4, 1, 2, 5), (0, 4, 5, 3)) * -1 - del tmp114 - t2new.abab += tmp115 * -1 - del tmp115 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp116, (1, 4, 2, 5), (0, 4, 5, 3)) * -1 - del tmp116 - t2new.abab += tmp80 * -1 - del tmp80 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp117, (0, 4, 3, 5), (4, 1, 2, 5)) * -1 - del tmp117 - t2new.abab += einsum(t1.bb, (0, 1), tmp118, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - del tmp118 - t2new.abab += einsum(t1.aa, (0, 1), tmp119, (2, 1, 3, 4), (0, 2, 3, 4)) - del tmp119 - t2new.abab += einsum(tmp120, (0, 1, 2, 3), tmp3, (1, 3, 4, 5), (0, 2, 4, 5)) - del tmp120 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp122, (0, 4, 2, 5), (4, 1, 5, 3)) - del tmp122 - t2new.abab += einsum(t2.bbbb, (0, 1, 2, 3), tmp124, (4, 1, 5, 3), (4, 0, 5, 2)) * 2 - del tmp124 - t2new.abab += tmp81 - del tmp81 - t2new.abab += tmp123 * 2 - del tmp123 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp128, (1, 4, 3, 5), (0, 4, 2, 5)) * 0.5 - del tmp128 - t2new.abab += einsum(tmp129, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (4, 1, 5, 3)) * 2 - del tmp129 - t2new.abab += einsum(tmp131, (0, 1, 2, 3), t2.abab, (4, 5, 0, 2), (4, 5, 1, 3)) - del tmp131 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp132, (4, 0, 2, 5), (4, 1, 5, 3)) - del tmp132 - t2new.abab += einsum(t2.bbbb, (0, 1, 2, 3), tmp73, (4, 1, 5, 3), (4, 0, 5, 2)) * 2 - del tmp73 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp135, (4, 1, 3, 5), (0, 4, 2, 5)) - del tmp135 - t2new.abab += einsum(tmp136, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (4, 1, 5, 3)) * 2 - del tmp136 - t2new.abab += tmp64 * -1 - del tmp64 - t2new.abab += einsum(tmp137, (0, 1, 2, 3), t2.abab, (1, 4, 5, 2), (0, 4, 5, 3)) * -1 - del tmp137 - t2new.abab += einsum(tmp138, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - del tmp138 - t2new.abab += einsum(t1.aa, (0, 1), tmp139, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp139 - t2new.abab += einsum(t1.aa, (0, 1), tmp140, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp140 - t2new.aaaa = np.copy(np.transpose(tmp32, (1, 0, 3, 2))) * 2 - del tmp32 - t2new.aaaa += tmp34 - t2new.aaaa += np.transpose(tmp36, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp34, (0, 1, 3, 2)) * -1 - del tmp34 - t2new.aaaa += np.transpose(tmp36, (1, 0, 3, 2)) * 2 - del tmp36 - t2new.aaaa += np.transpose(tmp37, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp38, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp46, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp37, (1, 0, 2, 3)) * -2 - t2new.aaaa += np.transpose(tmp38, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp46, (1, 0, 2, 3)) * -1 - del tmp46 - t2new.aaaa += np.transpose(tmp48, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp50, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp52, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(tmp52, (1, 0, 3, 2)) * -1 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp10, (4, 1), (0, 4, 2, 3)) * -1 - del tmp10 - t2new.aaaa += np.transpose(tmp48, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp57, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp48, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp50, (0, 1, 3, 2)) * 2 - del tmp50 - t2new.aaaa += tmp52 * -1 - t2new.aaaa += np.transpose(tmp52, (0, 1, 3, 2)) - del tmp52 - t2new.aaaa += np.transpose(tmp57, (1, 0, 3, 2)) * 2 - del tmp57 - t2new.aaaa += tmp48 - del tmp48 - t2new.aaaa += np.transpose(tmp58, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(tmp59, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - t2new.aaaa += einsum(tmp62, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 2, 5)) * 2 - del tmp62 - t2new.aaaa += np.transpose(tmp66, (0, 1, 3, 2)) - t2new.aaaa += tmp58 * -1 - t2new.aaaa += np.transpose(tmp59, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 3, 1)) * -1 - t2new.aaaa += np.transpose(tmp72, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp74, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp75, (0, 1, 3, 2)) - t2new.aaaa += tmp76 * 2 - t2new.aaaa += np.transpose(tmp76, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp79, (1, 0, 3, 2)) - t2new.aaaa += einsum(tmp82, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - del tmp82 - t2new.aaaa += np.transpose(tmp75, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp76, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp76, (1, 0, 2, 3)) * -2 - del tmp76 - t2new.aaaa += np.transpose(tmp79, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp84, (0, 1, 3, 2)) - t2new.aaaa += tmp75 * -1 - t2new.aaaa += np.transpose(tmp79, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp84, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(tmp75, (1, 0, 2, 3)) - del tmp75 - t2new.aaaa += tmp79 - del tmp79 - t2new.aaaa += tmp84 * -1 - del tmp84 - t2new.aaaa += np.transpose(tmp86, (0, 1, 3, 2)) * -2 - del tmp86 - t2new.aaaa += np.transpose(tmp58, (0, 1, 3, 2)) - t2new.aaaa += tmp88 - t2new.aaaa += np.transpose(tmp88, (0, 1, 3, 2)) * -1 - del tmp88 - t2new.aaaa += np.transpose(tmp90, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp90, (1, 0, 3, 2)) * -1 - t2new.aaaa += tmp92 - t2new.aaaa += np.transpose(tmp92, (0, 1, 3, 2)) * -1 - del tmp92 - t2new.aaaa += np.transpose(tmp58, (1, 0, 3, 2)) * -1 - del tmp58 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp94, (2, 4, 5, 3), (0, 1, 5, 4)) * -2 - del tmp94 - t2new.aaaa += np.transpose(tmp38, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp37, (0, 1, 3, 2)) * -2 - t2new.aaaa += tmp38 - del tmp38 - t2new.aaaa += tmp37 * 2 - del tmp37 - t2new.aaaa += np.transpose(tmp59, (1, 0, 2, 3)) - t2new.aaaa += tmp72 * -2 - t2new.aaaa += tmp66 * -1 - del tmp66 - t2new.aaaa += tmp59 * -1 - del tmp59 - t2new.aaaa += np.transpose(tmp72, (1, 0, 2, 3)) * 2 - del tmp72 - t2new.aaaa += np.transpose(tmp74, (1, 0, 2, 3)) * -1 - del tmp74 - t2new.aaaa += einsum(tmp95, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) * -2 - del tmp95 - t2new.aaaa += tmp90 * -1 - t2new.aaaa += np.transpose(tmp90, (1, 0, 2, 3)) - del tmp90 - t1new.bb = einsum(tmp21, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) * -1 - del tmp21 - t1new.bb += einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - t1new.bb += f.bb.ov - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp22, (4, 1, 0, 3), (4, 2)) * -2 - del tmp22 - t1new.bb += tmp13 - del tmp13 - t1new.bb += einsum(v.aabb.ovvv, (0, 1, 2, 3), tmp3, (0, 4, 1, 3), (4, 2)) - t1new.bb += einsum(v.bbbb.ovvv, (0, 1, 2, 3), tmp23, (0, 4, 1, 3), (4, 2)) - del tmp23 - t1new.bb += einsum(t1.bb, (0, 1), tmp26, (0, 2), (2, 1)) * -2 - del tmp26 - t1new.bb += einsum(t1.bb, (0, 1), tmp27, (1, 2), (0, 2)) - del tmp27 - t1new.bb += einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) * -1 - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ooov, (4, 0, 1, 3), (4, 2)) * -2 - t1new.bb += einsum(v.aabb.ovoo, (0, 1, 2, 3), t2.abab, (0, 3, 1, 4), (2, 4)) * -1 - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), tmp9, (0, 2), (1, 3)) - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp16, (1, 3), (0, 2)) * 2 - t1new.bb += einsum(t1.bb, (0, 1), tmp31, (0, 2), (2, 1)) * -1 - del tmp31 - t1new.aa = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (2, 3), (0, 1)) - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), tmp0, (4, 1, 0, 3), (4, 2)) * -2 - del tmp0 - t1new.aa += f.aa.ov - t1new.aa += einsum(tmp1, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) * -1 - del tmp1 - t1new.aa += tmp2 - del tmp2 - t1new.aa += einsum(v.aabb.vvov, (0, 1, 2, 3), tmp3, (4, 2, 1, 3), (4, 0)) - del tmp3 - t1new.aa += einsum(v.aaaa.ovvv, (0, 1, 2, 3), tmp4, (0, 4, 1, 3), (4, 2)) - del tmp4 - t1new.aa += einsum(t1.aa, (0, 1), tmp11, (0, 2), (2, 1)) * -1 - del tmp11 - t1new.aa += einsum(tmp12, (0, 1), t1.aa, (2, 0), (2, 1)) - del tmp12 - t1new.aa += einsum(v.aaaa.oovv, (0, 1, 2, 3), t1.aa, (1, 3), (0, 2)) * -1 - t1new.aa += einsum(v.aabb.ooov, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) * -1 - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ooov, (4, 0, 1, 3), (4, 2)) * -2 - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), tmp9, (1, 3), (0, 2)) * 2 - del tmp9 - t1new.aa += einsum(tmp16, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - del tmp16 - t1new.aa += einsum(tmp20, (0, 1), t1.aa, (0, 2), (1, 2)) * -1 - del tmp20 - - return {f"t1new": t1new, f"t2new": t2new} - diff --git a/ebcc/codegen/UDFCC2.py b/ebcc/codegen/UDFCC2.py deleted file mode 100644 index 606831c2..00000000 --- a/ebcc/codegen/UDFCC2.py +++ /dev/null @@ -1,5425 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T16:53:22.180022 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:53:24.005263. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 0, 1), (2,)) - tmp3 = einsum(t1.aa, (0, 1), v.baa.xov, (2, 3, 1), (2, 0, 3)) - tmp1 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) * 0.5 - tmp1 += tmp0 - tmp5 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 3, 1), (2, 0, 3)) - tmp7 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp7 += einsum(t1.bb, (0, 1), tmp0, (2,), (2, 0, 1)) * 0.5 - del tmp0 - tmp4 = np.copy(f.aa.ov) * 2 - tmp4 += einsum(v.baa.xov, (0, 1, 2), tmp3, (0, 1, 3), (3, 2)) * -1 - del tmp3 - tmp2 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp2 += einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp2 += einsum(t1.aa, (0, 1), tmp1, (2,), (2, 0, 1)) - del tmp1 - tmp6 = np.copy(f.bb.ov) - tmp6 += einsum(v.bbb.xov, (0, 1, 2), tmp5, (0, 1, 3), (3, 2)) * -0.5 - del tmp5 - e_cc = einsum(v.baa.xov, (0, 1, 2), tmp2, (0, 1, 2), ()) - del tmp2 - e_cc += einsum(t1.aa, (0, 1), tmp4, (0, 1), ()) * 0.5 - del tmp4 - e_cc += einsum(tmp6, (0, 1), t1.bb, (0, 1), ()) - del tmp6 - e_cc += einsum(tmp7, (0, 1, 2), v.bbb.xov, (0, 1, 2), ()) - del tmp7 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:53:48.694394. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t1new : Namespace of arrays - Updated T1 residuals. - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - tmp17 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 3, 1), (2, 0, 3)) - tmp0 = einsum(t1.aa, (0, 1), v.baa.xov, (2, 3, 1), (2, 0, 3)) - tmp6 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 0, 1), (2,)) - tmp5 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp34 = einsum(t1.bb, (0, 1), v.bbb.xvv, (2, 3, 1), (2, 0, 3)) - tmp86 = einsum(tmp17, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp92 = einsum(tmp17, (0, 1, 2), tmp17, (0, 3, 4), (1, 3, 2, 4)) - tmp71 = einsum(t1.bb, (0, 1), tmp17, (2, 3, 0), (2, 3, 1)) - tmp79 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp16 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp50 = einsum(tmp0, (0, 1, 2), t1.aa, (2, 3), (0, 1, 3)) - tmp36 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp47 = einsum(tmp0, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp58 = einsum(tmp0, (0, 1, 2), tmp0, (0, 3, 4), (1, 3, 2, 4)) - tmp7 = np.copy(tmp5) - tmp7 += tmp6 - tmp18 = einsum(tmp17, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp26 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp11 = einsum(tmp0, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp3 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp32 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp83 = einsum(tmp34, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp87 = einsum(tmp86, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - del tmp86 - tmp24 = einsum(tmp17, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp64 = einsum(t1.bb, (0, 1), f.bb.ov, (0, 2), (2, 1)) - tmp93 = einsum(tmp92, (0, 1, 2, 3), t1.bb, (2, 4), (1, 0, 3, 4)) - del tmp92 - tmp68 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp72 = np.copy(v.bbb.xov) - tmp72 += tmp34 - tmp72 += tmp71 * -1 - tmp80 = einsum(tmp79, (0, 1, 2, 3), t1.bb, (3, 4), (1, 2, 0, 4)) - del tmp79 - tmp96 = einsum(tmp17, (0, 1, 2), tmp34, (0, 3, 4), (1, 3, 2, 4)) - tmp69 = np.copy(tmp16) - tmp69 += tmp50 * -1 - tmp40 = einsum(f.aa.ov, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp66 = einsum(v.baa.xoo, (0, 1, 2), tmp17, (0, 3, 4), (1, 2, 3, 4)) - tmp73 = einsum(tmp0, (0, 1, 2), tmp17, (0, 3, 4), (1, 2, 3, 4)) - tmp62 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp37 = einsum(tmp36, (0, 1, 2, 3), t1.aa, (3, 4), (1, 2, 0, 4)) - del tmp36 - tmp1 = einsum(tmp0, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp48 = einsum(tmp47, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - del tmp47 - tmp59 = einsum(tmp58, (0, 1, 2, 3), t1.aa, (2, 4), (1, 0, 3, 4)) - del tmp58 - tmp15 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp51 = np.copy(v.baa.xov) - tmp51 += tmp16 - tmp51 += tmp50 * -1 - del tmp50 - tmp45 = einsum(v.baa.xoo, (0, 1, 2), tmp16, (0, 3, 4), (3, 1, 2, 4)) - tmp55 = einsum(tmp0, (0, 1, 2), tmp16, (0, 3, 4), (1, 3, 2, 4)) - tmp43 = einsum(f.aa.ov, (0, 1), t1.aa, (2, 1), (0, 2)) - tmp21 = einsum(tmp7, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp19 = einsum(tmp7, (0,), v.bbb.xov, (0, 1, 2), (1, 2)) - tmp27 = np.copy(t2.bbbb) - tmp27 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -0.5 - tmp30 = np.copy(f.bb.ov) - tmp30 += tmp18 * -1 - tmp29 = np.copy(tmp26) - tmp29 += einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) * 2 - tmp29 += einsum(tmp7, (0,), t1.bb, (1, 2), (0, 1, 2)) - tmp12 = np.copy(f.aa.ov) - tmp12 += tmp11 * -1 - tmp10 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp10 += tmp3 * 0.5 - tmp10 += einsum(tmp7, (0,), t1.aa, (1, 2), (0, 1, 2)) * 0.5 - tmp4 = np.copy(t2.aaaa) - tmp4 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -0.5 - tmp90 = einsum(tmp32, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 4, 3)) - tmp95 = einsum(tmp34, (0, 1, 2), tmp34, (0, 3, 4), (1, 3, 2, 4)) - tmp91 = einsum(v.bbb.xov, (0, 1, 2), tmp34, (0, 3, 4), (3, 1, 2, 4)) - tmp84 = einsum(t1.bb, (0, 1), tmp83, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp83 - tmp88 = einsum(tmp87, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 4, 3)) - del tmp87 - tmp98 = einsum(tmp24, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - tmp78 = einsum(f.bb.oo, (0, 1), t2.bbbb, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp82 = np.copy(f.bb.vv) - tmp82 += tmp64 * -1 - tmp94 = einsum(t1.bb, (0, 1), tmp93, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp93 - tmp65 = np.copy(f.bb.vv) - tmp65 += tmp64 * -1 - del tmp64 - tmp85 = einsum(tmp68, (0, 1), t2.bbbb, (2, 0, 3, 4), (1, 2, 3, 4)) - tmp89 = einsum(tmp72, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp81 = einsum(tmp80, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) - del tmp80 - tmp97 = einsum(tmp96, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - del tmp96 - tmp77 = einsum(tmp34, (0, 1, 2), tmp0, (0, 3, 4), (3, 4, 1, 2)) - tmp75 = np.copy(v.bbb.xov) - tmp75 += tmp34 - tmp75 += tmp71 * -1 - del tmp71 - tmp70 = einsum(tmp69, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - del tmp69 - tmp76 = einsum(tmp34, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp14 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp2 = einsum(v.bbb.xov, (0, 1, 2), tmp0, (0, 3, 4), (3, 4, 1, 2)) - tmp41 = np.copy(f.aa.vv) - tmp41 += tmp40 * -1 - tmp67 = einsum(t1.bb, (0, 1), tmp66, (2, 3, 4, 0), (2, 3, 4, 1)) - del tmp66 - tmp74 = einsum(t1.bb, (0, 1), tmp73, (2, 3, 4, 0), (2, 3, 4, 1)) - del tmp73 - tmp63 = einsum(t1.bb, (0, 1), tmp62, (2, 3, 4, 0), (3, 2, 4, 1)) - del tmp62 - tmp33 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp38 = einsum(tmp37, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - del tmp37 - tmp61 = einsum(tmp1, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - tmp49 = einsum(tmp48, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp48 - tmp42 = np.copy(f.aa.vv) - tmp42 += tmp40 * -1 - del tmp40 - tmp60 = einsum(tmp59, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp59 - tmp54 = einsum(tmp16, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 4, 2)) - tmp53 = einsum(tmp15, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - tmp57 = einsum(tmp16, (0, 1, 2), tmp16, (0, 3, 4), (3, 1, 4, 2)) - tmp52 = einsum(v.baa.xov, (0, 1, 2), tmp51, (0, 3, 4), (1, 3, 2, 4)) - del tmp51 - tmp46 = einsum(tmp45, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp45 - tmp56 = einsum(tmp55, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp55 - tmp39 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.oo, (4, 1), (4, 0, 2, 3)) - tmp44 = einsum(t2.aaaa, (0, 1, 2, 3), tmp43, (1, 4), (4, 0, 2, 3)) - tmp22 = np.copy(f.aa.ov) - tmp22 += tmp11 * -1 - del tmp11 - tmp22 += tmp21 - del tmp21 - tmp20 = np.copy(f.bb.ov) - tmp20 += tmp18 * -1 - del tmp18 - tmp20 += tmp19 - del tmp19 - tmp25 = einsum(v.baa.xov, (0, 1, 2), tmp17, (0, 3, 4), (1, 3, 4, 2)) - tmp35 = np.copy(f.bb.oo) - tmp35 += einsum(v.bbb.xoo, (0, 1, 2), tmp17, (0, 2, 3), (3, 1)) * -1 - del tmp17 - tmp35 += einsum(tmp7, (0,), v.bbb.xoo, (0, 1, 2), (1, 2)) - tmp9 = np.copy(tmp5) - del tmp5 - tmp9 += tmp6 - del tmp6 - tmp28 = np.copy(tmp26) * 0.5 - del tmp26 - tmp28 += einsum(v.bbb.xov, (0, 1, 2), tmp27, (1, 3, 2, 4), (0, 3, 4)) - del tmp27 - tmp28 += einsum(tmp7, (0,), t1.bb, (1, 2), (0, 1, 2)) * 0.5 - tmp31 = einsum(tmp29, (0, 1, 2), v.bbb.xov, (0, 3, 2), (3, 1)) - del tmp29 - tmp31 += einsum(tmp30, (0, 1), t1.bb, (2, 1), (0, 2)) - del tmp30 - tmp23 = np.copy(f.aa.oo) - tmp23 += einsum(tmp0, (0, 1, 2), v.baa.xoo, (0, 3, 1), (2, 3)) * -1 - del tmp0 - tmp23 += einsum(tmp7, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - tmp13 = einsum(tmp10, (0, 1, 2), v.baa.xov, (0, 3, 2), (3, 1)) * 2 - del tmp10 - tmp13 += einsum(tmp12, (0, 1), t1.aa, (2, 1), (0, 2)) - del tmp12 - tmp8 = np.copy(tmp3) * 0.5 - del tmp3 - tmp8 += einsum(v.baa.xov, (0, 1, 2), tmp4, (1, 3, 2, 4), (0, 3, 4)) - del tmp4 - tmp8 += einsum(tmp7, (0,), t1.aa, (1, 2), (0, 1, 2)) * 0.5 - del tmp7 - t2new.bbbb = np.copy(np.transpose(tmp78, (1, 0, 3, 2))) * 2 - t2new.bbbb += tmp81 - t2new.bbbb += np.transpose(tmp78, (0, 1, 3, 2)) * -2 - del tmp78 - t2new.bbbb += np.transpose(tmp81, (0, 1, 3, 2)) * -1 - del tmp81 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp82, (3, 4), (0, 1, 4, 2)) * -2 - del tmp82 - t2new.bbbb += einsum(tmp65, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 4, 1)) * 2 - t2new.bbbb += np.transpose(tmp84, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp85, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp88, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp88, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp84, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp84, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp85, (0, 1, 3, 2)) * -2 - del tmp85 - t2new.bbbb += tmp88 * -1 - t2new.bbbb += np.transpose(tmp88, (0, 1, 3, 2)) - del tmp88 - t2new.bbbb += tmp84 - del tmp84 - t2new.bbbb += tmp89 - t2new.bbbb += np.transpose(tmp89, (1, 0, 2, 3)) * -1 - del tmp89 - t2new.bbbb += np.transpose(tmp90, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp90, (1, 0, 3, 2)) * -1 - t2new.bbbb += tmp90 * -1 - t2new.bbbb += np.transpose(tmp90, (1, 0, 2, 3)) - del tmp90 - t2new.bbbb += np.transpose(tmp91, (0, 1, 3, 2)) - t2new.bbbb += tmp94 - t2new.bbbb += np.transpose(tmp94, (0, 1, 3, 2)) * -1 - del tmp94 - t2new.bbbb += tmp95 - t2new.bbbb += np.transpose(tmp95, (0, 1, 3, 2)) * -1 - del tmp95 - t2new.bbbb += np.transpose(tmp97, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp97, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp91, (1, 0, 3, 2)) * -1 - del tmp91 - t2new.bbbb += tmp98 * -1 - t2new.bbbb += np.transpose(tmp98, (1, 0, 2, 3)) - del tmp98 - t2new.bbbb += tmp97 * -1 - t2new.bbbb += np.transpose(tmp97, (1, 0, 2, 3)) - del tmp97 - t2new.abab = einsum(tmp63, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - del tmp63 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), f.bb.oo, (4, 1), (0, 4, 2, 3)) * -1 - t2new.abab += einsum(f.aa.oo, (0, 1), t2.abab, (1, 2, 3, 4), (0, 2, 3, 4)) * -1 - t2new.abab += einsum(tmp41, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp65, (3, 4), (0, 1, 2, 4)) - del tmp65 - t2new.abab += einsum(tmp67, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - del tmp67 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp68, (1, 4), (0, 4, 2, 3)) * -1 - del tmp68 - t2new.abab += einsum(tmp43, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -1 - del tmp43 - t2new.abab += einsum(tmp70, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) * -1 - del tmp70 - t2new.abab += einsum(v.baa.xov, (0, 1, 2), tmp72, (0, 3, 4), (1, 3, 2, 4)) - del tmp72 - t2new.abab += einsum(tmp33, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) * -1 - t2new.abab += einsum(tmp14, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - t2new.abab += einsum(tmp74, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp74 - t2new.abab += einsum(tmp75, (0, 1, 2), tmp16, (0, 3, 4), (3, 1, 4, 2)) - del tmp75 - t2new.abab += einsum(tmp2, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - t2new.abab += einsum(tmp76, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -1 - del tmp76 - t2new.abab += einsum(tmp77, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - del tmp77 - t2new.aaaa = np.copy(tmp38) - t2new.aaaa += np.transpose(tmp39, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp38, (0, 1, 3, 2)) * -1 - del tmp38 - t2new.aaaa += np.transpose(tmp39, (0, 1, 3, 2)) * -2 - del tmp39 - t2new.aaaa += einsum(tmp41, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 1, 4)) * -2 - del tmp41 - t2new.aaaa += einsum(tmp42, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 4, 1)) * 2 - del tmp42 - t2new.aaaa += np.transpose(tmp44, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp46, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp49, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(tmp49, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp46, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp44, (0, 1, 3, 2)) * -2 - del tmp44 - t2new.aaaa += np.transpose(tmp46, (0, 1, 3, 2)) * -1 - t2new.aaaa += tmp49 * -1 - t2new.aaaa += np.transpose(tmp49, (0, 1, 3, 2)) - del tmp49 - t2new.aaaa += tmp46 - del tmp46 - t2new.aaaa += tmp52 - t2new.aaaa += np.transpose(tmp52, (1, 0, 2, 3)) * -1 - del tmp52 - t2new.aaaa += np.transpose(tmp53, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp53, (1, 0, 3, 2)) * -1 - t2new.aaaa += tmp53 * -1 - t2new.aaaa += np.transpose(tmp53, (1, 0, 2, 3)) - del tmp53 - t2new.aaaa += np.transpose(tmp54, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp56, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp56, (1, 0, 3, 2)) * -1 - t2new.aaaa += tmp57 - t2new.aaaa += np.transpose(tmp57, (0, 1, 3, 2)) * -1 - del tmp57 - t2new.aaaa += tmp60 - t2new.aaaa += np.transpose(tmp60, (0, 1, 3, 2)) * -1 - del tmp60 - t2new.aaaa += np.transpose(tmp54, (1, 0, 3, 2)) * -1 - del tmp54 - t2new.aaaa += tmp61 * -1 - t2new.aaaa += np.transpose(tmp61, (1, 0, 2, 3)) - del tmp61 - t2new.aaaa += tmp56 * -1 - t2new.aaaa += np.transpose(tmp56, (1, 0, 2, 3)) - del tmp56 - t1new.bb = einsum(t2.bbbb, (0, 1, 2, 3), tmp24, (4, 1, 0, 3), (4, 2)) * -2 - del tmp24 - t1new.bb += f.bb.ov - t1new.bb += einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), tmp25, (0, 4, 1, 2), (4, 3)) * -1 - del tmp25 - t1new.bb += einsum(v.bbb.xvv, (0, 1, 2), tmp28, (0, 3, 2), (3, 1)) * 2 - del tmp28 - t1new.bb += einsum(tmp9, (0,), v.bbb.xov, (0, 1, 2), (1, 2)) - t1new.bb += einsum(tmp31, (0, 1), t1.bb, (0, 2), (1, 2)) * -1 - del tmp31 - t1new.bb += einsum(tmp32, (0, 1, 2, 3), t2.bbbb, (1, 2, 4, 3), (0, 4)) * -2 - del tmp32 - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), tmp33, (0, 4, 1, 2), (4, 3)) * -1 - del tmp33 - t1new.bb += einsum(v.bbb.xoo, (0, 1, 2), tmp34, (0, 2, 3), (1, 3)) * -1 - del tmp34 - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp20, (1, 3), (0, 2)) * 2 - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), tmp22, (0, 2), (1, 3)) - t1new.bb += einsum(t1.bb, (0, 1), tmp35, (0, 2), (2, 1)) * -1 - del tmp35 - t1new.aa = einsum(t2.aaaa, (0, 1, 2, 3), tmp1, (4, 1, 0, 3), (4, 2)) * -2 - del tmp1 - t1new.aa += f.aa.ov - t1new.aa += einsum(tmp2, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) * -1 - del tmp2 - t1new.aa += einsum(f.aa.vv, (0, 1), t1.aa, (2, 1), (2, 0)) - t1new.aa += einsum(v.baa.xvv, (0, 1, 2), tmp8, (0, 3, 2), (3, 1)) * 2 - del tmp8 - t1new.aa += einsum(tmp9, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - del tmp9 - t1new.aa += einsum(tmp13, (0, 1), t1.aa, (0, 2), (1, 2)) * -1 - del tmp13 - t1new.aa += einsum(tmp14, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) * -1 - del tmp14 - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), tmp15, (4, 0, 1, 3), (4, 2)) * -2 - del tmp15 - t1new.aa += einsum(v.baa.xoo, (0, 1, 2), tmp16, (0, 2, 3), (1, 3)) * -1 - del tmp16 - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), tmp20, (1, 3), (0, 2)) - del tmp20 - t1new.aa += einsum(tmp22, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) * 2 - del tmp22 - t1new.aa += einsum(tmp23, (0, 1), t1.aa, (0, 2), (1, 2)) * -1 - del tmp23 - - return {f"t1new": t1new, f"t2new": t2new} - -def update_lams(f=None, l1=None, l2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:55:58.376778. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - l1new : Namespace of arrays - Updated L1 residuals. - l2new : Namespace of arrays - Updated L2 residuals. - """ - - l1new = Namespace() - l2new = Namespace() - tmp13 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 0, 1), (2,)) - tmp12 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp54 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp52 = einsum(l1.aa, (0, 1), t1.aa, (2, 0), (1, 2)) - tmp53 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (2, 4)) - tmp65 = einsum(t1.bb, (0, 1), l1.bb, (1, 2), (2, 0)) - tmp67 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp66 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp27 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp7 = einsum(t1.bb, (0, 1), v.bbb.xvv, (2, 3, 1), (2, 0, 3)) - tmp4 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 3, 1), (2, 0, 3)) - tmp14 = np.copy(tmp12) - tmp14 += tmp13 - tmp1 = einsum(t1.aa, (0, 1), v.baa.xov, (2, 3, 1), (2, 0, 3)) - tmp101 = np.copy(tmp12) - del tmp12 - tmp101 += tmp13 - del tmp13 - tmp48 = einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp50 = einsum(l2.abab, (0, 1, 2, 3), t1.aa, (4, 0), (2, 4, 3, 1)) - tmp55 = np.copy(tmp52) * 0.5 - tmp55 += tmp53 - tmp55 += tmp54 * 0.5 - tmp63 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp68 = np.copy(tmp65) - tmp68 += tmp66 - tmp68 += tmp67 * 2 - tmp61 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (4, 1), (2, 3, 4, 0)) - tmp158 = np.copy(v.baa.xov) - tmp158 += tmp27 - tmp160 = np.copy(v.bbb.xov) - tmp160 += tmp7 - tmp107 = einsum(v.bbb.xov, (0, 1, 2), tmp4, (0, 1, 3), (3, 2)) - tmp108 = einsum(v.bbb.xov, (0, 1, 2), tmp14, (0,), (1, 2)) - tmp11 = einsum(v.baa.xov, (0, 1, 2), tmp1, (0, 1, 3), (3, 2)) - tmp165 = einsum(v.baa.xov, (0, 1, 2), tmp101, (0,), (1, 2)) - tmp15 = einsum(v.baa.xov, (0, 1, 2), tmp14, (0,), (1, 2)) - tmp17 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp49 = einsum(tmp48, (0, 1, 2, 3), t2.aaaa, (1, 0, 4, 3), (2, 4)) - tmp51 = einsum(tmp50, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (1, 4)) - tmp46 = einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) - tmp56 = einsum(tmp55, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp47 = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) - tmp42 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - tmp43 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) - tmp41 = einsum(t1.bb, (0, 1), l1.bb, (2, 0), (2, 1)) - tmp38 = einsum(t1.aa, (0, 1), l1.aa, (2, 0), (2, 1)) - tmp35 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - tmp34 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) - tmp59 = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 0), (1, 3)) - tmp60 = einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) - tmp64 = einsum(t2.bbbb, (0, 1, 2, 3), tmp63, (1, 0, 4, 3), (4, 2)) - tmp69 = einsum(tmp68, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp62 = einsum(t2.abab, (0, 1, 2, 3), tmp61, (0, 1, 4, 2), (4, 3)) - tmp144 = einsum(tmp101, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp202 = einsum(tmp7, (0, 1, 2), v.bbb.xov, (0, 1, 3), (3, 2)) - tmp195 = einsum(v.bbb.xov, (0, 1, 2), tmp101, (0,), (1, 2)) - tmp190 = einsum(l2.abab, (0, 1, 2, 3), tmp158, (4, 2, 0), (4, 3, 1)) - tmp189 = einsum(v.bbb.xvv, (0, 1, 2), l1.bb, (2, 3), (0, 3, 1)) - tmp131 = einsum(tmp50, (0, 1, 2, 3), tmp1, (4, 0, 1), (4, 2, 3)) - tmp129 = einsum(v.baa.xoo, (0, 1, 2), tmp50, (2, 1, 3, 4), (0, 3, 4)) - tmp191 = einsum(tmp160, (0, 1, 2), l2.bbbb, (3, 2, 4, 1), (0, 4, 3)) - tmp132 = einsum(tmp63, (0, 1, 2, 3), tmp4, (4, 0, 2), (4, 1, 3)) * -1 - tmp130 = einsum(v.bbb.xoo, (0, 1, 2), tmp63, (2, 3, 1, 4), (0, 3, 4)) * -1 - tmp109 = np.copy(f.bb.ov) - tmp109 += tmp107 * -1 - tmp109 += tmp108 - tmp193 = np.copy(v.bbb.xoo) - tmp193 += np.transpose(tmp4, (0, 2, 1)) - tmp166 = np.copy(f.aa.ov) - tmp166 += tmp11 * -1 - tmp166 += tmp165 - tmp146 = np.copy(v.baa.xoo) - tmp146 += np.transpose(tmp1, (0, 2, 1)) - tmp161 = einsum(l2.abab, (0, 1, 2, 3), tmp160, (4, 3, 1), (4, 2, 0)) - del tmp160 - tmp159 = einsum(l2.aaaa, (0, 1, 2, 3), tmp158, (4, 3, 1), (4, 2, 0)) - del tmp158 - tmp150 = einsum(l1.aa, (0, 1), v.baa.xvv, (2, 3, 0), (2, 1, 3)) - tmp83 = einsum(tmp61, (0, 1, 2, 3), v.bbb.xoo, (4, 2, 1), (4, 0, 3)) - tmp84 = einsum(tmp1, (0, 1, 2), tmp48, (3, 1, 2, 4), (0, 3, 4)) - tmp82 = einsum(v.baa.xoo, (0, 1, 2), tmp48, (2, 3, 1, 4), (0, 3, 4)) * -1 - tmp85 = einsum(tmp61, (0, 1, 2, 3), tmp4, (4, 1, 2), (4, 0, 3)) - tmp16 = np.copy(f.aa.ov) - tmp16 += tmp11 * -1 - tmp16 += tmp15 - tmp102 = einsum(v.baa.xvv, (0, 1, 2), tmp101, (0,), (1, 2)) - tmp174 = einsum(tmp27, (0, 1, 2), v.baa.xov, (0, 1, 3), (3, 2)) - tmp5 = np.copy(v.bbb.xoo) - tmp5 += tmp4 - tmp25 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp24 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp2 = np.copy(v.baa.xoo) - tmp2 += tmp1 - tmp18 = einsum(tmp17, (0, 1, 2, 3), t2.abab, (4, 5, 2, 3), (4, 0, 5, 1)) - tmp110 = np.copy(v.bbb.xoo) - tmp110 += np.transpose(tmp4, (0, 2, 1)) - tmp95 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 5, 0, 1), (2, 4, 3, 5)) - tmp96 = einsum(tmp61, (0, 1, 2, 3), t1.aa, (4, 3), (0, 4, 1, 2)) - tmp139 = einsum(tmp63, (0, 1, 2, 3), t1.bb, (4, 3), (1, 0, 2, 4)) - tmp138 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp8 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp9 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp116 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp118 = einsum(tmp4, (0, 1, 2), tmp4, (0, 3, 4), (1, 3, 2, 4)) - tmp117 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp119 = einsum(tmp4, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp57 = np.copy(np.transpose(l1.aa, (1, 0))) * -0.5 - tmp57 += t1.aa * -0.5 - tmp57 += tmp46 * -1 - tmp57 += tmp47 * -0.5 - tmp57 += tmp49 - tmp57 += tmp51 * 0.5 - tmp57 += tmp56 - tmp74 = np.copy(tmp65) - tmp74 += np.transpose(tmp66, (1, 0)) - tmp74 += np.transpose(tmp67, (1, 0)) * 2 - tmp44 = np.copy(tmp41) - del tmp41 - tmp44 += np.transpose(tmp42, (1, 0)) - tmp44 += tmp43 * 2 - tmp39 = np.copy(tmp38) * 0.5 - del tmp38 - tmp39 += np.transpose(tmp34, (1, 0)) - tmp39 += tmp35 * 0.5 - tmp70 = np.copy(np.transpose(l1.bb, (1, 0))) * -1 - tmp70 += t1.bb * -1 - tmp70 += tmp59 * -1 - tmp70 += tmp60 * -2 - tmp70 += tmp62 - tmp70 += tmp64 * 2 - tmp70 += tmp69 - tmp72 = np.copy(tmp52) * 0.5 - tmp72 += tmp53 - tmp72 += np.transpose(tmp54, (1, 0)) * 0.5 - tmp93 = einsum(tmp48, (0, 1, 2, 3), t1.aa, (4, 3), (0, 1, 4, 2)) - tmp92 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp19 = np.copy(v.baa.xoo) - tmp19 += np.transpose(tmp1, (0, 2, 1)) - tmp29 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp30 = einsum(tmp1, (0, 1, 2), tmp1, (0, 3, 4), (1, 3, 2, 4)) - tmp28 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp31 = einsum(tmp1, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp203 = np.copy(f.bb.vv) - tmp203 += np.transpose(tmp202, (1, 0)) * -1 - tmp203 += np.transpose(tmp144, (1, 0)) - tmp204 = np.copy(f.bb.ov) - tmp204 += tmp107 * -1 - tmp204 += tmp195 - tmp192 = np.copy(tmp189) - tmp192 += tmp129 * -1 - tmp192 += tmp130 * -2 - tmp192 += tmp131 * -1 - tmp192 += tmp132 * -2 - tmp192 += tmp190 - del tmp190 - tmp192 += tmp191 * 2 - del tmp191 - tmp210 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp127 = einsum(tmp109, (0, 1), t1.bb, (2, 1), (0, 2)) - tmp124 = einsum(v.bbb.xoo, (0, 1, 2), tmp4, (0, 2, 3), (1, 3)) - tmp126 = einsum(v.bbb.xoo, (0, 1, 2), tmp14, (0,), (1, 2)) - tmp113 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp220 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp209 = einsum(tmp4, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp208 = einsum(v.bbb.xov, (0, 1, 2), tmp65, (3, 1), (0, 3, 2)) - tmp211 = einsum(tmp193, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp194 = einsum(tmp193, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp152 = np.copy(v.bbb.xov) - tmp152 += tmp7 - tmp151 = np.copy(v.baa.xov) - tmp151 += tmp27 - tmp175 = einsum(v.baa.xvv, (0, 1, 2), tmp14, (0,), (1, 2)) - tmp199 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp77 = einsum(tmp1, (0, 1, 2), v.baa.xoo, (0, 3, 1), (3, 2)) - tmp164 = einsum(tmp101, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - tmp167 = einsum(tmp166, (0, 1), t1.aa, (2, 1), (0, 2)) - tmp156 = einsum(tmp146, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp147 = einsum(tmp146, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp186 = einsum(tmp1, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp184 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp162 = np.copy(tmp150) - tmp162 += tmp82 * -2 - tmp162 += tmp83 * -1 - tmp162 += tmp84 * -2 - tmp162 += tmp85 * -1 - tmp162 += tmp159 * 2 - del tmp159 - tmp162 += tmp161 - del tmp161 - tmp182 = einsum(tmp52, (0, 1), v.baa.xov, (2, 1, 3), (2, 0, 3)) - tmp22 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp79 = einsum(tmp14, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - tmp80 = einsum(t1.aa, (0, 1), tmp16, (2, 1), (0, 2)) - tmp178 = np.copy(f.aa.vv) - tmp178 += np.transpose(tmp174, (1, 0)) * -1 - tmp178 += np.transpose(tmp102, (1, 0)) - tmp171 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp122 = np.copy(tmp42) - del tmp42 - tmp122 += tmp43 * 2 - del tmp43 - tmp106 = einsum(v.bbb.xov, (0, 1, 2), tmp5, (0, 3, 4), (4, 3, 1, 2)) - tmp86 = np.copy(v.baa.xov) - tmp86 += tmp27 - tmp86 += tmp24 * 2 - tmp86 += tmp25 - tmp105 = einsum(tmp2, (0, 1, 2), v.bbb.xov, (0, 3, 4), (2, 1, 3, 4)) - tmp111 = np.copy(np.transpose(tmp18, (1, 0, 2, 3))) - tmp111 += einsum(tmp110, (0, 1, 2), tmp2, (0, 3, 4), (4, 3, 2, 1)) - tmp104 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp97 = np.copy(tmp95) - del tmp95 - tmp97 += tmp96 - tmp136 = einsum(t2.bbbb, (0, 1, 2, 3), l1.bb, (3, 4), (4, 0, 1, 2)) * -1 - tmp136 += einsum(t2.abab, (0, 1, 2, 3), tmp61, (0, 4, 5, 2), (4, 5, 1, 3)) * 0.5 - tmp136 += einsum(t2.bbbb, (0, 1, 2, 3), tmp63, (4, 1, 5, 3), (4, 5, 0, 2)) * -2 - tmp135 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 5), (3, 4, 1, 5)) - tmp135 += einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 1), (5, 0, 2, 4)) * 4 - tmp134 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 5, 1), (3, 4, 0, 5)) - tmp141 = np.copy(t1.bb) * -1 - tmp141 += tmp59 * -1 - del tmp59 - tmp141 += tmp60 * -2 - del tmp60 - tmp141 += tmp62 - del tmp62 - tmp141 += tmp64 * 2 - del tmp64 - tmp141 += tmp69 - del tmp69 - tmp140 = np.copy(np.transpose(tmp138, (1, 0, 3, 2))) - del tmp138 - tmp140 += np.transpose(tmp139, (0, 1, 3, 2)) * -1 - tmp137 = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 4), (0, 4, 1, 2)) - tmp137 += einsum(t2.abab, (0, 1, 2, 3), tmp50, (0, 4, 5, 3), (4, 5, 1, 2)) * -1 - tmp10 = np.copy(v.bbb.xov) - tmp10 += tmp7 - tmp10 += tmp8 - tmp10 += tmp9 * 2 - tmp125 = np.copy(tmp8) * 0.5 - tmp125 += tmp9 - tmp114 = einsum(tmp110, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp120 = np.copy(np.transpose(tmp116, (3, 2, 1, 0))) - tmp120 += einsum(t2.bbbb, (0, 1, 2, 3), tmp117, (4, 5, 2, 3), (5, 4, 0, 1)) - tmp120 += np.transpose(tmp118, (2, 3, 1, 0)) - tmp120 += np.transpose(tmp119, (1, 3, 0, 2)) - tmp120 += np.transpose(tmp119, (3, 2, 0, 1)) * -1 - tmp115 = np.copy(v.bbb.xov) - tmp115 += tmp8 - del tmp8 - tmp115 += tmp9 * 2 - del tmp9 - tmp58 = einsum(v.baa.xov, (0, 1, 2), tmp57, (1, 2), (0,)) * 2 - del tmp57 - tmp75 = einsum(v.bbb.xoo, (0, 1, 2), tmp74, (2, 1), (0,)) - del tmp74 - tmp45 = einsum(tmp44, (0, 1), v.bbb.xvv, (2, 1, 0), (2,)) - del tmp44 - tmp40 = einsum(tmp39, (0, 1), v.baa.xvv, (2, 1, 0), (2,)) * 2 - del tmp39 - tmp71 = einsum(v.bbb.xov, (0, 1, 2), tmp70, (1, 2), (0,)) - del tmp70 - tmp73 = einsum(tmp72, (0, 1), v.baa.xoo, (2, 1, 0), (2,)) * 2 - del tmp72 - tmp88 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 5), (2, 4, 1, 5)) - tmp98 = np.copy(t1.aa) * -0.5 - tmp98 += tmp46 * -1 - del tmp46 - tmp98 += tmp47 * -0.5 - del tmp47 - tmp98 += tmp49 - del tmp49 - tmp98 += tmp51 * 0.5 - del tmp51 - tmp98 += tmp56 - del tmp56 - tmp94 = np.copy(np.transpose(tmp92, (1, 0, 3, 2))) - del tmp92 - tmp94 += np.transpose(tmp93, (0, 1, 3, 2)) * -1 - tmp89 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp89 += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 5, 0)) * 0.25 - tmp90 = einsum(l1.aa, (0, 1), t2.aaaa, (2, 3, 4, 0), (1, 2, 3, 4)) * -1 - tmp90 += einsum(t2.aaaa, (0, 1, 2, 3), tmp48, (4, 1, 5, 3), (4, 5, 0, 2)) * -2 - tmp90 += einsum(t2.abab, (0, 1, 2, 3), tmp50, (4, 5, 1, 3), (4, 5, 0, 2)) * 0.5 - tmp91 = einsum(l1.aa, (0, 1), t2.abab, (2, 3, 0, 4), (1, 2, 3, 4)) - tmp91 += einsum(tmp61, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (0, 4, 2, 5)) * -1 - tmp3 = einsum(tmp2, (0, 1, 2), v.baa.xov, (0, 3, 4), (2, 1, 3, 4)) - tmp20 = np.copy(np.transpose(tmp18, (0, 1, 3, 2))) - del tmp18 - tmp20 += einsum(tmp19, (0, 1, 2), tmp5, (0, 3, 4), (2, 1, 4, 3)) - tmp6 = einsum(v.baa.xov, (0, 1, 2), tmp5, (0, 3, 4), (1, 4, 3, 2)) - tmp0 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp26 = np.copy(v.baa.xov) - tmp26 += tmp24 * 2 - tmp26 += tmp25 - tmp32 = np.copy(np.transpose(tmp28, (3, 2, 1, 0))) - tmp32 += einsum(tmp29, (0, 1, 2, 3), t2.aaaa, (4, 5, 2, 3), (1, 0, 4, 5)) - tmp32 += np.transpose(tmp30, (2, 3, 1, 0)) - tmp32 += np.transpose(tmp31, (1, 3, 0, 2)) - tmp32 += np.transpose(tmp31, (3, 2, 0, 1)) * -1 - tmp23 = einsum(tmp19, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp78 = np.copy(tmp24) * 2 - del tmp24 - tmp78 += tmp25 - del tmp25 - tmp36 = np.copy(tmp34) - del tmp34 - tmp36 += tmp35 * 0.5 - del tmp35 - tmp225 = einsum(l2.bbbb, (0, 1, 2, 3), tmp203, (1, 4), (2, 3, 4, 0)) * -1 - tmp223 = np.copy(f.bb.vv) - tmp223 += np.transpose(tmp202, (1, 0)) * -1 - del tmp202 - tmp223 += einsum(v.bbb.xvv, (0, 1, 2), tmp14, (0,), (1, 2)) - del tmp14 - tmp196 = np.copy(f.bb.ov) - tmp196 += tmp195 - del tmp195 - tmp224 = einsum(tmp63, (0, 1, 2, 3), tmp204, (2, 4), (0, 1, 4, 3)) - tmp219 = einsum(tmp117, (0, 1, 2, 3), tmp139, (4, 5, 0, 1), (4, 5, 2, 3)) - del tmp139 - tmp217 = einsum(tmp192, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp230 = einsum(tmp210, (0, 1, 2, 3), tmp63, (1, 4, 2, 5), (4, 0, 5, 3)) * -1 - tmp198 = np.copy(f.bb.oo) - tmp198 += tmp124 * -1 - tmp198 += np.transpose(tmp126, (1, 0)) - tmp198 += np.transpose(tmp127, (1, 0)) - tmp222 = einsum(tmp113, (0, 1, 2, 3), tmp63, (4, 5, 0, 2), (5, 4, 3, 1)) - tmp227 = np.copy(np.transpose(tmp116, (3, 2, 1, 0))) - del tmp116 - tmp227 += np.transpose(tmp118, (0, 3, 1, 2)) - del tmp118 - tmp218 = np.copy(f.bb.oo) - tmp218 += tmp124 * -1 - tmp218 += einsum(v.bbb.xoo, (0, 1, 2), tmp101, (0,), (1, 2)) - del tmp101 - tmp218 += einsum(tmp204, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp226 = einsum(l2.bbbb, (0, 1, 2, 3), tmp119, (2, 3, 4, 5), (4, 5, 0, 1)) - del tmp119 - tmp221 = einsum(tmp220, (0, 1, 2, 3), l2.bbbb, (3, 2, 4, 5), (4, 5, 0, 1)) - del tmp220 - tmp229 = einsum(tmp63, (0, 1, 2, 3), tmp209, (1, 2, 4, 5), (0, 4, 3, 5)) - tmp228 = einsum(tmp208, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 4, 2)) - tmp212 = einsum(tmp211, (0, 1, 2, 3), l1.bb, (4, 1), (2, 0, 3, 4)) - tmp216 = einsum(l2.bbbb, (0, 1, 2, 3), tmp194, (4, 3, 1, 5), (4, 2, 5, 0)) - tmp215 = np.copy(f.bb.ov) - tmp215 += tmp108 - del tmp108 - tmp213 = einsum(tmp110, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (2, 1, 3, 4)) - tmp214 = np.copy(tmp189) - del tmp189 - tmp214 += tmp129 * -1 - tmp214 += tmp130 * -2 - tmp214 += tmp131 * -1 - tmp214 += tmp132 * -2 - tmp214 += einsum(l2.abab, (0, 1, 2, 3), tmp151, (4, 2, 0), (4, 3, 1)) - tmp214 += einsum(tmp152, (0, 1, 2), l2.bbbb, (3, 2, 4, 1), (0, 4, 3)) * 2 - tmp176 = np.copy(f.aa.vv) - tmp176 += np.transpose(tmp174, (1, 0)) * -1 - del tmp174 - tmp176 += np.transpose(tmp175, (1, 0)) - del tmp175 - tmp201 = einsum(tmp17, (0, 1, 2, 3), tmp96, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp96 - tmp200 = einsum(l2.abab, (0, 1, 2, 3), tmp199, (4, 0, 1, 5), (2, 3, 4, 5)) - del tmp199 - tmp206 = einsum(tmp110, (0, 1, 2), tmp19, (0, 3, 4), (4, 3, 2, 1)) - tmp207 = einsum(v.bbb.xvv, (0, 1, 2), tmp146, (0, 3, 4), (4, 3, 1, 2)) - tmp168 = np.copy(f.aa.oo) - tmp168 += tmp77 * -1 - tmp168 += np.transpose(tmp164, (1, 0)) - del tmp164 - tmp168 += np.transpose(tmp167, (1, 0)) - del tmp167 - tmp197 = einsum(tmp193, (0, 1, 2), v.baa.xvv, (0, 3, 4), (2, 1, 3, 4)) - del tmp193 - tmp205 = einsum(tmp146, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - del tmp146 - tmp169 = np.copy(f.aa.ov) - tmp169 += tmp165 - del tmp165 - tmp188 = einsum(v.baa.xov, (0, 1, 2), tmp110, (0, 3, 4), (1, 3, 4, 2)) - del tmp110 - tmp157 = einsum(tmp156, (0, 1, 2, 3), l2.aaaa, (4, 2, 5, 1), (0, 5, 3, 4)) - tmp148 = einsum(tmp147, (0, 1, 2, 3), l1.aa, (4, 1), (2, 0, 3, 4)) - tmp187 = einsum(tmp48, (0, 1, 2, 3), tmp186, (1, 2, 4, 5), (0, 4, 3, 5)) - tmp181 = np.copy(np.transpose(tmp28, (3, 2, 1, 0))) - del tmp28 - tmp181 += np.transpose(tmp30, (0, 3, 1, 2)) - del tmp30 - tmp180 = einsum(l2.aaaa, (0, 1, 2, 3), tmp31, (2, 3, 4, 5), (4, 5, 0, 1)) - del tmp31 - tmp185 = einsum(tmp48, (0, 1, 2, 3), tmp184, (4, 0, 2, 5), (1, 4, 3, 5)) * -1 - tmp163 = einsum(v.baa.xov, (0, 1, 2), tmp162, (0, 3, 4), (3, 1, 4, 2)) - tmp183 = einsum(v.baa.xov, (0, 1, 2), tmp182, (0, 3, 4), (3, 1, 2, 4)) - tmp173 = einsum(tmp29, (0, 1, 2, 3), tmp93, (4, 5, 0, 1), (4, 5, 2, 3)) - del tmp93 - tmp155 = np.copy(f.aa.ov) - tmp155 += tmp15 - del tmp15 - tmp153 = np.copy(tmp150) - del tmp150 - tmp153 += tmp82 * -2 - tmp153 += tmp83 * -1 - tmp153 += tmp84 * -2 - tmp153 += tmp85 * -1 - tmp153 += einsum(l2.aaaa, (0, 1, 2, 3), tmp151, (4, 3, 1), (4, 2, 0)) * 2 - del tmp151 - tmp153 += einsum(l2.abab, (0, 1, 2, 3), tmp152, (4, 3, 1), (4, 2, 0)) - del tmp152 - tmp177 = einsum(tmp48, (0, 1, 2, 3), tmp166, (2, 4), (0, 1, 4, 3)) - tmp170 = einsum(tmp48, (0, 1, 2, 3), tmp22, (2, 4, 3, 5), (1, 0, 5, 4)) - tmp154 = np.copy(f.aa.oo) - tmp154 += tmp77 * -1 - tmp154 += np.transpose(tmp79, (1, 0)) - tmp154 += tmp80 - tmp179 = einsum(l2.aaaa, (0, 1, 2, 3), tmp178, (1, 4), (2, 3, 4, 0)) * -1 - del tmp178 - tmp172 = einsum(tmp171, (0, 1, 2, 3), l2.aaaa, (3, 2, 4, 5), (4, 5, 0, 1)) - del tmp171 - tmp149 = einsum(v.baa.xvv, (0, 1, 2), tmp19, (0, 3, 4), (4, 3, 1, 2)) - del tmp19 - tmp123 = einsum(v.bbb.xov, (0, 1, 2), tmp122, (3, 2), (0, 1, 3)) * 0.5 - del tmp122 - tmp123 += einsum(l1.bb, (0, 1), tmp5, (2, 1, 3), (2, 3, 0)) * 0.5 - tmp112 = einsum(t2.abab, (0, 1, 2, 3), tmp104, (4, 2, 5, 3), (0, 4, 1, 5)) * 0.5 - tmp112 += einsum(t2.abab, (0, 1, 2, 3), tmp105, (0, 4, 5, 3), (4, 5, 1, 2)) * -0.5 - del tmp105 - tmp112 += einsum(tmp106, (0, 1, 2, 3), t2.abab, (4, 0, 5, 3), (4, 2, 1, 5)) * -0.5 - del tmp106 - tmp112 += einsum(tmp86, (0, 1, 2), tmp5, (0, 3, 4), (1, 4, 3, 2)) * 0.5 - tmp112 += einsum(t2.abab, (0, 1, 2, 3), tmp109, (4, 3), (0, 4, 1, 2)) * 0.5 - tmp112 += einsum(tmp111, (0, 1, 2, 3), t1.aa, (0, 4), (1, 3, 2, 4)) * -0.5 - del tmp111 - tmp145 = np.copy(f.bb.vv) - tmp145 += np.transpose(tmp144, (1, 0)) - del tmp144 - tmp142 = einsum(l1.bb, (0, 1), tmp7, (2, 3, 0), (2, 3, 1)) * 0.25 - tmp142 += einsum(v.baa.xvv, (0, 1, 2), tmp134, (3, 4, 1, 2), (0, 4, 3)) * 0.25 - del tmp134 - tmp142 += einsum(v.bbb.xvv, (0, 1, 2), tmp135, (3, 4, 1, 2), (0, 4, 3)) * 0.25 - del tmp135 - tmp142 += einsum(tmp61, (0, 1, 2, 3), tmp86, (4, 0, 3), (4, 2, 1)) * 0.25 - tmp142 += einsum(tmp63, (0, 1, 2, 3), tmp10, (4, 0, 3), (4, 2, 1)) * 0.5 - del tmp63 - tmp142 += einsum(tmp136, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 2, 0)) * -0.5 - del tmp136 - tmp142 += einsum(tmp137, (0, 1, 2, 3), v.baa.xov, (4, 0, 3), (4, 2, 1)) * 0.25 - del tmp137 - tmp142 += einsum(tmp97, (0, 1, 2, 3), tmp1, (4, 0, 1), (4, 3, 2)) * -0.25 - tmp142 += einsum(tmp97, (0, 1, 2, 3), v.baa.xoo, (4, 0, 1), (4, 3, 2)) * -0.25 - tmp142 += einsum(tmp140, (0, 1, 2, 3), tmp4, (4, 0, 2), (4, 3, 1)) * -0.5 - tmp142 += einsum(tmp140, (0, 1, 2, 3), v.bbb.xoo, (4, 0, 2), (4, 3, 1)) * -0.5 - del tmp140 - tmp142 += einsum(tmp141, (0, 1), v.bbb.xov, (2, 3, 1), (2, 0, 3)) * -0.25 - del tmp141 - tmp142 += einsum(tmp68, (0, 1), v.bbb.xoo, (2, 3, 0), (2, 1, 3)) * -0.25 - del tmp68 - tmp128 = np.copy(f.bb.oo) - tmp128 += tmp124 * -1 - del tmp124 - tmp128 += einsum(tmp125, (0, 1, 2), v.bbb.xov, (0, 3, 2), (1, 3)) * 2 - del tmp125 - tmp128 += np.transpose(tmp126, (1, 0)) - del tmp126 - tmp128 += np.transpose(tmp127, (1, 0)) - del tmp127 - tmp143 = np.copy(tmp65) * 0.5 - del tmp65 - tmp143 += tmp66 * 0.5 - del tmp66 - tmp143 += tmp67 - del tmp67 - tmp133 = np.copy(tmp129) * -0.25 - del tmp129 - tmp133 += tmp130 * -0.5 - del tmp130 - tmp133 += tmp131 * -0.25 - del tmp131 - tmp133 += tmp132 * -0.5 - del tmp132 - tmp133 += einsum(l2.abab, (0, 1, 2, 3), tmp86, (4, 2, 0), (4, 3, 1)) * 0.25 - tmp133 += einsum(tmp10, (0, 1, 2), l2.bbbb, (3, 2, 4, 1), (0, 4, 3)) * 0.5 - tmp121 = einsum(t2.bbbb, (0, 1, 2, 3), tmp113, (4, 2, 5, 3), (4, 0, 1, 5)) - del tmp113 - tmp121 += einsum(t2.bbbb, (0, 1, 2, 3), tmp114, (1, 4, 5, 3), (5, 0, 4, 2)) * -2 - tmp121 += einsum(tmp115, (0, 1, 2), tmp5, (0, 3, 4), (4, 1, 3, 2)) - del tmp115 - tmp121 += einsum(t2.bbbb, (0, 1, 2, 3), tmp109, (4, 3), (4, 0, 1, 2)) - tmp121 += einsum(tmp7, (0, 1, 2), tmp5, (0, 3, 4), (4, 3, 1, 2)) * -1 - del tmp7, tmp5 - tmp121 += einsum(tmp120, (0, 1, 2, 3), t1.bb, (0, 4), (1, 3, 2, 4)) * -1 - del tmp120 - tmp76 = np.copy(tmp40) - del tmp40 - tmp76 += tmp45 - del tmp45 - tmp76 += tmp58 * -1 - del tmp58 - tmp76 += tmp71 * -1 - del tmp71 - tmp76 += tmp73 * -1 - del tmp73 - tmp76 += tmp75 * -1 - del tmp75 - tmp99 = einsum(l1.aa, (0, 1), tmp27, (2, 3, 0), (2, 3, 1)) - tmp99 += einsum(v.bbb.xvv, (0, 1, 2), tmp88, (3, 4, 2, 1), (0, 4, 3)) - del tmp88 - tmp99 += einsum(v.baa.xvv, (0, 1, 2), tmp89, (3, 4, 1, 2), (0, 4, 3)) * 4 - del tmp89 - tmp99 += einsum(tmp86, (0, 1, 2), tmp48, (1, 3, 4, 2), (0, 4, 3)) * 2 - del tmp48 - tmp99 += einsum(tmp10, (0, 1, 2), tmp50, (3, 4, 1, 2), (0, 4, 3)) - tmp99 += einsum(tmp90, (0, 1, 2, 3), v.baa.xov, (4, 1, 3), (4, 2, 0)) * -2 - del tmp90 - tmp99 += einsum(tmp91, (0, 1, 2, 3), v.bbb.xov, (4, 2, 3), (4, 1, 0)) - del tmp91 - tmp99 += einsum(tmp1, (0, 1, 2), tmp94, (1, 3, 2, 4), (0, 4, 3)) * -2 - del tmp1 - tmp99 += einsum(v.baa.xoo, (0, 1, 2), tmp94, (1, 3, 2, 4), (0, 4, 3)) * -2 - del tmp94 - tmp99 += einsum(tmp97, (0, 1, 2, 3), tmp4, (4, 2, 3), (4, 1, 0)) * -1 - del tmp4 - tmp99 += einsum(v.bbb.xoo, (0, 1, 2), tmp97, (3, 4, 1, 2), (0, 4, 3)) * -1 - del tmp97 - tmp99 += einsum(tmp98, (0, 1), v.baa.xov, (2, 3, 1), (2, 0, 3)) * -2 - del tmp98 - tmp99 += einsum(tmp55, (0, 1), v.baa.xoo, (2, 3, 0), (2, 1, 3)) * -2 - del tmp55 - tmp87 = np.copy(tmp82) * -1 - del tmp82 - tmp87 += tmp83 * -0.5 - del tmp83 - tmp87 += tmp84 * -1 - del tmp84 - tmp87 += tmp85 * -0.5 - del tmp85 - tmp87 += einsum(l2.aaaa, (0, 1, 2, 3), tmp86, (4, 3, 1), (4, 2, 0)) - del tmp86 - tmp87 += einsum(tmp10, (0, 1, 2), l2.abab, (3, 2, 4, 1), (0, 4, 3)) * 0.5 - tmp21 = einsum(tmp0, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp21 += einsum(t2.abab, (0, 1, 2, 3), tmp3, (0, 4, 5, 2), (5, 4, 1, 3)) * -1 - del tmp3 - tmp21 += einsum(tmp6, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (0, 4, 2, 5)) * -1 - del tmp6 - tmp21 += einsum(tmp10, (0, 1, 2), tmp2, (0, 3, 4), (4, 3, 1, 2)) - del tmp10 - tmp21 += einsum(t2.abab, (0, 1, 2, 3), tmp16, (4, 2), (4, 0, 1, 3)) - tmp21 += einsum(tmp20, (0, 1, 2, 3), t1.bb, (2, 4), (1, 0, 3, 4)) * -1 - del tmp20 - tmp33 = einsum(tmp22, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (0, 4, 5, 2)) * 0.5 - del tmp22 - tmp33 += einsum(t2.aaaa, (0, 1, 2, 3), tmp23, (4, 1, 5, 3), (4, 0, 5, 2)) * -1 - tmp33 += einsum(tmp2, (0, 1, 2), tmp26, (0, 3, 4), (2, 3, 1, 4)) * 0.5 - del tmp26 - tmp33 += einsum(tmp16, (0, 1), t2.aaaa, (2, 3, 4, 1), (0, 2, 3, 4)) * 0.5 - tmp33 += einsum(tmp2, (0, 1, 2), tmp27, (0, 3, 4), (2, 1, 3, 4)) * -0.5 - del tmp27 - tmp33 += einsum(tmp32, (0, 1, 2, 3), t1.aa, (0, 4), (1, 3, 2, 4)) * -0.5 - del tmp32 - tmp100 = np.copy(tmp52) - del tmp52 - tmp100 += tmp53 * 2 - del tmp53 - tmp100 += tmp54 - del tmp54 - tmp103 = np.copy(f.aa.vv) - tmp103 += np.transpose(tmp102, (1, 0)) - del tmp102 - tmp81 = np.copy(f.aa.oo) - tmp81 += tmp77 * -1 - del tmp77 - tmp81 += einsum(v.baa.xov, (0, 1, 2), tmp78, (0, 3, 2), (3, 1)) - del tmp78 - tmp81 += np.transpose(tmp79, (1, 0)) - del tmp79 - tmp81 += tmp80 - del tmp80 - tmp37 = einsum(v.baa.xov, (0, 1, 2), tmp36, (3, 2), (0, 1, 3)) * 2 - del tmp36 - tmp37 += einsum(tmp2, (0, 1, 2), l1.aa, (3, 1), (0, 2, 3)) - del tmp2 - l2new.bbbb = np.copy(np.transpose(tmp117, (3, 2, 1, 0))) - l2new.bbbb += einsum(tmp114, (0, 1, 2, 3), l1.bb, (4, 1), (3, 4, 2, 0)) * -1 - del tmp114 - l2new.bbbb += np.transpose(tmp117, (2, 3, 1, 0)) * -1 - del tmp117 - l2new.bbbb += np.transpose(tmp212, (3, 2, 0, 1)) - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp213, (3, 4, 5, 1), (5, 0, 2, 4)) * 2 - del tmp213 - l2new.bbbb += einsum(v.bbb.xov, (0, 1, 2), tmp214, (0, 3, 4), (2, 4, 3, 1)) * -1 - del tmp214 - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp198, (3, 4), (0, 1, 2, 4)) * -2 - l2new.bbbb += einsum(tmp215, (0, 1), l1.bb, (2, 3), (1, 2, 3, 0)) * -1 - del tmp215 - l2new.bbbb += np.transpose(tmp216, (2, 3, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp217, (3, 2, 1, 0)) - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp218, (3, 4), (0, 1, 4, 2)) * 2 - del tmp218 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp196, (2, 3), (3, 0, 2, 1)) - l2new.bbbb += np.transpose(tmp216, (3, 2, 1, 0)) * -2 - l2new.bbbb += np.transpose(tmp217, (2, 3, 0, 1)) - l2new.bbbb += einsum(l1.bb, (0, 1), tmp196, (2, 3), (0, 3, 1, 2)) - l2new.bbbb += np.transpose(tmp216, (3, 2, 0, 1)) * 2 - del tmp216 - l2new.bbbb += np.transpose(tmp217, (2, 3, 1, 0)) * -1 - del tmp217 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp196, (2, 3), (0, 3, 2, 1)) * -1 - l2new.bbbb += np.transpose(tmp219, (3, 2, 1, 0)) * 2 - del tmp219 - l2new.bbbb += np.transpose(tmp221, (2, 3, 1, 0)) * -2 - del tmp221 - l2new.bbbb += np.transpose(tmp222, (2, 3, 1, 0)) * 2 - l2new.bbbb += einsum(tmp223, (0, 1), l2.bbbb, (2, 0, 3, 4), (1, 2, 3, 4)) * -1 - del tmp223 - l2new.bbbb += np.transpose(tmp224, (2, 3, 1, 0)) * -2 - l2new.bbbb += np.transpose(tmp225, (2, 3, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp222, (3, 2, 1, 0)) * -2 - del tmp222 - l2new.bbbb += np.transpose(tmp225, (3, 2, 1, 0)) * 2 - del tmp225 - l2new.bbbb += np.transpose(tmp224, (3, 2, 1, 0)) * 2 - del tmp224 - l2new.bbbb += np.transpose(tmp226, (2, 3, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp226, (2, 3, 1, 0)) * 2 - del tmp226 - l2new.bbbb += einsum(tmp227, (0, 1, 2, 3), l2.bbbb, (4, 5, 0, 2), (4, 5, 1, 3)) * -2 - del tmp227 - l2new.bbbb += einsum(tmp211, (0, 1, 2, 3), l1.bb, (4, 1), (3, 4, 0, 2)) - del tmp211 - l2new.bbbb += np.transpose(tmp212, (3, 2, 1, 0)) * -1 - del tmp212 - l2new.bbbb += einsum(tmp107, (0, 1), l1.bb, (2, 3), (1, 2, 3, 0)) - l2new.bbbb += np.transpose(tmp228, (3, 2, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp229, (3, 2, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp230, (3, 2, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp228, (2, 3, 0, 1)) - l2new.bbbb += einsum(l1.bb, (0, 1), tmp107, (2, 3), (0, 3, 1, 2)) * -1 - l2new.bbbb += np.transpose(tmp229, (2, 3, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp230, (2, 3, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp228, (3, 2, 1, 0)) - l2new.bbbb += einsum(tmp107, (0, 1), l1.bb, (2, 3), (1, 2, 0, 3)) * -1 - l2new.bbbb += np.transpose(tmp229, (3, 2, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp230, (3, 2, 1, 0)) * 2 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp107, (2, 3), (0, 3, 2, 1)) - l2new.bbbb += np.transpose(tmp228, (2, 3, 1, 0)) * -1 - del tmp228 - l2new.bbbb += np.transpose(tmp229, (2, 3, 1, 0)) * -2 - del tmp229 - l2new.bbbb += np.transpose(tmp230, (2, 3, 1, 0)) * -2 - del tmp230 - l2new.abab = np.copy(np.transpose(tmp17, (2, 3, 0, 1))) - del tmp17 - l2new.abab += einsum(l1.bb, (0, 1), tmp188, (2, 3, 1, 4), (4, 0, 2, 3)) * -1 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp156, (4, 2, 5, 0), (5, 1, 4, 3)) * -1 - del tmp156 - l2new.abab += einsum(tmp192, (0, 1, 2), v.baa.xov, (0, 3, 4), (4, 2, 3, 1)) - del tmp192 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp168, (2, 4), (0, 1, 4, 3)) * -1 - l2new.abab += einsum(tmp169, (0, 1), l1.bb, (2, 3), (1, 2, 0, 3)) - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp194, (4, 3, 5, 1), (0, 5, 2, 4)) * -1 - del tmp194 - l2new.abab += einsum(v.bbb.xov, (0, 1, 2), tmp162, (0, 3, 4), (4, 2, 3, 1)) - del tmp162 - l2new.abab += einsum(l1.aa, (0, 1), tmp196, (2, 3), (0, 3, 1, 2)) - del tmp196 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp197, (3, 4, 0, 5), (5, 1, 2, 4)) * -1 - del tmp197 - l2new.abab += einsum(tmp198, (0, 1), l2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -1 - del tmp198 - l2new.abab += einsum(tmp50, (0, 1, 2, 3), tmp0, (1, 4, 3, 5), (4, 5, 0, 2)) * -1 - del tmp0 - l2new.abab += np.transpose(tmp200, (2, 3, 0, 1)) - del tmp200 - l2new.abab += np.transpose(tmp201, (2, 3, 0, 1)) - del tmp201 - l2new.abab += einsum(tmp176, (0, 1), l2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) - l2new.abab += einsum(tmp166, (0, 1), tmp50, (2, 0, 3, 4), (1, 4, 2, 3)) * -1 - del tmp166 - l2new.abab += einsum(tmp104, (0, 1, 2, 3), tmp61, (4, 5, 0, 2), (1, 3, 4, 5)) * -1 - del tmp104 - l2new.abab += einsum(tmp203, (0, 1), l2.abab, (2, 0, 3, 4), (2, 1, 3, 4)) - del tmp203 - l2new.abab += einsum(tmp204, (0, 1), tmp61, (2, 3, 0, 4), (4, 1, 2, 3)) * -1 - del tmp204 - l2new.abab += einsum(tmp205, (0, 1, 2, 3), l1.aa, (4, 1), (4, 3, 0, 2)) * -1 - l2new.abab += einsum(tmp206, (0, 1, 2, 3), l2.abab, (4, 5, 0, 2), (4, 5, 1, 3)) - del tmp206 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp207, (2, 4, 1, 5), (0, 5, 4, 3)) * -1 - del tmp207 - l2new.abab += einsum(tmp182, (0, 1, 2), v.bbb.xov, (0, 3, 4), (2, 4, 1, 3)) * -1 - del tmp182 - l2new.abab += einsum(tmp50, (0, 1, 2, 3), tmp188, (1, 4, 2, 5), (5, 3, 0, 4)) - del tmp188 - l2new.abab += einsum(tmp208, (0, 1, 2), v.baa.xov, (0, 3, 4), (4, 2, 3, 1)) * -1 - del tmp208 - l2new.abab += einsum(tmp205, (0, 1, 2, 3), tmp61, (1, 4, 2, 5), (5, 3, 0, 4)) - del tmp205 - l2new.abab += einsum(tmp11, (0, 1), l1.bb, (2, 3), (1, 2, 0, 3)) * -1 - l2new.abab += einsum(tmp50, (0, 1, 2, 3), tmp184, (4, 0, 1, 5), (5, 3, 4, 2)) - del tmp184 - l2new.abab += einsum(tmp50, (0, 1, 2, 3), tmp186, (0, 1, 4, 5), (5, 3, 4, 2)) - del tmp50, tmp186 - l2new.abab += einsum(tmp61, (0, 1, 2, 3), tmp209, (1, 2, 4, 5), (3, 5, 0, 4)) - del tmp209 - l2new.abab += einsum(tmp210, (0, 1, 2, 3), tmp61, (4, 1, 2, 5), (5, 3, 4, 0)) - del tmp61, tmp210 - l2new.abab += einsum(tmp107, (0, 1), l1.aa, (2, 3), (2, 1, 3, 0)) * -1 - del tmp107 - l2new.aaaa = np.copy(np.transpose(tmp29, (3, 2, 1, 0))) - l2new.aaaa += einsum(tmp23, (0, 1, 2, 3), l1.aa, (4, 2), (3, 4, 0, 1)) * -1 - del tmp23 - l2new.aaaa += np.transpose(tmp29, (2, 3, 1, 0)) * -1 - del tmp29 - l2new.aaaa += np.transpose(tmp148, (3, 2, 0, 1)) - l2new.aaaa += einsum(l2.aaaa, (0, 1, 2, 3), tmp149, (3, 4, 5, 1), (5, 0, 2, 4)) * 2 - del tmp149 - l2new.aaaa += einsum(v.baa.xov, (0, 1, 2), tmp153, (0, 3, 4), (2, 4, 3, 1)) * -1 - del tmp153 - l2new.aaaa += einsum(l2.aaaa, (0, 1, 2, 3), tmp154, (3, 4), (0, 1, 2, 4)) * -2 - del tmp154 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp155, (2, 3), (3, 0, 1, 2)) * -1 - del tmp155 - l2new.aaaa += np.transpose(tmp157, (2, 3, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp163, (3, 2, 1, 0)) - l2new.aaaa += einsum(tmp168, (0, 1), l2.aaaa, (2, 3, 4, 0), (2, 3, 1, 4)) * 2 - del tmp168 - l2new.aaaa += einsum(tmp169, (0, 1), l1.aa, (2, 3), (1, 2, 0, 3)) - l2new.aaaa += np.transpose(tmp157, (3, 2, 1, 0)) * -2 - l2new.aaaa += np.transpose(tmp163, (2, 3, 0, 1)) - l2new.aaaa += einsum(tmp169, (0, 1), l1.aa, (2, 3), (2, 1, 3, 0)) - l2new.aaaa += np.transpose(tmp157, (3, 2, 0, 1)) * 2 - del tmp157 - l2new.aaaa += np.transpose(tmp163, (2, 3, 1, 0)) * -1 - del tmp163 - l2new.aaaa += einsum(tmp169, (0, 1), l1.aa, (2, 3), (2, 1, 0, 3)) * -1 - del tmp169 - l2new.aaaa += np.transpose(tmp170, (2, 3, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp172, (2, 3, 1, 0)) * -2 - del tmp172 - l2new.aaaa += np.transpose(tmp173, (3, 2, 1, 0)) * 2 - del tmp173 - l2new.aaaa += einsum(l2.aaaa, (0, 1, 2, 3), tmp176, (1, 4), (4, 0, 2, 3)) * -1 - del tmp176 - l2new.aaaa += np.transpose(tmp177, (2, 3, 1, 0)) * -2 - l2new.aaaa += np.transpose(tmp179, (2, 3, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp170, (3, 2, 1, 0)) * -2 - del tmp170 - l2new.aaaa += np.transpose(tmp179, (3, 2, 1, 0)) * 2 - del tmp179 - l2new.aaaa += np.transpose(tmp177, (3, 2, 1, 0)) * 2 - del tmp177 - l2new.aaaa += np.transpose(tmp180, (2, 3, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp180, (2, 3, 1, 0)) * 2 - del tmp180 - l2new.aaaa += einsum(l2.aaaa, (0, 1, 2, 3), tmp181, (2, 4, 3, 5), (0, 1, 4, 5)) * -2 - del tmp181 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp147, (2, 1, 3, 4), (4, 0, 2, 3)) - del tmp147 - l2new.aaaa += np.transpose(tmp148, (3, 2, 1, 0)) * -1 - del tmp148 - l2new.aaaa += einsum(tmp11, (0, 1), l1.aa, (2, 3), (1, 2, 3, 0)) - l2new.aaaa += np.transpose(tmp183, (3, 2, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp185, (3, 2, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp187, (3, 2, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp183, (2, 3, 0, 1)) - l2new.aaaa += einsum(tmp11, (0, 1), l1.aa, (2, 3), (2, 1, 3, 0)) * -1 - l2new.aaaa += np.transpose(tmp185, (2, 3, 0, 1)) * 2 - l2new.aaaa += np.transpose(tmp187, (2, 3, 0, 1)) * 2 - l2new.aaaa += np.transpose(tmp183, (3, 2, 1, 0)) - l2new.aaaa += einsum(l1.aa, (0, 1), tmp11, (2, 3), (3, 0, 2, 1)) * -1 - l2new.aaaa += np.transpose(tmp185, (3, 2, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp187, (3, 2, 1, 0)) * 2 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp11, (2, 3), (0, 3, 2, 1)) - del tmp11 - l2new.aaaa += np.transpose(tmp183, (2, 3, 1, 0)) * -1 - del tmp183 - l2new.aaaa += np.transpose(tmp185, (2, 3, 1, 0)) * -2 - del tmp185 - l2new.aaaa += np.transpose(tmp187, (2, 3, 1, 0)) * -2 - del tmp187 - l1new.bb = np.copy(np.transpose(f.bb.ov, (1, 0))) - l1new.bb += einsum(tmp112, (0, 1, 2, 3), l2.abab, (3, 4, 0, 2), (4, 1)) * -2 - del tmp112 - l1new.bb += einsum(tmp121, (0, 1, 2, 3), l2.bbbb, (4, 3, 1, 2), (4, 0)) * 2 - del tmp121 - l1new.bb += einsum(v.bbb.xvv, (0, 1, 2), tmp123, (0, 3, 2), (1, 3)) * -2 - del tmp123 - l1new.bb += einsum(tmp76, (0,), v.bbb.xov, (0, 1, 2), (2, 1)) - l1new.bb += einsum(l1.bb, (0, 1), tmp128, (1, 2), (0, 2)) * -1 - del tmp128 - l1new.bb += einsum(v.bbb.xvv, (0, 1, 2), tmp133, (0, 3, 2), (1, 3)) * 4 - del tmp133 - l1new.bb += einsum(v.bbb.xov, (0, 1, 2), tmp142, (0, 1, 3), (2, 3)) * -4 - del tmp142 - l1new.bb += einsum(tmp109, (0, 1), tmp143, (2, 0), (1, 2)) * -2 - del tmp109, tmp143 - l1new.bb += einsum(tmp145, (0, 1), l1.bb, (0, 2), (1, 2)) - del tmp145 - l1new.aa = np.copy(np.transpose(f.aa.ov, (1, 0))) - l1new.aa += einsum(l2.abab, (0, 1, 2, 3), tmp21, (4, 2, 3, 1), (0, 4)) * -1 - del tmp21 - l1new.aa += einsum(tmp33, (0, 1, 2, 3), l2.aaaa, (4, 3, 1, 2), (4, 0)) * 4 - del tmp33 - l1new.aa += einsum(tmp37, (0, 1, 2), v.baa.xvv, (0, 3, 2), (3, 1)) * -1 - del tmp37 - l1new.aa += einsum(tmp76, (0,), v.baa.xov, (0, 1, 2), (2, 1)) - del tmp76 - l1new.aa += einsum(tmp81, (0, 1), l1.aa, (2, 0), (2, 1)) * -1 - del tmp81 - l1new.aa += einsum(v.baa.xvv, (0, 1, 2), tmp87, (0, 3, 2), (1, 3)) * 2 - del tmp87 - l1new.aa += einsum(tmp99, (0, 1, 2), v.baa.xov, (0, 1, 3), (3, 2)) * -1 - del tmp99 - l1new.aa += einsum(tmp16, (0, 1), tmp100, (2, 0), (1, 2)) * -1 - del tmp16, tmp100 - l1new.aa += einsum(l1.aa, (0, 1), tmp103, (0, 2), (2, 1)) - del tmp103 - - return {f"l1new": l1new, f"l2new": l2new} - -def make_rdm1_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:56:01.508347. - - Parameters - ---------- - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm1 : Namespace of arrays - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - rdm1.aa = Namespace() - rdm1.bb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - tmp3 = einsum(t1.bb, (0, 1), l1.bb, (1, 2), (2, 0)) - tmp4 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp5 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp1 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 1), (4, 0)) - tmp0 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp2 = einsum(l1.aa, (0, 1), t1.aa, (2, 0), (1, 2)) - tmp11 = np.copy(tmp3) - tmp11 += tmp4 - tmp11 += tmp5 * 2 - tmp9 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (4, 1), (2, 3, 4, 0)) - tmp10 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp7 = einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp8 = np.copy(tmp2) * 0.5 - tmp8 += tmp1 - tmp8 += tmp0 * 0.5 - tmp6 = einsum(l2.abab, (0, 1, 2, 3), t1.aa, (4, 0), (2, 4, 3, 1)) - rdm1.bb.vv = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) * 2 - rdm1.bb.vv += einsum(t1.bb, (0, 1), l1.bb, (2, 0), (2, 1)) - rdm1.bb.vv += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - rdm1.aa.vv = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - rdm1.aa.vv += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) * 2 - rdm1.aa.vv += einsum(t1.aa, (0, 1), l1.aa, (2, 0), (2, 1)) - rdm1.bb.vo = np.copy(l1.bb) - rdm1.aa.vo = np.copy(l1.aa) - rdm1.bb.ov = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 0), (1, 3)) - rdm1.bb.ov += t1.bb - rdm1.bb.ov += einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) * 2 - rdm1.bb.ov += einsum(t2.abab, (0, 1, 2, 3), tmp9, (0, 1, 4, 2), (4, 3)) * -1 - del tmp9 - rdm1.bb.ov += einsum(tmp10, (0, 1, 2, 3), t2.bbbb, (1, 0, 4, 3), (2, 4)) * -2 - del tmp10 - rdm1.bb.ov += einsum(t1.bb, (0, 1), tmp11, (0, 2), (2, 1)) * -1 - del tmp11 - rdm1.aa.ov = np.copy(t1.aa) - rdm1.aa.ov += einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) - rdm1.aa.ov += einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) * 2 - rdm1.aa.ov += einsum(tmp6, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (1, 4)) * -1 - del tmp6 - rdm1.aa.ov += einsum(t2.aaaa, (0, 1, 2, 3), tmp7, (1, 0, 4, 3), (4, 2)) * -2 - del tmp7 - rdm1.aa.ov += einsum(tmp8, (0, 1), t1.aa, (0, 2), (1, 2)) * -2 - del tmp8 - rdm1.bb.oo = np.copy(np.transpose(tmp3, (1, 0))) * -1 - del tmp3 - rdm1.bb.oo += delta.bb.oo - rdm1.bb.oo += np.transpose(tmp4, (1, 0)) * -1 - del tmp4 - rdm1.bb.oo += np.transpose(tmp5, (1, 0)) * -2 - del tmp5 - rdm1.aa.oo = np.copy(delta.aa.oo) - del delta - rdm1.aa.oo += np.transpose(tmp0, (1, 0)) * -1 - del tmp0 - rdm1.aa.oo += np.transpose(tmp1, (1, 0)) * -2 - del tmp1 - rdm1.aa.oo += np.transpose(tmp2, (1, 0)) * -1 - del tmp2 - rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]]) - rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]]) - - return rdm1 - -def make_rdm2_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:57:05.288911. - - Parameters - ---------- - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm2 : Namespace of arrays - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - rdm2.aaaa = Namespace() - rdm2.abab = Namespace() - rdm2.bbbb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - tmp18 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp14 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (4, 1), (2, 3, 4, 0)) - tmp8 = einsum(t1.bb, (0, 1), l1.bb, (1, 2), (2, 0)) - tmp9 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp10 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp1 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 1), (4, 0)) - tmp0 = einsum(l1.aa, (0, 1), t1.aa, (2, 0), (1, 2)) - tmp2 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp6 = einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp26 = einsum(l2.abab, (0, 1, 2, 3), t1.aa, (4, 0), (2, 4, 3, 1)) - tmp90 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp92 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 5), (3, 4, 1, 5)) - tmp69 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp67 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp19 = einsum(t1.bb, (0, 1), tmp18, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp17 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp52 = einsum(t2.abab, (0, 1, 2, 3), tmp14, (0, 4, 5, 2), (4, 5, 1, 3)) - tmp51 = einsum(tmp18, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 2, 4, 5)) * -1 - tmp16 = np.copy(tmp8) - tmp16 += tmp9 - tmp16 += tmp10 * 2 - tmp13 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 5, 0, 1), (2, 4, 3, 5)) - tmp15 = einsum(tmp14, (0, 1, 2, 3), t1.aa, (4, 3), (0, 4, 1, 2)) - tmp12 = np.copy(tmp0) * 0.5 - tmp12 += tmp1 - tmp12 += tmp2 * 0.5 - tmp7 = einsum(tmp6, (0, 1, 2, 3), t1.aa, (4, 3), (0, 1, 4, 2)) - tmp5 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp30 = einsum(tmp6, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (0, 2, 4, 5)) * -1 - tmp31 = einsum(t2.abab, (0, 1, 2, 3), tmp26, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp122 = np.copy(tmp92) - tmp122 += tmp90 * 4 - tmp79 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - tmp106 = einsum(t1.bb, (0, 1), l1.bb, (2, 0), (2, 1)) - tmp80 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) - tmp109 = einsum(t1.bb, (0, 1), tmp18, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp112 = einsum(l2.abab, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp88 = einsum(l2.aaaa, (0, 1, 2, 3), t2.abab, (3, 4, 1, 5), (2, 4, 0, 5)) - tmp63 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - tmp62 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) - tmp103 = einsum(t1.aa, (0, 1), l1.aa, (2, 0), (2, 1)) - tmp84 = np.copy(tmp67) * 4 - tmp84 += tmp69 - tmp105 = einsum(t1.aa, (0, 1), tmp6, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp82 = einsum(l2.abab, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 0), (4, 3, 5, 1)) - tmp65 = einsum(l2.bbbb, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (4, 2, 5, 0)) - tmp48 = einsum(t2.bbbb, (0, 1, 2, 3), l1.bb, (3, 4), (4, 0, 1, 2)) - tmp54 = np.copy(np.transpose(tmp17, (1, 0, 3, 2))) - tmp54 += np.transpose(tmp19, (0, 1, 3, 2)) * -1 - tmp101 = np.copy(tmp52) - tmp101 += tmp51 * 4 - tmp35 = einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) - tmp34 = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 0), (1, 3)) - tmp38 = einsum(t2.abab, (0, 1, 2, 3), tmp14, (0, 1, 4, 2), (4, 3)) - tmp39 = einsum(t2.bbbb, (0, 1, 2, 3), tmp18, (1, 0, 4, 3), (4, 2)) - tmp49 = einsum(tmp16, (0, 1), t1.bb, (0, 2), (1, 2)) * 0.5 - tmp53 = np.copy(tmp8) * 0.5 - tmp53 += tmp9 * 0.5 - tmp53 += tmp10 - tmp40 = einsum(tmp16, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp59 = einsum(t2.abab, (0, 1, 2, 3), tmp18, (4, 1, 5, 3), (0, 4, 5, 2)) * -1 - tmp60 = einsum(tmp14, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 2, 5)) - tmp44 = np.copy(tmp13) - tmp44 += tmp15 - tmp25 = einsum(tmp6, (0, 1, 2, 3), t2.aaaa, (1, 0, 4, 3), (2, 4)) - tmp27 = einsum(tmp26, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (1, 4)) - tmp28 = einsum(tmp12, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp42 = einsum(tmp26, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp43 = einsum(t2.abab, (0, 1, 2, 3), tmp6, (4, 0, 5, 2), (4, 5, 1, 3)) * -1 - tmp20 = einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) - tmp21 = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) - tmp24 = einsum(t2.aaaa, (0, 1, 2, 3), l1.aa, (3, 4), (4, 0, 1, 2)) - tmp4 = np.copy(tmp0) - tmp4 += tmp1 * 2 - tmp4 += tmp2 - tmp32 = np.copy(np.transpose(tmp5, (1, 0, 3, 2))) - tmp32 += np.transpose(tmp7, (0, 1, 3, 2)) * -1 - tmp77 = np.copy(tmp30) * 4 - tmp77 += tmp31 - tmp56 = einsum(tmp12, (0, 1), t1.aa, (0, 2), (1, 2)) * 2 - tmp131 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 5, 0, 1), (4, 5, 2, 3)) - tmp129 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 3, 4, 0), (4, 2, 3, 1)) - tmp128 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (3, 4), (2, 0, 1, 4)) - tmp130 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 5), (0, 1, 4, 5)) - tmp127 = einsum(l2.aaaa, (0, 1, 2, 3), t1.aa, (3, 4), (2, 0, 1, 4)) - tmp123 = einsum(t1.bb, (0, 1), tmp122, (0, 2, 3, 4), (2, 1, 3, 4)) - del tmp122 - tmp114 = np.copy(tmp106) * 0.5 - tmp114 += tmp79 * 0.5 - tmp114 += tmp80 - tmp125 = einsum(t1.bb, (0, 1), tmp109, (0, 2, 3, 4), (2, 3, 4, 1)) * -1 - tmp107 = np.copy(tmp106) - del tmp106 - tmp107 += tmp79 - tmp107 += tmp80 * 2 - tmp124 = einsum(t2.bbbb, (0, 1, 2, 3), tmp18, (1, 0, 4, 5), (4, 5, 2, 3)) * -1 - tmp120 = einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 4), (2, 0, 3, 4)) - tmp126 = np.copy(tmp88) - tmp126 += tmp112 - tmp85 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 5, 1), (3, 4, 0, 5)) - tmp113 = einsum(tmp14, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) - tmp110 = np.copy(tmp103) - tmp110 += tmp62 * 2 - tmp110 += tmp63 - tmp118 = einsum(t2.aaaa, (0, 1, 2, 3), tmp6, (1, 0, 4, 5), (4, 5, 2, 3)) * -1 - tmp117 = einsum(tmp84, (0, 1, 2, 3), t1.aa, (0, 4), (1, 4, 2, 3)) - tmp119 = einsum(tmp105, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 3, 4)) * -1 - tmp115 = einsum(t2.aaaa, (0, 1, 2, 3), l1.aa, (4, 1), (0, 4, 2, 3)) - tmp121 = np.copy(tmp92) - tmp121 += tmp90 * 4 - tmp83 = np.copy(tmp82) - tmp83 += tmp65 - tmp108 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 5), (2, 4, 1, 5)) - tmp111 = einsum(tmp26, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - tmp116 = np.copy(tmp67) * 4 - tmp116 += tmp69 - tmp104 = np.copy(tmp103) * 0.5 - del tmp103 - tmp104 += tmp62 - tmp104 += tmp63 * 0.5 - tmp95 = einsum(t1.bb, (0, 1), tmp48, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp91 = einsum(tmp90, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 2), (1, 4, 3, 5)) - tmp99 = einsum(tmp54, (0, 1, 2, 3), t2.bbbb, (0, 1, 4, 5), (2, 3, 4, 5)) - tmp102 = einsum(tmp101, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) - del tmp101 - tmp36 = np.copy(t1.bb) - tmp36 += tmp34 - tmp36 += tmp35 * 2 - tmp98 = einsum(tmp16, (0, 1), t2.bbbb, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - tmp100 = einsum(tmp54, (0, 1, 2, 3), t1.bb, (0, 4), (1, 3, 2, 4)) - tmp94 = np.copy(tmp34) - tmp94 += tmp35 * 2 - tmp50 = np.copy(tmp38) * 0.5 - tmp50 += tmp39 - tmp50 += tmp49 - del tmp49 - tmp97 = einsum(tmp53, (0, 1), t2.bbbb, (2, 0, 3, 4), (2, 1, 3, 4)) * -2 - tmp81 = np.copy(tmp79) - tmp81 += tmp80 * 2 - tmp89 = einsum(tmp88, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp96 = np.copy(tmp79) * 0.5 - del tmp79 - tmp96 += tmp80 - del tmp80 - tmp93 = einsum(t2.bbbb, (0, 1, 2, 3), tmp92, (1, 4, 3, 5), (4, 0, 5, 2)) - tmp47 = np.copy(t1.bb) - tmp47 += tmp34 - del tmp34 - tmp47 += tmp35 * 2 - del tmp35 - tmp41 = np.copy(tmp38) - del tmp38 - tmp41 += tmp39 * 2 - del tmp39 - tmp41 += tmp40 - del tmp40 - tmp58 = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 4), (0, 4, 1, 2)) - tmp61 = einsum(t2.abab, (0, 1, 2, 3), tmp26, (0, 4, 5, 3), (4, 5, 1, 2)) - tmp87 = np.copy(tmp60) - tmp87 += tmp59 - tmp45 = einsum(tmp44, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) - tmp37 = einsum(l1.aa, (0, 1), t2.abab, (2, 3, 0, 4), (1, 2, 3, 4)) - tmp73 = np.copy(tmp62) - tmp73 += tmp63 * 0.5 - tmp46 = einsum(tmp14, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (0, 4, 2, 5)) - tmp29 = np.copy(tmp25) - tmp29 += tmp27 * 0.5 - tmp29 += tmp28 - del tmp28 - tmp86 = np.copy(tmp43) - tmp86 += tmp42 - tmp71 = np.copy(tmp20) * 2 - tmp71 += tmp21 - tmp72 = einsum(tmp24, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - tmp74 = einsum(t2.aaaa, (0, 1, 2, 3), tmp4, (1, 4), (4, 0, 2, 3)) * -1 - tmp22 = np.copy(t1.aa) - tmp22 += tmp20 * 2 - tmp22 += tmp21 - tmp75 = einsum(tmp32, (0, 1, 2, 3), t2.aaaa, (0, 1, 4, 5), (2, 3, 4, 5)) - tmp68 = einsum(t2.aaaa, (0, 1, 2, 3), tmp67, (1, 4, 3, 5), (4, 0, 5, 2)) - tmp78 = einsum(tmp77, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - del tmp77 - tmp64 = np.copy(tmp62) * 2 - del tmp62 - tmp64 += tmp63 - del tmp63 - tmp57 = np.copy(tmp25) * 2 - del tmp25 - tmp57 += tmp27 - del tmp27 - tmp57 += tmp56 - del tmp56 - tmp66 = einsum(t2.abab, (0, 1, 2, 3), tmp65, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp70 = einsum(tmp69, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (4, 1, 5, 3)) - tmp23 = np.copy(t1.aa) - tmp23 += tmp20 * 2 - del tmp20 - tmp23 += tmp21 - del tmp21 - tmp76 = einsum(tmp32, (0, 1, 2, 3), t1.aa, (0, 4), (1, 3, 2, 4)) - tmp55 = einsum(tmp54, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 3, 4)) * 2 - del tmp54 - tmp33 = einsum(tmp32, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 3, 4)) * 2 - del tmp32 - tmp11 = np.copy(delta.bb.oo) * -1 - tmp11 += tmp8 - del tmp8 - tmp11 += tmp9 - del tmp9 - tmp11 += tmp10 * 2 - del tmp10 - tmp3 = np.copy(delta.aa.oo) * -1 - tmp3 += tmp0 - del tmp0 - tmp3 += tmp1 * 2 - del tmp1 - tmp3 += tmp2 - del tmp2 - rdm2.bbbb.vvvv = np.copy(np.transpose(tmp131, (1, 0, 3, 2))) * 2 - del tmp131 - rdm2.bbbb.vvvv += einsum(tmp129, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) * 2 - rdm2.abab.vvvv = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 5), (0, 1, 4, 5)) - rdm2.abab.vvvv += einsum(tmp128, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - rdm2.aaaa.vvvv = np.copy(np.transpose(tmp130, (1, 0, 3, 2))) * 2 - del tmp130 - rdm2.aaaa.vvvv += einsum(t1.aa, (0, 1), tmp127, (0, 2, 3, 4), (2, 3, 1, 4)) * 2 - rdm2.bbbb.vvvo = np.copy(np.transpose(tmp129, (2, 1, 3, 0))) * 2 - rdm2.abab.vvvo = einsum(l2.abab, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - rdm2.aaaa.vvvo = np.copy(np.transpose(tmp127, (2, 1, 3, 0))) * 2 - rdm2.bbbb.vvov = np.copy(np.transpose(tmp129, (2, 1, 0, 3))) * -2 - del tmp129 - rdm2.abab.vvov = np.copy(np.transpose(tmp128, (1, 2, 0, 3))) - del tmp128 - rdm2.aaaa.vvov = np.copy(np.transpose(tmp127, (2, 1, 0, 3))) * -2 - del tmp127 - rdm2.bbbb.vovv = np.copy(np.transpose(tmp120, (1, 0, 3, 2))) * 2 - rdm2.bbbb.vovv += einsum(tmp107, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.vovv += einsum(tmp114, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.bbbb.vovv += np.transpose(tmp123, (2, 0, 1, 3)) - rdm2.bbbb.vovv += np.transpose(tmp123, (2, 0, 3, 1)) * -1 - rdm2.bbbb.vovv += np.transpose(tmp124, (1, 0, 3, 2)) * 2 - rdm2.bbbb.vovv += np.transpose(tmp125, (1, 0, 3, 2)) * 2 - rdm2.abab.vovv = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (4, 0), (4, 1, 2, 3)) - rdm2.abab.vovv += einsum(tmp110, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.vovv += einsum(t1.aa, (0, 1), tmp126, (0, 2, 3, 4), (3, 2, 1, 4)) * 2 - del tmp126 - rdm2.abab.vovv += einsum(tmp85, (0, 1, 2, 3), t1.bb, (0, 4), (2, 1, 3, 4)) * -1 - rdm2.abab.vovv += einsum(t2.abab, (0, 1, 2, 3), tmp14, (0, 1, 4, 5), (5, 4, 2, 3)) * -1 - rdm2.abab.vovv += einsum(tmp113, (0, 1, 2, 3), t1.aa, (0, 4), (2, 1, 4, 3)) * -1 - rdm2.aaaa.vovv = np.copy(np.transpose(tmp115, (1, 0, 3, 2))) * 2 - rdm2.aaaa.vovv += einsum(tmp110, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.vovv += einsum(tmp110, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.vovv += np.transpose(tmp117, (2, 0, 1, 3)) - rdm2.aaaa.vovv += np.transpose(tmp117, (2, 0, 3, 1)) * -1 - rdm2.aaaa.vovv += np.transpose(tmp118, (1, 0, 3, 2)) * 2 - rdm2.aaaa.vovv += np.transpose(tmp119, (1, 0, 3, 2)) * 2 - rdm2.bbbb.ovvv = np.copy(np.transpose(tmp120, (0, 1, 3, 2))) * -2 - del tmp120 - rdm2.bbbb.ovvv += einsum(tmp107, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.ovvv += einsum(tmp114, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.bbbb.ovvv += einsum(tmp121, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) * -1 - del tmp121 - rdm2.bbbb.ovvv += np.transpose(tmp123, (0, 2, 3, 1)) - del tmp123 - rdm2.bbbb.ovvv += np.transpose(tmp124, (0, 1, 3, 2)) * -2 - del tmp124 - rdm2.bbbb.ovvv += np.transpose(tmp125, (0, 1, 3, 2)) * -2 - del tmp125 - rdm2.abab.ovvv = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (4, 1), (0, 4, 2, 3)) - rdm2.abab.ovvv += einsum(tmp114, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.abab.ovvv += einsum(tmp108, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -1 - rdm2.abab.ovvv += einsum(tmp83, (0, 1, 2, 3), t1.bb, (1, 4), (0, 3, 2, 4)) * 2 - rdm2.abab.ovvv += einsum(t2.abab, (0, 1, 2, 3), tmp26, (0, 4, 1, 5), (4, 5, 2, 3)) * -1 - rdm2.abab.ovvv += einsum(tmp111, (0, 1, 2, 3), t1.bb, (1, 4), (0, 3, 2, 4)) * -1 - rdm2.aaaa.ovvv = np.copy(np.transpose(tmp115, (0, 1, 3, 2))) * -2 - del tmp115 - rdm2.aaaa.ovvv += einsum(tmp110, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.ovvv += einsum(tmp110, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.ovvv += einsum(t1.aa, (0, 1), tmp116, (0, 2, 3, 4), (2, 3, 1, 4)) * -1 - del tmp116 - rdm2.aaaa.ovvv += np.transpose(tmp117, (0, 2, 3, 1)) - del tmp117 - rdm2.aaaa.ovvv += np.transpose(tmp118, (0, 1, 3, 2)) * -2 - del tmp118 - rdm2.aaaa.ovvv += np.transpose(tmp119, (0, 1, 3, 2)) * -2 - del tmp119 - rdm2.bbbb.vvoo = np.copy(l2.bbbb) * 2 - rdm2.abab.vvoo = np.copy(l2.abab) - rdm2.aaaa.vvoo = np.copy(l2.aaaa) * 2 - rdm2.bbbb.vovo = einsum(tmp114, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.bbbb.vovo += np.transpose(tmp92, (2, 1, 3, 0)) * -1 - rdm2.bbbb.vovo += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.vovo += np.transpose(tmp90, (2, 1, 3, 0)) * -4 - rdm2.bbbb.vovo += np.transpose(tmp109, (2, 1, 3, 0)) * 2 - rdm2.abab.vovo = einsum(tmp104, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.abab.vovo += np.transpose(tmp85, (2, 1, 3, 0)) * -1 - rdm2.abab.vovo += einsum(tmp14, (0, 1, 2, 3), t1.aa, (0, 4), (3, 2, 4, 1)) * -1 - rdm2.aaaa.vovo = einsum(tmp110, (0, 1), delta.aa.oo, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.vovo += np.transpose(tmp67, (2, 1, 3, 0)) * -4 - rdm2.aaaa.vovo += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.vovo += np.transpose(tmp69, (2, 1, 3, 0)) * -1 - rdm2.aaaa.vovo += np.transpose(tmp105, (2, 1, 3, 0)) * 2 - rdm2.bbbb.voov = einsum(tmp114, (0, 1), delta.bb.oo, (2, 3), (0, 2, 3, 1)) * -2 - del tmp114 - rdm2.bbbb.voov += np.transpose(tmp92, (2, 1, 0, 3)) - rdm2.bbbb.voov += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.voov += np.transpose(tmp90, (2, 1, 0, 3)) * 4 - rdm2.bbbb.voov += np.transpose(tmp109, (2, 1, 0, 3)) * -2 - rdm2.abab.voov = einsum(t1.bb, (0, 1), l1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.abab.voov += np.transpose(tmp112, (2, 1, 0, 3)) * 2 - del tmp112 - rdm2.abab.voov += np.transpose(tmp88, (2, 1, 0, 3)) * 2 - del tmp88 - rdm2.abab.voov += np.transpose(tmp113, (2, 1, 0, 3)) * -1 - del tmp113 - rdm2.aaaa.voov = einsum(delta.aa.oo, (0, 1), tmp104, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.aaaa.voov += np.transpose(tmp67, (2, 1, 0, 3)) * 4 - rdm2.aaaa.voov += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.voov += np.transpose(tmp69, (2, 1, 0, 3)) - rdm2.aaaa.voov += np.transpose(tmp105, (2, 1, 0, 3)) * -2 - rdm2.bbbb.ovvo = einsum(delta.bb.oo, (0, 1), tmp107, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.ovvo += np.transpose(tmp92, (1, 2, 3, 0)) - rdm2.bbbb.ovvo += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.ovvo += np.transpose(tmp90, (1, 2, 3, 0)) * 4 - rdm2.bbbb.ovvo += np.transpose(tmp109, (1, 2, 3, 0)) * -2 - rdm2.abab.ovvo = einsum(t1.aa, (0, 1), l1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.ovvo += np.transpose(tmp65, (0, 3, 2, 1)) * 2 - del tmp65 - rdm2.abab.ovvo += np.transpose(tmp82, (0, 3, 2, 1)) * 2 - del tmp82 - rdm2.abab.ovvo += np.transpose(tmp111, (0, 3, 2, 1)) * -1 - del tmp111 - rdm2.aaaa.ovvo = einsum(tmp110, (0, 1), delta.aa.oo, (2, 3), (2, 0, 1, 3)) * -1 - del tmp110 - rdm2.aaaa.ovvo += np.transpose(tmp67, (1, 2, 3, 0)) * 4 - rdm2.aaaa.ovvo += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.ovvo += np.transpose(tmp69, (1, 2, 3, 0)) - rdm2.aaaa.ovvo += np.transpose(tmp105, (1, 2, 3, 0)) * -2 - rdm2.bbbb.ovov = einsum(delta.bb.oo, (0, 1), tmp107, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.ovov += np.transpose(tmp92, (1, 2, 0, 3)) * -1 - del tmp92 - rdm2.bbbb.ovov += einsum(l1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.ovov += np.transpose(tmp90, (1, 2, 0, 3)) * -4 - del tmp90 - rdm2.bbbb.ovov += np.transpose(tmp109, (1, 2, 0, 3)) * 2 - del tmp109 - rdm2.abab.ovov = einsum(delta.aa.oo, (0, 1), tmp107, (2, 3), (0, 2, 1, 3)) - del tmp107 - rdm2.abab.ovov += np.transpose(tmp108, (1, 2, 0, 3)) * -1 - del tmp108 - rdm2.abab.ovov += einsum(t1.bb, (0, 1), tmp26, (2, 3, 0, 4), (3, 4, 2, 1)) * -1 - rdm2.aaaa.ovov = einsum(delta.aa.oo, (0, 1), tmp104, (2, 3), (0, 2, 1, 3)) * 2 - del tmp104 - rdm2.aaaa.ovov += np.transpose(tmp67, (1, 2, 0, 3)) * -4 - del tmp67 - rdm2.aaaa.ovov += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.ovov += np.transpose(tmp69, (1, 2, 0, 3)) * -1 - del tmp69 - rdm2.aaaa.ovov += np.transpose(tmp105, (1, 2, 0, 3)) * 2 - del tmp105 - rdm2.bbbb.oovv = np.copy(t2.bbbb) * 2 - rdm2.bbbb.oovv += einsum(tmp81, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 4, 1)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp89, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp91, (0, 1, 3, 2)) * -8 - rdm2.bbbb.oovv += np.transpose(tmp93, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp93, (1, 0, 2, 3)) * -2 - rdm2.bbbb.oovv += einsum(tmp47, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.oovv += np.transpose(tmp89, (1, 0, 3, 2)) * 2 - del tmp89 - rdm2.bbbb.oovv += tmp91 * 8 - del tmp91 - rdm2.bbbb.oovv += tmp93 * 2 - rdm2.bbbb.oovv += np.transpose(tmp93, (1, 0, 3, 2)) * 2 - del tmp93 - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp36, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp94, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.oovv += einsum(tmp94, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -1 - del tmp94 - rdm2.bbbb.oovv += tmp95 * 2 - rdm2.bbbb.oovv += einsum(t2.bbbb, (0, 1, 2, 3), tmp96, (3, 4), (0, 1, 4, 2)) * 4 - del tmp96 - rdm2.bbbb.oovv += np.transpose(tmp95, (0, 1, 3, 2)) * -2 - del tmp95 - rdm2.bbbb.oovv += np.transpose(tmp97, (0, 1, 3, 2)) * -1 - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp41, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.bbbb.oovv += np.transpose(tmp98, (0, 1, 3, 2)) * -1 - rdm2.bbbb.oovv += einsum(tmp41, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) - rdm2.bbbb.oovv += np.transpose(tmp98, (1, 0, 3, 2)) - del tmp98 - rdm2.bbbb.oovv += einsum(tmp50, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * 2 - rdm2.bbbb.oovv += np.transpose(tmp97, (1, 0, 3, 2)) - del tmp97 - rdm2.bbbb.oovv += einsum(tmp50, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp99, (1, 0, 3, 2)) * 2 - del tmp99 - rdm2.bbbb.oovv += einsum(tmp100, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) * 2 - del tmp100 - rdm2.bbbb.oovv += np.transpose(tmp102, (1, 0, 2, 3)) - rdm2.bbbb.oovv += tmp102 * -1 - rdm2.bbbb.oovv += np.transpose(tmp102, (1, 0, 3, 2)) * -1 - rdm2.bbbb.oovv += np.transpose(tmp102, (0, 1, 3, 2)) - del tmp102 - rdm2.abab.oovv = np.copy(t2.abab) - rdm2.abab.oovv += einsum(tmp81, (0, 1), t2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -1 - del tmp81 - rdm2.abab.oovv += einsum(tmp83, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * 4 - del tmp83 - rdm2.abab.oovv += einsum(tmp84, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp84 - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp36, (2, 3), (0, 2, 1, 3)) - rdm2.abab.oovv += einsum(tmp71, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.oovv += einsum(tmp37, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -1 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp73, (2, 4), (0, 1, 4, 3)) * -2 - rdm2.abab.oovv += einsum(t1.bb, (0, 1), tmp58, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp16, (1, 4), (0, 4, 2, 3)) * -1 - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp41, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.abab.oovv += einsum(tmp12, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -2 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp44, (0, 4, 1, 5), (4, 5, 2, 3)) - rdm2.abab.oovv += einsum(tmp45, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - rdm2.abab.oovv += einsum(tmp85, (0, 1, 2, 3), t2.abab, (4, 0, 2, 5), (4, 1, 3, 5)) - del tmp85 - rdm2.abab.oovv += einsum(tmp29, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * -2 - rdm2.abab.oovv += einsum(tmp46, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - rdm2.abab.oovv += einsum(tmp86, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -2 - del tmp86 - rdm2.abab.oovv += einsum(tmp87, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) * -2 - del tmp87 - rdm2.abab.oovv += einsum(tmp61, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) - rdm2.aaaa.oovv = np.copy(t2.aaaa) * 2 - rdm2.aaaa.oovv += einsum(tmp64, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 4, 1)) * -2 - del tmp64 - rdm2.aaaa.oovv += np.transpose(tmp66, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp68, (0, 1, 3, 2)) * -8 - rdm2.aaaa.oovv += np.transpose(tmp70, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp70, (1, 0, 2, 3)) * -2 - rdm2.aaaa.oovv += einsum(tmp22, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.oovv += tmp66 * 2 - del tmp66 - rdm2.aaaa.oovv += tmp68 * 8 - del tmp68 - rdm2.aaaa.oovv += tmp70 * 2 - rdm2.aaaa.oovv += np.transpose(tmp70, (1, 0, 3, 2)) * 2 - del tmp70 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp23, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp71, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.oovv += einsum(tmp71, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * -1 - del tmp71 - rdm2.aaaa.oovv += tmp72 * 2 - rdm2.aaaa.oovv += einsum(t2.aaaa, (0, 1, 2, 3), tmp73, (3, 4), (0, 1, 4, 2)) * 4 - del tmp73 - rdm2.aaaa.oovv += np.transpose(tmp72, (0, 1, 3, 2)) * -2 - del tmp72 - rdm2.aaaa.oovv += np.transpose(tmp74, (1, 0, 3, 2)) * -2 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp57, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.aaaa.oovv += einsum(tmp29, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * 2 - rdm2.aaaa.oovv += np.transpose(tmp74, (0, 1, 3, 2)) * 2 - del tmp74 - rdm2.aaaa.oovv += einsum(tmp57, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp29, (2, 3), (2, 0, 3, 1)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp75, (1, 0, 3, 2)) * 2 - del tmp75 - rdm2.aaaa.oovv += einsum(tmp76, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * 2 - del tmp76 - rdm2.aaaa.oovv += np.transpose(tmp78, (1, 0, 2, 3)) - rdm2.aaaa.oovv += tmp78 * -1 - rdm2.aaaa.oovv += np.transpose(tmp78, (1, 0, 3, 2)) * -1 - rdm2.aaaa.oovv += np.transpose(tmp78, (0, 1, 3, 2)) - del tmp78 - rdm2.bbbb.vooo = einsum(l1.bb, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.vooo += einsum(l1.bb, (0, 1), delta.bb.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.vooo += np.transpose(tmp18, (3, 2, 1, 0)) * 2 - rdm2.abab.vooo = einsum(l1.aa, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2.abab.vooo += np.transpose(tmp14, (3, 2, 0, 1)) * -1 - del tmp14 - rdm2.aaaa.vooo = einsum(l1.aa, (0, 1), delta.aa.oo, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.vooo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.vooo += np.transpose(tmp6, (3, 2, 1, 0)) * 2 - rdm2.bbbb.ovoo = einsum(l1.bb, (0, 1), delta.bb.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.ovoo += einsum(l1.bb, (0, 1), delta.bb.oo, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.ovoo += np.transpose(tmp18, (2, 3, 1, 0)) * -2 - del tmp18 - rdm2.abab.ovoo = einsum(delta.aa.oo, (0, 1), l1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.ovoo += np.transpose(tmp26, (1, 3, 0, 2)) * -1 - del tmp26 - rdm2.aaaa.ovoo = einsum(l1.aa, (0, 1), delta.aa.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.ovoo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.ovoo += np.transpose(tmp6, (2, 3, 1, 0)) * -2 - del tmp6 - rdm2.bbbb.oovo = einsum(delta.bb.oo, (0, 1), tmp47, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.oovo += einsum(tmp36, (0, 1), delta.bb.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.oovo += np.transpose(tmp48, (2, 1, 3, 0)) * 2 - rdm2.bbbb.oovo += einsum(delta.bb.oo, (0, 1), tmp41, (2, 3), (2, 0, 3, 1)) * -1 - rdm2.bbbb.oovo += einsum(tmp41, (0, 1), delta.bb.oo, (2, 3), (2, 0, 1, 3)) - rdm2.bbbb.oovo += np.transpose(tmp51, (1, 2, 3, 0)) * 4 - rdm2.bbbb.oovo += np.transpose(tmp52, (1, 2, 3, 0)) - rdm2.bbbb.oovo += einsum(tmp16, (0, 1), t1.bb, (2, 3), (1, 2, 3, 0)) - rdm2.bbbb.oovo += np.transpose(tmp51, (2, 1, 3, 0)) * -4 - rdm2.bbbb.oovo += np.transpose(tmp52, (2, 1, 3, 0)) * -1 - rdm2.bbbb.oovo += einsum(t1.bb, (0, 1), tmp16, (2, 3), (0, 3, 1, 2)) * -1 - rdm2.bbbb.oovo += np.transpose(tmp55, (2, 1, 3, 0)) * -1 - rdm2.abab.oovo = einsum(delta.bb.oo, (0, 1), tmp22, (2, 3), (2, 0, 3, 1)) - rdm2.abab.oovo += np.transpose(tmp58, (0, 2, 3, 1)) * -1 - del tmp58 - rdm2.abab.oovo += einsum(tmp29, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) * -2 - rdm2.abab.oovo += np.transpose(tmp59, (0, 2, 3, 1)) * -2 - del tmp59 - rdm2.abab.oovo += np.transpose(tmp60, (0, 2, 3, 1)) * -2 - del tmp60 - rdm2.abab.oovo += einsum(tmp53, (0, 1), t1.aa, (2, 3), (2, 1, 3, 0)) * -2 - rdm2.abab.oovo += einsum(tmp44, (0, 1, 2, 3), t1.aa, (0, 4), (1, 3, 4, 2)) - del tmp44 - rdm2.abab.oovo += np.transpose(tmp61, (0, 2, 3, 1)) - del tmp61 - rdm2.aaaa.oovo = einsum(delta.aa.oo, (0, 1), tmp22, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.oovo += einsum(delta.aa.oo, (0, 1), tmp23, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.oovo += np.transpose(tmp24, (2, 1, 3, 0)) * 2 - rdm2.aaaa.oovo += einsum(delta.aa.oo, (0, 1), tmp57, (2, 3), (2, 0, 3, 1)) * -1 - rdm2.aaaa.oovo += einsum(tmp57, (0, 1), delta.aa.oo, (2, 3), (2, 0, 1, 3)) - del tmp57 - rdm2.aaaa.oovo += np.transpose(tmp30, (1, 2, 3, 0)) * 4 - rdm2.aaaa.oovo += np.transpose(tmp31, (1, 2, 3, 0)) - rdm2.aaaa.oovo += einsum(tmp4, (0, 1), t1.aa, (2, 3), (1, 2, 3, 0)) - rdm2.aaaa.oovo += np.transpose(tmp30, (2, 1, 3, 0)) * -4 - rdm2.aaaa.oovo += np.transpose(tmp31, (2, 1, 3, 0)) * -1 - rdm2.aaaa.oovo += einsum(t1.aa, (0, 1), tmp4, (2, 3), (0, 3, 1, 2)) * -1 - rdm2.aaaa.oovo += np.transpose(tmp33, (2, 1, 3, 0)) * -1 - rdm2.bbbb.ooov = einsum(delta.bb.oo, (0, 1), tmp47, (2, 3), (2, 0, 1, 3)) * -1 - del tmp47 - rdm2.bbbb.ooov += einsum(tmp36, (0, 1), delta.bb.oo, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.ooov += np.transpose(tmp48, (2, 1, 0, 3)) * -2 - del tmp48 - rdm2.bbbb.ooov += einsum(delta.bb.oo, (0, 1), tmp50, (2, 3), (2, 0, 1, 3)) * 2 - rdm2.bbbb.ooov += einsum(tmp50, (0, 1), delta.bb.oo, (2, 3), (2, 0, 3, 1)) * -2 - del tmp50 - rdm2.bbbb.ooov += np.transpose(tmp51, (1, 2, 0, 3)) * -4 - rdm2.bbbb.ooov += np.transpose(tmp52, (1, 2, 0, 3)) * -1 - rdm2.bbbb.ooov += einsum(tmp53, (0, 1), t1.bb, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.bbbb.ooov += np.transpose(tmp51, (2, 1, 0, 3)) * 4 - del tmp51 - rdm2.bbbb.ooov += np.transpose(tmp52, (2, 1, 0, 3)) - del tmp52 - rdm2.bbbb.ooov += einsum(t1.bb, (0, 1), tmp53, (2, 3), (0, 3, 2, 1)) * 2 - del tmp53 - rdm2.bbbb.ooov += np.transpose(tmp55, (2, 1, 0, 3)) - del tmp55 - rdm2.abab.ooov = einsum(delta.aa.oo, (0, 1), tmp36, (2, 3), (0, 2, 1, 3)) - del tmp36 - rdm2.abab.ooov += np.transpose(tmp37, (1, 2, 0, 3)) * -1 - del tmp37 - rdm2.abab.ooov += einsum(delta.aa.oo, (0, 1), tmp41, (2, 3), (0, 2, 1, 3)) * -1 - del tmp41 - rdm2.abab.ooov += np.transpose(tmp42, (1, 2, 0, 3)) * -2 - del tmp42 - rdm2.abab.ooov += np.transpose(tmp43, (1, 2, 0, 3)) * -2 - del tmp43 - rdm2.abab.ooov += einsum(tmp12, (0, 1), t1.bb, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.abab.ooov += np.transpose(tmp45, (1, 2, 0, 3)) - del tmp45 - rdm2.abab.ooov += np.transpose(tmp46, (1, 2, 0, 3)) - del tmp46 - rdm2.aaaa.ooov = einsum(delta.aa.oo, (0, 1), tmp22, (2, 3), (2, 0, 1, 3)) * -1 - del tmp22 - rdm2.aaaa.ooov += einsum(delta.aa.oo, (0, 1), tmp23, (2, 3), (0, 2, 1, 3)) - del tmp23 - rdm2.aaaa.ooov += np.transpose(tmp24, (2, 1, 0, 3)) * -2 - del tmp24 - rdm2.aaaa.ooov += einsum(tmp29, (0, 1), delta.aa.oo, (2, 3), (0, 2, 3, 1)) * 2 - rdm2.aaaa.ooov += einsum(tmp29, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) * -2 - del tmp29 - rdm2.aaaa.ooov += np.transpose(tmp30, (1, 2, 0, 3)) * -4 - rdm2.aaaa.ooov += np.transpose(tmp31, (1, 2, 0, 3)) * -1 - rdm2.aaaa.ooov += einsum(tmp12, (0, 1), t1.aa, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.aaaa.ooov += np.transpose(tmp30, (2, 1, 0, 3)) * 4 - del tmp30 - rdm2.aaaa.ooov += np.transpose(tmp31, (2, 1, 0, 3)) - del tmp31 - rdm2.aaaa.ooov += einsum(t1.aa, (0, 1), tmp12, (2, 3), (0, 3, 2, 1)) * 2 - rdm2.aaaa.ooov += np.transpose(tmp33, (2, 1, 0, 3)) - del tmp33 - rdm2.bbbb.oooo = einsum(tmp11, (0, 1), delta.bb.oo, (2, 3), (2, 1, 3, 0)) * -1 - rdm2.bbbb.oooo += einsum(delta.bb.oo, (0, 1), tmp11, (2, 3), (3, 0, 1, 2)) - rdm2.bbbb.oooo += einsum(delta.bb.oo, (0, 1), tmp16, (2, 3), (3, 0, 2, 1)) * -1 - rdm2.bbbb.oooo += einsum(delta.bb.oo, (0, 1), tmp16, (2, 3), (0, 3, 2, 1)) - del tmp16 - rdm2.bbbb.oooo += np.transpose(tmp17, (3, 2, 1, 0)) * 2 - del tmp17 - rdm2.bbbb.oooo += np.transpose(tmp19, (2, 3, 1, 0)) * -2 - del tmp19 - rdm2.abab.oooo = einsum(delta.aa.oo, (0, 1), tmp11, (2, 3), (0, 3, 1, 2)) * -1 - del tmp11 - rdm2.abab.oooo += einsum(tmp12, (0, 1), delta.bb.oo, (2, 3), (1, 2, 0, 3)) * -2 - del tmp12 - rdm2.abab.oooo += np.transpose(tmp13, (1, 3, 0, 2)) - del tmp13 - rdm2.abab.oooo += np.transpose(tmp15, (1, 3, 0, 2)) - del tmp15 - rdm2.aaaa.oooo = einsum(delta.aa.oo, (0, 1), tmp3, (2, 3), (0, 3, 1, 2)) * -1 - rdm2.aaaa.oooo += einsum(tmp3, (0, 1), delta.aa.oo, (2, 3), (1, 2, 3, 0)) - del tmp3 - rdm2.aaaa.oooo += einsum(delta.aa.oo, (0, 1), tmp4, (2, 3), (3, 0, 2, 1)) * -1 - rdm2.aaaa.oooo += einsum(delta.aa.oo, (0, 1), tmp4, (2, 3), (0, 3, 2, 1)) - del tmp4, delta - rdm2.aaaa.oooo += np.transpose(tmp5, (3, 2, 1, 0)) * 2 - del tmp5 - rdm2.aaaa.oooo += np.transpose(tmp7, (2, 3, 1, 0)) * -2 - del tmp7 - rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv) - rdm2.abab = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv) - rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv) - rdm2 = Namespace( - aaaa=np.transpose(rdm2.aaaa, (0, 2, 1, 3)), - aabb=np.transpose(rdm2.abab, (0, 2, 1, 3)), - bbbb=np.transpose(rdm2.bbbb, (0, 2, 1, 3)), - ) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:58:31.362610. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp103 : array - tmp107 : array - tmp11 : array - tmp111 : array - tmp113 : array - tmp12 : array - tmp121 : array - tmp123 : array - tmp125 : array - tmp127 : array - tmp128 : array - tmp129 : array - tmp137 : array - tmp138 : array - tmp14 : array - tmp141 : array - tmp148 : array - tmp153 : array - tmp156 : array - tmp157 : array - tmp159 : array - tmp160 : array - tmp161 : array - tmp163 : array - tmp166 : array - tmp17 : array - tmp170 : array - tmp172 : array - tmp173 : array - tmp174 : array - tmp175 : array - tmp176 : array - tmp178 : array - tmp18 : array - tmp180 : array - tmp183 : array - tmp184 : array - tmp185 : array - tmp186 : array - tmp189 : array - tmp19 : array - tmp190 : array - tmp197 : array - tmp199 : array - tmp2 : array - tmp204 : array - tmp206 : array - tmp208 : array - tmp21 : array - tmp210 : array - tmp22 : array - tmp220 : array - tmp24 : array - tmp26 : array - tmp27 : array - tmp29 : array - tmp30 : array - tmp32 : array - tmp33 : array - tmp34 : array - tmp36 : array - tmp37 : array - tmp39 : array - tmp4 : array - tmp41 : array - tmp42 : array - tmp43 : array - tmp47 : array - tmp49 : array - tmp51 : array - tmp52 : array - tmp54 : array - tmp55 : array - tmp57 : array - tmp58 : array - tmp59 : array - tmp61 : array - tmp66 : array - tmp67 : array - tmp69 : array - tmp7 : array - tmp71 : array - tmp72 : array - tmp75 : array - tmp78 : array - tmp79 : array - tmp80 : array - tmp82 : array - tmp83 : array - tmp84 : array - tmp86 : array - tmp88 : array - tmp9 : array - tmp90 : array - tmp92 : array - tmp94 : array - tmp97 : array - tmp98 : array - """ - - tmp8 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp10 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 0, 1), (2,)) - tmp16 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 3, 1), (2, 0, 3)) - tmp6 = einsum(t1.aa, (0, 1), v.baa.xov, (2, 3, 1), (2, 0, 3)) - tmp54 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp51 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp37 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp97 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp196 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp36 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp107 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp39 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp71 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp2 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp152 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp4 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp26 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp29 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp120 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp1 = einsum(f.aa.ov, (0, 1), t1.aa, (2, 1), (0, 2)) - tmp68 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp21 = einsum(v.bbb.xov, (0, 1, 2), tmp8, (0,), (1, 2)) - tmp18 = einsum(v.bbb.xov, (0, 1, 2), tmp10, (0,), (1, 2)) - tmp17 = einsum(tmp16, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp19 = einsum(v.baa.xov, (0, 1, 2), tmp10, (0,), (1, 2)) - tmp14 = einsum(v.baa.xov, (0, 1, 2), tmp8, (0,), (1, 2)) - tmp12 = einsum(v.baa.xov, (0, 1, 2), tmp6, (0, 1, 3), (3, 2)) - tmp220 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (4, 3), (4, 0, 1, 2)) - tmp210 = einsum(v.bbb.xoo, (0, 1, 2), tmp54, (0, 3, 4), (3, 1, 2, 4)) - tmp208 = einsum(v.bbb.xoo, (0, 1, 2), tmp51, (0, 3, 4), (3, 1, 2, 4)) - tmp206 = einsum(t2.bbbb, (0, 1, 2, 3), tmp37, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp204 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp199 = einsum(t2.bbbb, (0, 1, 2, 3), tmp97, (4, 5, 3, 2), (0, 1, 5, 4)) - tmp197 = einsum(t2.bbbb, (0, 1, 2, 3), tmp196, (4, 5, 2, 3), (0, 1, 4, 5)) * -1 - del tmp196 - tmp190 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp189 = einsum(tmp36, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp186 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp185 = einsum(tmp54, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) - tmp184 = einsum(tmp51, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) * -1 - tmp183 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp180 = einsum(t2.abab, (0, 1, 2, 3), tmp107, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp178 = einsum(v.bbb.xov, (0, 1, 2), tmp54, (0, 1, 3), (3, 2)) - tmp176 = einsum(v.bbb.xov, (0, 1, 2), tmp51, (0, 1, 3), (3, 2)) - tmp175 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (4, 5, 1, 2), (0, 4, 5, 3)) - tmp174 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (0, 4, 1, 2), (4, 3)) - tmp173 = einsum(t2.bbbb, (0, 1, 2, 3), tmp37, (4, 0, 1, 3), (4, 2)) - tmp172 = einsum(f.aa.ov, (0, 1), t2.abab, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp170 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp166 = einsum(t2.bbbb, (0, 1, 2, 3), tmp97, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp163 = einsum(tmp71, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 4, 2, 5)) - tmp161 = einsum(v.baa.xoo, (0, 1, 2), tmp51, (0, 3, 4), (1, 2, 3, 4)) - tmp160 = einsum(v.baa.xoo, (0, 1, 2), tmp54, (0, 3, 4), (1, 2, 3, 4)) - tmp159 = einsum(t2.abab, (0, 1, 2, 3), tmp2, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp157 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp156 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp153 = einsum(t2.abab, (0, 1, 2, 3), tmp152, (4, 2, 5, 3), (0, 4, 1, 5)) - del tmp152 - tmp148 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp141 = einsum(tmp107, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (4, 1, 5, 2)) - tmp138 = einsum(tmp4, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp137 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (4, 3), (0, 4, 1, 2)) - tmp129 = einsum(tmp26, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp128 = einsum(tmp29, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp127 = einsum(tmp37, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp125 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp123 = einsum(t2.abab, (0, 1, 2, 3), tmp107, (4, 5, 2, 3), (0, 4, 1, 5)) - tmp121 = einsum(t2.abab, (0, 1, 2, 3), tmp120, (4, 5, 2, 3), (0, 1, 4, 5)) - del tmp120 - tmp113 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp111 = einsum(tmp1, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp103 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (4, 3), (4, 0, 1, 2)) - tmp98 = einsum(tmp97, (0, 1, 2, 3), t2.abab, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp94 = einsum(t2.aaaa, (0, 1, 2, 3), tmp71, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp92 = einsum(tmp29, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp90 = einsum(tmp26, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp88 = einsum(tmp29, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp86 = einsum(tmp26, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp84 = einsum(t2.aaaa, (0, 1, 2, 3), tmp2, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp83 = einsum(tmp4, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp82 = einsum(t2.aaaa, (0, 1, 2, 3), tmp2, (4, 0, 1, 3), (4, 2)) - tmp80 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp79 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp78 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp75 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp72 = einsum(t2.aaaa, (0, 1, 2, 3), tmp71, (4, 5, 3, 2), (0, 1, 5, 4)) - tmp69 = einsum(tmp68, (0, 1, 2, 3), t2.aaaa, (4, 5, 2, 3), (4, 5, 0, 1)) * -1 - del tmp68 - tmp67 = einsum(tmp29, (0, 1, 2), v.baa.xvv, (0, 3, 2), (1, 3)) - tmp66 = einsum(tmp26, (0, 1, 2), v.baa.xvv, (0, 3, 2), (1, 3)) * -1 - tmp61 = einsum(f.aa.vv, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp59 = einsum(t1.bb, (0, 1), tmp21, (2, 1), (0, 2)) - tmp58 = einsum(tmp18, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp57 = einsum(t1.bb, (0, 1), tmp17, (2, 1), (0, 2)) - tmp55 = einsum(v.bbb.xov, (0, 1, 2), tmp54, (0, 3, 2), (3, 1)) - tmp52 = einsum(v.bbb.xov, (0, 1, 2), tmp51, (0, 3, 2), (3, 1)) - tmp49 = einsum(v.baa.xov, (0, 1, 2), tmp16, (0, 3, 4), (1, 3, 4, 2)) - tmp47 = einsum(v.bbb.xov, (0, 1, 2), tmp16, (0, 3, 4), (3, 1, 4, 2)) - tmp43 = einsum(v.bbb.xoo, (0, 1, 2), tmp8, (0,), (1, 2)) - tmp42 = einsum(v.bbb.xoo, (0, 1, 2), tmp10, (0,), (1, 2)) - tmp41 = einsum(tmp16, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (3, 2)) - del tmp16 - tmp34 = einsum(t1.aa, (0, 1), tmp19, (2, 1), (0, 2)) - tmp33 = einsum(tmp14, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp32 = einsum(t1.aa, (0, 1), tmp12, (2, 1), (0, 2)) - tmp30 = einsum(tmp29, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp27 = einsum(tmp26, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp24 = einsum(tmp6, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp22 = einsum(tmp6, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp11 = einsum(tmp10, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - del tmp10 - tmp9 = einsum(tmp8, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - del tmp8 - tmp7 = einsum(v.baa.xoo, (0, 1, 2), tmp6, (0, 2, 3), (1, 3)) - del tmp6 - - return {f"tmp1": tmp1, f"tmp103": tmp103, f"tmp107": tmp107, f"tmp11": tmp11, f"tmp111": tmp111, f"tmp113": tmp113, f"tmp12": tmp12, f"tmp121": tmp121, f"tmp123": tmp123, f"tmp125": tmp125, f"tmp127": tmp127, f"tmp128": tmp128, f"tmp129": tmp129, f"tmp137": tmp137, f"tmp138": tmp138, f"tmp14": tmp14, f"tmp141": tmp141, f"tmp148": tmp148, f"tmp153": tmp153, f"tmp156": tmp156, f"tmp157": tmp157, f"tmp159": tmp159, f"tmp160": tmp160, f"tmp161": tmp161, f"tmp163": tmp163, f"tmp166": tmp166, f"tmp17": tmp17, f"tmp170": tmp170, f"tmp172": tmp172, f"tmp173": tmp173, f"tmp174": tmp174, f"tmp175": tmp175, f"tmp176": tmp176, f"tmp178": tmp178, f"tmp18": tmp18, f"tmp180": tmp180, f"tmp183": tmp183, f"tmp184": tmp184, f"tmp185": tmp185, f"tmp186": tmp186, f"tmp189": tmp189, f"tmp19": tmp19, f"tmp190": tmp190, f"tmp197": tmp197, f"tmp199": tmp199, f"tmp2": tmp2, f"tmp204": tmp204, f"tmp206": tmp206, f"tmp208": tmp208, f"tmp21": tmp21, f"tmp210": tmp210, f"tmp22": tmp22, f"tmp220": tmp220, f"tmp24": tmp24, f"tmp26": tmp26, f"tmp27": tmp27, f"tmp29": tmp29, f"tmp30": tmp30, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp34": tmp34, f"tmp36": tmp36, f"tmp37": tmp37, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp42": tmp42, f"tmp43": tmp43, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp51": tmp51, f"tmp52": tmp52, f"tmp54": tmp54, f"tmp55": tmp55, f"tmp57": tmp57, f"tmp58": tmp58, f"tmp59": tmp59, f"tmp61": tmp61, f"tmp66": tmp66, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp7": tmp7, f"tmp71": tmp71, f"tmp72": tmp72, f"tmp75": tmp75, f"tmp78": tmp78, f"tmp79": tmp79, f"tmp80": tmp80, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp84": tmp84, f"tmp86": tmp86, f"tmp88": tmp88, f"tmp9": tmp9, f"tmp90": tmp90, f"tmp92": tmp92, f"tmp94": tmp94, f"tmp97": tmp97, f"tmp98": tmp98} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:58:31.468713. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp8 = einsum(r2.aaa, (0, 1, 2), v.baa.xov, (3, 1, 2), (3, 0)) - tmp9 = einsum(v.bbb.xov, (0, 1, 2), r2.bab, (1, 3, 2), (0, 3)) * -1 - tmp39 = einsum(v.baa.xov, (0, 1, 2), r2.aba, (1, 3, 2), (0, 3)) - tmp70 = np.copy(ints.tmp52) * 2 - tmp70 += ints.tmp55 - tmp72 = np.copy(ints.tmp206) - del ints.tmp206 - tmp72 += np.transpose(ints.tmp37, (0, 2, 1, 3)) * 0.5 - tmp40 = einsum(v.bbb.xov, (0, 1, 2), r2.bbb, (3, 1, 2), (0, 3)) - tmp68 = np.copy(ints.tmp51) - tmp68 += ints.tmp54 * 0.5 - tmp49 = np.copy(ints.tmp186) - del ints.tmp186 - tmp49 += ints.tmp166 * 2 - del ints.tmp166 - tmp59 = np.copy(ints.tmp54) - tmp59 += ints.tmp51 * 2 - tmp63 = np.copy(ints.tmp210) - del ints.tmp210 - tmp63 += ints.tmp208 * 2 - del ints.tmp208 - tmp61 = np.copy(f.bb.oo) - tmp61 += ints.tmp36 - tmp25 = np.copy(ints.tmp88) - del ints.tmp88 - tmp25 += ints.tmp86 * 2 - del ints.tmp86 - tmp21 = np.copy(tmp8) * 2 - tmp21 += tmp9 - tmp19 = np.copy(ints.tmp113) - tmp19 += ints.tmp94 * 2 - tmp23 = np.copy(f.aa.oo) - tmp23 += ints.tmp1 - tmp15 = np.copy(ints.tmp2) - tmp15 += np.transpose(ints.tmp84, (0, 2, 1, 3)) * 2 - del ints.tmp84 - tmp13 = np.copy(ints.tmp27) * 2 - tmp13 += ints.tmp30 - tmp11 = np.copy(ints.tmp26) - tmp11 += ints.tmp29 * 0.5 - tmp10 = np.copy(tmp8) * 2 - del tmp8 - tmp10 += tmp9 - del tmp9 - tmp67 = einsum(tmp39, (0, 1), v.bbb.xov, (0, 2, 3), (1, 2, 3)) - tmp71 = einsum(r2.bbb, (0, 1, 2), tmp70, (3, 1), (0, 3, 2)) * -2 - del tmp70 - tmp66 = einsum(r2.aba, (0, 1, 2), ints.tmp163, (0, 3, 2, 4), (3, 1, 4)) - tmp73 = einsum(tmp72, (0, 1, 2, 3), r1.b, (2,), (0, 1, 3)) * 2 - del tmp72 - tmp69 = einsum(tmp68, (0, 1, 2), tmp40, (0, 3), (3, 1, 2)) * 4 - del tmp68 - tmp43 = einsum(ints.tmp107, (0, 1, 2, 3), r2.aba, (0, 1, 2), (3,)) - tmp44 = einsum(ints.tmp97, (0, 1, 2, 3), r2.bbb, (1, 0, 2), (3,)) * -1 - del ints.tmp97 - tmp53 = einsum(t1.bb, (0, 1), f.bb.ov, (0, 2), (2, 1)) - tmp58 = einsum(tmp49, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (4, 0, 2)) * -1 - tmp60 = einsum(tmp39, (0, 1), tmp59, (0, 2, 3), (1, 2, 3)) - del tmp59 - tmp64 = einsum(r1.b, (0,), tmp63, (1, 0, 2, 3), (1, 2, 3)) - del tmp63 - tmp57 = einsum(tmp40, (0, 1), v.bbb.xov, (0, 2, 3), (1, 2, 3)) - tmp62 = einsum(tmp61, (0, 1), r2.bbb, (2, 0, 3), (2, 1, 3)) * -1 - del tmp61 - tmp31 = einsum(ints.tmp71, (0, 1, 2, 3), r2.aaa, (1, 0, 2), (3,)) * -1 - del ints.tmp71 - tmp32 = einsum(ints.tmp107, (0, 1, 2, 3), r2.bab, (1, 0, 3), (2,)) * -1 - del ints.tmp107 - tmp29 = einsum(f.aa.ov, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp26 = einsum(tmp25, (0, 1, 2, 3), r1.a, (1,), (0, 2, 3)) - del tmp25 - tmp22 = einsum(v.baa.xov, (0, 1, 2), tmp21, (0, 3), (1, 3, 2)) - del tmp21 - tmp18 = einsum(ints.tmp98, (0, 1, 2, 3), r2.bab, (1, 4, 3), (0, 4, 2)) * -1 - tmp20 = einsum(r2.aaa, (0, 1, 2), tmp19, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp19 - tmp24 = einsum(r2.aaa, (0, 1, 2), tmp23, (1, 3), (0, 3, 2)) * -1 - del tmp23 - tmp16 = einsum(r1.a, (0,), tmp15, (1, 0, 2, 3), (1, 2, 3)) - del tmp15 - tmp14 = einsum(r2.aaa, (0, 1, 2), tmp13, (3, 1), (0, 3, 2)) * -2 - del tmp13 - tmp12 = einsum(tmp11, (0, 1, 2), tmp10, (0, 3), (3, 1, 2)) * 2 - del tmp11 - tmp74 = np.copy(tmp66) - del tmp66 - tmp74 += tmp67 - del tmp67 - tmp74 += np.transpose(tmp69, (1, 0, 2)) - del tmp69 - tmp74 += np.transpose(tmp71, (1, 0, 2)) - del tmp71 - tmp74 += tmp73 - del tmp73 - tmp75 = np.copy(ints.tmp199) - del ints.tmp199 - tmp75 += np.transpose(ints.tmp204, (0, 2, 1, 3)) * -1 - del ints.tmp204 - tmp45 = np.copy(tmp43) * 0.5 - del tmp43 - tmp45 += tmp44 - del tmp44 - tmp54 = np.copy(np.transpose(ints.tmp176, (1, 0))) * 2 - del ints.tmp176 - tmp54 += np.transpose(ints.tmp178, (1, 0)) - del ints.tmp178 - tmp54 += f.bb.vv * -1 - tmp54 += tmp53 - del tmp53 - tmp65 = np.copy(tmp57) * 2 - del tmp57 - tmp65 += np.transpose(tmp58, (1, 0, 2)) * -2 - del tmp58 - tmp65 += np.transpose(tmp60, (1, 0, 2)) - del tmp60 - tmp65 += np.transpose(tmp62, (1, 0, 2)) * -2 - del tmp62 - tmp65 += tmp64 - del tmp64 - tmp56 = np.copy(ints.tmp170) - del ints.tmp170 - tmp56 += ints.tmp173 * 2 - del ints.tmp173 - tmp56 += ints.tmp174 - del ints.tmp174 - tmp56 += ints.tmp184 * 2 - del ints.tmp184 - tmp56 += ints.tmp189 - del ints.tmp189 - tmp56 += f.bb.ov * -1 - tmp56 += ints.tmp156 * -1 - del ints.tmp156 - tmp56 += ints.tmp157 * -2 - del ints.tmp157 - tmp56 += ints.tmp183 * -1 - del ints.tmp183 - tmp56 += ints.tmp185 * -1 - del ints.tmp185 - tmp76 = np.copy(ints.tmp197) - del ints.tmp197 - tmp76 += np.transpose(ints.tmp220, (1, 2, 0, 3)) * -1 - del ints.tmp220 - tmp55 = np.copy(ints.tmp153) - del ints.tmp153 - tmp55 += np.transpose(ints.tmp160, (1, 0, 2, 3)) - del ints.tmp160 - tmp55 += np.transpose(ints.tmp161, (1, 0, 2, 3)) * 2 - del ints.tmp161 - tmp55 += np.transpose(ints.tmp172, (1, 0, 2, 3)) - del ints.tmp172 - tmp55 += ints.tmp4 - tmp55 += ints.tmp159 * -1 - del ints.tmp159 - tmp55 += ints.tmp175 * -1 - del ints.tmp175 - tmp51 = np.copy(ints.tmp123) - tmp51 += ints.tmp125 - tmp33 = np.copy(tmp31) - del tmp31 - tmp33 += tmp32 * -0.5 - del tmp32 - tmp50 = np.copy(ints.tmp180) - del ints.tmp180 - tmp50 += ints.tmp190 * -1 - del ints.tmp190 - tmp52 = np.copy(ints.tmp51) * 2 - del ints.tmp51 - tmp52 += ints.tmp54 - del ints.tmp54 - tmp52 += v.bbb.xov - tmp47 = np.copy(f.bb.oo) - tmp47 += ints.tmp36 - tmp47 += np.transpose(ints.tmp52, (1, 0)) * 2 - tmp47 += np.transpose(ints.tmp55, (1, 0)) - tmp48 = np.copy(f.aa.oo) - tmp48 += ints.tmp1 - tmp48 += np.transpose(ints.tmp27, (1, 0)) * 2 - tmp48 += np.transpose(ints.tmp30, (1, 0)) - tmp38 = np.copy(ints.tmp123) - del ints.tmp123 - tmp38 += ints.tmp125 - del ints.tmp125 - tmp36 = np.copy(ints.tmp113) - del ints.tmp113 - tmp36 += ints.tmp94 * 2 - del ints.tmp94 - tmp35 = np.copy(ints.tmp111) - del ints.tmp111 - tmp35 += ints.tmp66 * 2 - del ints.tmp66 - tmp35 += ints.tmp75 - del ints.tmp75 - tmp35 += ints.tmp82 * 2 - del ints.tmp82 - tmp35 += ints.tmp83 - del ints.tmp83 - tmp35 += f.aa.ov * -1 - tmp35 += ints.tmp61 * -1 - del ints.tmp61 - tmp35 += ints.tmp67 * -1 - del ints.tmp67 - tmp35 += ints.tmp78 * -2 - del ints.tmp78 - tmp35 += ints.tmp79 * -1 - del ints.tmp79 - tmp30 = np.copy(np.transpose(ints.tmp90, (1, 0))) * 2 - del ints.tmp90 - tmp30 += np.transpose(ints.tmp92, (1, 0)) - del ints.tmp92 - tmp30 += f.aa.vv * -1 - tmp30 += tmp29 - del tmp29 - tmp42 = np.copy(ints.tmp26) * 2 - del ints.tmp26 - tmp42 += ints.tmp29 - del ints.tmp29 - tmp42 += v.baa.xov - tmp46 = np.copy(ints.tmp121) - del ints.tmp121 - tmp46 += np.transpose(ints.tmp128, (0, 2, 1, 3)) - del ints.tmp128 - tmp46 += np.transpose(ints.tmp129, (0, 2, 1, 3)) * 2 - del ints.tmp129 - tmp46 += np.transpose(ints.tmp137, (0, 2, 1, 3)) - del ints.tmp137 - tmp46 += ints.tmp39 - tmp46 += ints.tmp127 * -1 - del ints.tmp127 - tmp46 += ints.tmp138 * -1 - del ints.tmp138 - tmp37 = np.copy(ints.tmp141) - del ints.tmp141 - tmp37 += ints.tmp148 * -1 - del ints.tmp148 - tmp41 = np.copy(tmp39) * -0.5 - del tmp39 - tmp41 += tmp40 - del tmp40 - tmp27 = np.copy(tmp18) - del tmp18 - tmp27 += np.transpose(tmp20, (1, 0, 2)) * -2 - del tmp20 - tmp27 += np.transpose(tmp22, (1, 0, 2)) - del tmp22 - tmp27 += np.transpose(tmp24, (1, 0, 2)) * -2 - del tmp24 - tmp27 += tmp26 - del tmp26 - tmp17 = np.copy(np.transpose(tmp12, (1, 0, 2))) - del tmp12 - tmp17 += np.transpose(tmp14, (1, 0, 2)) - del tmp14 - tmp17 += tmp16 - del tmp16 - tmp28 = np.copy(ints.tmp72) - del ints.tmp72 - tmp28 += np.transpose(ints.tmp80, (0, 2, 1, 3)) * -1 - del ints.tmp80 - tmp34 = np.copy(ints.tmp103) - del ints.tmp103 - tmp34 += np.transpose(ints.tmp69, (2, 0, 1, 3)) * -1 - del ints.tmp69 - tmp3 = np.copy(f.aa.ov) - tmp3 += ints.tmp14 - del ints.tmp14 - tmp3 += ints.tmp19 - del ints.tmp19 - tmp3 += ints.tmp12 * -1 - del ints.tmp12 - tmp7 = np.copy(f.bb.oo) - tmp7 += ints.tmp36 - del ints.tmp36 - tmp7 += np.transpose(ints.tmp42, (1, 0)) - del ints.tmp42 - tmp7 += np.transpose(ints.tmp43, (1, 0)) - del ints.tmp43 - tmp7 += np.transpose(ints.tmp52, (1, 0)) * 2 - del ints.tmp52 - tmp7 += np.transpose(ints.tmp55, (1, 0)) - del ints.tmp55 - tmp7 += np.transpose(ints.tmp58, (1, 0)) - del ints.tmp58 - tmp7 += np.transpose(ints.tmp59, (1, 0)) - del ints.tmp59 - tmp7 += np.transpose(ints.tmp41, (1, 0)) * -1 - del ints.tmp41 - tmp7 += np.transpose(ints.tmp57, (1, 0)) * -1 - del ints.tmp57 - tmp5 = np.copy(ints.tmp37) - del ints.tmp37 - tmp5 += ints.tmp47 * -1 - del ints.tmp47 - tmp2 = np.copy(f.bb.ov) - tmp2 += ints.tmp18 - del ints.tmp18 - tmp2 += ints.tmp21 - del ints.tmp21 - tmp2 += ints.tmp17 * -1 - del ints.tmp17 - tmp6 = np.copy(ints.tmp39) - del ints.tmp39 - tmp6 += ints.tmp49 - del ints.tmp49 - tmp4 = np.copy(f.aa.oo) - tmp4 += np.transpose(ints.tmp11, (1, 0)) - del ints.tmp11 - tmp4 += ints.tmp1 - del ints.tmp1 - tmp4 += np.transpose(ints.tmp27, (1, 0)) * 2 - del ints.tmp27 - tmp4 += np.transpose(ints.tmp30, (1, 0)) - del ints.tmp30 - tmp4 += np.transpose(ints.tmp33, (1, 0)) - del ints.tmp33 - tmp4 += np.transpose(ints.tmp34, (1, 0)) - del ints.tmp34 - tmp4 += np.transpose(ints.tmp9, (1, 0)) - del ints.tmp9 - tmp4 += np.transpose(ints.tmp32, (1, 0)) * -1 - del ints.tmp32 - tmp4 += np.transpose(ints.tmp7, (1, 0)) * -1 - del ints.tmp7 - tmp1 = np.copy(ints.tmp24) - del ints.tmp24 - tmp1 += ints.tmp4 - del ints.tmp4 - tmp0 = np.copy(ints.tmp22) - del ints.tmp22 - tmp0 += ints.tmp2 * -1 - del ints.tmp2 - r2new.bbb = np.copy(tmp65) - r2new.bbb += np.transpose(tmp65, (1, 0, 2)) * -1 - del tmp65 - r2new.bbb += tmp74 * -1 - r2new.bbb += np.transpose(tmp74, (1, 0, 2)) - del tmp74 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp75, (3, 4, 1, 0), (3, 4, 2)) * -2 - del tmp75 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp54, (2, 3), (0, 1, 3)) * -2 - r2new.bbb += einsum(tmp45, (0,), t2.bbbb, (1, 2, 3, 0), (1, 2, 3)) * -4 - r2new.bbb += einsum(tmp76, (0, 1, 2, 3), r1.b, (2,), (1, 0, 3)) * 2 - del tmp76 - r2new.bbb += einsum(tmp56, (0, 1), r1.b, (2,), (2, 0, 1)) * -1 - r2new.bbb += einsum(tmp56, (0, 1), r1.b, (2,), (0, 2, 1)) - r2new.bab = einsum(r2.aaa, (0, 1, 2), ints.tmp163, (1, 3, 2, 4), (3, 0, 4)) * 2 - del ints.tmp163 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp49, (3, 0, 4, 2), (3, 1, 4)) * -1 - del tmp49 - r2new.bab += einsum(tmp50, (0, 1, 2, 3), r2.bab, (4, 1, 3), (4, 0, 2)) - del tmp50 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp51, (3, 1, 4, 0), (4, 3, 2)) - del tmp51 - r2new.bab += einsum(tmp52, (0, 1, 2), tmp10, (0, 3), (1, 3, 2)) * -1 - del tmp10, tmp52 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp54, (2, 3), (0, 1, 3)) * -1 - del tmp54 - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp33, (2,), (1, 0, 3)) * -2 - r2new.bab += einsum(tmp55, (0, 1, 2, 3), r1.a, (1,), (2, 0, 3)) - del tmp55 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp47, (0, 3), (3, 1, 2)) * -1 - r2new.bab += einsum(tmp48, (0, 1), r2.bab, (2, 0, 3), (2, 1, 3)) * -1 - r2new.bab += einsum(tmp56, (0, 1), r1.a, (2,), (0, 2, 1)) - del tmp56 - r2new.aba = einsum(ints.tmp98, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (0, 4, 2)) * 2 - del ints.tmp98 - r2new.aba += einsum(tmp36, (0, 1, 2, 3), r2.aba, (1, 4, 3), (0, 4, 2)) * -1 - del tmp36 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp37, (3, 1, 4, 2), (0, 3, 4)) - del tmp37 - r2new.aba += einsum(tmp38, (0, 1, 2, 3), r2.aba, (1, 3, 4), (0, 2, 4)) - del tmp38 - r2new.aba += einsum(tmp41, (0, 1), tmp42, (0, 2, 3), (2, 1, 3)) * -2 - del tmp41, tmp42 - r2new.aba += einsum(tmp30, (0, 1), r2.aba, (2, 3, 0), (2, 3, 1)) * -1 - r2new.aba += einsum(t2.abab, (0, 1, 2, 3), tmp45, (3,), (0, 1, 2)) * -2 - del tmp45 - r2new.aba += einsum(tmp46, (0, 1, 2, 3), r1.b, (2,), (0, 1, 3)) - del tmp46 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp47, (1, 3), (0, 3, 2)) * -1 - del tmp47 - r2new.aba += einsum(tmp48, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - del tmp48 - r2new.aba += einsum(r1.b, (0,), tmp35, (1, 2), (1, 0, 2)) - r2new.aaa = np.copy(tmp17) * -1 - r2new.aaa += np.transpose(tmp17, (1, 0, 2)) - del tmp17 - r2new.aaa += tmp27 - r2new.aaa += np.transpose(tmp27, (1, 0, 2)) * -1 - del tmp27 - r2new.aaa += einsum(tmp28, (0, 1, 2, 3), r2.aaa, (2, 3, 4), (0, 1, 4)) * 2 - del tmp28 - r2new.aaa += einsum(tmp30, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp30 - r2new.aaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp33, (3,), (0, 1, 2)) * -4 - del tmp33 - r2new.aaa += einsum(tmp34, (0, 1, 2, 3), r1.a, (0,), (2, 1, 3)) * -2 - del tmp34 - r2new.aaa += einsum(tmp35, (0, 1), r1.a, (2,), (2, 0, 1)) * -1 - r2new.aaa += einsum(tmp35, (0, 1), r1.a, (2,), (0, 2, 1)) - del tmp35 - r1new.b = einsum(tmp5, (0, 1, 2, 3), r2.bbb, (1, 2, 3), (0,)) * -2 - del tmp5 - r1new.b += einsum(r2.aba, (0, 1, 2), tmp6, (0, 3, 1, 2), (3,)) - del tmp6 - r1new.b += einsum(tmp3, (0, 1), r2.aba, (0, 2, 1), (2,)) * -1 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp2, (1, 2), (0,)) * 2 - r1new.b += einsum(tmp7, (0, 1), r1.b, (0,), (1,)) * -1 - del tmp7 - r1new.a = einsum(tmp0, (0, 1, 2, 3), r2.aaa, (1, 2, 3), (0,)) * 2 - del tmp0 - r1new.a += einsum(tmp1, (0, 1, 2, 3), r2.bab, (2, 1, 3), (0,)) - del tmp1 - r1new.a += einsum(tmp2, (0, 1), r2.bab, (0, 2, 1), (2,)) * -1 - del tmp2 - r1new.a += einsum(tmp3, (0, 1), r2.aaa, (2, 0, 1), (2,)) * 2 - del tmp3 - r1new.a += einsum(r1.a, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:59:58.647334. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp106 : array - tmp107 : array - tmp109 : array - tmp11 : array - tmp110 : array - tmp112 : array - tmp113 : array - tmp114 : array - tmp116 : array - tmp122 : array - tmp125 : array - tmp126 : array - tmp13 : array - tmp132 : array - tmp136 : array - tmp138 : array - tmp139 : array - tmp140 : array - tmp15 : array - tmp151 : array - tmp154 : array - tmp155 : array - tmp157 : array - tmp163 : array - tmp164 : array - tmp166 : array - tmp167 : array - tmp168 : array - tmp170 : array - tmp172 : array - tmp173 : array - tmp174 : array - tmp176 : array - tmp177 : array - tmp179 : array - tmp18 : array - tmp180 : array - tmp181 : array - tmp182 : array - tmp183 : array - tmp187 : array - tmp19 : array - tmp190 : array - tmp199 : array - tmp2 : array - tmp20 : array - tmp201 : array - tmp203 : array - tmp216 : array - tmp22 : array - tmp224 : array - tmp23 : array - tmp26 : array - tmp29 : array - tmp30 : array - tmp32 : array - tmp33 : array - tmp4 : array - tmp40 : array - tmp42 : array - tmp44 : array - tmp46 : array - tmp47 : array - tmp51 : array - tmp56 : array - tmp57 : array - tmp59 : array - tmp60 : array - tmp67 : array - tmp68 : array - tmp7 : array - tmp74 : array - tmp76 : array - tmp78 : array - tmp82 : array - tmp85 : array - tmp9 : array - tmp91 : array - tmp93 : array - tmp96 : array - tmp98 : array - tmp99 : array - """ - - tmp175 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp59 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp40 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp56 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp51 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp23 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp2 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp156 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp164 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp26 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp42 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp29 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp32 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp97 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp4 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp107 = einsum(f.aa.ov, (0, 1), t1.aa, (2, 1), (0, 2)) - tmp95 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp6 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp45 = einsum(t1.bb, (0, 1), v.bbb.xvv, (2, 3, 1), (2, 0, 3)) - tmp10 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 0, 1), (2,)) - tmp17 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 3, 1), (2, 0, 3)) - tmp12 = einsum(t1.aa, (0, 1), v.baa.xov, (2, 3, 1), (2, 0, 3)) - tmp8 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp224 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp216 = einsum(t2.bbbb, (0, 1, 2, 3), tmp175, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp203 = einsum(v.bbb.xvv, (0, 1, 2), tmp59, (0, 3, 4), (3, 4, 1, 2)) - tmp201 = einsum(tmp40, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 2), (4, 5, 3, 1)) - tmp199 = einsum(tmp56, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp190 = einsum(t2.bbbb, (0, 1, 2, 3), tmp51, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp187 = einsum(t2.abab, (0, 1, 2, 3), tmp23, (0, 4, 5, 2), (4, 1, 5, 3)) - tmp183 = einsum(tmp56, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp182 = einsum(t2.abab, (0, 1, 2, 3), tmp2, (0, 4, 2, 5), (1, 5, 4, 3)) - tmp181 = einsum(v.baa.xvv, (0, 1, 2), tmp59, (0, 3, 4), (3, 1, 2, 4)) - tmp180 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp179 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp177 = einsum(t2.abab, (0, 1, 2, 3), tmp156, (0, 4, 1, 2), (4, 3)) - tmp176 = einsum(t2.bbbb, (0, 1, 2, 3), tmp175, (4, 0, 1, 3), (4, 2)) - del tmp175 - tmp174 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp173 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp172 = einsum(t1.bb, (0, 1), tmp164, (0, 2), (2, 1)) - tmp170 = einsum(tmp59, (0, 1, 2), v.bbb.xov, (0, 3, 2), (1, 3)) - tmp168 = einsum(tmp56, (0, 1, 2), v.bbb.xov, (0, 3, 2), (1, 3)) - tmp167 = einsum(tmp59, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) - tmp166 = einsum(tmp56, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) * -1 - tmp163 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp157 = einsum(t2.abab, (0, 1, 2, 3), tmp156, (0, 4, 1, 5), (4, 2, 5, 3)) - del tmp156 - tmp155 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp154 = einsum(t2.abab, (0, 1, 2, 3), tmp26, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp151 = einsum(t2.abab, (0, 1, 2, 3), tmp42, (0, 4, 5, 3), (1, 2, 4, 5)) - tmp140 = einsum(v.bbb.xvv, (0, 1, 2), tmp29, (0, 3, 4), (3, 4, 1, 2)) - tmp139 = einsum(tmp40, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 5, 3, 1)) - tmp138 = einsum(v.bbb.xvv, (0, 1, 2), tmp32, (0, 3, 4), (3, 4, 1, 2)) - tmp136 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp132 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp126 = einsum(tmp97, (0, 1, 2, 3), t2.abab, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp125 = einsum(t2.abab, (0, 1, 2, 3), tmp26, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp122 = einsum(tmp4, (0, 1, 2, 3), t2.abab, (4, 0, 2, 5), (4, 1, 5, 3)) - tmp116 = einsum(tmp32, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp114 = einsum(tmp29, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp113 = einsum(v.baa.xvv, (0, 1, 2), tmp32, (0, 3, 2), (3, 1)) - tmp112 = einsum(tmp29, (0, 1, 2), v.baa.xvv, (0, 3, 2), (1, 3)) * -1 - tmp110 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp109 = einsum(tmp107, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp106 = einsum(f.aa.vv, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp99 = einsum(t2.aaaa, (0, 1, 2, 3), tmp95, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp98 = einsum(tmp97, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - del tmp97 - tmp96 = einsum(tmp95, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) - del tmp95 - tmp93 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp91 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp85 = einsum(t2.abab, (0, 1, 2, 3), tmp51, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp82 = einsum(tmp23, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp78 = einsum(tmp32, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp76 = einsum(t2.aaaa, (0, 1, 2, 3), tmp2, (1, 4, 3, 5), (0, 2, 5, 4)) - tmp74 = einsum(tmp29, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp68 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp67 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp60 = einsum(v.bbb.xov, (0, 1, 2), tmp59, (0, 1, 3), (3, 2)) - tmp57 = einsum(tmp56, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp47 = einsum(tmp6, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp46 = einsum(v.bbb.xov, (0, 1, 2), tmp45, (0, 1, 3), (2, 3)) - del tmp45 - tmp44 = einsum(tmp10, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp33 = einsum(v.baa.xov, (0, 1, 2), tmp32, (0, 1, 3), (3, 2)) - tmp30 = einsum(tmp29, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp22 = einsum(tmp6, (0,), v.bbb.xov, (0, 1, 2), (1, 2)) - tmp20 = einsum(v.baa.xov, (0, 1, 2), tmp10, (0,), (1, 2)) - tmp19 = einsum(v.bbb.xov, (0, 1, 2), tmp10, (0,), (1, 2)) - tmp18 = einsum(tmp17, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - del tmp17 - tmp15 = einsum(tmp6, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp13 = einsum(v.baa.xov, (0, 1, 2), tmp12, (0, 1, 3), (3, 2)) - del tmp12 - tmp11 = einsum(v.baa.xvv, (0, 1, 2), tmp10, (0,), (1, 2)) - del tmp10 - tmp9 = einsum(v.baa.xov, (0, 1, 2), tmp8, (0, 1, 3), (2, 3)) - del tmp8 - tmp7 = einsum(tmp6, (0,), v.baa.xvv, (0, 1, 2), (1, 2)) - del tmp6 - - return {f"tmp106": tmp106, f"tmp107": tmp107, f"tmp109": tmp109, f"tmp11": tmp11, f"tmp110": tmp110, f"tmp112": tmp112, f"tmp113": tmp113, f"tmp114": tmp114, f"tmp116": tmp116, f"tmp122": tmp122, f"tmp125": tmp125, f"tmp126": tmp126, f"tmp13": tmp13, f"tmp132": tmp132, f"tmp136": tmp136, f"tmp138": tmp138, f"tmp139": tmp139, f"tmp140": tmp140, f"tmp15": tmp15, f"tmp151": tmp151, f"tmp154": tmp154, f"tmp155": tmp155, f"tmp157": tmp157, f"tmp163": tmp163, f"tmp164": tmp164, f"tmp166": tmp166, f"tmp167": tmp167, f"tmp168": tmp168, f"tmp170": tmp170, f"tmp172": tmp172, f"tmp173": tmp173, f"tmp174": tmp174, f"tmp176": tmp176, f"tmp177": tmp177, f"tmp179": tmp179, f"tmp18": tmp18, f"tmp180": tmp180, f"tmp181": tmp181, f"tmp182": tmp182, f"tmp183": tmp183, f"tmp187": tmp187, f"tmp19": tmp19, f"tmp190": tmp190, f"tmp199": tmp199, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp201": tmp201, f"tmp203": tmp203, f"tmp216": tmp216, f"tmp22": tmp22, f"tmp224": tmp224, f"tmp23": tmp23, f"tmp26": tmp26, f"tmp29": tmp29, f"tmp30": tmp30, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp42": tmp42, f"tmp44": tmp44, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp51": tmp51, f"tmp56": tmp56, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp60": tmp60, f"tmp67": tmp67, f"tmp68": tmp68, f"tmp7": tmp7, f"tmp74": tmp74, f"tmp76": tmp76, f"tmp78": tmp78, f"tmp82": tmp82, f"tmp85": tmp85, f"tmp9": tmp9, f"tmp91": tmp91, f"tmp93": tmp93, f"tmp96": tmp96, f"tmp98": tmp98, f"tmp99": tmp99} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:59:58.746642. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp13 = einsum(r2.aaa, (0, 1, 2), v.baa.xov, (3, 2, 1), (3, 0)) - tmp14 = einsum(r2.bab, (0, 1, 2), v.bbb.xov, (3, 2, 0), (3, 1)) * -1 - tmp50 = np.copy(ints.tmp155) - del ints.tmp155 - tmp50 += ints.tmp190 * 2 - del ints.tmp190 - tmp39 = einsum(v.bbb.xov, (0, 1, 2), r2.bbb, (3, 2, 1), (0, 3)) - tmp38 = einsum(v.baa.xov, (0, 1, 2), r2.aba, (2, 3, 1), (0, 3)) - tmp71 = np.copy(ints.tmp59) - tmp71 += ints.tmp56 * 2 - tmp73 = np.copy(ints.tmp40) - tmp73 += ints.tmp201 * 2 - del ints.tmp201 - tmp62 = np.copy(ints.tmp56) * 2 - tmp62 += ints.tmp59 - tmp66 = np.copy(ints.tmp199) - del ints.tmp199 - tmp66 += ints.tmp203 * 0.5 - del ints.tmp203 - tmp59 = einsum(f.bb.ov, (0, 1), r2.bbb, (2, 1, 3), (0, 3, 2)) - tmp64 = np.copy(np.transpose(ints.tmp57, (1, 0))) - tmp64 += np.transpose(ints.tmp60, (1, 0)) * 0.5 - tmp64 += f.bb.vv * -0.5 - tmp24 = np.copy(ints.tmp93) - tmp24 += ints.tmp82 * 2 - tmp28 = np.copy(ints.tmp2) - tmp28 += ints.tmp76 * 2 - del ints.tmp76 - tmp26 = np.copy(tmp13) * 2 - tmp26 += tmp14 - tmp18 = np.copy(np.transpose(ints.tmp30, (1, 0))) - tmp18 += np.transpose(ints.tmp33, (1, 0)) * 0.5 - tmp18 += f.aa.vv * -0.5 - tmp16 = np.copy(ints.tmp29) * 2 - tmp16 += ints.tmp32 - tmp15 = np.copy(tmp13) - tmp15 += tmp14 * 0.5 - tmp11 = einsum(r2.aaa, (0, 1, 2), f.aa.ov, (3, 1), (3, 2, 0)) - tmp20 = np.copy(ints.tmp74) - del ints.tmp74 - tmp20 += ints.tmp78 * 0.5 - del ints.tmp78 - tmp70 = einsum(r2.bbb, (0, 1, 2), tmp50, (3, 2, 4, 1), (3, 0, 4)) * -1 - tmp69 = einsum(v.bbb.xov, (0, 1, 2), tmp39, (0, 3), (1, 3, 2)) - tmp72 = einsum(tmp38, (0, 1), tmp71, (0, 2, 3), (2, 1, 3)) - del tmp71 - tmp74 = einsum(r1.b, (0,), tmp73, (1, 2, 0, 3), (1, 2, 3)) - del tmp73 - tmp63 = einsum(tmp62, (0, 1, 2), tmp39, (0, 3), (1, 3, 2)) * 2 - del tmp62 - tmp58 = einsum(r2.aba, (0, 1, 2), ints.tmp187, (2, 3, 0, 4), (3, 4, 1)) - tmp61 = einsum(v.bbb.xov, (0, 1, 2), tmp38, (0, 3), (1, 3, 2)) - tmp67 = einsum(r1.b, (0,), tmp66, (1, 2, 0, 3), (1, 2, 3)) * 2 - del tmp66 - tmp60 = einsum(t1.bb, (0, 1), tmp59, (0, 2, 3), (2, 3, 1)) - del tmp59 - tmp65 = einsum(r2.bbb, (0, 1, 2), tmp64, (1, 3), (2, 0, 3)) * -4 - del tmp64 - tmp8 = einsum(ints.tmp51, (0, 1, 2, 3), r2.bbb, (2, 3, 0), (1,)) - tmp7 = einsum(r2.aba, (0, 1, 2), ints.tmp26, (2, 3, 0, 1), (3,)) - tmp47 = einsum(r1.b, (0,), f.bb.ov, (1, 0), (1,)) - tmp3 = einsum(r2.aaa, (0, 1, 2), ints.tmp23, (2, 3, 1, 0), (3,)) * -1 - tmp4 = einsum(r2.bab, (0, 1, 2), ints.tmp26, (3, 2, 1, 0), (3,)) * -1 - tmp32 = einsum(f.aa.ov, (0, 1), r1.a, (1,), (0,)) - tmp45 = einsum(t1.bb, (0, 1), f.bb.ov, (0, 2), (2, 1)) - tmp43 = einsum(f.aa.ov, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp25 = einsum(tmp24, (0, 1, 2, 3), r2.aaa, (4, 3, 1), (0, 4, 2)) * -1 - del tmp24 - tmp23 = einsum(r2.bab, (0, 1, 2), ints.tmp85, (3, 2, 4, 0), (3, 4, 1)) * -1 - tmp29 = einsum(r1.a, (0,), tmp28, (1, 2, 0, 3), (1, 2, 3)) - del tmp28 - tmp27 = einsum(tmp26, (0, 1), v.baa.xov, (0, 2, 3), (2, 3, 1)) - del tmp26 - tmp19 = einsum(r2.aaa, (0, 1, 2), tmp18, (1, 3), (2, 0, 3)) * -4 - del tmp18 - tmp17 = einsum(tmp16, (0, 1, 2), tmp15, (0, 3), (1, 2, 3)) * 2 - del tmp16, tmp15 - tmp12 = einsum(t1.aa, (0, 1), tmp11, (0, 2, 3), (2, 3, 1)) - del tmp11 - tmp21 = einsum(r1.a, (0,), tmp20, (1, 2, 0, 3), (1, 2, 3)) * 2 - del tmp20 - tmp0 = np.copy(f.bb.ov) - tmp0 += ints.tmp19 - del ints.tmp19 - tmp0 += ints.tmp22 - del ints.tmp22 - tmp0 += ints.tmp18 * -1 - del ints.tmp18 - tmp1 = np.copy(f.aa.ov) - tmp1 += ints.tmp15 - del ints.tmp15 - tmp1 += ints.tmp20 - del ints.tmp20 - tmp1 += ints.tmp13 * -1 - del ints.tmp13 - tmp55 = np.copy(f.bb.oo) - tmp55 += ints.tmp164 - del ints.tmp164 - tmp55 += np.transpose(ints.tmp168, (1, 0)) * 2 - del ints.tmp168 - tmp55 += np.transpose(ints.tmp170, (1, 0)) - del ints.tmp170 - tmp75 = np.copy(tmp69) * 2 - del tmp69 - tmp75 += np.transpose(tmp70, (0, 2, 1)) * -2 - del tmp70 - tmp75 += np.transpose(tmp72, (0, 2, 1)) - del tmp72 - tmp75 += tmp74 - del tmp74 - tmp68 = np.copy(tmp58) - del tmp58 - tmp68 += tmp60 * 2 - del tmp60 - tmp68 += tmp61 - del tmp61 - tmp68 += np.transpose(tmp63, (0, 2, 1)) - del tmp63 - tmp68 += np.transpose(tmp65, (0, 2, 1)) - del tmp65 - tmp68 += tmp67 - del tmp67 - tmp57 = einsum(ints.tmp51, (0, 1, 2, 3), r2.bbb, (3, 2, 4), (0, 1, 4)) * -1 - del ints.tmp51 - tmp56 = np.copy(ints.tmp166) * 2 - del ints.tmp166 - tmp56 += ints.tmp172 - del ints.tmp172 - tmp56 += ints.tmp173 - del ints.tmp173 - tmp56 += ints.tmp176 * 2 - del ints.tmp176 - tmp56 += ints.tmp177 - del ints.tmp177 - tmp56 += f.bb.ov * -1 - tmp56 += ints.tmp163 * -1 - del ints.tmp163 - tmp56 += ints.tmp167 * -1 - del ints.tmp167 - tmp56 += ints.tmp179 * -1 - del ints.tmp179 - tmp56 += ints.tmp180 * -2 - del ints.tmp180 - tmp76 = np.copy(tmp47) * -1 - tmp76 += tmp7 - tmp76 += tmp8 * 2 - tmp51 = np.copy(ints.tmp154) - del ints.tmp154 - tmp51 += ints.tmp174 * -1 - del ints.tmp174 - tmp49 = einsum(ints.tmp26, (0, 1, 2, 3), r2.bab, (3, 2, 4), (0, 1, 4)) * -1 - tmp33 = np.copy(tmp32) * 0.5 - del tmp32 - tmp33 += tmp3 * -1 - tmp33 += tmp4 * 0.5 - tmp54 = np.copy(ints.tmp157) - del ints.tmp157 - tmp54 += np.transpose(ints.tmp181, (0, 2, 1, 3)) - del ints.tmp181 - tmp54 += np.transpose(ints.tmp183, (0, 2, 1, 3)) * 2 - del ints.tmp183 - tmp54 += ints.tmp4 - tmp54 += ints.tmp151 * -1 - del ints.tmp151 - tmp54 += np.transpose(ints.tmp182, (0, 2, 1, 3)) * -1 - del ints.tmp182 - tmp53 = np.copy(ints.tmp56) * 2 - del ints.tmp56 - tmp53 += ints.tmp59 - del ints.tmp59 - tmp53 += v.bbb.xov - tmp46 = np.copy(np.transpose(ints.tmp57, (1, 0))) * 2 - tmp46 += np.transpose(ints.tmp60, (1, 0)) - tmp46 += f.bb.vv * -1 - tmp46 += tmp45 - del tmp45 - tmp52 = np.copy(tmp13) * 2 - del tmp13 - tmp52 += tmp14 - del tmp14 - tmp44 = np.copy(np.transpose(ints.tmp30, (1, 0))) * 2 - tmp44 += np.transpose(ints.tmp33, (1, 0)) - tmp44 += f.aa.vv * -1 - tmp44 += tmp43 - del tmp43 - tmp36 = np.copy(ints.tmp82) * 2 - del ints.tmp82 - tmp36 += ints.tmp93 - del ints.tmp93 - tmp35 = einsum(r2.aba, (0, 1, 2), ints.tmp26, (3, 4, 0, 1), (3, 2, 4)) - del ints.tmp26 - tmp42 = np.copy(ints.tmp126) - del ints.tmp126 - tmp42 += np.transpose(ints.tmp138, (0, 1, 3, 2)) - del ints.tmp138 - tmp42 += np.transpose(ints.tmp140, (0, 1, 3, 2)) * 2 - del ints.tmp140 - tmp42 += ints.tmp42 - tmp42 += ints.tmp122 * -1 - del ints.tmp122 - tmp42 += np.transpose(ints.tmp139, (0, 1, 3, 2)) * -1 - del ints.tmp139 - tmp40 = np.copy(tmp38) * -1 - del tmp38 - tmp40 += tmp39 * 2 - del tmp39 - tmp34 = np.copy(ints.tmp109) - del ints.tmp109 - tmp34 += ints.tmp112 * 2 - del ints.tmp112 - tmp34 += ints.tmp91 - del ints.tmp91 - tmp34 += ints.tmp96 * 2 - del ints.tmp96 - tmp34 += ints.tmp98 - del ints.tmp98 - tmp34 += f.aa.ov * -1 - tmp34 += ints.tmp106 * -1 - del ints.tmp106 - tmp34 += ints.tmp113 * -1 - del ints.tmp113 - tmp34 += ints.tmp67 * -2 - del ints.tmp67 - tmp34 += ints.tmp68 * -1 - del ints.tmp68 - tmp31 = np.copy(f.aa.oo) - tmp31 += ints.tmp107 - del ints.tmp107 - tmp31 += np.transpose(ints.tmp114, (1, 0)) * 2 - del ints.tmp114 - tmp31 += np.transpose(ints.tmp116, (1, 0)) - del ints.tmp116 - tmp37 = np.copy(ints.tmp125) - del ints.tmp125 - tmp37 += ints.tmp136 * -1 - del ints.tmp136 - tmp41 = np.copy(ints.tmp32) - del ints.tmp32 - tmp41 += v.baa.xov - tmp41 += ints.tmp29 * 2 - del ints.tmp29 - tmp48 = np.copy(tmp47) * -0.5 - del tmp47 - tmp48 += tmp7 * 0.5 - tmp48 += tmp8 - tmp30 = np.copy(tmp23) - del tmp23 - tmp30 += np.transpose(tmp25, (0, 2, 1)) * -2 - del tmp25 - tmp30 += np.transpose(tmp27, (0, 2, 1)) - del tmp27 - tmp30 += tmp29 - del tmp29 - tmp22 = np.copy(tmp12) * 2 - del tmp12 - tmp22 += tmp17 - del tmp17 - tmp22 += np.transpose(tmp19, (0, 2, 1)) - del tmp19 - tmp22 += tmp21 - del tmp21 - tmp10 = einsum(ints.tmp23, (0, 1, 2, 3), r2.aaa, (2, 3, 4), (0, 1, 4)) - del ints.tmp23 - tmp9 = np.copy(tmp7) - del tmp7 - tmp9 += tmp8 * 2 - del tmp8 - tmp9 += einsum(r1.b, (0,), tmp0, (1, 0), (1,)) * -1 - tmp6 = np.copy(ints.tmp46) - del ints.tmp46 - tmp6 += np.transpose(ints.tmp57, (1, 0)) * 2 - del ints.tmp57 - tmp6 += np.transpose(ints.tmp60, (1, 0)) - del ints.tmp60 - tmp6 += f.bb.vv * -1 - tmp6 += np.transpose(ints.tmp44, (1, 0)) * -1 - del ints.tmp44 - tmp6 += np.transpose(ints.tmp47, (1, 0)) * -1 - del ints.tmp47 - tmp5 = np.copy(tmp3) * -2 - del tmp3 - tmp5 += tmp4 - del tmp4 - tmp5 += einsum(tmp1, (0, 1), r1.a, (1,), (0,)) - tmp2 = np.copy(np.transpose(ints.tmp30, (1, 0))) * 2 - del ints.tmp30 - tmp2 += np.transpose(ints.tmp33, (1, 0)) - del ints.tmp33 - tmp2 += ints.tmp9 - del ints.tmp9 - tmp2 += f.aa.vv * -1 - tmp2 += np.transpose(ints.tmp11, (1, 0)) * -1 - del ints.tmp11 - tmp2 += np.transpose(ints.tmp7, (1, 0)) * -1 - del ints.tmp7 - r2new.bbb = einsum(ints.tmp224, (0, 1, 2, 3), r2.bbb, (3, 1, 4), (0, 2, 4)) * 2 - del ints.tmp224 - r2new.bbb += einsum(r1.b, (0,), ints.tmp216, (1, 2, 3, 0), (3, 2, 1)) * 2 - del ints.tmp216 - r2new.bbb += einsum(tmp57, (0, 1, 2), t2.bbbb, (0, 1, 3, 4), (3, 4, 2)) * 2 - del tmp57 - r2new.bbb += np.transpose(tmp68, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp68, (2, 1, 0)) - del tmp68 - r2new.bbb += np.transpose(tmp75, (1, 2, 0)) - r2new.bbb += np.transpose(tmp75, (2, 1, 0)) * -1 - del tmp75 - r2new.bbb += einsum(tmp55, (0, 1), r2.bbb, (2, 3, 0), (2, 3, 1)) * -2 - r2new.bbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp76, (1,), (2, 3, 0)) * -2 - del tmp76 - r2new.bbb += einsum(r1.b, (0,), tmp56, (1, 2), (0, 2, 1)) * -1 - r2new.bbb += einsum(tmp56, (0, 1), r1.b, (2,), (1, 2, 0)) - r2new.bab = einsum(ints.tmp187, (0, 1, 2, 3), r2.aaa, (4, 2, 0), (3, 4, 1)) * 2 - del ints.tmp187 - r2new.bab += einsum(r2.bab, (0, 1, 2), ints.tmp132, (3, 1, 4, 0), (4, 3, 2)) - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp49, (0, 1, 4), (3, 2, 4)) * -1 - del tmp49 - r2new.bab += einsum(tmp50, (0, 1, 2, 3), r2.bab, (3, 4, 1), (2, 4, 0)) * -1 - del tmp50 - r2new.bab += einsum(tmp51, (0, 1, 2, 3), r2.bab, (4, 3, 1), (4, 2, 0)) - del tmp51 - r2new.bab += einsum(tmp52, (0, 1), tmp53, (0, 2, 3), (3, 1, 2)) * -1 - del tmp52, tmp53 - r2new.bab += einsum(r1.a, (0,), tmp54, (1, 2, 0, 3), (3, 2, 1)) * -1 - del tmp54 - r2new.bab += einsum(tmp46, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp44, (1, 3), (0, 3, 2)) * -1 - r2new.bab += einsum(tmp55, (0, 1), r2.bab, (2, 3, 0), (2, 3, 1)) * -1 - del tmp55 - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp33, (0,), (3, 2, 1)) * 2 - r2new.bab += einsum(tmp56, (0, 1), r1.a, (2,), (1, 2, 0)) - del tmp56 - r2new.aba = einsum(t2.abab, (0, 1, 2, 3), tmp35, (0, 4, 1), (2, 3, 4)) - del tmp35 - r2new.aba += einsum(r2.aba, (0, 1, 2), ints.tmp132, (3, 0, 4, 1), (3, 4, 2)) - del ints.tmp132 - r2new.aba += einsum(r2.bbb, (0, 1, 2), ints.tmp85, (3, 2, 4, 1), (4, 0, 3)) * 2 - del ints.tmp85 - r2new.aba += einsum(tmp36, (0, 1, 2, 3), r2.aba, (3, 4, 1), (2, 4, 0)) * -1 - del tmp36 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp37, (3, 2, 4, 1), (0, 4, 3)) - del tmp37 - r2new.aba += einsum(tmp41, (0, 1, 2), tmp40, (0, 3), (2, 3, 1)) * -1 - del tmp41, tmp40 - r2new.aba += einsum(tmp42, (0, 1, 2, 3), r1.b, (3,), (1, 2, 0)) * -1 - del tmp42 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp44, (0, 3), (3, 1, 2)) * -1 - del tmp44 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp46, (1, 3), (0, 3, 2)) * -1 - del tmp46 - r2new.aba += einsum(tmp31, (0, 1), r2.aba, (2, 3, 0), (2, 3, 1)) * -1 - r2new.aba += einsum(t2.abab, (0, 1, 2, 3), tmp48, (1,), (2, 3, 0)) * -2 - del tmp48 - r2new.aba += einsum(r1.b, (0,), tmp34, (1, 2), (2, 0, 1)) - r2new.aaa = einsum(ints.tmp99, (0, 1, 2, 3), r1.a, (3,), (2, 1, 0)) * 2 - del ints.tmp99 - r2new.aaa += einsum(tmp10, (0, 1, 2), t2.aaaa, (0, 1, 3, 4), (3, 4, 2)) * 2 - del tmp10 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), ints.tmp110, (3, 0, 4, 1), (3, 4, 2)) * -2 - del ints.tmp110 - r2new.aaa += np.transpose(tmp22, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp22, (2, 1, 0)) - del tmp22 - r2new.aaa += np.transpose(tmp30, (1, 2, 0)) - r2new.aaa += np.transpose(tmp30, (2, 1, 0)) * -1 - del tmp30 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp31, (2, 3), (0, 1, 3)) * -2 - del tmp31 - r2new.aaa += einsum(tmp33, (0,), t2.aaaa, (1, 0, 2, 3), (2, 3, 1)) * 4 - del tmp33 - r2new.aaa += einsum(tmp34, (0, 1), r1.a, (2,), (2, 1, 0)) * -1 - r2new.aaa += einsum(r1.a, (0,), tmp34, (1, 2), (2, 0, 1)) - del tmp34 - r1new.b = einsum(r2.bbb, (0, 1, 2), ints.tmp40, (2, 3, 0, 1), (3,)) * 2 - del ints.tmp40 - r1new.b += einsum(r2.aba, (0, 1, 2), ints.tmp42, (2, 0, 3, 1), (3,)) * -1 - del ints.tmp42 - r1new.b += einsum(r2.aba, (0, 1, 2), tmp1, (2, 0), (1,)) * -1 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp0, (2, 1), (0,)) * 2 - r1new.b += einsum(tmp6, (0, 1), r1.b, (0,), (1,)) * -1 - del tmp6 - r1new.b += einsum(t1.bb, (0, 1), tmp9, (0,), (1,)) - del tmp9 - r1new.a = einsum(r2.aaa, (0, 1, 2), ints.tmp2, (2, 3, 1, 0), (3,)) * -2 - del ints.tmp2 - r1new.a += einsum(r2.bab, (0, 1, 2), ints.tmp4, (2, 3, 1, 0), (3,)) * -1 - del ints.tmp4 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp0, (2, 0), (1,)) * -1 - del tmp0 - r1new.a += einsum(r2.aaa, (0, 1, 2), tmp1, (2, 1), (0,)) * 2 - del tmp1 - r1new.a += einsum(tmp2, (0, 1), r1.a, (0,), (1,)) * -1 - del tmp2 - r1new.a += einsum(t1.aa, (0, 1), tmp5, (0,), (1,)) * -1 - del tmp5 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:03:21.725052. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp100 : array - tmp102 : array - tmp103 : array - tmp105 : array - tmp108 : array - tmp11 : array - tmp110 : array - tmp112 : array - tmp114 : array - tmp116 : array - tmp118 : array - tmp119 : array - tmp121 : array - tmp123 : array - tmp125 : array - tmp127 : array - tmp129 : array - tmp13 : array - tmp131 : array - tmp133 : array - tmp135 : array - tmp137 : array - tmp138 : array - tmp140 : array - tmp142 : array - tmp143 : array - tmp145 : array - tmp147 : array - tmp148 : array - tmp15 : array - tmp150 : array - tmp151 : array - tmp153 : array - tmp155 : array - tmp156 : array - tmp158 : array - tmp159 : array - tmp161 : array - tmp162 : array - tmp164 : array - tmp166 : array - tmp167 : array - tmp168 : array - tmp17 : array - tmp170 : array - tmp171 : array - tmp172 : array - tmp174 : array - tmp175 : array - tmp176 : array - tmp177 : array - tmp179 : array - tmp181 : array - tmp182 : array - tmp183 : array - tmp184 : array - tmp185 : array - tmp187 : array - tmp188 : array - tmp19 : array - tmp190 : array - tmp192 : array - tmp195 : array - tmp197 : array - tmp199 : array - tmp2 : array - tmp201 : array - tmp204 : array - tmp205 : array - tmp207 : array - tmp209 : array - tmp21 : array - tmp211 : array - tmp213 : array - tmp215 : array - tmp217 : array - tmp219 : array - tmp22 : array - tmp220 : array - tmp221 : array - tmp222 : array - tmp223 : array - tmp225 : array - tmp226 : array - tmp228 : array - tmp23 : array - tmp231 : array - tmp239 : array - tmp241 : array - tmp246 : array - tmp247 : array - tmp249 : array - tmp25 : array - tmp255 : array - tmp257 : array - tmp264 : array - tmp265 : array - tmp267 : array - tmp268 : array - tmp270 : array - tmp271 : array - tmp273 : array - tmp28 : array - tmp280 : array - tmp283 : array - tmp294 : array - tmp296 : array - tmp298 : array - tmp30 : array - tmp300 : array - tmp302 : array - tmp304 : array - tmp310 : array - tmp311 : array - tmp313 : array - tmp314 : array - tmp316 : array - tmp318 : array - tmp32 : array - tmp320 : array - tmp325 : array - tmp326 : array - tmp327 : array - tmp329 : array - tmp33 : array - tmp335 : array - tmp337 : array - tmp339 : array - tmp34 : array - tmp340 : array - tmp344 : array - tmp346 : array - tmp352 : array - tmp354 : array - tmp358 : array - tmp36 : array - tmp362 : array - tmp364 : array - tmp37 : array - tmp388 : array - tmp39 : array - tmp390 : array - tmp4 : array - tmp417 : array - tmp418 : array - tmp419 : array - tmp42 : array - tmp421 : array - tmp423 : array - tmp437 : array - tmp439 : array - tmp44 : array - tmp441 : array - tmp442 : array - tmp46 : array - tmp47 : array - tmp48 : array - tmp5 : array - tmp50 : array - tmp52 : array - tmp54 : array - tmp55 : array - tmp56 : array - tmp57 : array - tmp59 : array - tmp60 : array - tmp62 : array - tmp64 : array - tmp65 : array - tmp67 : array - tmp68 : array - tmp7 : array - tmp70 : array - tmp72 : array - tmp74 : array - tmp75 : array - tmp77 : array - tmp78 : array - tmp79 : array - tmp8 : array - tmp80 : array - tmp82 : array - tmp83 : array - tmp85 : array - tmp87 : array - tmp89 : array - tmp91 : array - tmp94 : array - tmp97 : array - """ - - tmp29 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp31 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 0, 1), (2,)) - tmp106 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 3, 1), (2, 0, 3)) - tmp27 = einsum(t1.aa, (0, 1), v.baa.xov, (2, 3, 1), (2, 0, 3)) - tmp170 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp325 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp47 = einsum(v.bbb.xov, (0, 1, 2), tmp29, (0,), (1, 2)) - tmp48 = einsum(tmp31, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp44 = einsum(tmp31, (0,), v.bbb.xov, (0, 1, 2), (1, 2)) - tmp107 = einsum(tmp106, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp39 = einsum(v.baa.xov, (0, 1, 2), tmp29, (0,), (1, 2)) - tmp99 = einsum(v.baa.xov, (0, 1, 2), tmp27, (0, 1, 3), (3, 2)) - tmp166 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp59 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp77 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp82 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp56 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp230 = einsum(tmp106, (0, 1, 2), tmp27, (0, 3, 4), (3, 4, 1, 2)) - tmp351 = einsum(tmp106, (0, 1, 2), tmp106, (0, 3, 4), (1, 3, 2, 4)) - tmp41 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp45 = einsum(t1.bb, (0, 1), v.bbb.xvv, (2, 3, 1), (2, 0, 3)) - tmp194 = einsum(v.bbb.xoo, (0, 1, 2), tmp27, (0, 3, 4), (3, 4, 1, 2)) - tmp196 = einsum(tmp106, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp334 = einsum(tmp106, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp171 = einsum(t2.abab, (0, 1, 2, 3), tmp170, (4, 5, 2, 3), (0, 4, 1, 5)) - tmp326 = einsum(t2.bbbb, (0, 1, 2, 3), tmp325, (4, 5, 2, 3), (0, 1, 5, 4)) * -1 - tmp54 = einsum(tmp27, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp137 = einsum(v.bbb.xov, (0, 1, 2), tmp106, (0, 3, 4), (3, 1, 4, 2)) - tmp282 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp279 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp25 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp64 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp36 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp246 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp227 = einsum(tmp27, (0, 1, 2), tmp27, (0, 3, 4), (1, 3, 2, 4)) - tmp225 = einsum(t1.bb, (0, 1), tmp47, (2, 1), (0, 2)) - tmp176 = einsum(t1.aa, (0, 1), tmp48, (2, 1), (0, 2)) - tmp221 = einsum(t1.bb, (0, 1), tmp44, (2, 1), (0, 2)) - tmp219 = einsum(tmp107, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp175 = einsum(t1.aa, (0, 1), tmp39, (2, 1), (0, 2)) - tmp174 = einsum(t1.aa, (0, 1), tmp99, (2, 1), (0, 2)) - tmp208 = einsum(tmp31, (0,), v.baa.xvv, (0, 1, 2), (1, 2)) - tmp206 = einsum(tmp29, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp203 = einsum(tmp31, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp198 = einsum(v.baa.xvv, (0, 1, 2), tmp29, (0,), (1, 2)) - tmp189 = einsum(tmp27, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp187 = einsum(v.bbb.xoo, (0, 1, 2), tmp29, (0,), (1, 2)) - tmp32 = einsum(tmp31, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - tmp183 = einsum(tmp31, (0,), v.bbb.xoo, (0, 1, 2), (1, 2)) - del tmp31 - tmp181 = einsum(tmp106, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (3, 2)) - tmp30 = einsum(tmp29, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - del tmp29 - tmp28 = einsum(tmp27, (0, 1, 2), v.baa.xoo, (0, 3, 1), (3, 2)) - tmp167 = einsum(t2.aaaa, (0, 1, 2, 3), tmp166, (4, 5, 2, 3), (0, 1, 5, 4)) * -1 - tmp60 = einsum(v.baa.xov, (0, 1, 2), tmp59, (0, 3, 2), (3, 1)) - tmp161 = einsum(v.bbb.xov, (0, 1, 2), tmp77, (0, 3, 2), (3, 1)) - tmp158 = einsum(tmp82, (0, 1, 2), v.bbb.xov, (0, 3, 2), (1, 3)) - tmp57 = einsum(tmp56, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp142 = einsum(tmp106, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp50 = einsum(tmp27, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp96 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp93 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp67 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp23 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp33 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp21 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp1 = einsum(f.aa.ov, (0, 1), t1.aa, (2, 1), (0, 2)) - tmp442 = einsum(t2.abab, (0, 1, 2, 3), tmp170, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp441 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp439 = einsum(v.bbb.xov, (0, 1, 2), tmp77, (0, 1, 3), (3, 2)) - tmp437 = einsum(tmp82, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp423 = einsum(t2.bbbb, (0, 1, 2, 3), tmp325, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp421 = einsum(t2.abab, (0, 1, 2, 3), tmp325, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp419 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp418 = einsum(t2.abab, (0, 1, 2, 3), tmp170, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp417 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp390 = einsum(v.baa.xov, (0, 1, 2), tmp59, (0, 1, 3), (3, 2)) - tmp388 = einsum(tmp56, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp364 = einsum(t2.abab, (0, 1, 2, 3), tmp166, (0, 4, 5, 2), (4, 1, 5, 3)) - tmp362 = einsum(tmp166, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp358 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp354 = einsum(tmp230, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 3, 4)) - tmp352 = einsum(tmp351, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - del tmp351 - tmp346 = einsum(tmp41, (0, 1, 2), tmp106, (0, 3, 4), (1, 3, 4, 2)) - tmp344 = einsum(tmp106, (0, 1, 2), tmp45, (0, 3, 4), (1, 3, 2, 4)) - tmp340 = einsum(tmp194, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 3, 4)) - tmp339 = einsum(tmp196, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 3, 4)) - tmp337 = einsum(t1.bb, (0, 1), tmp334, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp335 = einsum(tmp334, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) - del tmp334 - tmp329 = einsum(tmp171, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 3, 4)) - tmp327 = einsum(tmp326, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) * -1 - tmp320 = einsum(tmp54, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp318 = einsum(tmp106, (0, 1, 2), tmp77, (0, 3, 4), (1, 3, 2, 4)) - tmp316 = einsum(tmp56, (0, 1, 2), tmp106, (0, 3, 4), (1, 3, 4, 2)) - tmp314 = einsum(t2.bbbb, (0, 1, 2, 3), tmp137, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp313 = einsum(tmp137, (0, 1, 2, 3), t2.abab, (4, 2, 5, 3), (4, 0, 1, 5)) - tmp311 = einsum(tmp106, (0, 1, 2), tmp82, (0, 3, 4), (1, 3, 2, 4)) - tmp310 = einsum(tmp106, (0, 1, 2), tmp59, (0, 3, 4), (3, 1, 2, 4)) - tmp304 = einsum(t2.bbbb, (0, 1, 2, 3), tmp47, (4, 3), (0, 1, 4, 2)) - tmp302 = einsum(t2.abab, (0, 1, 2, 3), tmp47, (4, 3), (0, 1, 4, 2)) - tmp300 = einsum(tmp44, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp298 = einsum(t2.abab, (0, 1, 2, 3), tmp44, (4, 3), (0, 1, 4, 2)) - tmp296 = einsum(tmp107, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp294 = einsum(tmp107, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp283 = einsum(t2.abab, (0, 1, 2, 3), tmp282, (4, 2, 5, 3), (0, 1, 4, 5)) - del tmp282 - tmp280 = einsum(t2.bbbb, (0, 1, 2, 3), tmp279, (4, 5, 2, 3), (0, 1, 4, 5)) * -1 - del tmp279 - tmp273 = einsum(v.bbb.xoo, (0, 1, 2), tmp77, (0, 3, 4), (3, 1, 2, 4)) - tmp271 = einsum(tmp56, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp270 = einsum(tmp25, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp268 = einsum(tmp82, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp267 = einsum(tmp59, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp265 = einsum(tmp64, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 3), (4, 1, 2, 5)) - tmp264 = einsum(t2.abab, (0, 1, 2, 3), tmp64, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp257 = einsum(tmp41, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp255 = einsum(tmp45, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp249 = einsum(tmp36, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 3, 4)) - tmp247 = einsum(tmp246, (0, 1, 2, 3), t1.bb, (1, 4), (3, 0, 2, 4)) - tmp241 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (4, 3), (4, 0, 1, 2)) - tmp239 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (4, 3), (0, 4, 1, 2)) - tmp231 = einsum(tmp230, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - del tmp230 - tmp228 = einsum(t1.aa, (0, 1), tmp227, (2, 3, 4, 0), (2, 3, 4, 1)) - del tmp227 - tmp226 = einsum(tmp225, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp223 = einsum(tmp176, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp222 = einsum(t1.bb, (0, 1), tmp221, (2, 0), (2, 1)) - tmp220 = einsum(tmp219, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp217 = einsum(tmp175, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp215 = einsum(tmp174, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp213 = einsum(tmp45, (0, 1, 2), tmp27, (0, 3, 4), (3, 4, 1, 2)) - tmp211 = einsum(tmp27, (0, 1, 2), tmp41, (0, 3, 4), (1, 3, 2, 4)) - tmp209 = einsum(t1.aa, (0, 1), tmp208, (2, 1), (0, 2)) - del tmp208 - tmp207 = einsum(tmp206, (0, 1), t1.bb, (2, 1), (2, 0)) - del tmp206 - tmp205 = einsum(tmp106, (0, 1, 2), tmp45, (0, 2, 3), (1, 3)) - del tmp106 - tmp204 = einsum(t1.bb, (0, 1), tmp203, (2, 1), (0, 2)) - del tmp203 - tmp201 = einsum(tmp41, (0, 1, 2), tmp27, (0, 3, 1), (3, 2)) - tmp199 = einsum(tmp198, (0, 1), t1.aa, (2, 1), (2, 0)) - del tmp198 - tmp197 = einsum(tmp196, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - del tmp196 - tmp195 = einsum(tmp194, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - del tmp194 - tmp192 = einsum(tmp189, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp190 = einsum(tmp189, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 3, 4)) - del tmp189 - tmp188 = einsum(tmp187, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp185 = einsum(tmp32, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp184 = einsum(tmp183, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp182 = einsum(tmp181, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp179 = einsum(tmp30, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp177 = einsum(tmp28, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp172 = einsum(t1.bb, (0, 1), tmp171, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp168 = einsum(t1.aa, (0, 1), tmp167, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - tmp164 = einsum(tmp60, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp162 = einsum(t1.bb, (0, 1), tmp161, (2, 0), (2, 1)) - tmp159 = einsum(tmp158, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp156 = einsum(tmp57, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp155 = einsum(t2.abab, (0, 1, 2, 3), tmp142, (4, 5, 1, 2), (0, 4, 5, 3)) - tmp153 = einsum(tmp82, (0, 1, 2), tmp27, (0, 3, 4), (3, 4, 1, 2)) - tmp151 = einsum(tmp27, (0, 1, 2), tmp59, (0, 3, 4), (1, 3, 2, 4)) - tmp150 = einsum(t2.abab, (0, 1, 2, 3), tmp50, (4, 5, 0, 2), (4, 5, 1, 3)) - tmp148 = einsum(tmp50, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp147 = einsum(tmp27, (0, 1, 2), tmp77, (0, 3, 4), (1, 2, 3, 4)) - tmp145 = einsum(tmp27, (0, 1, 2), tmp56, (0, 3, 4), (1, 3, 2, 4)) - del tmp27 - tmp143 = einsum(t2.abab, (0, 1, 2, 3), tmp142, (0, 4, 1, 2), (4, 3)) - tmp140 = einsum(tmp54, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp138 = einsum(t2.bbbb, (0, 1, 2, 3), tmp137, (4, 1, 0, 3), (4, 2)) - tmp135 = einsum(tmp50, (0, 1, 2, 3), t2.aaaa, (2, 1, 4, 3), (0, 4)) - tmp133 = einsum(t2.abab, (0, 1, 2, 3), tmp48, (4, 2), (0, 4, 1, 3)) - tmp131 = einsum(tmp48, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp129 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (4, 2), (0, 4, 1, 3)) - tmp127 = einsum(tmp39, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp125 = einsum(t2.abab, (0, 1, 2, 3), tmp99, (4, 2), (0, 4, 1, 3)) - tmp123 = einsum(t2.aaaa, (0, 1, 2, 3), tmp99, (4, 3), (0, 1, 4, 2)) - tmp121 = einsum(t2.bbbb, (0, 1, 2, 3), tmp47, (1, 3), (0, 2)) - tmp119 = einsum(t2.abab, (0, 1, 2, 3), tmp47, (1, 3), (0, 2)) - tmp118 = einsum(t2.abab, (0, 1, 2, 3), tmp48, (0, 2), (1, 3)) - tmp116 = einsum(tmp48, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp114 = einsum(t2.bbbb, (0, 1, 2, 3), tmp44, (1, 3), (0, 2)) - tmp112 = einsum(tmp44, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp110 = einsum(t2.bbbb, (0, 1, 2, 3), tmp107, (1, 3), (0, 2)) - tmp108 = einsum(t2.abab, (0, 1, 2, 3), tmp107, (1, 3), (0, 2)) - del tmp107 - tmp105 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (0, 2), (1, 3)) - tmp103 = einsum(t2.aaaa, (0, 1, 2, 3), tmp39, (1, 3), (0, 2)) - tmp102 = einsum(t2.abab, (0, 1, 2, 3), tmp99, (0, 2), (1, 3)) - tmp100 = einsum(tmp99, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - del tmp99 - tmp97 = einsum(t2.abab, (0, 1, 2, 3), tmp96, (4, 2, 5, 3), (0, 4, 1, 5)) - del tmp96 - tmp94 = einsum(t2.aaaa, (0, 1, 2, 3), tmp93, (4, 2, 5, 3), (0, 1, 4, 5)) * -1 - del tmp93 - tmp91 = einsum(tmp59, (0, 1, 2), v.baa.xvv, (0, 3, 2), (1, 3)) - tmp89 = einsum(tmp77, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) - tmp87 = einsum(v.bbb.xvv, (0, 1, 2), tmp82, (0, 3, 2), (3, 1)) * -1 - tmp85 = einsum(v.baa.xvv, (0, 1, 2), tmp56, (0, 3, 2), (3, 1)) * -1 - tmp83 = einsum(tmp82, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp80 = einsum(v.baa.xoo, (0, 1, 2), tmp59, (0, 3, 4), (3, 1, 2, 4)) - tmp79 = einsum(t2.abab, (0, 1, 2, 3), tmp67, (4, 5, 1, 2), (0, 4, 5, 3)) - tmp78 = einsum(v.baa.xoo, (0, 1, 2), tmp77, (0, 3, 4), (1, 2, 3, 4)) - tmp75 = einsum(tmp56, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp74 = einsum(t2.abab, (0, 1, 2, 3), tmp23, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp72 = einsum(t2.aaaa, (0, 1, 2, 3), tmp23, (1, 4, 5, 3), (0, 4, 5, 2)) - tmp70 = einsum(tmp25, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp68 = einsum(t2.abab, (0, 1, 2, 3), tmp67, (0, 4, 1, 2), (4, 3)) - tmp65 = einsum(tmp64, (0, 1, 2, 3), t2.bbbb, (1, 2, 4, 3), (0, 4)) - tmp62 = einsum(tmp23, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) - tmp55 = einsum(tmp45, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp52 = einsum(tmp41, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp46 = einsum(v.bbb.xoo, (0, 1, 2), tmp45, (0, 2, 3), (1, 3)) - del tmp45 - tmp42 = einsum(tmp41, (0, 1, 2), v.baa.xoo, (0, 3, 1), (3, 2)) - del tmp41 - tmp37 = einsum(tmp36, (0, 1, 2, 3), t1.bb, (3, 4), (1, 0, 2, 4)) - tmp34 = einsum(tmp33, (0, 1, 2, 3), t1.aa, (1, 4), (3, 0, 2, 4)) - tmp22 = einsum(tmp21, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp19 = einsum(tmp1, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp17 = einsum(f.aa.ov, (0, 1), t2.abab, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp15 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (4, 3), (4, 0, 1, 2)) - tmp13 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp11 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp10 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp8 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp7 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp5 = einsum(t1.aa, (0, 1), f.aa.vv, (2, 1), (0, 2)) - tmp4 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp2 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp100": tmp100, f"tmp102": tmp102, f"tmp103": tmp103, f"tmp105": tmp105, f"tmp108": tmp108, f"tmp11": tmp11, f"tmp110": tmp110, f"tmp112": tmp112, f"tmp114": tmp114, f"tmp116": tmp116, f"tmp118": tmp118, f"tmp119": tmp119, f"tmp121": tmp121, f"tmp123": tmp123, f"tmp125": tmp125, f"tmp127": tmp127, f"tmp129": tmp129, f"tmp13": tmp13, f"tmp131": tmp131, f"tmp133": tmp133, f"tmp135": tmp135, f"tmp137": tmp137, f"tmp138": tmp138, f"tmp140": tmp140, f"tmp142": tmp142, f"tmp143": tmp143, f"tmp145": tmp145, f"tmp147": tmp147, f"tmp148": tmp148, f"tmp15": tmp15, f"tmp150": tmp150, f"tmp151": tmp151, f"tmp153": tmp153, f"tmp155": tmp155, f"tmp156": tmp156, f"tmp158": tmp158, f"tmp159": tmp159, f"tmp161": tmp161, f"tmp162": tmp162, f"tmp164": tmp164, f"tmp166": tmp166, f"tmp167": tmp167, f"tmp168": tmp168, f"tmp17": tmp17, f"tmp170": tmp170, f"tmp171": tmp171, f"tmp172": tmp172, f"tmp174": tmp174, f"tmp175": tmp175, f"tmp176": tmp176, f"tmp177": tmp177, f"tmp179": tmp179, f"tmp181": tmp181, f"tmp182": tmp182, f"tmp183": tmp183, f"tmp184": tmp184, f"tmp185": tmp185, f"tmp187": tmp187, f"tmp188": tmp188, f"tmp19": tmp19, f"tmp190": tmp190, f"tmp192": tmp192, f"tmp195": tmp195, f"tmp197": tmp197, f"tmp199": tmp199, f"tmp2": tmp2, f"tmp201": tmp201, f"tmp204": tmp204, f"tmp205": tmp205, f"tmp207": tmp207, f"tmp209": tmp209, f"tmp21": tmp21, f"tmp211": tmp211, f"tmp213": tmp213, f"tmp215": tmp215, f"tmp217": tmp217, f"tmp219": tmp219, f"tmp22": tmp22, f"tmp220": tmp220, f"tmp221": tmp221, f"tmp222": tmp222, f"tmp223": tmp223, f"tmp225": tmp225, f"tmp226": tmp226, f"tmp228": tmp228, f"tmp23": tmp23, f"tmp231": tmp231, f"tmp239": tmp239, f"tmp241": tmp241, f"tmp246": tmp246, f"tmp247": tmp247, f"tmp249": tmp249, f"tmp25": tmp25, f"tmp255": tmp255, f"tmp257": tmp257, f"tmp264": tmp264, f"tmp265": tmp265, f"tmp267": tmp267, f"tmp268": tmp268, f"tmp270": tmp270, f"tmp271": tmp271, f"tmp273": tmp273, f"tmp28": tmp28, f"tmp280": tmp280, f"tmp283": tmp283, f"tmp294": tmp294, f"tmp296": tmp296, f"tmp298": tmp298, f"tmp30": tmp30, f"tmp300": tmp300, f"tmp302": tmp302, f"tmp304": tmp304, f"tmp310": tmp310, f"tmp311": tmp311, f"tmp313": tmp313, f"tmp314": tmp314, f"tmp316": tmp316, f"tmp318": tmp318, f"tmp32": tmp32, f"tmp320": tmp320, f"tmp325": tmp325, f"tmp326": tmp326, f"tmp327": tmp327, f"tmp329": tmp329, f"tmp33": tmp33, f"tmp335": tmp335, f"tmp337": tmp337, f"tmp339": tmp339, f"tmp34": tmp34, f"tmp340": tmp340, f"tmp344": tmp344, f"tmp346": tmp346, f"tmp352": tmp352, f"tmp354": tmp354, f"tmp358": tmp358, f"tmp36": tmp36, f"tmp362": tmp362, f"tmp364": tmp364, f"tmp37": tmp37, f"tmp388": tmp388, f"tmp39": tmp39, f"tmp390": tmp390, f"tmp4": tmp4, f"tmp417": tmp417, f"tmp418": tmp418, f"tmp419": tmp419, f"tmp42": tmp42, f"tmp421": tmp421, f"tmp423": tmp423, f"tmp437": tmp437, f"tmp439": tmp439, f"tmp44": tmp44, f"tmp441": tmp441, f"tmp442": tmp442, f"tmp46": tmp46, f"tmp47": tmp47, f"tmp48": tmp48, f"tmp5": tmp5, f"tmp50": tmp50, f"tmp52": tmp52, f"tmp54": tmp54, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp60": tmp60, f"tmp62": tmp62, f"tmp64": tmp64, f"tmp65": tmp65, f"tmp67": tmp67, f"tmp68": tmp68, f"tmp7": tmp7, f"tmp70": tmp70, f"tmp72": tmp72, f"tmp74": tmp74, f"tmp75": tmp75, f"tmp77": tmp77, f"tmp78": tmp78, f"tmp79": tmp79, f"tmp8": tmp8, f"tmp80": tmp80, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp85": tmp85, f"tmp87": tmp87, f"tmp89": tmp89, f"tmp91": tmp91, f"tmp94": tmp94, f"tmp97": tmp97} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:03:21.915349. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp15 = np.copy(ints.tmp77) - tmp15 += v.bbb.xov - tmp15 += ints.tmp82 * 2 - tmp13 = np.copy(ints.tmp59) - tmp13 += v.baa.xov - tmp13 += ints.tmp56 * 2 - tmp38 = einsum(r2.bbb, (0, 1, 2), t2.bbbb, (0, 1, 3, 2), (3,)) - tmp37 = einsum(t2.abab, (0, 1, 2, 3), r2.aba, (0, 1, 2), (3,)) - tmp34 = np.copy(ints.tmp56) * 2 - del ints.tmp56 - tmp34 += ints.tmp59 - del ints.tmp59 - tmp34 += v.baa.xov - tmp16 = einsum(tmp15, (0, 1, 2), r2.bab, (1, 3, 2), (0, 3)) * -1 - tmp14 = einsum(tmp13, (0, 1, 2), r2.aaa, (3, 1, 2), (0, 3)) * -1 - del tmp13 - tmp58 = einsum(tmp15, (0, 1, 2), r2.bbb, (3, 1, 2), (0, 3)) * -1 - del tmp15 - tmp60 = np.copy(f.bb.oo) - tmp60 += np.transpose(ints.tmp21, (1, 0)) - tmp42 = np.copy(ints.tmp419) - del ints.tmp419 - tmp42 += ints.tmp423 * 2 - del ints.tmp423 - tmp54 = np.copy(ints.tmp158) * 2 - tmp54 += ints.tmp161 - tmp39 = np.copy(tmp37) * -0.5 - del tmp37 - tmp39 += tmp38 - del tmp38 - tmp51 = einsum(tmp34, (0, 1, 2), r2.aba, (1, 3, 2), (0, 3)) - tmp25 = np.copy(ints.tmp57) * 2 - tmp25 += ints.tmp60 - tmp23 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (0, 1, 3), (2,)) - tmp17 = np.copy(tmp14) * -2 - del tmp14 - tmp17 += tmp16 - del tmp16 - tmp19 = np.copy(f.aa.oo) - tmp19 += np.transpose(ints.tmp1, (1, 0)) - tmp9 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (1, 0, 3), (2,)) * -1 - tmp11 = np.copy(ints.tmp358) - tmp11 += ints.tmp362 * 2 - tmp59 = einsum(tmp58, (0, 1), v.bbb.xov, (0, 2, 3), (2, 1, 3)) * -1 - del tmp58 - tmp61 = einsum(r2.bbb, (0, 1, 2), tmp60, (1, 3), (0, 3, 2)) * -1 - del tmp60 - tmp57 = einsum(tmp42, (0, 1, 2, 3), r2.bbb, (4, 0, 2), (4, 1, 3)) * -1 - tmp46 = einsum(t1.bb, (0, 1), f.bb.ov, (0, 2), (2, 1)) - tmp49 = einsum(r1.b, (0,), ints.tmp64, (1, 0, 2, 3), (1, 2, 3)) - tmp55 = einsum(tmp54, (0, 1), r2.bbb, (2, 0, 3), (2, 1, 3)) * -2 - del tmp54 - tmp53 = einsum(tmp39, (0,), ints.tmp325, (1, 2, 3, 0), (1, 2, 3)) * 2 - del ints.tmp325 - tmp50 = einsum(ints.tmp421, (0, 1, 2, 3), r2.aba, (0, 4, 2), (1, 4, 3)) - tmp52 = einsum(tmp51, (0, 1), v.bbb.xov, (0, 2, 3), (2, 1, 3)) - del tmp51 - tmp35 = np.copy(ints.tmp77) * 0.5 - del ints.tmp77 - tmp35 += ints.tmp82 - del ints.tmp82 - tmp35 += v.bbb.xov * 0.5 - tmp29 = einsum(f.aa.ov, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp26 = einsum(r2.aaa, (0, 1, 2), tmp25, (1, 3), (0, 3, 2)) * -2 - del tmp25 - tmp22 = einsum(ints.tmp23, (0, 1, 2, 3), r1.a, (1,), (0, 2, 3)) - tmp24 = einsum(ints.tmp166, (0, 1, 2, 3), tmp23, (3,), (0, 1, 2)) - tmp18 = einsum(tmp17, (0, 1), v.baa.xov, (0, 2, 3), (2, 1, 3)) - del tmp17 - tmp20 = einsum(r2.aaa, (0, 1, 2), tmp19, (1, 3), (0, 3, 2)) * -1 - del tmp19 - tmp10 = einsum(tmp9, (0,), ints.tmp166, (1, 2, 3, 0), (1, 2, 3)) - del ints.tmp166 - tmp8 = einsum(ints.tmp364, (0, 1, 2, 3), r2.bab, (1, 4, 3), (0, 4, 2)) * -1 - tmp12 = einsum(r2.aaa, (0, 1, 2), tmp11, (1, 3, 2, 4), (0, 3, 4)) * -1 - del tmp11 - tmp63 = np.copy(ints.tmp246) - del ints.tmp246 - tmp63 += np.transpose(ints.tmp326, (2, 3, 0, 1)) * -1 - del ints.tmp326 - tmp62 = np.copy(np.transpose(tmp57, (1, 0, 2))) * -1 - del tmp57 - tmp62 += np.transpose(tmp59, (1, 0, 2)) - del tmp59 - tmp62 += np.transpose(tmp61, (1, 0, 2)) * -1 - del tmp61 - tmp47 = np.copy(ints.tmp437) * 2 - del ints.tmp437 - tmp47 += ints.tmp439 - del ints.tmp439 - tmp47 += f.bb.vv * -1 - tmp47 += np.transpose(tmp46, (1, 0)) - del tmp46 - tmp56 = einsum(f.bb.ov, (0, 1), r1.b, (2,), (0, 2, 1)) - tmp56 += tmp49 - del tmp49 - tmp56 += tmp50 - del tmp50 - tmp56 += np.transpose(tmp52, (1, 0, 2)) - del tmp52 - tmp56 += tmp53 * -1 - del tmp53 - tmp56 += np.transpose(tmp55, (1, 0, 2)) - del tmp55 - tmp45 = einsum(tmp34, (0, 1, 2), r2.aaa, (3, 1, 2), (0, 3)) * 2 - tmp45 += einsum(tmp35, (0, 1, 2), r2.bab, (1, 3, 2), (0, 3)) * -2 - tmp43 = np.copy(ints.tmp441) - del ints.tmp441 - tmp43 += np.transpose(ints.tmp442, (1, 0, 2, 3)) * -1 - del ints.tmp442 - tmp40 = np.copy(f.bb.oo) - tmp40 += ints.tmp158 * 2 - tmp40 += ints.tmp161 - tmp40 += np.transpose(ints.tmp21, (1, 0)) - tmp44 = np.copy(ints.tmp171) - tmp44 += np.transpose(ints.tmp36, (1, 0, 2, 3)) - tmp41 = np.copy(f.aa.oo) - tmp41 += np.transpose(ints.tmp1, (1, 0)) - tmp41 += ints.tmp57 * 2 - tmp41 += ints.tmp60 - tmp48 = np.copy(tmp23) - del tmp23 - tmp48 += tmp9 * 0.5 - del tmp9 - tmp36 = einsum(tmp34, (0, 1, 2), r2.aba, (1, 3, 2), (0, 3)) * -0.5 - del tmp34 - tmp36 += einsum(tmp35, (0, 1, 2), r2.bbb, (3, 1, 2), (0, 3)) * 2 - del tmp35 - tmp32 = np.copy(ints.tmp417) - del ints.tmp417 - tmp32 += np.transpose(ints.tmp418, (1, 0, 2, 3)) * -1 - del ints.tmp418 - tmp30 = np.copy(ints.tmp388) * 2 - del ints.tmp388 - tmp30 += ints.tmp390 - del ints.tmp390 - tmp30 += f.aa.vv * -1 - tmp30 += np.transpose(tmp29, (1, 0)) - del tmp29 - tmp33 = np.copy(ints.tmp171) - del ints.tmp171 - tmp33 += np.transpose(ints.tmp36, (0, 1, 3, 2)) - del ints.tmp36 - tmp31 = np.copy(ints.tmp358) - del ints.tmp358 - tmp31 += ints.tmp362 * 2 - del ints.tmp362 - tmp27 = einsum(f.aa.ov, (0, 1), r1.a, (2,), (0, 2, 1)) * -1 - tmp27 += tmp22 * -1 - del tmp22 - tmp27 += tmp24 * 2 - del tmp24 - tmp27 += np.transpose(tmp26, (1, 0, 2)) * -1 - del tmp26 - tmp21 = np.copy(tmp8) - del tmp8 - tmp21 += tmp10 - del tmp10 - tmp21 += np.transpose(tmp12, (1, 0, 2)) * -2 - del tmp12 - tmp21 += np.transpose(tmp18, (1, 0, 2)) - del tmp18 - tmp21 += np.transpose(tmp20, (1, 0, 2)) * -2 - del tmp20 - tmp28 = np.copy(ints.tmp167) - del ints.tmp167 - tmp28 += np.transpose(ints.tmp33, (2, 3, 0, 1)) * -1 - del ints.tmp33 - tmp3 = np.copy(ints.tmp100) - del ints.tmp100 - tmp3 += ints.tmp108 * 0.5 - del ints.tmp108 - tmp3 += ints.tmp135 - del ints.tmp135 - tmp3 += ints.tmp140 * 0.5 - del ints.tmp140 - tmp3 += ints.tmp156 - del ints.tmp156 - tmp3 += ints.tmp164 * 0.5 - del ints.tmp164 - tmp3 += ints.tmp179 * 0.5 - del ints.tmp179 - tmp3 += ints.tmp185 * 0.5 - del ints.tmp185 - tmp3 += ints.tmp19 * 0.5 - del ints.tmp19 - tmp3 += ints.tmp201 * 0.5 - del ints.tmp201 - tmp3 += ints.tmp217 * 0.5 - del ints.tmp217 - tmp3 += ints.tmp223 * 0.5 - del ints.tmp223 - tmp3 += ints.tmp2 * 0.5 - del ints.tmp2 - tmp3 += ints.tmp42 * 0.5 - del ints.tmp42 - tmp3 += ints.tmp62 - del ints.tmp62 - tmp3 += ints.tmp70 * 0.5 - del ints.tmp70 - tmp3 += ints.tmp85 - del ints.tmp85 - tmp3 += f.aa.ov * -0.5 - tmp3 += ints.tmp103 * -1 - del ints.tmp103 - tmp3 += ints.tmp112 * -0.5 - del ints.tmp112 - tmp3 += ints.tmp116 * -1 - del ints.tmp116 - tmp3 += ints.tmp119 * -0.5 - del ints.tmp119 - tmp3 += ints.tmp11 * -0.5 - del ints.tmp11 - tmp3 += ints.tmp177 * -0.5 - del ints.tmp177 - tmp3 += ints.tmp199 * -0.5 - del ints.tmp199 - tmp3 += ints.tmp209 * -0.5 - del ints.tmp209 - tmp3 += ints.tmp215 * -0.5 - del ints.tmp215 - tmp3 += ints.tmp39 * -0.5 - del ints.tmp39 - tmp3 += ints.tmp48 * -0.5 - del ints.tmp48 - tmp3 += ints.tmp5 * -0.5 - del ints.tmp5 - tmp3 += ints.tmp8 * -1 - del ints.tmp8 - tmp3 += ints.tmp91 * -0.5 - del ints.tmp91 - tmp7 = np.copy(f.bb.oo) - tmp7 += ints.tmp158 * 2 - del ints.tmp158 - tmp7 += ints.tmp161 - del ints.tmp161 - tmp7 += np.transpose(ints.tmp183, (1, 0)) - del ints.tmp183 - tmp7 += np.transpose(ints.tmp187, (1, 0)) - del ints.tmp187 - tmp7 += np.transpose(ints.tmp21, (1, 0)) - del ints.tmp21 - tmp7 += ints.tmp221 - del ints.tmp221 - tmp7 += ints.tmp225 - del ints.tmp225 - tmp7 += ints.tmp181 * -1 - del ints.tmp181 - tmp7 += ints.tmp219 * -1 - del ints.tmp219 - tmp5 = np.copy(ints.tmp142) - del ints.tmp142 - tmp5 += np.transpose(ints.tmp239, (0, 2, 1, 3)) - del ints.tmp239 - tmp5 += np.transpose(ints.tmp257, (0, 2, 1, 3)) - del ints.tmp257 - tmp5 += ints.tmp267 - del ints.tmp267 - tmp5 += ints.tmp271 * 2 - del ints.tmp271 - tmp5 += ints.tmp283 - del ints.tmp283 - tmp5 += ints.tmp298 - del ints.tmp298 - tmp5 += ints.tmp302 - del ints.tmp302 - tmp5 += ints.tmp310 - del ints.tmp310 - tmp5 += ints.tmp316 * 2 - del ints.tmp316 - tmp5 += ints.tmp346 - del ints.tmp346 - tmp5 += np.transpose(ints.tmp67, (0, 2, 1, 3)) - tmp5 += np.transpose(ints.tmp249, (0, 2, 1, 3)) * -1 - del ints.tmp249 - tmp5 += ints.tmp264 * -1 - del ints.tmp264 - tmp5 += ints.tmp270 * -1 - del ints.tmp270 - tmp5 += ints.tmp294 * -1 - del ints.tmp294 - tmp5 += ints.tmp313 * -1 - del ints.tmp313 - tmp5 += ints.tmp320 * -1 - del ints.tmp320 - tmp5 += ints.tmp329 * -1 - del ints.tmp329 - tmp5 += ints.tmp339 * -1 - del ints.tmp339 - tmp5 += np.transpose(ints.tmp340, (0, 2, 1, 3)) * -1 - del ints.tmp340 - tmp5 += ints.tmp354 * -1 - del ints.tmp354 - tmp2 = np.copy(ints.tmp102) * 0.5 - del ints.tmp102 - tmp2 += ints.tmp110 - del ints.tmp110 - tmp2 += ints.tmp138 - del ints.tmp138 - tmp2 += ints.tmp143 * 0.5 - del ints.tmp143 - tmp2 += ints.tmp159 - del ints.tmp159 - tmp2 += ints.tmp162 * 0.5 - del ints.tmp162 - tmp2 += ints.tmp184 * 0.5 - del ints.tmp184 - tmp2 += ints.tmp188 * 0.5 - del ints.tmp188 - tmp2 += ints.tmp205 * 0.5 - del ints.tmp205 - tmp2 += ints.tmp222 * 0.5 - del ints.tmp222 - tmp2 += ints.tmp226 * 0.5 - del ints.tmp226 - tmp2 += ints.tmp22 * 0.5 - del ints.tmp22 - tmp2 += ints.tmp46 * 0.5 - del ints.tmp46 - tmp2 += ints.tmp4 * 0.5 - del ints.tmp4 - tmp2 += ints.tmp65 - del ints.tmp65 - tmp2 += ints.tmp68 * 0.5 - del ints.tmp68 - tmp2 += ints.tmp87 - del ints.tmp87 - tmp2 += f.bb.ov * -0.5 - tmp2 += ints.tmp105 * -0.5 - del ints.tmp105 - tmp2 += ints.tmp10 * -0.5 - del ints.tmp10 - tmp2 += ints.tmp114 * -1 - del ints.tmp114 - tmp2 += ints.tmp118 * -0.5 - del ints.tmp118 - tmp2 += ints.tmp121 * -1 - del ints.tmp121 - tmp2 += ints.tmp13 * -1 - del ints.tmp13 - tmp2 += ints.tmp182 * -0.5 - del ints.tmp182 - tmp2 += ints.tmp204 * -0.5 - del ints.tmp204 - tmp2 += ints.tmp207 * -0.5 - del ints.tmp207 - tmp2 += ints.tmp220 * -0.5 - del ints.tmp220 - tmp2 += ints.tmp44 * -0.5 - del ints.tmp44 - tmp2 += ints.tmp47 * -0.5 - del ints.tmp47 - tmp2 += ints.tmp7 * -0.5 - del ints.tmp7 - tmp2 += ints.tmp89 * -0.5 - del ints.tmp89 - tmp6 = np.copy(np.transpose(ints.tmp241, (1, 2, 0, 3))) - del ints.tmp241 - tmp6 += np.transpose(ints.tmp247, (0, 2, 1, 3)) - del ints.tmp247 - tmp6 += np.transpose(ints.tmp255, (0, 2, 1, 3)) - del ints.tmp255 - tmp6 += ints.tmp268 * 2 - del ints.tmp268 - tmp6 += ints.tmp273 - del ints.tmp273 - tmp6 += ints.tmp300 - del ints.tmp300 - tmp6 += ints.tmp304 - del ints.tmp304 - tmp6 += ints.tmp314 * 2 - del ints.tmp314 - tmp6 += ints.tmp327 - del ints.tmp327 - tmp6 += ints.tmp335 - del ints.tmp335 - tmp6 += ints.tmp352 - del ints.tmp352 - tmp6 += ints.tmp137 * -1 - del ints.tmp137 - tmp6 += ints.tmp265 * -2 - del ints.tmp265 - tmp6 += ints.tmp280 * -1 - del ints.tmp280 - tmp6 += ints.tmp296 * -1 - del ints.tmp296 - tmp6 += ints.tmp311 * -2 - del ints.tmp311 - tmp6 += ints.tmp318 * -1 - del ints.tmp318 - tmp6 += np.transpose(ints.tmp337, (0, 2, 1, 3)) * -1 - del ints.tmp337 - tmp6 += ints.tmp344 * -1 - del ints.tmp344 - tmp6 += np.transpose(ints.tmp64, (1, 2, 0, 3)) * -1 - del ints.tmp64 - tmp4 = np.copy(f.aa.oo) - tmp4 += ints.tmp175 - del ints.tmp175 - tmp4 += ints.tmp176 - del ints.tmp176 - tmp4 += np.transpose(ints.tmp1, (1, 0)) - del ints.tmp1 - tmp4 += np.transpose(ints.tmp30, (1, 0)) - del ints.tmp30 - tmp4 += np.transpose(ints.tmp32, (1, 0)) - del ints.tmp32 - tmp4 += ints.tmp57 * 2 - del ints.tmp57 - tmp4 += ints.tmp60 - del ints.tmp60 - tmp4 += ints.tmp174 * -1 - del ints.tmp174 - tmp4 += ints.tmp28 * -1 - del ints.tmp28 - tmp1 = np.copy(ints.tmp127) - del ints.tmp127 - tmp1 += ints.tmp131 - del ints.tmp131 - tmp1 += ints.tmp148 * 2 - del ints.tmp148 - tmp1 += np.transpose(ints.tmp15, (1, 2, 0, 3)) - del ints.tmp15 - tmp1 += ints.tmp168 - del ints.tmp168 - tmp1 += ints.tmp190 - del ints.tmp190 - tmp1 += ints.tmp228 - del ints.tmp228 - tmp1 += np.transpose(ints.tmp34, (0, 2, 1, 3)) - del ints.tmp34 - tmp1 += np.transpose(ints.tmp52, (0, 2, 1, 3)) - del ints.tmp52 - tmp1 += ints.tmp75 * 2 - del ints.tmp75 - tmp1 += ints.tmp80 - del ints.tmp80 - tmp1 += ints.tmp123 * -1 - del ints.tmp123 - tmp1 += ints.tmp145 * -2 - del ints.tmp145 - tmp1 += ints.tmp151 * -1 - del ints.tmp151 - tmp1 += np.transpose(ints.tmp192, (0, 2, 1, 3)) * -1 - del ints.tmp192 - tmp1 += ints.tmp211 * -1 - del ints.tmp211 - tmp1 += np.transpose(ints.tmp23, (1, 2, 0, 3)) * -1 - del ints.tmp23 - tmp1 += ints.tmp50 * -1 - del ints.tmp50 - tmp1 += ints.tmp72 * -2 - del ints.tmp72 - tmp1 += ints.tmp94 * -1 - del ints.tmp94 - tmp0 = np.copy(ints.tmp129) - del ints.tmp129 - tmp0 += ints.tmp133 - del ints.tmp133 - tmp0 += ints.tmp147 - del ints.tmp147 - tmp0 += ints.tmp153 * 2 - del ints.tmp153 - tmp0 += np.transpose(ints.tmp17, (1, 0, 2, 3)) - del ints.tmp17 - tmp0 += ints.tmp213 - del ints.tmp213 - tmp0 += np.transpose(ints.tmp25, (1, 0, 2, 3)) - tmp0 += ints.tmp54 - del ints.tmp54 - tmp0 += np.transpose(ints.tmp55, (1, 0, 2, 3)) - del ints.tmp55 - tmp0 += ints.tmp78 - del ints.tmp78 - tmp0 += ints.tmp83 * 2 - del ints.tmp83 - tmp0 += ints.tmp97 - del ints.tmp97 - tmp0 += ints.tmp125 * -1 - del ints.tmp125 - tmp0 += ints.tmp150 * -1 - del ints.tmp150 - tmp0 += ints.tmp155 * -1 - del ints.tmp155 - tmp0 += ints.tmp172 * -1 - del ints.tmp172 - tmp0 += ints.tmp195 * -1 - del ints.tmp195 - tmp0 += np.transpose(ints.tmp197, (1, 0, 2, 3)) * -1 - del ints.tmp197 - tmp0 += ints.tmp231 * -1 - del ints.tmp231 - tmp0 += ints.tmp37 * -1 - del ints.tmp37 - tmp0 += ints.tmp74 * -1 - del ints.tmp74 - tmp0 += ints.tmp79 * -1 - del ints.tmp79 - r2new.bbb = np.copy(tmp56) * -1 - r2new.bbb += np.transpose(tmp56, (1, 0, 2)) - del tmp56 - r2new.bbb += tmp62 * 2 - r2new.bbb += np.transpose(tmp62, (1, 0, 2)) * -2 - del tmp62 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp63, (3, 4, 1, 0), (3, 4, 2)) * 2 - del tmp63 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp47, (2, 3), (0, 1, 3)) * -2 - r2new.bab = einsum(r1.a, (0,), f.bb.ov, (1, 2), (1, 0, 2)) * -1 - r2new.bab += einsum(ints.tmp25, (0, 1, 2, 3), r1.a, (1,), (2, 0, 3)) - del ints.tmp25 - r2new.bab += einsum(r2.aaa, (0, 1, 2), ints.tmp421, (1, 3, 2, 4), (3, 0, 4)) * 2 - del ints.tmp421 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp42, (0, 3, 2, 4), (3, 1, 4)) * -1 - del tmp42 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp43, (3, 1, 2, 4), (0, 3, 4)) * -1 - del tmp43 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp44, (1, 3, 0, 4), (4, 3, 2)) - del tmp44 - r2new.bab += einsum(tmp45, (0, 1), v.bbb.xov, (0, 2, 3), (2, 1, 3)) * -1 - del tmp45 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp47, (2, 3), (0, 1, 3)) * -1 - del tmp47 - r2new.bab += einsum(tmp48, (0,), ints.tmp170, (1, 2, 0, 3), (2, 1, 3)) * 2 - del tmp48 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp40, (0, 3), (3, 1, 2)) * -1 - r2new.bab += einsum(tmp41, (0, 1), r2.bab, (2, 0, 3), (2, 1, 3)) * -1 - r2new.aba = einsum(f.aa.ov, (0, 1), r1.b, (2,), (0, 2, 1)) * -1 - r2new.aba += einsum(ints.tmp67, (0, 1, 2, 3), r1.b, (2,), (0, 1, 3)) - del ints.tmp67 - r2new.aba += einsum(r2.bbb, (0, 1, 2), ints.tmp364, (3, 1, 4, 2), (3, 0, 4)) * 2 - del ints.tmp364 - r2new.aba += einsum(tmp31, (0, 1, 2, 3), r2.aba, (0, 4, 2), (1, 4, 3)) * -1 - del tmp31 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp32, (3, 1, 2, 4), (0, 3, 4)) * -1 - del tmp32 - r2new.aba += einsum(tmp33, (0, 1, 2, 3), r2.aba, (0, 2, 4), (1, 3, 4)) - del tmp33 - r2new.aba += einsum(v.baa.xov, (0, 1, 2), tmp36, (0, 3), (1, 3, 2)) * -2 - del tmp36 - r2new.aba += einsum(tmp30, (0, 1), r2.aba, (2, 3, 0), (2, 3, 1)) * -1 - r2new.aba += einsum(tmp39, (0,), ints.tmp170, (1, 2, 3, 0), (1, 2, 3)) * 2 - del tmp39, ints.tmp170 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp40, (1, 3), (0, 3, 2)) * -1 - del tmp40 - r2new.aba += einsum(tmp41, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - del tmp41 - r2new.aaa = np.copy(tmp21) - r2new.aaa += np.transpose(tmp21, (1, 0, 2)) * -1 - del tmp21 - r2new.aaa += tmp27 - r2new.aaa += np.transpose(tmp27, (1, 0, 2)) * -1 - del tmp27 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp28, (0, 1, 3, 4), (3, 4, 2)) * 2 - del tmp28 - r2new.aaa += einsum(tmp30, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp30 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp5, (0, 1, 3, 2), (3,)) - del tmp5 - r1new.b += einsum(tmp6, (0, 1, 2, 3), r2.bbb, (0, 1, 3), (2,)) * 2 - del tmp6 - r1new.b += einsum(tmp3, (0, 1), r2.aba, (0, 2, 1), (2,)) * 2 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp2, (1, 2), (0,)) * -4 - r1new.b += einsum(tmp7, (0, 1), r1.b, (0,), (1,)) * -1 - del tmp7 - r1new.a = einsum(r2.bab, (0, 1, 2), tmp0, (1, 3, 0, 2), (3,)) - del tmp0 - r1new.a += einsum(tmp1, (0, 1, 2, 3), r2.aaa, (0, 1, 3), (2,)) * 2 - del tmp1 - r1new.a += einsum(tmp2, (0, 1), r2.bab, (0, 2, 1), (2,)) * 2 - del tmp2 - r1new.a += einsum(tmp3, (0, 1), r2.aaa, (2, 0, 1), (2,)) * -4 - del tmp3 - r1new.a += einsum(r1.a, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:06:54.044194. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp10 : array - tmp100 : array - tmp102 : array - tmp103 : array - tmp105 : array - tmp106 : array - tmp108 : array - tmp11 : array - tmp110 : array - tmp111 : array - tmp113 : array - tmp115 : array - tmp117 : array - tmp119 : array - tmp121 : array - tmp122 : array - tmp124 : array - tmp13 : array - tmp132 : array - tmp133 : array - tmp135 : array - tmp136 : array - tmp138 : array - tmp139 : array - tmp141 : array - tmp142 : array - tmp144 : array - tmp146 : array - tmp148 : array - tmp149 : array - tmp151 : array - tmp152 : array - tmp154 : array - tmp155 : array - tmp157 : array - tmp158 : array - tmp160 : array - tmp162 : array - tmp163 : array - tmp165 : array - tmp166 : array - tmp168 : array - tmp170 : array - tmp172 : array - tmp175 : array - tmp178 : array - tmp180 : array - tmp182 : array - tmp185 : array - tmp19 : array - tmp190 : array - tmp192 : array - tmp194 : array - tmp195 : array - tmp196 : array - tmp197 : array - tmp198 : array - tmp199 : array - tmp2 : array - tmp20 : array - tmp201 : array - tmp203 : array - tmp205 : array - tmp206 : array - tmp208 : array - tmp211 : array - tmp214 : array - tmp216 : array - tmp218 : array - tmp22 : array - tmp221 : array - tmp23 : array - tmp236 : array - tmp239 : array - tmp24 : array - tmp243 : array - tmp246 : array - tmp250 : array - tmp251 : array - tmp253 : array - tmp255 : array - tmp257 : array - tmp26 : array - tmp263 : array - tmp265 : array - tmp271 : array - tmp272 : array - tmp274 : array - tmp275 : array - tmp277 : array - tmp279 : array - tmp281 : array - tmp29 : array - tmp301 : array - tmp303 : array - tmp309 : array - tmp31 : array - tmp310 : array - tmp312 : array - tmp313 : array - tmp315 : array - tmp317 : array - tmp319 : array - tmp33 : array - tmp330 : array - tmp332 : array - tmp334 : array - tmp335 : array - tmp34 : array - tmp36 : array - tmp365 : array - tmp38 : array - tmp387 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp42 : array - tmp430 : array - tmp44 : array - tmp47 : array - tmp49 : array - tmp5 : array - tmp52 : array - tmp53 : array - tmp55 : array - tmp57 : array - tmp58 : array - tmp60 : array - tmp61 : array - tmp63 : array - tmp64 : array - tmp66 : array - tmp67 : array - tmp69 : array - tmp7 : array - tmp70 : array - tmp72 : array - tmp73 : array - tmp75 : array - tmp77 : array - tmp79 : array - tmp8 : array - tmp81 : array - tmp82 : array - tmp84 : array - tmp85 : array - tmp87 : array - tmp89 : array - tmp91 : array - tmp92 : array - tmp94 : array - tmp95 : array - tmp97 : array - tmp99 : array - """ - - tmp28 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp32 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 0, 1), (2,)) - tmp109 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 3, 1), (2, 0, 3)) - tmp101 = einsum(t1.aa, (0, 1), v.baa.xov, (2, 3, 1), (2, 0, 3)) - tmp41 = einsum(v.bbb.xov, (0, 1, 2), tmp28, (0,), (1, 2)) - tmp42 = einsum(v.baa.xov, (0, 1, 2), tmp32, (0,), (1, 2)) - tmp38 = einsum(v.bbb.xov, (0, 1, 2), tmp32, (0,), (1, 2)) - tmp110 = einsum(tmp109, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp34 = einsum(v.baa.xov, (0, 1, 2), tmp28, (0,), (1, 2)) - tmp102 = einsum(tmp101, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp60 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp84 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp81 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp57 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp30 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp39 = einsum(t1.bb, (0, 1), v.bbb.xvv, (2, 3, 1), (2, 0, 3)) - tmp49 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp243 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp138 = einsum(tmp101, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp135 = einsum(tmp109, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp26 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp236 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp72 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp66 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp220 = einsum(t1.bb, (0, 1), tmp41, (2, 1), (0, 2)) - tmp217 = einsum(t1.aa, (0, 1), tmp42, (2, 1), (0, 2)) - tmp215 = einsum(t1.bb, (0, 1), tmp38, (2, 1), (0, 2)) - tmp213 = einsum(t1.bb, (0, 1), tmp110, (2, 1), (0, 2)) - tmp210 = einsum(t1.aa, (0, 1), tmp34, (2, 1), (0, 2)) - tmp207 = einsum(t1.aa, (0, 1), tmp102, (2, 1), (0, 2)) - tmp33 = einsum(v.baa.xvv, (0, 1, 2), tmp32, (0,), (1, 2)) - tmp197 = einsum(tmp28, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp194 = einsum(v.bbb.xvv, (0, 1, 2), tmp32, (0,), (1, 2)) - tmp29 = einsum(v.baa.xvv, (0, 1, 2), tmp28, (0,), (1, 2)) - tmp184 = einsum(v.bbb.xoo, (0, 1, 2), tmp28, (0,), (1, 2)) - tmp181 = einsum(tmp32, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - tmp179 = einsum(v.bbb.xoo, (0, 1, 2), tmp32, (0,), (1, 2)) - del tmp32 - tmp177 = einsum(tmp109, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (3, 2)) - tmp174 = einsum(tmp28, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - del tmp28 - tmp171 = einsum(v.baa.xoo, (0, 1, 2), tmp101, (0, 2, 3), (1, 3)) - tmp44 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp157 = einsum(v.baa.xov, (0, 1, 2), tmp60, (0, 3, 2), (3, 1)) - tmp154 = einsum(tmp84, (0, 1, 2), v.bbb.xov, (0, 3, 2), (1, 3)) - tmp151 = einsum(tmp81, (0, 1, 2), v.bbb.xov, (0, 3, 2), (1, 3)) - tmp148 = einsum(tmp57, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp141 = einsum(tmp109, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp132 = einsum(v.baa.xov, (0, 1, 2), tmp101, (0, 3, 4), (3, 1, 4, 2)) - tmp99 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp24 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp69 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp63 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp22 = einsum(t1.bb, (0, 1), f.bb.ov, (2, 1), (2, 0)) - tmp19 = einsum(f.aa.ov, (0, 1), t1.aa, (2, 1), (0, 2)) - tmp430 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp387 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp365 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp335 = einsum(tmp30, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp334 = einsum(tmp101, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp332 = einsum(tmp39, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 4, 2)) - tmp330 = einsum(tmp109, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp319 = einsum(t2.abab, (0, 1, 2, 3), tmp49, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp317 = einsum(v.bbb.xov, (0, 1, 2), tmp84, (0, 3, 4), (3, 1, 4, 2)) - tmp315 = einsum(tmp57, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp313 = einsum(t2.bbbb, (0, 1, 2, 3), tmp243, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp312 = einsum(t2.abab, (0, 1, 2, 3), tmp243, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp310 = einsum(tmp81, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp309 = einsum(v.bbb.xov, (0, 1, 2), tmp60, (0, 3, 4), (3, 1, 4, 2)) - tmp303 = einsum(tmp138, (0, 1, 2, 3), t2.abab, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp301 = einsum(t2.bbbb, (0, 1, 2, 3), tmp135, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp281 = einsum(t2.abab, (0, 1, 2, 3), tmp26, (1, 2, 4, 5), (0, 4, 3, 5)) - tmp279 = einsum(tmp84, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp277 = einsum(v.bbb.xvv, (0, 1, 2), tmp57, (0, 3, 4), (3, 4, 1, 2)) - tmp275 = einsum(tmp236, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 2), (4, 5, 3, 1)) - tmp274 = einsum(tmp236, (0, 1, 2, 3), t2.abab, (4, 0, 5, 1), (4, 5, 3, 2)) - tmp272 = einsum(tmp81, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp271 = einsum(v.bbb.xvv, (0, 1, 2), tmp60, (0, 3, 4), (3, 4, 1, 2)) - tmp265 = einsum(tmp72, (0, 1, 2, 3), t2.abab, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp263 = einsum(t2.bbbb, (0, 1, 2, 3), tmp66, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp257 = einsum(v.bbb.xov, (0, 1, 2), tmp84, (0, 1, 3), (3, 2)) - tmp255 = einsum(tmp81, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp253 = einsum(tmp30, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp251 = einsum(tmp39, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp250 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp246 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp239 = einsum(tmp39, (0, 1, 2), v.bbb.xov, (0, 1, 3), (3, 2)) - tmp221 = einsum(tmp220, (0, 1), t1.bb, (1, 2), (0, 2)) - del tmp220 - tmp218 = einsum(tmp217, (0, 1), t1.aa, (1, 2), (0, 2)) - del tmp217 - tmp216 = einsum(tmp215, (0, 1), t1.bb, (1, 2), (0, 2)) - del tmp215 - tmp214 = einsum(tmp213, (0, 1), t1.bb, (1, 2), (0, 2)) - del tmp213 - tmp211 = einsum(tmp210, (0, 1), t1.aa, (1, 2), (0, 2)) - del tmp210 - tmp208 = einsum(tmp207, (0, 1), t1.aa, (1, 2), (0, 2)) - del tmp207 - tmp206 = einsum(v.baa.xov, (0, 1, 2), tmp39, (0, 3, 4), (1, 3, 2, 4)) - tmp205 = einsum(tmp109, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp203 = einsum(tmp30, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 4, 2)) - tmp201 = einsum(tmp101, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp199 = einsum(tmp33, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp198 = einsum(tmp197, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp196 = einsum(tmp109, (0, 1, 2), tmp39, (0, 2, 3), (1, 3)) - del tmp109 - tmp195 = einsum(tmp194, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp192 = einsum(tmp30, (0, 1, 2), tmp101, (0, 3, 1), (3, 2)) - del tmp101 - tmp190 = einsum(t1.aa, (0, 1), tmp29, (2, 1), (0, 2)) - tmp185 = einsum(tmp184, (0, 1), t1.bb, (1, 2), (0, 2)) - del tmp184 - tmp182 = einsum(tmp181, (0, 1), t1.aa, (1, 2), (0, 2)) - del tmp181 - tmp180 = einsum(t1.bb, (0, 1), tmp179, (2, 0), (2, 1)) - del tmp179 - tmp178 = einsum(tmp177, (0, 1), t1.bb, (1, 2), (0, 2)) - del tmp177 - tmp175 = einsum(tmp174, (0, 1), t1.aa, (1, 2), (0, 2)) - del tmp174 - tmp172 = einsum(tmp171, (0, 1), t1.aa, (1, 2), (0, 2)) - del tmp171 - tmp170 = einsum(t2.abab, (0, 1, 2, 3), tmp49, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp168 = einsum(tmp81, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp166 = einsum(v.baa.xov, (0, 1, 2), tmp60, (0, 3, 4), (3, 1, 4, 2)) - tmp165 = einsum(tmp44, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 4, 2, 5)) - tmp163 = einsum(tmp44, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp162 = einsum(tmp84, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp160 = einsum(v.baa.xov, (0, 1, 2), tmp57, (0, 3, 4), (3, 1, 4, 2)) - tmp158 = einsum(tmp157, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp155 = einsum(tmp154, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp152 = einsum(t1.bb, (0, 1), tmp151, (2, 0), (2, 1)) - tmp149 = einsum(tmp148, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp146 = einsum(t2.abab, (0, 1, 2, 3), tmp141, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp144 = einsum(tmp132, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp142 = einsum(t2.abab, (0, 1, 2, 3), tmp141, (0, 4, 1, 2), (4, 3)) - tmp139 = einsum(tmp138, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp136 = einsum(t2.bbbb, (0, 1, 2, 3), tmp135, (4, 1, 0, 3), (4, 2)) - tmp133 = einsum(tmp132, (0, 1, 2, 3), t2.aaaa, (2, 1, 4, 3), (0, 4)) - tmp124 = einsum(t2.bbbb, (0, 1, 2, 3), tmp41, (1, 3), (0, 2)) - tmp122 = einsum(t2.abab, (0, 1, 2, 3), tmp41, (1, 3), (0, 2)) - tmp121 = einsum(t2.abab, (0, 1, 2, 3), tmp42, (0, 2), (1, 3)) - tmp119 = einsum(tmp42, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp117 = einsum(t2.bbbb, (0, 1, 2, 3), tmp38, (1, 3), (0, 2)) - tmp115 = einsum(t2.abab, (0, 1, 2, 3), tmp38, (1, 3), (0, 2)) - tmp113 = einsum(tmp110, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp111 = einsum(t2.abab, (0, 1, 2, 3), tmp110, (1, 3), (0, 2)) - tmp108 = einsum(t2.abab, (0, 1, 2, 3), tmp34, (0, 2), (1, 3)) - tmp106 = einsum(t2.aaaa, (0, 1, 2, 3), tmp34, (1, 3), (0, 2)) - tmp105 = einsum(t2.abab, (0, 1, 2, 3), tmp102, (0, 2), (1, 3)) - tmp103 = einsum(tmp102, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp100 = einsum(tmp99, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (4, 5, 1, 2)) - tmp97 = einsum(tmp81, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp95 = einsum(v.baa.xvv, (0, 1, 2), tmp60, (0, 3, 4), (3, 4, 1, 2)) - tmp94 = einsum(t2.abab, (0, 1, 2, 3), tmp24, (0, 2, 4, 5), (1, 5, 4, 3)) - tmp92 = einsum(t2.aaaa, (0, 1, 2, 3), tmp24, (1, 4, 3, 5), (0, 2, 5, 4)) - tmp91 = einsum(tmp84, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp89 = einsum(tmp57, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp87 = einsum(v.baa.xvv, (0, 1, 2), tmp60, (0, 3, 2), (3, 1)) - tmp85 = einsum(v.bbb.xvv, (0, 1, 2), tmp84, (0, 3, 2), (3, 1)) - tmp82 = einsum(tmp81, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) * -1 - tmp79 = einsum(v.baa.xvv, (0, 1, 2), tmp57, (0, 3, 2), (3, 1)) * -1 - tmp77 = einsum(t2.abab, (0, 1, 2, 3), tmp69, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp75 = einsum(tmp63, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp73 = einsum(tmp72, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp70 = einsum(t2.abab, (0, 1, 2, 3), tmp69, (0, 4, 1, 2), (4, 3)) - tmp67 = einsum(t2.bbbb, (0, 1, 2, 3), tmp66, (4, 0, 1, 3), (4, 2)) - tmp64 = einsum(tmp63, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) - tmp61 = einsum(v.baa.xov, (0, 1, 2), tmp60, (0, 1, 3), (3, 2)) - tmp58 = einsum(tmp57, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp55 = einsum(v.baa.xvv, (0, 1, 2), tmp39, (0, 3, 4), (3, 1, 2, 4)) - tmp53 = einsum(tmp30, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp52 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp47 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp40 = einsum(v.bbb.xoo, (0, 1, 2), tmp39, (0, 2, 3), (1, 3)) - del tmp39 - tmp36 = einsum(tmp30, (0, 1, 2), v.baa.xoo, (0, 3, 1), (3, 2)) - tmp31 = einsum(v.baa.xov, (0, 1, 2), tmp30, (0, 1, 3), (2, 3)) - del tmp30 - tmp23 = einsum(tmp22, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp20 = einsum(tmp19, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp13 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp11 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp10 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp8 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp7 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp5 = einsum(f.aa.vv, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp4 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp2 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - - return {f"tmp10": tmp10, f"tmp100": tmp100, f"tmp102": tmp102, f"tmp103": tmp103, f"tmp105": tmp105, f"tmp106": tmp106, f"tmp108": tmp108, f"tmp11": tmp11, f"tmp110": tmp110, f"tmp111": tmp111, f"tmp113": tmp113, f"tmp115": tmp115, f"tmp117": tmp117, f"tmp119": tmp119, f"tmp121": tmp121, f"tmp122": tmp122, f"tmp124": tmp124, f"tmp13": tmp13, f"tmp132": tmp132, f"tmp133": tmp133, f"tmp135": tmp135, f"tmp136": tmp136, f"tmp138": tmp138, f"tmp139": tmp139, f"tmp141": tmp141, f"tmp142": tmp142, f"tmp144": tmp144, f"tmp146": tmp146, f"tmp148": tmp148, f"tmp149": tmp149, f"tmp151": tmp151, f"tmp152": tmp152, f"tmp154": tmp154, f"tmp155": tmp155, f"tmp157": tmp157, f"tmp158": tmp158, f"tmp160": tmp160, f"tmp162": tmp162, f"tmp163": tmp163, f"tmp165": tmp165, f"tmp166": tmp166, f"tmp168": tmp168, f"tmp170": tmp170, f"tmp172": tmp172, f"tmp175": tmp175, f"tmp178": tmp178, f"tmp180": tmp180, f"tmp182": tmp182, f"tmp185": tmp185, f"tmp19": tmp19, f"tmp190": tmp190, f"tmp192": tmp192, f"tmp194": tmp194, f"tmp195": tmp195, f"tmp196": tmp196, f"tmp197": tmp197, f"tmp198": tmp198, f"tmp199": tmp199, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp201": tmp201, f"tmp203": tmp203, f"tmp205": tmp205, f"tmp206": tmp206, f"tmp208": tmp208, f"tmp211": tmp211, f"tmp214": tmp214, f"tmp216": tmp216, f"tmp218": tmp218, f"tmp22": tmp22, f"tmp221": tmp221, f"tmp23": tmp23, f"tmp236": tmp236, f"tmp239": tmp239, f"tmp24": tmp24, f"tmp243": tmp243, f"tmp246": tmp246, f"tmp250": tmp250, f"tmp251": tmp251, f"tmp253": tmp253, f"tmp255": tmp255, f"tmp257": tmp257, f"tmp26": tmp26, f"tmp263": tmp263, f"tmp265": tmp265, f"tmp271": tmp271, f"tmp272": tmp272, f"tmp274": tmp274, f"tmp275": tmp275, f"tmp277": tmp277, f"tmp279": tmp279, f"tmp281": tmp281, f"tmp29": tmp29, f"tmp301": tmp301, f"tmp303": tmp303, f"tmp309": tmp309, f"tmp31": tmp31, f"tmp310": tmp310, f"tmp312": tmp312, f"tmp313": tmp313, f"tmp315": tmp315, f"tmp317": tmp317, f"tmp319": tmp319, f"tmp33": tmp33, f"tmp330": tmp330, f"tmp332": tmp332, f"tmp334": tmp334, f"tmp335": tmp335, f"tmp34": tmp34, f"tmp36": tmp36, f"tmp365": tmp365, f"tmp38": tmp38, f"tmp387": tmp387, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp42": tmp42, f"tmp430": tmp430, f"tmp44": tmp44, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp5": tmp5, f"tmp52": tmp52, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp57": tmp57, f"tmp58": tmp58, f"tmp60": tmp60, f"tmp61": tmp61, f"tmp63": tmp63, f"tmp64": tmp64, f"tmp66": tmp66, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp7": tmp7, f"tmp70": tmp70, f"tmp72": tmp72, f"tmp73": tmp73, f"tmp75": tmp75, f"tmp77": tmp77, f"tmp79": tmp79, f"tmp8": tmp8, f"tmp81": tmp81, f"tmp82": tmp82, f"tmp84": tmp84, f"tmp85": tmp85, f"tmp87": tmp87, f"tmp89": tmp89, f"tmp91": tmp91, f"tmp92": tmp92, f"tmp94": tmp94, f"tmp95": tmp95, f"tmp97": tmp97, f"tmp99": tmp99} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:06:54.210873. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp46 = np.copy(ints.tmp84) - tmp46 += v.bbb.xov - tmp46 += ints.tmp81 * 2 - tmp44 = np.copy(ints.tmp60) - tmp44 += v.baa.xov - tmp44 += ints.tmp57 * 2 - tmp60 = np.copy(ints.tmp57) * 2 - del ints.tmp57 - tmp60 += ints.tmp60 - del ints.tmp60 - tmp60 += v.baa.xov - tmp16 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (3, 2, 1), (0,)) * -1 - tmp15 = einsum(r2.aaa, (0, 1, 2), t2.aaaa, (3, 2, 0, 1), (3,)) - tmp47 = einsum(r2.bab, (0, 1, 2), tmp46, (3, 2, 0), (3, 1)) * -1 - tmp45 = einsum(r2.aaa, (0, 1, 2), tmp44, (3, 2, 1), (3, 0)) * -1 - del tmp44 - tmp70 = np.copy(ints.tmp246) - tmp70 += ints.tmp313 * 2 - tmp34 = einsum(t2.abab, (0, 1, 2, 3), r2.aba, (2, 3, 0), (1,)) - tmp85 = einsum(tmp46, (0, 1, 2), r2.bbb, (3, 2, 1), (0, 3)) * -1 - del tmp46 - tmp21 = einsum(t1.bb, (0, 1), r2.bbb, (2, 1, 3), (3, 0, 2)) - tmp78 = np.copy(ints.tmp255) - tmp78 += ints.tmp257 * 0.5 - tmp78 += f.bb.vv * -0.5 - tmp61 = einsum(r2.aba, (0, 1, 2), tmp60, (3, 2, 0), (3, 1)) - tmp35 = einsum(t2.bbbb, (0, 1, 2, 3), r2.bbb, (2, 3, 1), (0,)) - tmp51 = np.copy(ints.tmp58) - tmp51 += ints.tmp61 * 0.5 - tmp51 += f.aa.vv * -0.5 - tmp53 = np.copy(tmp15) * 2 - tmp53 += tmp16 - tmp42 = np.copy(ints.tmp47) - tmp42 += ints.tmp163 * 2 - tmp48 = np.copy(tmp45) * -2 - del tmp45 - tmp48 += tmp47 - del tmp47 - tmp2 = einsum(t1.aa, (0, 1), r2.aaa, (2, 1, 3), (3, 0, 2)) - tmp84 = einsum(tmp70, (0, 1, 2, 3), r2.bbb, (4, 2, 0), (1, 4, 3)) * -1 - tmp83 = einsum(tmp34, (0,), ints.tmp243, (0, 1, 2, 3), (1, 2, 3)) - tmp86 = einsum(tmp85, (0, 1), v.bbb.xov, (0, 2, 3), (2, 3, 1)) * -1 - del tmp85 - tmp82 = einsum(f.bb.ov, (0, 1), tmp21, (2, 0, 3), (2, 1, 3)) - tmp81 = einsum(r1.b, (0,), ints.tmp236, (1, 2, 0, 3), (1, 2, 3)) - tmp79 = einsum(r2.bbb, (0, 1, 2), tmp78, (1, 3), (2, 0, 3)) * -4 - del tmp78 - tmp77 = einsum(tmp61, (0, 1), v.bbb.xov, (0, 2, 3), (2, 3, 1)) - tmp75 = einsum(r2.aba, (0, 1, 2), ints.tmp312, (2, 3, 0, 4), (3, 4, 1)) - tmp76 = einsum(ints.tmp243, (0, 1, 2, 3), tmp35, (0,), (1, 2, 3)) - tmp66 = einsum(t1.bb, (0, 1), f.bb.ov, (0, 2), (2, 1)) - tmp62 = np.copy(ints.tmp81) * 2 - del ints.tmp81 - tmp62 += ints.tmp84 - del ints.tmp84 - tmp62 += v.bbb.xov - tmp64 = einsum(f.aa.ov, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp52 = einsum(tmp51, (0, 1), r2.aaa, (2, 0, 3), (3, 2, 1)) * -4 - del tmp51 - tmp54 = einsum(ints.tmp44, (0, 1, 2, 3), tmp53, (0,), (1, 2, 3)) - tmp43 = einsum(tmp42, (0, 1, 2, 3), r2.aaa, (4, 2, 0), (1, 4, 3)) * -1 - del tmp42 - tmp49 = einsum(v.baa.xov, (0, 1, 2), tmp48, (0, 3), (1, 2, 3)) - del tmp48 - tmp40 = einsum(f.aa.ov, (0, 1), tmp2, (2, 0, 3), (2, 1, 3)) - tmp39 = einsum(r1.a, (0,), ints.tmp24, (1, 2, 0, 3), (1, 2, 3)) - tmp41 = einsum(r2.bab, (0, 1, 2), ints.tmp165, (3, 2, 4, 0), (3, 4, 1)) * -1 - tmp25 = einsum(r2.aba, (0, 1, 2), t1.aa, (3, 0), (2, 3, 1)) - tmp6 = einsum(r2.bab, (0, 1, 2), t1.bb, (3, 0), (2, 3, 1)) * -1 - tmp74 = einsum(r2.bbb, (0, 1, 2), t2.bbbb, (3, 4, 0, 1), (2, 3, 4)) - tmp87 = np.copy(tmp81) - del tmp81 - tmp87 += tmp82 * 2 - del tmp82 - tmp87 += tmp83 - del tmp83 - tmp87 += np.transpose(tmp84, (0, 2, 1)) * -2 - del tmp84 - tmp87 += np.transpose(tmp86, (0, 2, 1)) * 2 - del tmp86 - tmp80 = einsum(f.bb.ov, (0, 1), r1.b, (2,), (0, 1, 2)) - tmp80 += tmp75 - del tmp75 - tmp80 += tmp76 * 2 - del tmp76 - tmp80 += np.transpose(tmp77, (0, 2, 1)) - del tmp77 - tmp80 += np.transpose(tmp79, (0, 2, 1)) - del tmp79 - tmp73 = np.copy(f.bb.oo) - tmp73 += ints.tmp151 * 2 - del ints.tmp151 - tmp73 += ints.tmp154 - del ints.tmp154 - tmp73 += np.transpose(ints.tmp22, (1, 0)) - del ints.tmp22 - tmp67 = np.copy(ints.tmp255) * 2 - tmp67 += ints.tmp257 - tmp67 += f.bb.vv * -1 - tmp67 += np.transpose(tmp66, (1, 0)) - del tmp66 - tmp72 = einsum(r2.aaa, (0, 1, 2), tmp60, (3, 2, 1), (3, 0)) * 2 - del tmp60 - tmp72 += einsum(tmp62, (0, 1, 2), r2.bab, (2, 3, 1), (0, 3)) * -1 - tmp65 = np.copy(ints.tmp58) * 2 - tmp65 += ints.tmp61 - tmp65 += f.aa.vv * -1 - tmp65 += np.transpose(tmp64, (1, 0)) - del tmp64 - tmp71 = np.copy(ints.tmp170) - tmp71 += np.transpose(ints.tmp52, (0, 1, 3, 2)) * -1 - tmp69 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (3, 2, 4), (0, 4, 1)) * -1 - tmp63 = np.copy(tmp61) * -1 - del tmp61 - tmp63 += einsum(r2.bbb, (0, 1, 2), tmp62, (3, 2, 1), (3, 0)) * 2 - del tmp62 - tmp58 = np.copy(ints.tmp163) * 2 - tmp58 += ints.tmp47 - tmp68 = np.copy(tmp34) * -0.5 - tmp68 += tmp35 - tmp59 = np.copy(ints.tmp250) - tmp59 += np.transpose(ints.tmp319, (0, 1, 3, 2)) * -1 - tmp57 = einsum(r2.aba, (0, 1, 2), t2.abab, (3, 4, 0, 1), (2, 3, 4)) - tmp56 = np.copy(f.aa.oo) - tmp56 += ints.tmp148 * 2 - del ints.tmp148 - tmp56 += ints.tmp157 - del ints.tmp157 - tmp56 += np.transpose(ints.tmp19, (1, 0)) - del ints.tmp19 - tmp55 = einsum(f.aa.ov, (0, 1), r1.a, (2,), (0, 1, 2)) - tmp55 += np.transpose(tmp52, (0, 2, 1)) - del tmp52 - tmp55 += tmp54 - del tmp54 - tmp38 = einsum(r2.aaa, (0, 1, 2), t2.aaaa, (3, 4, 0, 1), (2, 3, 4)) - tmp50 = np.copy(tmp39) - del tmp39 - tmp50 += tmp40 * 2 - del tmp40 - tmp50 += tmp41 - del tmp41 - tmp50 += np.transpose(tmp43, (0, 2, 1)) * -2 - del tmp43 - tmp50 += np.transpose(tmp49, (0, 2, 1)) - del tmp49 - tmp36 = einsum(r1.b, (0,), t1.bb, (1, 0), (1,)) - tmp36 += tmp34 * -1 - del tmp34 - tmp36 += tmp35 * 2 - del tmp35 - tmp30 = np.copy(ints.tmp135) - del ints.tmp135 - tmp30 += ints.tmp66 * -1 - del ints.tmp66 - tmp27 = np.copy(ints.tmp103) - tmp27 += ints.tmp111 * 0.5 - tmp27 += ints.tmp133 - tmp27 += ints.tmp139 * 0.5 - tmp27 += ints.tmp149 - tmp27 += ints.tmp158 * 0.5 - tmp27 += ints.tmp175 * 0.5 - tmp27 += ints.tmp182 * 0.5 - tmp27 += ints.tmp192 * 0.5 - tmp27 += ints.tmp20 * 0.5 - tmp27 += ints.tmp211 * 0.5 - tmp27 += ints.tmp218 * 0.5 - tmp27 += ints.tmp2 * 0.5 - tmp27 += ints.tmp36 * 0.5 - tmp27 += ints.tmp64 - tmp27 += ints.tmp73 * 0.5 - tmp27 += ints.tmp79 - tmp27 += f.aa.ov * -0.5 - tmp27 += ints.tmp106 * -1 - tmp27 += ints.tmp115 * -0.5 - tmp27 += ints.tmp119 * -1 - tmp27 += ints.tmp11 * -0.5 - tmp27 += ints.tmp122 * -0.5 - tmp27 += ints.tmp172 * -0.5 - tmp27 += ints.tmp190 * -0.5 - tmp27 += ints.tmp199 * -0.5 - tmp27 += ints.tmp208 * -0.5 - tmp27 += ints.tmp34 * -0.5 - tmp27 += ints.tmp42 * -0.5 - tmp27 += ints.tmp5 * -0.5 - tmp27 += ints.tmp87 * -0.5 - tmp27 += ints.tmp8 * -1 - tmp22 = np.copy(ints.tmp243) - tmp22 += ints.tmp310 * 2 - del ints.tmp310 - tmp22 += ints.tmp317 - del ints.tmp317 - tmp22 += np.transpose(ints.tmp332, (0, 1, 3, 2)) - del ints.tmp332 - tmp22 += np.transpose(ints.tmp246, (0, 1, 3, 2)) * -1 - del ints.tmp246 - tmp22 += ints.tmp313 * -2 - del ints.tmp313 - tmp22 += np.transpose(ints.tmp330, (0, 1, 3, 2)) * -1 - del ints.tmp330 - tmp19 = np.copy(ints.tmp253) - del ints.tmp253 - tmp19 += np.transpose(ints.tmp265, (0, 1, 3, 2)) - del ints.tmp265 - tmp19 += np.transpose(ints.tmp271, (0, 1, 3, 2)) - del ints.tmp271 - tmp19 += np.transpose(ints.tmp277, (0, 1, 3, 2)) * 2 - del ints.tmp277 - tmp19 += np.transpose(ints.tmp303, (0, 1, 3, 2)) - del ints.tmp303 - tmp19 += ints.tmp99 - tmp19 += ints.tmp274 * -1 - del ints.tmp274 - tmp19 += np.transpose(ints.tmp281, (0, 1, 3, 2)) * -1 - del ints.tmp281 - tmp20 = np.copy(ints.tmp236) * 0.5 - del ints.tmp236 - tmp20 += ints.tmp251 * 0.5 - del ints.tmp251 - tmp20 += np.transpose(ints.tmp275, (0, 2, 1, 3)) - del ints.tmp275 - tmp20 += np.transpose(ints.tmp301, (0, 3, 1, 2)) * 0.5 - del ints.tmp301 - tmp20 += np.transpose(ints.tmp263, (0, 3, 1, 2)) * -0.5 - del ints.tmp263 - tmp20 += np.transpose(ints.tmp272, (0, 3, 1, 2)) * -1 - del ints.tmp272 - tmp20 += np.transpose(ints.tmp279, (0, 3, 1, 2)) * -0.5 - del ints.tmp279 - tmp37 = np.copy(f.bb.ov) - tmp37 += ints.tmp38 - tmp37 += ints.tmp41 - tmp37 += ints.tmp110 * -1 - del ints.tmp110 - tmp24 = np.copy(ints.tmp309) - del ints.tmp309 - tmp24 += ints.tmp315 * 2 - del ints.tmp315 - tmp24 += ints.tmp335 - del ints.tmp335 - tmp24 += ints.tmp49 - tmp24 += ints.tmp312 * -1 - tmp26 = np.copy(ints.tmp250) - del ints.tmp250 - tmp26 += ints.tmp334 - del ints.tmp334 - tmp26 += np.transpose(ints.tmp319, (0, 1, 3, 2)) * -1 - del ints.tmp319 - tmp23 = einsum(t1.bb, (0, 1), r2.aba, (2, 1, 3), (3, 0, 2)) - tmp29 = einsum(tmp21, (0, 1, 2), t1.bb, (3, 2), (0, 1, 3)) * -1 - tmp32 = np.copy(ints.tmp138) - del ints.tmp138 - tmp32 += ints.tmp72 - del ints.tmp72 - tmp33 = np.copy(np.transpose(ints.tmp239, (1, 0))) - del ints.tmp239 - tmp33 += ints.tmp255 * 2 - del ints.tmp255 - tmp33 += ints.tmp257 - del ints.tmp257 - tmp33 += f.bb.vv * -1 - tmp33 += np.transpose(ints.tmp194, (1, 0)) * -1 - del ints.tmp194 - tmp33 += np.transpose(ints.tmp197, (1, 0)) * -1 - del ints.tmp197 - tmp28 = np.copy(ints.tmp105) - tmp28 += ints.tmp113 * 2 - tmp28 += ints.tmp136 * 2 - tmp28 += ints.tmp142 - tmp28 += ints.tmp152 * 2 - tmp28 += ints.tmp155 - tmp28 += ints.tmp180 - tmp28 += ints.tmp185 - tmp28 += ints.tmp196 - tmp28 += ints.tmp216 - tmp28 += ints.tmp221 - tmp28 += ints.tmp23 - tmp28 += ints.tmp40 - tmp28 += ints.tmp4 - tmp28 += ints.tmp67 * 2 - tmp28 += ints.tmp70 - tmp28 += ints.tmp82 * 2 - tmp28 += f.bb.ov * -1 - tmp28 += ints.tmp108 * -1 - tmp28 += ints.tmp10 * -1 - tmp28 += ints.tmp117 * -2 - tmp28 += ints.tmp121 * -1 - tmp28 += ints.tmp124 * -2 - tmp28 += ints.tmp13 * -2 - tmp28 += ints.tmp178 * -1 - tmp28 += ints.tmp195 * -1 - tmp28 += ints.tmp198 * -1 - tmp28 += ints.tmp214 * -1 - tmp28 += ints.tmp38 * -1 - tmp28 += ints.tmp41 * -1 - tmp28 += ints.tmp7 * -1 - tmp28 += ints.tmp85 * -1 - tmp31 = einsum(t1.bb, (0, 1), tmp25, (2, 3, 1), (2, 3, 0)) - tmp0 = np.copy(ints.tmp146) - del ints.tmp146 - tmp0 += np.transpose(ints.tmp26, (0, 2, 1, 3)) - tmp0 += np.transpose(ints.tmp55, (0, 2, 1, 3)) - del ints.tmp55 - tmp0 += ints.tmp77 - del ints.tmp77 - tmp0 += ints.tmp91 - del ints.tmp91 - tmp0 += ints.tmp97 * 2 - del ints.tmp97 - tmp0 += ints.tmp100 * -1 - del ints.tmp100 - tmp0 += np.transpose(ints.tmp94, (0, 2, 1, 3)) * -1 - del ints.tmp94 - tmp14 = np.copy(np.transpose(ints.tmp31, (1, 0))) - del ints.tmp31 - tmp14 += ints.tmp58 * 2 - del ints.tmp58 - tmp14 += ints.tmp61 - del ints.tmp61 - tmp14 += f.aa.vv * -1 - tmp14 += np.transpose(ints.tmp29, (1, 0)) * -1 - del ints.tmp29 - tmp14 += np.transpose(ints.tmp33, (1, 0)) * -1 - del ints.tmp33 - tmp11 = np.copy(ints.tmp132) - del ints.tmp132 - tmp11 += ints.tmp63 * -1 - del ints.tmp63 - tmp7 = np.copy(np.transpose(ints.tmp205, (0, 1, 3, 2))) - del ints.tmp205 - tmp7 += np.transpose(ints.tmp52, (0, 1, 3, 2)) - del ints.tmp52 - tmp7 += ints.tmp170 * -1 - del ints.tmp170 - tmp5 = np.copy(ints.tmp162) - del ints.tmp162 - tmp5 += ints.tmp168 * 2 - del ints.tmp168 - tmp5 += ints.tmp206 - del ints.tmp206 - tmp5 += ints.tmp49 - tmp5 += ints.tmp165 * -1 - tmp18 = np.copy(f.aa.ov) - tmp18 += ints.tmp34 - tmp18 += ints.tmp42 - tmp18 += ints.tmp102 * -1 - del ints.tmp102 - tmp17 = einsum(t1.aa, (0, 1), r1.a, (1,), (0,)) * 0.5 - tmp17 += tmp15 - del tmp15 - tmp17 += tmp16 * 0.5 - del tmp16 - tmp3 = np.copy(ints.tmp160) * 2 - del ints.tmp160 - tmp3 += ints.tmp166 - del ints.tmp166 - tmp3 += np.transpose(ints.tmp203, (0, 1, 3, 2)) - del ints.tmp203 - tmp3 += ints.tmp44 - tmp3 += ints.tmp163 * -2 - del ints.tmp163 - tmp3 += np.transpose(ints.tmp201, (0, 1, 3, 2)) * -1 - del ints.tmp201 - tmp3 += np.transpose(ints.tmp47, (0, 1, 3, 2)) * -1 - del ints.tmp47 - tmp9 = np.copy(ints.tmp105) * 0.5 - del ints.tmp105 - tmp9 += ints.tmp113 - del ints.tmp113 - tmp9 += ints.tmp136 - del ints.tmp136 - tmp9 += ints.tmp142 * 0.5 - del ints.tmp142 - tmp9 += ints.tmp152 - del ints.tmp152 - tmp9 += ints.tmp155 * 0.5 - del ints.tmp155 - tmp9 += ints.tmp180 * 0.5 - del ints.tmp180 - tmp9 += ints.tmp185 * 0.5 - del ints.tmp185 - tmp9 += ints.tmp196 * 0.5 - del ints.tmp196 - tmp9 += ints.tmp216 * 0.5 - del ints.tmp216 - tmp9 += ints.tmp221 * 0.5 - del ints.tmp221 - tmp9 += ints.tmp23 * 0.5 - del ints.tmp23 - tmp9 += ints.tmp40 * 0.5 - del ints.tmp40 - tmp9 += ints.tmp4 * 0.5 - del ints.tmp4 - tmp9 += ints.tmp67 - del ints.tmp67 - tmp9 += ints.tmp70 * 0.5 - del ints.tmp70 - tmp9 += ints.tmp82 - del ints.tmp82 - tmp9 += f.bb.ov * -0.5 - tmp9 += ints.tmp108 * -0.5 - del ints.tmp108 - tmp9 += ints.tmp10 * -0.5 - del ints.tmp10 - tmp9 += ints.tmp117 * -1 - del ints.tmp117 - tmp9 += ints.tmp121 * -0.5 - del ints.tmp121 - tmp9 += ints.tmp124 * -1 - del ints.tmp124 - tmp9 += ints.tmp13 * -1 - del ints.tmp13 - tmp9 += ints.tmp178 * -0.5 - del ints.tmp178 - tmp9 += ints.tmp195 * -0.5 - del ints.tmp195 - tmp9 += ints.tmp198 * -0.5 - del ints.tmp198 - tmp9 += ints.tmp214 * -0.5 - del ints.tmp214 - tmp9 += ints.tmp38 * -0.5 - del ints.tmp38 - tmp9 += ints.tmp41 * -0.5 - del ints.tmp41 - tmp9 += ints.tmp7 * -0.5 - del ints.tmp7 - tmp9 += ints.tmp85 * -0.5 - del ints.tmp85 - tmp4 = einsum(r2.bab, (0, 1, 2), t1.aa, (3, 1), (3, 2, 0)) * -1 - tmp13 = np.copy(ints.tmp141) - del ints.tmp141 - tmp13 += ints.tmp69 - del ints.tmp69 - tmp10 = einsum(tmp2, (0, 1, 2), t1.aa, (3, 2), (0, 1, 3)) * -1 - tmp8 = np.copy(ints.tmp103) * 2 - del ints.tmp103 - tmp8 += ints.tmp111 - del ints.tmp111 - tmp8 += ints.tmp133 * 2 - del ints.tmp133 - tmp8 += ints.tmp139 - del ints.tmp139 - tmp8 += ints.tmp149 * 2 - del ints.tmp149 - tmp8 += ints.tmp158 - del ints.tmp158 - tmp8 += ints.tmp175 - del ints.tmp175 - tmp8 += ints.tmp182 - del ints.tmp182 - tmp8 += ints.tmp192 - del ints.tmp192 - tmp8 += ints.tmp20 - del ints.tmp20 - tmp8 += ints.tmp211 - del ints.tmp211 - tmp8 += ints.tmp218 - del ints.tmp218 - tmp8 += ints.tmp2 - del ints.tmp2 - tmp8 += ints.tmp36 - del ints.tmp36 - tmp8 += ints.tmp64 * 2 - del ints.tmp64 - tmp8 += ints.tmp73 - del ints.tmp73 - tmp8 += ints.tmp79 * 2 - del ints.tmp79 - tmp8 += f.aa.ov * -1 - tmp8 += ints.tmp106 * -2 - del ints.tmp106 - tmp8 += ints.tmp115 * -1 - del ints.tmp115 - tmp8 += ints.tmp119 * -2 - del ints.tmp119 - tmp8 += ints.tmp11 * -1 - del ints.tmp11 - tmp8 += ints.tmp122 * -1 - del ints.tmp122 - tmp8 += ints.tmp172 * -1 - del ints.tmp172 - tmp8 += ints.tmp190 * -1 - del ints.tmp190 - tmp8 += ints.tmp199 * -1 - del ints.tmp199 - tmp8 += ints.tmp208 * -1 - del ints.tmp208 - tmp8 += ints.tmp34 * -1 - del ints.tmp34 - tmp8 += ints.tmp42 * -1 - del ints.tmp42 - tmp8 += ints.tmp5 * -1 - del ints.tmp5 - tmp8 += ints.tmp87 * -1 - del ints.tmp87 - tmp8 += ints.tmp8 * -2 - del ints.tmp8 - tmp1 = np.copy(ints.tmp144) * 0.5 - del ints.tmp144 - tmp1 += np.transpose(ints.tmp24, (0, 2, 3, 1)) * 0.5 - del ints.tmp24 - tmp1 += np.transpose(ints.tmp53, (0, 2, 3, 1)) * 0.5 - del ints.tmp53 - tmp1 += np.transpose(ints.tmp92, (0, 1, 3, 2)) - del ints.tmp92 - tmp1 += ints.tmp75 * -0.5 - del ints.tmp75 - tmp1 += ints.tmp89 * -1 - del ints.tmp89 - tmp1 += ints.tmp95 * -0.5 - del ints.tmp95 - tmp12 = einsum(t1.aa, (0, 1), tmp6, (2, 3, 1), (0, 2, 3)) - r2new.bbb = einsum(ints.tmp430, (0, 1, 2, 3), r2.bbb, (3, 2, 4), (1, 0, 4)) * -2 - del ints.tmp430 - r2new.bbb += einsum(ints.tmp243, (0, 1, 2, 3), tmp74, (4, 1, 0), (3, 2, 4)) * 2 - del ints.tmp243, tmp74 - r2new.bbb += np.transpose(tmp80, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp80, (2, 1, 0)) - del tmp80 - r2new.bbb += np.transpose(tmp87, (1, 2, 0)) - r2new.bbb += np.transpose(tmp87, (2, 1, 0)) * -1 - del tmp87 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp73, (2, 3), (0, 1, 3)) * -2 - r2new.bab = einsum(r1.a, (0,), f.bb.ov, (1, 2), (2, 0, 1)) * -1 - r2new.bab += einsum(r1.a, (0,), ints.tmp26, (1, 2, 0, 3), (3, 2, 1)) * -1 - del ints.tmp26 - r2new.bab += einsum(r2.aaa, (0, 1, 2), ints.tmp312, (2, 3, 1, 4), (4, 0, 3)) * 2 - del ints.tmp312 - r2new.bab += einsum(r2.bab, (0, 1, 2), ints.tmp387, (3, 1, 0, 4), (4, 3, 2)) - r2new.bab += einsum(ints.tmp49, (0, 1, 2, 3), tmp69, (0, 4, 1), (3, 2, 4)) * -1 - del tmp69 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp70, (2, 3, 0, 4), (4, 1, 3)) * -1 - del tmp70 - r2new.bab += einsum(tmp71, (0, 1, 2, 3), r2.bab, (4, 2, 0), (4, 3, 1)) - del tmp71 - r2new.bab += einsum(tmp72, (0, 1), v.bbb.xov, (0, 2, 3), (3, 1, 2)) * -1 - del tmp72 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp67, (0, 3), (3, 1, 2)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp65, (1, 3), (0, 3, 2)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp73, (2, 3), (0, 1, 3)) * -1 - del tmp73 - r2new.bab += einsum(tmp53, (0,), ints.tmp49, (0, 1, 2, 3), (3, 2, 1)) - del tmp53 - r2new.aba = einsum(ints.tmp49, (0, 1, 2, 3), tmp57, (4, 0, 1), (2, 3, 4)) - del tmp57 - r2new.aba += einsum(f.aa.ov, (0, 1), r1.b, (2,), (1, 2, 0)) * -1 - r2new.aba += einsum(r2.bbb, (0, 1, 2), ints.tmp165, (3, 2, 4, 1), (4, 0, 3)) * 2 - del ints.tmp165 - r2new.aba += einsum(r2.aba, (0, 1, 2), ints.tmp387, (0, 3, 4, 1), (3, 4, 2)) - del ints.tmp387 - r2new.aba += einsum(ints.tmp99, (0, 1, 2, 3), r1.b, (3,), (1, 2, 0)) * -1 - del ints.tmp99 - r2new.aba += einsum(tmp58, (0, 1, 2, 3), r2.aba, (2, 4, 0), (3, 4, 1)) * -1 - del tmp58 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp59, (2, 3, 4, 1), (0, 4, 3)) * -1 - del tmp59 - r2new.aba += einsum(tmp63, (0, 1), v.baa.xov, (0, 2, 3), (3, 1, 2)) * -1 - del tmp63 - r2new.aba += einsum(tmp65, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - del tmp65 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp67, (1, 3), (0, 3, 2)) * -1 - del tmp67 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp56, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(tmp68, (0,), ints.tmp49, (1, 0, 2, 3), (2, 3, 1)) * 2 - del ints.tmp49, tmp68 - r2new.aaa = einsum(tmp38, (0, 1, 2), ints.tmp44, (2, 1, 3, 4), (4, 3, 0)) * 2 - del ints.tmp44, tmp38 - r2new.aaa += einsum(ints.tmp365, (0, 1, 2, 3), r2.aaa, (2, 3, 4), (1, 0, 4)) * 2 - del ints.tmp365 - r2new.aaa += np.transpose(tmp50, (1, 2, 0)) - r2new.aaa += np.transpose(tmp50, (2, 1, 0)) * -1 - del tmp50 - r2new.aaa += np.transpose(tmp55, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp55, (2, 1, 0)) - del tmp55 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp56, (2, 3), (0, 1, 3)) * -2 - del tmp56 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp19, (2, 0, 3, 1), (3,)) * -1 - del tmp19 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp20, (2, 3, 1, 0), (3,)) * -4 - del tmp20 - r1new.b += einsum(tmp22, (0, 1, 2, 3), tmp21, (0, 1, 2), (3,)) * 2 - del tmp21, tmp22 - r1new.b += einsum(tmp23, (0, 1, 2), tmp24, (0, 1, 2, 3), (3,)) - del tmp23, tmp24 - r1new.b += einsum(tmp26, (0, 1, 2, 3), tmp25, (0, 1, 3), (2,)) - del tmp25, tmp26 - r1new.b += einsum(r2.aba, (0, 1, 2), tmp27, (2, 0), (1,)) * 2 - del tmp27 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp28, (2, 1), (0,)) * -2 - del tmp28 - r1new.b += einsum(tmp29, (0, 1, 2), tmp30, (0, 2, 1, 3), (3,)) * -2 - del tmp29, tmp30 - r1new.b += einsum(tmp32, (0, 1, 2, 3), tmp31, (0, 1, 2), (3,)) * -1 - del tmp32, tmp31 - r1new.b += einsum(tmp33, (0, 1), r1.b, (0,), (1,)) * -1 - del tmp33 - r1new.b += einsum(tmp36, (0,), tmp37, (0, 1), (1,)) * -1 - del tmp36, tmp37 - r1new.a = einsum(tmp0, (0, 1, 2, 3), r2.bab, (3, 1, 0), (2,)) * -1 - del tmp0 - r1new.a += einsum(r2.aaa, (0, 1, 2), tmp1, (2, 0, 1, 3), (3,)) * 4 - del tmp1 - r1new.a += einsum(tmp2, (0, 1, 2), tmp3, (0, 1, 2, 3), (3,)) * 2 - del tmp2, tmp3 - r1new.a += einsum(tmp5, (0, 1, 2, 3), tmp4, (0, 1, 3), (2,)) * -1 - del tmp5, tmp4 - r1new.a += einsum(tmp6, (0, 1, 2), tmp7, (0, 1, 2, 3), (3,)) * -1 - del tmp6, tmp7 - r1new.a += einsum(r2.aaa, (0, 1, 2), tmp8, (2, 1), (0,)) * -2 - del tmp8 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp9, (2, 0), (1,)) * 2 - del tmp9 - r1new.a += einsum(tmp10, (0, 1, 2), tmp11, (0, 2, 1, 3), (3,)) * -2 - del tmp10, tmp11 - r1new.a += einsum(tmp12, (0, 1, 2), tmp13, (0, 1, 2, 3), (3,)) - del tmp12, tmp13 - r1new.a += einsum(r1.a, (0,), tmp14, (0, 1), (1,)) * -1 - del tmp14 - r1new.a += einsum(tmp18, (0, 1), tmp17, (0,), (1,)) * -2 - del tmp18, tmp17 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/UDFCCD.py b/ebcc/codegen/UDFCCD.py deleted file mode 100644 index 7eda2436..00000000 --- a/ebcc/codegen/UDFCCD.py +++ /dev/null @@ -1,2947 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:25:23.742399 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:25:24.460053. - - Parameters - ---------- - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp1 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp1 += einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - e_cc = einsum(tmp0, (0, 1, 2), v.bbb.xov, (0, 1, 2), ()) - del tmp0 - e_cc += einsum(tmp1, (0, 1, 2), v.baa.xov, (0, 1, 2), ()) - del tmp1 - - return e_cc - -def update_amps(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:25:43.291244. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - tmp17 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp10 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp29 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp30 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp18 = np.copy(np.transpose(tmp17, (1, 0, 2, 3))) - tmp18 += np.transpose(tmp17, (1, 0, 3, 2)) * -1 - tmp4 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp3 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp13 = np.copy(np.transpose(tmp10, (1, 0, 2, 3))) - tmp13 += np.transpose(tmp10, (1, 0, 3, 2)) * -1 - tmp31 = np.copy(tmp29) * 0.5 - tmp31 += tmp30 - tmp41 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp53 = einsum(t2.bbbb, (0, 1, 2, 3), tmp18, (1, 4, 5, 3), (4, 0, 5, 2)) - tmp7 = np.copy(tmp3) * 2 - tmp7 += tmp4 - tmp12 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp14 = einsum(t2.aaaa, (0, 1, 2, 3), tmp13, (1, 4, 5, 3), (4, 0, 5, 2)) - tmp5 = np.copy(tmp3) * 2 - tmp5 += tmp4 - tmp56 = einsum(t2.abab, (0, 1, 2, 3), tmp13, (0, 4, 5, 2), (4, 1, 5, 3)) - del tmp13 - tmp59 = einsum(tmp17, (0, 1, 2, 3), t2.bbbb, (4, 5, 3, 2), (4, 5, 1, 0)) - tmp32 = einsum(tmp31, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) * 2 - tmp54 = np.copy(np.transpose(tmp41, (1, 0, 3, 2))) - tmp54 += np.transpose(tmp53, (1, 0, 3, 2)) * -2 - del tmp53 - tmp47 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp33 = np.copy(tmp29) - tmp33 += tmp30 * 2 - tmp45 = einsum(v.bbb.xov, (0, 1, 2), tmp31, (0, 3, 2), (3, 1)) * 2 - del tmp31 - tmp27 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 2, 3, 4)) - tmp34 = np.copy(tmp3) - tmp34 += tmp4 * 0.5 - tmp8 = einsum(tmp7, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp36 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp39 = einsum(v.bbb.xov, (0, 1, 2), tmp7, (0, 3, 4), (3, 1, 4, 2)) - del tmp7 - tmp22 = einsum(tmp10, (0, 1, 2, 3), t2.aaaa, (4, 5, 3, 2), (4, 5, 1, 0)) - tmp15 = np.copy(np.transpose(tmp12, (1, 0, 3, 2))) - tmp15 += np.transpose(tmp14, (1, 0, 3, 2)) * -2 - del tmp14 - tmp0 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp25 = einsum(v.baa.xov, (0, 1, 2), tmp5, (0, 3, 2), (1, 3)) * 0.5 - tmp19 = einsum(t2.abab, (0, 1, 2, 3), tmp18, (1, 4, 3, 5), (0, 4, 2, 5)) - del tmp18 - tmp57 = einsum(t2.abab, (0, 1, 2, 3), tmp56, (0, 4, 2, 5), (4, 1, 5, 3)) - del tmp56 - tmp60 = einsum(t2.bbbb, (0, 1, 2, 3), tmp59, (4, 5, 0, 1), (5, 4, 2, 3)) * -1 - del tmp59 - tmp58 = einsum(t2.bbbb, (0, 1, 2, 3), tmp41, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp49 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.oo, (4, 1), (4, 0, 2, 3)) - tmp52 = einsum(tmp30, (0, 1, 2), tmp29, (0, 3, 4), (3, 1, 4, 2)) - del tmp29, tmp30 - tmp51 = np.copy(f.bb.vv) * -1 - tmp51 += tmp32 - tmp55 = einsum(tmp54, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp54 - tmp48 = einsum(tmp47, (0, 1, 2, 3), t2.bbbb, (1, 3, 4, 5), (2, 0, 4, 5)) - del tmp47 - tmp61 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp50 = einsum(v.bbb.xov, (0, 1, 2), tmp33, (0, 3, 4), (3, 1, 4, 2)) - tmp62 = einsum(t2.bbbb, (0, 1, 2, 3), tmp45, (4, 1), (0, 4, 2, 3)) * -1 - tmp28 = einsum(tmp27, (0, 1, 2, 3), t2.abab, (1, 3, 4, 5), (0, 2, 4, 5)) - del tmp27 - tmp42 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp35 = np.copy(f.aa.vv) * -1 - tmp35 += einsum(v.baa.xov, (0, 1, 2), tmp34, (0, 1, 3), (2, 3)) * 2 - del tmp34 - tmp38 = np.copy(np.transpose(tmp12, (1, 0, 3, 2))) - tmp38 += einsum(tmp10, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 2), (0, 4, 3, 5)) * 2 - tmp38 += tmp8 * -1 - tmp46 = einsum(tmp5, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp44 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp37 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp37 += einsum(tmp36, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (1, 4, 2, 5)) * -1 - tmp43 = einsum(t2.abab, (0, 1, 2, 3), tmp36, (4, 5, 2, 3), (0, 4, 1, 5)) - tmp40 = einsum(t2.abab, (0, 1, 2, 3), tmp17, (4, 1, 3, 5), (0, 4, 2, 5)) * -1 - tmp40 += tmp39 - tmp6 = einsum(tmp5, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp23 = einsum(tmp22, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 5), (1, 0, 4, 5)) * -1 - del tmp22 - tmp21 = einsum(t2.aaaa, (0, 1, 2, 3), tmp12, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp12 - tmp16 = einsum(t2.aaaa, (0, 1, 2, 3), tmp15, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp15 - tmp1 = einsum(t2.aaaa, (0, 1, 2, 3), tmp0, (4, 0, 5, 1), (5, 4, 2, 3)) - del tmp0 - tmp9 = np.copy(f.aa.vv) * -0.5 - tmp9 += einsum(tmp5, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) * 0.5 - del tmp5 - tmp26 = einsum(tmp25, (0, 1), t2.aaaa, (2, 0, 3, 4), (1, 2, 3, 4)) * -2 - del tmp25 - tmp2 = einsum(f.aa.oo, (0, 1), t2.aaaa, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp20 = einsum(t2.abab, (0, 1, 2, 3), tmp19, (4, 1, 5, 3), (4, 0, 5, 2)) * -1 - del tmp19 - tmp24 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp11 = einsum(tmp4, (0, 1, 2), tmp3, (0, 3, 4), (3, 1, 4, 2)) - del tmp3, tmp4 - t2new.bbbb = np.copy(np.transpose(tmp48, (0, 1, 3, 2))) * -2 - del tmp48 - t2new.bbbb += np.transpose(tmp49, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp49, (0, 1, 3, 2)) * -2 - del tmp49 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp32, (4, 3), (0, 1, 2, 4)) * -2 - t2new.bbbb += np.transpose(tmp50, (1, 0, 3, 2)) - t2new.bbbb += einsum(tmp51, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) * 2 - del tmp51 - t2new.bbbb += einsum(f.bb.vv, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 4, 0)) * 2 - t2new.bbbb += np.transpose(tmp50, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp17, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp17, (1, 0, 2, 3)) * -1 - del tmp17 - t2new.bbbb += np.transpose(tmp50, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp52, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp52, (1, 0, 2, 3)) * -2 - t2new.bbbb += np.transpose(tmp55, (0, 1, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp57, (1, 0, 2, 3)) * -1 - t2new.bbbb += tmp52 * 2 - t2new.bbbb += np.transpose(tmp52, (1, 0, 3, 2)) * 2 - del tmp52 - t2new.bbbb += np.transpose(tmp55, (1, 0, 3, 2)) * -2 - del tmp55 - t2new.bbbb += tmp57 - del tmp57 - t2new.bbbb += tmp50 - del tmp50 - t2new.bbbb += tmp58 * -2 - t2new.bbbb += np.transpose(tmp58, (1, 0, 2, 3)) * 2 - del tmp58 - t2new.bbbb += tmp60 * 2 - del tmp60 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp61, (4, 2, 5, 3), (0, 1, 4, 5)) * -2 - del tmp61 - t2new.bbbb += np.transpose(tmp62, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp62, (1, 0, 3, 2)) * 2 - del tmp62 - t2new.abab = np.copy(tmp28) - del tmp28 - t2new.abab += einsum(f.bb.oo, (0, 1), t2.abab, (2, 1, 3, 4), (2, 0, 3, 4)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), f.aa.oo, (4, 0), (4, 1, 2, 3)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp32, (4, 3), (0, 1, 2, 4)) * -1 - del tmp32 - t2new.abab += einsum(tmp33, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - del tmp33 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp35, (2, 4), (0, 1, 4, 3)) * -1 - del tmp35 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), f.bb.vv, (4, 3), (0, 1, 2, 4)) - t2new.abab += tmp36 - del tmp36 - t2new.abab += einsum(tmp37, (0, 1, 2, 3), t2.abab, (4, 0, 2, 5), (4, 1, 3, 5)) * -1 - del tmp37 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp38, (0, 4, 2, 5), (4, 1, 5, 3)) * -1 - del tmp38 - t2new.abab += einsum(tmp40, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp40 - t2new.abab += tmp39 - del tmp39 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp41, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - del tmp41 - t2new.abab += einsum(tmp42, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 5, 2)) * -1 - del tmp42 - t2new.abab += einsum(tmp43, (0, 1, 2, 3), t2.abab, (1, 3, 4, 5), (0, 2, 4, 5)) - del tmp43 - t2new.abab += einsum(tmp44, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 5, 0, 2)) - del tmp44 - t2new.abab += einsum(tmp45, (0, 1), t2.abab, (2, 1, 3, 4), (2, 0, 3, 4)) * -1 - del tmp45 - t2new.abab += einsum(tmp46, (0, 1), t2.abab, (1, 2, 3, 4), (0, 2, 3, 4)) * -1 - del tmp46 - t2new.aaaa = np.copy(np.transpose(tmp1, (0, 1, 3, 2))) * -2 - del tmp1 - t2new.aaaa += np.transpose(tmp2, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp2, (0, 1, 3, 2)) * -2 - del tmp2 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp6, (4, 3), (0, 1, 2, 4)) * -2 - del tmp6 - t2new.aaaa += tmp8 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp9, (4, 3), (0, 1, 4, 2)) * 4 - del tmp9 - t2new.aaaa += einsum(f.aa.vv, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 4, 0)) * 2 - t2new.aaaa += np.transpose(tmp8, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp10, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp10, (1, 0, 2, 3)) * -1 - del tmp10 - t2new.aaaa += np.transpose(tmp8, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp11, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp11, (1, 0, 2, 3)) * -2 - t2new.aaaa += np.transpose(tmp16, (1, 0, 2, 3)) * 2 - t2new.aaaa += np.transpose(tmp20, (0, 1, 3, 2)) * -1 - t2new.aaaa += tmp11 * 2 - t2new.aaaa += np.transpose(tmp11, (1, 0, 3, 2)) * 2 - del tmp11 - t2new.aaaa += tmp16 * -2 - del tmp16 - t2new.aaaa += tmp20 - del tmp20 - t2new.aaaa += np.transpose(tmp8, (1, 0, 3, 2)) - del tmp8 - t2new.aaaa += tmp21 * -2 - t2new.aaaa += np.transpose(tmp21, (1, 0, 2, 3)) * 2 - del tmp21 - t2new.aaaa += tmp23 * 2 - del tmp23 - t2new.aaaa += einsum(tmp24, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (4, 5, 0, 2)) * -2 - del tmp24 - t2new.aaaa += np.transpose(tmp26, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp26, (0, 1, 3, 2)) * 2 - del tmp26 - - return {f"t2new": t2new} - -def update_lams(f=None, l2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:26:12.909477. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - l2 : Namespace of arrays - L2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - l2new : Namespace of arrays - Updated L2 residuals. - """ - - l1new = Namespace() - l2new = Namespace() - tmp8 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp9 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp13 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp12 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp0 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) - tmp1 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - tmp51 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) - tmp50 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - tmp73 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp72 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp33 = np.copy(v.baa.xov) - tmp33 += tmp8 * 2 - tmp33 += tmp9 - tmp35 = np.copy(v.bbb.xov) - tmp35 += tmp12 - tmp35 += tmp13 * 2 - tmp56 = np.copy(tmp12) * 0.5 - tmp56 += tmp13 - tmp44 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp43 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (2, 4)) - tmp18 = np.copy(tmp8) * 2 - tmp18 += tmp9 - tmp14 = np.copy(v.bbb.xov) - tmp14 += tmp12 - del tmp12 - tmp14 += tmp13 * 2 - del tmp13 - tmp10 = np.copy(v.baa.xov) * 0.5 - tmp10 += tmp8 - del tmp8 - tmp10 += tmp9 * 0.5 - del tmp9 - tmp2 = np.copy(tmp0) - del tmp0 - tmp2 += tmp1 * 0.5 - del tmp1 - tmp52 = np.copy(tmp50) - del tmp50 - tmp52 += tmp51 * 2 - del tmp51 - tmp74 = np.copy(tmp72) * 0.5 - del tmp72 - tmp74 += tmp73 - del tmp73 - tmp99 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp98 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 0, 5), (5, 1, 4, 3)) - tmp94 = einsum(tmp33, (0, 1, 2), l2.abab, (2, 3, 1, 4), (0, 4, 3)) - tmp95 = einsum(tmp35, (0, 1, 2), l2.bbbb, (3, 2, 4, 1), (0, 4, 3)) - tmp83 = einsum(v.bbb.xov, (0, 1, 2), tmp56, (0, 3, 2), (1, 3)) * 2 - tmp65 = einsum(tmp56, (0, 1, 2), v.bbb.xov, (0, 1, 3), (3, 2)) * 2 - tmp45 = np.copy(tmp43) * 2 - del tmp43 - tmp45 += tmp44 - del tmp44 - tmp27 = einsum(tmp18, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp36 = einsum(l2.abab, (0, 1, 2, 3), tmp35, (4, 3, 1), (4, 2, 0)) - del tmp35 - tmp34 = einsum(l2.aaaa, (0, 1, 2, 3), tmp33, (4, 3, 1), (4, 2, 0)) - del tmp33 - tmp40 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp39 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp15 = einsum(tmp14, (0, 1, 2), l2.abab, (3, 2, 4, 1), (0, 4, 3)) - tmp11 = einsum(l2.aaaa, (0, 1, 2, 3), tmp10, (4, 3, 1), (4, 2, 0)) * 4 - tmp3 = einsum(tmp2, (0, 1), v.baa.xov, (2, 3, 1), (2, 3, 0)) * 2 - tmp78 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp53 = einsum(v.bbb.xov, (0, 1, 2), tmp52, (3, 2), (0, 1, 3)) * 0.5 - tmp87 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp79 = einsum(v.bbb.xov, (0, 1, 2), tmp52, (3, 2), (0, 1, 3)) - del tmp52 - tmp75 = einsum(v.bbb.xov, (0, 1, 2), tmp74, (3, 1), (0, 3, 2)) - tmp103 = einsum(v.bbb.xov, (0, 1, 2), tmp74, (3, 1), (0, 3, 2)) * 2 - del tmp74 - tmp100 = np.copy(tmp98) - del tmp98 - tmp100 += tmp99 * 4 - del tmp99 - tmp96 = np.copy(tmp94) - del tmp94 - tmp96 += tmp95 * 2 - del tmp95 - tmp68 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp84 = np.copy(f.bb.oo) - tmp84 += np.transpose(tmp83, (1, 0)) - del tmp83 - tmp89 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp66 = np.copy(f.bb.vv) * -1 - tmp66 += np.transpose(tmp65, (1, 0)) - del tmp65 - tmp20 = einsum(tmp18, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp62 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp60 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 5, 0, 1), (2, 4, 3, 5)) - tmp59 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp22 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp23 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp6 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp48 = einsum(v.baa.xov, (0, 1, 2), tmp45, (3, 1), (0, 3, 2)) - tmp25 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp46 = einsum(v.baa.xov, (0, 1, 2), tmp45, (3, 1), (0, 3, 2)) * 0.5 - del tmp45 - tmp28 = np.copy(f.aa.vv) * -1 - tmp28 += tmp27 - del tmp27 - tmp37 = np.copy(tmp34) * 2 - del tmp34 - tmp37 += tmp36 - del tmp36 - tmp41 = np.copy(tmp39) * 4 - del tmp39 - tmp41 += tmp40 - del tmp40 - tmp31 = einsum(tmp2, (0, 1), v.baa.xov, (2, 3, 1), (2, 3, 0)) - del tmp2 - tmp16 = np.copy(tmp11) - del tmp11 - tmp16 += tmp15 - del tmp15 - tmp4 = np.copy(v.baa.xov) - tmp4 += tmp3 * -1 - tmp92 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp92 += einsum(t2.bbbb, (0, 1, 2, 3), tmp78, (4, 5, 3, 2), (0, 1, 5, 4)) * -1 - tmp54 = np.copy(v.bbb.xov) * 0.5 - tmp54 += tmp53 * -1 - del tmp53 - tmp88 = einsum(tmp78, (0, 1, 2, 3), tmp87, (4, 5, 0, 1), (4, 5, 2, 3)) - del tmp87 - tmp80 = np.copy(v.bbb.xov) - tmp80 += tmp79 * -1 - tmp82 = einsum(l2.abab, (0, 1, 2, 3), tmp10, (4, 2, 0), (4, 3, 1)) * 2 - tmp82 += einsum(tmp14, (0, 1, 2), l2.bbbb, (3, 2, 4, 1), (0, 4, 3)) * 2 - tmp102 = einsum(v.bbb.xov, (0, 1, 2), tmp75, (0, 3, 4), (1, 3, 2, 4)) * -2 - tmp104 = einsum(v.bbb.xov, (0, 1, 2), tmp103, (0, 3, 4), (1, 3, 2, 4)) * -1 - del tmp103 - tmp101 = einsum(tmp78, (0, 1, 2, 3), tmp100, (4, 0, 5, 3), (4, 1, 5, 2)) - del tmp100 - tmp97 = einsum(v.bbb.xov, (0, 1, 2), tmp96, (0, 3, 4), (1, 3, 2, 4)) - del tmp96 - tmp86 = einsum(l2.abab, (0, 1, 2, 3), tmp10, (4, 2, 0), (4, 3, 1)) - tmp86 += einsum(tmp14, (0, 1, 2), l2.bbbb, (3, 2, 4, 1), (0, 4, 3)) - tmp81 = einsum(l2.bbbb, (0, 1, 2, 3), tmp68, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp85 = einsum(tmp84, (0, 1), l2.bbbb, (2, 3, 4, 0), (4, 1, 2, 3)) * -2 - del tmp84 - tmp93 = einsum(v.bbb.xov, (0, 1, 2), tmp79, (0, 3, 4), (1, 3, 2, 4)) * -1 - del tmp79 - tmp90 = einsum(l2.bbbb, (0, 1, 2, 3), tmp89, (4, 0, 5, 1), (2, 3, 5, 4)) - del tmp89 - tmp91 = einsum(tmp66, (0, 1), l2.bbbb, (2, 0, 3, 4), (3, 4, 2, 1)) * -1 - tmp69 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp21 = np.copy(f.aa.oo) - tmp21 += tmp20 - del tmp20 - tmp63 = einsum(l2.abab, (0, 1, 2, 3), tmp62, (4, 0, 5, 1), (2, 3, 4, 5)) - del tmp62 - tmp77 = einsum(t2.abab, (0, 1, 2, 3), l2.aaaa, (4, 2, 5, 0), (5, 1, 4, 3)) - tmp77 += einsum(l2.abab, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp76 = einsum(t2.aaaa, (0, 1, 2, 3), l2.abab, (3, 4, 1, 5), (0, 5, 2, 4)) - tmp76 += einsum(t2.abab, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 1), (0, 5, 2, 4)) - tmp61 = einsum(tmp60, (0, 1, 2, 3), tmp59, (1, 3, 4, 5), (0, 2, 4, 5)) - del tmp60 - tmp64 = np.copy(f.aa.vv) * -0.5 - tmp64 += einsum(tmp18, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) * 0.5 - tmp67 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 2, 3, 4)) - tmp67 += einsum(t2.abab, (0, 1, 2, 3), tmp59, (4, 5, 2, 3), (0, 4, 1, 5)) - tmp57 = np.copy(f.bb.oo) * 0.5 - tmp57 += einsum(tmp56, (0, 1, 2), v.bbb.xov, (0, 3, 2), (1, 3)) - del tmp56 - tmp71 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 5, 1), (3, 4, 0, 5)) - tmp58 = einsum(l2.abab, (0, 1, 2, 3), tmp10, (4, 2, 0), (4, 3, 1)) * 0.5 - del tmp10 - tmp58 += einsum(tmp14, (0, 1, 2), l2.bbbb, (3, 2, 4, 1), (0, 4, 3)) * 0.5 - del tmp14 - tmp55 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp70 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 5, 1), (5, 0, 4, 3)) - tmp24 = einsum(tmp22, (0, 1, 2, 3), tmp23, (4, 5, 0, 1), (4, 5, 2, 3)) - del tmp23 - tmp7 = einsum(l2.aaaa, (0, 1, 2, 3), tmp6, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp30 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp30 += einsum(t2.aaaa, (0, 1, 2, 3), tmp22, (4, 5, 3, 2), (0, 1, 5, 4)) * -1 - tmp49 = einsum(tmp48, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 2, 4)) * -1 - tmp26 = einsum(l2.aaaa, (0, 1, 2, 3), tmp25, (4, 0, 5, 1), (2, 3, 5, 4)) - del tmp25 - tmp47 = einsum(v.baa.xov, (0, 1, 2), tmp46, (0, 3, 4), (3, 1, 4, 2)) * -2 - del tmp46 - tmp29 = einsum(l2.aaaa, (0, 1, 2, 3), tmp28, (1, 4), (2, 3, 0, 4)) * -1 - del tmp28 - tmp38 = einsum(v.baa.xov, (0, 1, 2), tmp37, (0, 3, 4), (3, 1, 4, 2)) - tmp19 = np.copy(f.aa.oo) * 0.5 - tmp19 += einsum(tmp18, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) * 0.5 - del tmp18 - tmp42 = einsum(tmp41, (0, 1, 2, 3), tmp22, (1, 4, 5, 3), (0, 4, 2, 5)) - del tmp41 - tmp32 = einsum(v.baa.xov, (0, 1, 2), tmp31, (0, 3, 4), (3, 1, 4, 2)) * -2 - del tmp31 - tmp17 = einsum(v.baa.xov, (0, 1, 2), tmp16, (0, 3, 4), (3, 1, 4, 2)) - del tmp16 - tmp5 = einsum(v.baa.xov, (0, 1, 2), tmp4, (0, 3, 4), (3, 1, 4, 2)) - del tmp4 - l2new.bbbb = einsum(tmp54, (0, 1, 2), v.bbb.xov, (0, 3, 4), (4, 2, 3, 1)) * 2 - l2new.bbbb += einsum(tmp80, (0, 1, 2), v.bbb.xov, (0, 3, 4), (2, 4, 3, 1)) * -1 - del tmp80 - l2new.bbbb += np.transpose(tmp81, (3, 2, 0, 1)) * 2 - l2new.bbbb += einsum(tmp82, (0, 1, 2), v.bbb.xov, (0, 3, 4), (4, 2, 1, 3)) * -1 - del tmp82 - l2new.bbbb += np.transpose(tmp85, (3, 2, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp81, (3, 2, 1, 0)) * -2 - l2new.bbbb += einsum(v.bbb.xov, (0, 1, 2), tmp86, (0, 3, 4), (2, 4, 1, 3)) * 2 - del tmp86 - l2new.bbbb += np.transpose(tmp85, (3, 2, 1, 0)) - del tmp85 - l2new.bbbb += np.transpose(tmp88, (3, 2, 1, 0)) * 2 - del tmp88 - l2new.bbbb += np.transpose(tmp90, (2, 3, 1, 0)) * -2 - del tmp90 - l2new.bbbb += np.transpose(tmp91, (3, 2, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp91, (2, 3, 1, 0)) * -2 - del tmp91 - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp92, (2, 3, 4, 5), (0, 1, 5, 4)) * 2 - del tmp92 - l2new.bbbb += np.transpose(tmp93, (2, 3, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp81, (2, 3, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp97, (3, 2, 1, 0)) - l2new.bbbb += np.transpose(tmp81, (2, 3, 1, 0)) * 2 - del tmp81 - l2new.bbbb += np.transpose(tmp97, (3, 2, 0, 1)) * -1 - del tmp97 - l2new.bbbb += np.transpose(tmp101, (3, 2, 0, 1)) - l2new.bbbb += np.transpose(tmp102, (3, 2, 1, 0)) - l2new.bbbb += np.transpose(tmp101, (2, 3, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp104, (2, 3, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp101, (3, 2, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp102, (3, 2, 0, 1)) * -1 - del tmp102 - l2new.bbbb += np.transpose(tmp101, (2, 3, 1, 0)) - del tmp101 - l2new.bbbb += np.transpose(tmp104, (2, 3, 0, 1)) - del tmp104 - l2new.bbbb += np.transpose(tmp93, (3, 2, 1, 0)) - del tmp93 - l2new.abab = einsum(tmp54, (0, 1, 2), v.baa.xov, (0, 3, 4), (4, 2, 3, 1)) * 2 - del tmp54 - l2new.abab += einsum(tmp55, (0, 1, 2, 3), l2.abab, (3, 4, 5, 1), (2, 4, 5, 0)) * -1 - del tmp55 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp57, (3, 4), (0, 1, 2, 4)) * -2 - del tmp57 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp6, (4, 2, 5, 0), (5, 1, 4, 3)) * -1 - del tmp6 - l2new.abab += einsum(tmp58, (0, 1, 2), v.baa.xov, (0, 3, 4), (4, 2, 3, 1)) * 4 - del tmp58 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp21, (2, 4), (0, 1, 4, 3)) * -1 - l2new.abab += np.transpose(tmp61, (2, 3, 0, 1)) - del tmp61 - l2new.abab += np.transpose(tmp63, (2, 3, 0, 1)) - del tmp63 - l2new.abab += einsum(tmp64, (0, 1), l2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -2 - del tmp64 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp66, (1, 4), (0, 4, 2, 3)) * -1 - del tmp66 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp67, (2, 4, 3, 5), (0, 1, 4, 5)) - del tmp67 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp68, (4, 3, 5, 1), (0, 5, 2, 4)) * -1 - del tmp68 - l2new.abab += einsum(tmp37, (0, 1, 2), v.bbb.xov, (0, 3, 4), (2, 4, 1, 3)) - del tmp37 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp69, (4, 2, 5, 1), (0, 5, 4, 3)) * -1 - del tmp69 - l2new.abab += einsum(tmp59, (0, 1, 2, 3), tmp70, (4, 0, 5, 3), (2, 5, 4, 1)) - del tmp70 - l2new.abab += einsum(tmp48, (0, 1, 2), v.bbb.xov, (0, 3, 4), (2, 4, 1, 3)) * -1 - del tmp48 - l2new.abab += einsum(tmp71, (0, 1, 2, 3), tmp59, (4, 1, 3, 5), (2, 5, 4, 0)) - del tmp59, tmp71 - l2new.abab += einsum(tmp75, (0, 1, 2), v.baa.xov, (0, 3, 4), (4, 2, 3, 1)) * -2 - del tmp75 - l2new.abab += einsum(v.bbb.xov, (0, 1, 2), tmp3, (0, 3, 4), (4, 2, 3, 1)) * -1 - del tmp3 - l2new.abab += einsum(tmp76, (0, 1, 2, 3), tmp22, (0, 4, 5, 2), (5, 3, 4, 1)) * -2 - del tmp22, tmp76 - l2new.abab += einsum(tmp77, (0, 1, 2, 3), tmp78, (1, 4, 5, 3), (2, 5, 0, 4)) * -2 - del tmp78, tmp77 - l2new.aaaa = np.copy(np.transpose(tmp5, (3, 2, 1, 0))) - l2new.aaaa += np.transpose(tmp5, (2, 3, 1, 0)) * -1 - del tmp5 - l2new.aaaa += np.transpose(tmp7, (3, 2, 0, 1)) * 2 - l2new.aaaa += np.transpose(tmp17, (3, 2, 0, 1)) * -1 - l2new.aaaa += einsum(tmp19, (0, 1), l2.aaaa, (2, 3, 4, 0), (2, 3, 4, 1)) * -4 - del tmp19 - l2new.aaaa += np.transpose(tmp7, (3, 2, 1, 0)) * -2 - l2new.aaaa += np.transpose(tmp17, (3, 2, 1, 0)) - del tmp17 - l2new.aaaa += einsum(tmp21, (0, 1), l2.aaaa, (2, 3, 4, 0), (2, 3, 1, 4)) * 2 - del tmp21 - l2new.aaaa += np.transpose(tmp24, (3, 2, 1, 0)) * 2 - del tmp24 - l2new.aaaa += np.transpose(tmp26, (2, 3, 1, 0)) * -2 - del tmp26 - l2new.aaaa += np.transpose(tmp29, (3, 2, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp29, (2, 3, 1, 0)) * -2 - del tmp29 - l2new.aaaa += einsum(tmp30, (0, 1, 2, 3), l2.aaaa, (4, 5, 0, 1), (4, 5, 3, 2)) * 2 - del tmp30 - l2new.aaaa += np.transpose(tmp32, (3, 2, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp7, (2, 3, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp38, (2, 3, 0, 1)) - l2new.aaaa += np.transpose(tmp7, (2, 3, 1, 0)) * 2 - del tmp7 - l2new.aaaa += np.transpose(tmp38, (2, 3, 1, 0)) * -1 - del tmp38 - l2new.aaaa += np.transpose(tmp42, (3, 2, 0, 1)) - l2new.aaaa += np.transpose(tmp47, (2, 3, 0, 1)) - l2new.aaaa += np.transpose(tmp42, (2, 3, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp47, (3, 2, 0, 1)) * -1 - del tmp47 - l2new.aaaa += np.transpose(tmp42, (3, 2, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp49, (2, 3, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp42, (2, 3, 1, 0)) - del tmp42 - l2new.aaaa += np.transpose(tmp49, (3, 2, 1, 0)) - del tmp49 - l2new.aaaa += np.transpose(tmp32, (2, 3, 0, 1)) - del tmp32 - - return {f"l2new": l2new} - -def make_rdm1_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:26:13.923469. - - Parameters - ---------- - l2 : Namespace of arrays - L2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm1 : Namespace of arrays - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - rdm1.aa = Namespace() - rdm1.bb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - rdm1.bb.vv = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - rdm1.bb.vv += einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) * 2 - rdm1.aa.vv = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - rdm1.aa.vv += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) * 2 - rdm1.bb.oo = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 0, 4), (1, 4)) * -1 - rdm1.bb.oo += einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (0, 4)) * -2 - rdm1.bb.oo += delta.bb.oo - rdm1.aa.oo = np.copy(delta.aa.oo) - del delta - rdm1.aa.oo += einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (4, 2)) * -2 - rdm1.aa.oo += einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 4, 1), (0, 4)) * -1 - rdm1.aa.oo = np.zeros((t2.aa.shape[0], t2.aa.shape[0])) - rdm1.aa.vv = np.zeros((t2.aa.shape[-1], t2.aa.shape[-1])) - rdm1.bb.oo = np.zeros((t2.bb.shape[0], t2.bb.shape[0])) - rdm1.bb.vv = np.zeros((t2.bb.shape[-1], t2.bb.shape[-1])) - rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]]) - rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]]) - - return rdm1 - -def make_rdm2_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:26:29.603509. - - Parameters - ---------- - l2 : Namespace of arrays - L2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm2 : Namespace of arrays - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - rdm2.aaaa = Namespace() - rdm2.abab = Namespace() - rdm2.bbbb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - tmp6 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp5 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp0 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 1), (4, 0)) - tmp1 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp25 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - tmp26 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 1), (0, 4)) - tmp13 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 1), (0, 4)) - tmp14 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - tmp39 = einsum(l2.aaaa, (0, 1, 2, 3), t2.abab, (3, 4, 1, 5), (2, 4, 0, 5)) - tmp12 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp28 = np.copy(tmp5) - tmp28 += tmp6 * 2 - tmp37 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp41 = einsum(l2.abab, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp11 = np.copy(tmp5) * 0.5 - tmp11 += tmp6 - tmp20 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp30 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp22 = einsum(l2.abab, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 0), (4, 3, 5, 1)) - tmp18 = einsum(t2.abab, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 1), (0, 5, 2, 4)) - tmp8 = np.copy(tmp0) - tmp8 += tmp1 * 0.5 - tmp4 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp45 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 5, 0, 1), (4, 5, 2, 3)) - tmp44 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 5), (0, 1, 4, 5)) - tmp27 = np.copy(tmp25) * 0.5 - tmp27 += tmp26 - tmp43 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 0, 5), (5, 1, 4, 3)) - tmp15 = np.copy(tmp13) * 2 - tmp15 += tmp14 - tmp33 = np.copy(tmp25) - del tmp25 - tmp33 += tmp26 * 2 - del tmp26 - tmp24 = np.copy(tmp13) - del tmp13 - tmp24 += tmp14 * 0.5 - del tmp14 - tmp29 = einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 4, 5, 1), (5, 0, 4, 3)) - tmp40 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (0, 4, 2, 5), (4, 1, 5, 3)) - tmp36 = einsum(tmp12, (0, 1, 2, 3), t2.bbbb, (1, 0, 4, 5), (3, 2, 4, 5)) - tmp34 = einsum(tmp28, (0, 1), t2.bbbb, (2, 0, 3, 4), (1, 2, 3, 4)) * -1 - tmp38 = einsum(t2.bbbb, (0, 1, 2, 3), tmp37, (1, 4, 3, 5), (4, 0, 5, 2)) - tmp42 = einsum(t2.abab, (0, 1, 2, 3), tmp41, (0, 4, 2, 5), (1, 4, 3, 5)) - tmp35 = einsum(tmp11, (0, 1), t2.bbbb, (2, 0, 3, 4), (2, 1, 3, 4)) * -2 - tmp9 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 5, 0, 1), (2, 4, 3, 5)) - tmp31 = np.copy(tmp20) * 4 - tmp31 += tmp30 - tmp3 = np.copy(tmp0) * 2 - tmp3 += tmp1 - tmp32 = np.copy(tmp22) - tmp32 += tmp18 - tmp23 = einsum(t2.abab, (0, 1, 2, 3), tmp22, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp21 = einsum(t2.aaaa, (0, 1, 2, 3), tmp20, (1, 4, 3, 5), (0, 4, 2, 5)) - tmp16 = einsum(t2.aaaa, (0, 1, 2, 3), tmp8, (1, 4), (0, 4, 2, 3)) * -2 - tmp19 = einsum(tmp18, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp17 = einsum(tmp4, (0, 1, 2, 3), t2.aaaa, (1, 0, 4, 5), (3, 2, 4, 5)) - tmp10 = np.copy(delta.bb.oo) * -1 - tmp10 += tmp5 - tmp10 += tmp6 * 2 - tmp7 = np.copy(delta.bb.oo) * -0.5 - tmp7 += tmp5 * 0.5 - del tmp5 - tmp7 += tmp6 - del tmp6 - tmp2 = np.copy(delta.aa.oo) * -0.5 - tmp2 += tmp0 - del tmp0 - tmp2 += tmp1 * 0.5 - del tmp1 - rdm2.bbbb.vvvv = np.copy(np.transpose(tmp45, (1, 0, 3, 2))) * 2 - del tmp45 - rdm2.abab.vvvv = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 5), (0, 1, 4, 5)) - rdm2.aaaa.vvvv = np.copy(np.transpose(tmp44, (1, 0, 3, 2))) * 2 - del tmp44 - rdm2.bbbb.vvoo = np.copy(l2.bbbb) * 2 - rdm2.abab.vvoo = np.copy(l2.abab) - rdm2.aaaa.vvoo = np.copy(l2.aaaa) * 2 - rdm2.bbbb.vovo = einsum(tmp27, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.bbbb.vovo += np.transpose(tmp43, (2, 1, 3, 0)) * -1 - rdm2.bbbb.vovo += np.transpose(tmp37, (2, 1, 3, 0)) * -4 - rdm2.abab.vovo = einsum(delta.bb.oo, (0, 1), tmp15, (2, 3), (2, 0, 3, 1)) - rdm2.abab.vovo += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 5, 1), (0, 4, 5, 3)) * -1 - rdm2.aaaa.vovo = einsum(delta.aa.oo, (0, 1), tmp15, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.vovo += np.transpose(tmp20, (2, 1, 3, 0)) * -4 - rdm2.aaaa.vovo += np.transpose(tmp30, (2, 1, 3, 0)) * -1 - rdm2.bbbb.voov = einsum(delta.bb.oo, (0, 1), tmp33, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.voov += np.transpose(tmp43, (2, 1, 0, 3)) - rdm2.bbbb.voov += np.transpose(tmp37, (2, 1, 0, 3)) * 4 - rdm2.abab.voov = np.copy(np.transpose(tmp41, (2, 1, 0, 3))) * 2 - del tmp41 - rdm2.abab.voov += np.transpose(tmp39, (2, 1, 0, 3)) * 2 - del tmp39 - rdm2.aaaa.voov = einsum(delta.aa.oo, (0, 1), tmp24, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.aaaa.voov += np.transpose(tmp20, (2, 1, 0, 3)) * 4 - rdm2.aaaa.voov += np.transpose(tmp30, (2, 1, 0, 3)) - rdm2.bbbb.ovvo = einsum(tmp27, (0, 1), delta.bb.oo, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.bbbb.ovvo += np.transpose(tmp43, (1, 2, 3, 0)) - rdm2.bbbb.ovvo += np.transpose(tmp37, (1, 2, 3, 0)) * 4 - rdm2.abab.ovvo = np.copy(np.transpose(tmp18, (0, 3, 2, 1))) * 2 - del tmp18 - rdm2.abab.ovvo += np.transpose(tmp22, (0, 3, 2, 1)) * 2 - del tmp22 - rdm2.aaaa.ovvo = einsum(delta.aa.oo, (0, 1), tmp15, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.ovvo += np.transpose(tmp20, (1, 2, 3, 0)) * 4 - rdm2.aaaa.ovvo += np.transpose(tmp30, (1, 2, 3, 0)) - rdm2.bbbb.ovov = einsum(delta.bb.oo, (0, 1), tmp33, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.ovov += np.transpose(tmp43, (1, 2, 0, 3)) * -1 - del tmp43 - rdm2.bbbb.ovov += np.transpose(tmp37, (1, 2, 0, 3)) * -4 - del tmp37 - rdm2.abab.ovov = einsum(delta.aa.oo, (0, 1), tmp33, (2, 3), (0, 2, 1, 3)) - rdm2.abab.ovov += np.transpose(tmp29, (1, 2, 0, 3)) * -1 - rdm2.aaaa.ovov = einsum(delta.aa.oo, (0, 1), tmp24, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.aaaa.ovov += np.transpose(tmp20, (1, 2, 0, 3)) * -4 - del tmp20 - rdm2.aaaa.ovov += np.transpose(tmp30, (1, 2, 0, 3)) * -1 - del tmp30 - rdm2.bbbb.oovv = np.copy(t2.bbbb) * 2 - rdm2.bbbb.oovv += einsum(t2.bbbb, (0, 1, 2, 3), tmp33, (3, 4), (0, 1, 2, 4)) * -2 - del tmp33 - rdm2.bbbb.oovv += np.transpose(tmp34, (0, 1, 3, 2)) - rdm2.bbbb.oovv += np.transpose(tmp35, (1, 0, 3, 2)) - rdm2.bbbb.oovv += np.transpose(tmp35, (0, 1, 3, 2)) * -1 - del tmp35 - rdm2.bbbb.oovv += np.transpose(tmp34, (1, 0, 3, 2)) * -1 - del tmp34 - rdm2.bbbb.oovv += np.transpose(tmp36, (0, 1, 3, 2)) * -2 - del tmp36 - rdm2.bbbb.oovv += np.transpose(tmp38, (0, 1, 3, 2)) * -8 - rdm2.bbbb.oovv += np.transpose(tmp40, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp42, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp42, (1, 0, 2, 3)) * -2 - rdm2.bbbb.oovv += tmp38 * 8 - del tmp38 - rdm2.bbbb.oovv += np.transpose(tmp40, (1, 0, 3, 2)) * 2 - del tmp40 - rdm2.bbbb.oovv += tmp42 * 2 - rdm2.bbbb.oovv += np.transpose(tmp42, (1, 0, 3, 2)) * 2 - del tmp42 - rdm2.bbbb.oovv += einsum(t2.bbbb, (0, 1, 2, 3), tmp27, (3, 4), (0, 1, 4, 2)) * 4 - rdm2.abab.oovv = np.copy(t2.abab) - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp27, (3, 4), (0, 1, 2, 4)) * -2 - del tmp27 - rdm2.abab.oovv += einsum(tmp3, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -1 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp28, (1, 4), (0, 4, 2, 3)) * -1 - del tmp28 - rdm2.abab.oovv += einsum(tmp9, (0, 1, 2, 3), t2.abab, (0, 2, 4, 5), (1, 3, 4, 5)) - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp29, (0, 4, 3, 5), (4, 1, 2, 5)) - del tmp29 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp31, (0, 4, 2, 5), (4, 1, 5, 3)) - del tmp31 - rdm2.abab.oovv += einsum(t2.bbbb, (0, 1, 2, 3), tmp32, (4, 1, 5, 3), (4, 0, 5, 2)) * 4 - del tmp32 - rdm2.abab.oovv += einsum(tmp15, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1 - rdm2.aaaa.oovv = np.copy(t2.aaaa) * 2 - rdm2.aaaa.oovv += einsum(t2.aaaa, (0, 1, 2, 3), tmp15, (3, 4), (0, 1, 2, 4)) * -2 - del tmp15 - rdm2.aaaa.oovv += np.transpose(tmp16, (1, 0, 3, 2)) * 2 - rdm2.aaaa.oovv += np.transpose(tmp16, (0, 1, 3, 2)) * -2 - del tmp16 - rdm2.aaaa.oovv += np.transpose(tmp17, (0, 1, 3, 2)) * -2 - del tmp17 - rdm2.aaaa.oovv += np.transpose(tmp19, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp21, (0, 1, 3, 2)) * -8 - rdm2.aaaa.oovv += np.transpose(tmp23, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp23, (1, 0, 2, 3)) * -2 - rdm2.aaaa.oovv += tmp19 * 2 - del tmp19 - rdm2.aaaa.oovv += tmp21 * 8 - del tmp21 - rdm2.aaaa.oovv += tmp23 * 2 - rdm2.aaaa.oovv += np.transpose(tmp23, (1, 0, 3, 2)) * 2 - del tmp23 - rdm2.aaaa.oovv += einsum(t2.aaaa, (0, 1, 2, 3), tmp24, (3, 4), (0, 1, 4, 2)) * 4 - del tmp24 - rdm2.bbbb.oooo = einsum(delta.bb.oo, (0, 1), tmp10, (2, 3), (0, 3, 1, 2)) * -1 - rdm2.bbbb.oooo += einsum(delta.bb.oo, (0, 1), tmp10, (2, 3), (3, 0, 1, 2)) - del tmp10 - rdm2.bbbb.oooo += einsum(tmp11, (0, 1), delta.bb.oo, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.bbbb.oooo += einsum(tmp11, (0, 1), delta.bb.oo, (2, 3), (2, 1, 0, 3)) * 2 - del tmp11 - rdm2.bbbb.oooo += np.transpose(tmp12, (3, 2, 1, 0)) * 2 - del tmp12 - rdm2.abab.oooo = einsum(delta.aa.oo, (0, 1), tmp7, (2, 3), (0, 3, 1, 2)) * -2 - del tmp7 - rdm2.abab.oooo += einsum(delta.bb.oo, (0, 1), tmp8, (2, 3), (3, 0, 2, 1)) * -2 - del tmp8 - rdm2.abab.oooo += np.transpose(tmp9, (1, 3, 0, 2)) - del tmp9 - rdm2.aaaa.oooo = einsum(delta.aa.oo, (0, 1), tmp2, (2, 3), (0, 3, 1, 2)) * -2 - rdm2.aaaa.oooo += einsum(delta.aa.oo, (0, 1), tmp2, (2, 3), (3, 0, 1, 2)) * 2 - del tmp2 - rdm2.aaaa.oooo += einsum(delta.aa.oo, (0, 1), tmp3, (2, 3), (3, 0, 2, 1)) * -1 - rdm2.aaaa.oooo += einsum(delta.aa.oo, (0, 1), tmp3, (2, 3), (0, 3, 2, 1)) - del delta, tmp3 - rdm2.aaaa.oooo += np.transpose(tmp4, (3, 2, 1, 0)) * 2 - del tmp4 - rdm2.aaaa.ooov = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm2.aaaa.oovo = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm2.aaaa.ovoo = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[0])) - rdm2.aaaa.vooo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[0])) - rdm2.aaaa.ovvv = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[-1])) - rdm2.aaaa.vovv = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[-1])) - rdm2.aaaa.vvov = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm2.aaaa.vvvo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm2.aabb.ooov = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm2.aabb.oovo = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm2.aabb.ovoo = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[0])) - rdm2.aabb.vooo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[0])) - rdm2.aabb.ovvv = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[-1])) - rdm2.aabb.vovv = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[-1])) - rdm2.aabb.vvov = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm2.aabb.vvvo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm2.bbaa.ooov = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm2.bbaa.oovo = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm2.bbaa.ovoo = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[0])) - rdm2.bbaa.vooo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[0])) - rdm2.bbaa.ovvv = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[-1])) - rdm2.bbaa.vovv = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[-1])) - rdm2.bbaa.vvov = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm2.bbaa.vvvo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm2.bbbb.ooov = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm2.bbbb.oovo = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm2.bbbb.ovoo = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[0])) - rdm2.bbbb.vooo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[0])) - rdm2.bbbb.ovvv = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[-1])) - rdm2.bbbb.vovv = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[-1])) - rdm2.bbbb.vvov = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm2.bbbb.vvvo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv) - rdm2.abab = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv) - rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv) - rdm2 = Namespace( - aaaa=np.transpose(rdm2.aaaa, (0, 2, 1, 3)), - aabb=np.transpose(rdm2.abab, (0, 2, 1, 3)), - bbbb=np.transpose(rdm2.bbbb, (0, 2, 1, 3)), - ) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:27:38.441351. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp101 : array - tmp108 : array - tmp111 : array - tmp112 : array - tmp114 : array - tmp115 : array - tmp116 : array - tmp118 : array - tmp12 : array - tmp121 : array - tmp125 : array - tmp126 : array - tmp127 : array - tmp128 : array - tmp129 : array - tmp131 : array - tmp133 : array - tmp136 : array - tmp139 : array - tmp14 : array - tmp142 : array - tmp143 : array - tmp148 : array - tmp150 : array - tmp153 : array - tmp155 : array - tmp157 : array - tmp159 : array - tmp16 : array - tmp169 : array - tmp17 : array - tmp19 : array - tmp20 : array - tmp27 : array - tmp28 : array - tmp3 : array - tmp30 : array - tmp32 : array - tmp33 : array - tmp36 : array - tmp37 : array - tmp38 : array - tmp40 : array - tmp41 : array - tmp42 : array - tmp44 : array - tmp46 : array - tmp48 : array - tmp5 : array - tmp50 : array - tmp52 : array - tmp55 : array - tmp56 : array - tmp6 : array - tmp61 : array - tmp65 : array - tmp69 : array - tmp77 : array - tmp79 : array - tmp8 : array - tmp81 : array - tmp83 : array - tmp84 : array - tmp85 : array - tmp9 : array - tmp92 : array - tmp93 : array - tmp96 : array - """ - - tmp19 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp16 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp12 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp55 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp147 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp65 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp14 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp32 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp1 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp107 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp3 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp5 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp8 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp76 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp29 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp169 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp159 = einsum(tmp19, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp157 = einsum(v.bbb.xoo, (0, 1, 2), tmp16, (0, 3, 4), (3, 1, 2, 4)) - tmp155 = einsum(t2.bbbb, (0, 1, 2, 3), tmp12, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp153 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp150 = einsum(tmp55, (0, 1, 2, 3), t2.bbbb, (4, 5, 3, 2), (4, 5, 1, 0)) - tmp148 = einsum(t2.bbbb, (0, 1, 2, 3), tmp147, (4, 5, 2, 3), (0, 1, 4, 5)) * -1 - del tmp147 - tmp143 = einsum(v.bbb.xvv, (0, 1, 2), tmp19, (0, 3, 2), (3, 1)) - tmp142 = einsum(tmp16, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) * -1 - tmp139 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp136 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp133 = einsum(tmp65, (0, 1, 2, 3), t2.abab, (4, 1, 2, 5), (4, 0, 5, 3)) - tmp131 = einsum(tmp19, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp129 = einsum(v.bbb.xov, (0, 1, 2), tmp16, (0, 1, 3), (3, 2)) - tmp128 = einsum(tmp14, (0, 1, 2, 3), t2.abab, (4, 2, 3, 5), (4, 0, 1, 5)) - tmp127 = einsum(tmp14, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) - tmp126 = einsum(t2.bbbb, (0, 1, 2, 3), tmp12, (4, 0, 1, 3), (4, 2)) - tmp125 = einsum(f.aa.ov, (0, 1), t2.abab, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp121 = einsum(t2.bbbb, (0, 1, 2, 3), tmp55, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp118 = einsum(t2.abab, (0, 1, 2, 3), tmp32, (0, 4, 5, 2), (4, 1, 5, 3)) - tmp116 = einsum(v.baa.xoo, (0, 1, 2), tmp16, (0, 3, 4), (1, 2, 3, 4)) - tmp115 = einsum(v.baa.xoo, (0, 1, 2), tmp19, (0, 3, 4), (1, 2, 3, 4)) - tmp114 = einsum(t2.abab, (0, 1, 2, 3), tmp1, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp112 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp111 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp108 = einsum(t2.abab, (0, 1, 2, 3), tmp107, (4, 2, 5, 3), (0, 4, 1, 5)) - del tmp107 - tmp101 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp96 = einsum(t2.abab, (0, 1, 2, 3), tmp65, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp93 = einsum(tmp3, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp92 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (4, 3), (0, 4, 1, 2)) - tmp85 = einsum(v.bbb.xoo, (0, 1, 2), tmp5, (0, 3, 4), (3, 1, 2, 4)) - tmp84 = einsum(v.bbb.xoo, (0, 1, 2), tmp8, (0, 3, 4), (3, 1, 2, 4)) - tmp83 = einsum(tmp12, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 2, 5)) - tmp81 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 2, 3, 4)) - tmp79 = einsum(t2.abab, (0, 1, 2, 3), tmp65, (4, 5, 2, 3), (0, 4, 1, 5)) - tmp77 = einsum(tmp76, (0, 1, 2, 3), t2.abab, (4, 5, 2, 3), (4, 5, 0, 1)) - del tmp76 - tmp69 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp61 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (4, 3), (4, 0, 1, 2)) - tmp56 = einsum(t2.abab, (0, 1, 2, 3), tmp55, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp52 = einsum(t2.aaaa, (0, 1, 2, 3), tmp32, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp50 = einsum(tmp8, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp48 = einsum(tmp5, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp46 = einsum(v.baa.xoo, (0, 1, 2), tmp8, (0, 3, 4), (3, 1, 2, 4)) - tmp44 = einsum(v.baa.xoo, (0, 1, 2), tmp5, (0, 3, 4), (3, 1, 2, 4)) - tmp42 = einsum(t2.aaaa, (0, 1, 2, 3), tmp1, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp41 = einsum(tmp3, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp40 = einsum(t2.aaaa, (0, 1, 2, 3), tmp1, (4, 0, 1, 3), (4, 2)) - tmp38 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp37 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp36 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp33 = einsum(tmp32, (0, 1, 2, 3), t2.aaaa, (4, 5, 3, 2), (4, 5, 1, 0)) - tmp30 = einsum(tmp29, (0, 1, 2, 3), t2.aaaa, (4, 5, 2, 3), (4, 5, 0, 1)) * -1 - del tmp29 - tmp28 = einsum(v.baa.xvv, (0, 1, 2), tmp8, (0, 3, 2), (3, 1)) - tmp27 = einsum(v.baa.xvv, (0, 1, 2), tmp5, (0, 3, 2), (3, 1)) * -1 - tmp20 = einsum(v.bbb.xov, (0, 1, 2), tmp19, (0, 3, 2), (3, 1)) - tmp17 = einsum(v.bbb.xov, (0, 1, 2), tmp16, (0, 3, 2), (3, 1)) - tmp9 = einsum(tmp8, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp6 = einsum(tmp5, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - - return {f"tmp1": tmp1, f"tmp101": tmp101, f"tmp108": tmp108, f"tmp111": tmp111, f"tmp112": tmp112, f"tmp114": tmp114, f"tmp115": tmp115, f"tmp116": tmp116, f"tmp118": tmp118, f"tmp12": tmp12, f"tmp121": tmp121, f"tmp125": tmp125, f"tmp126": tmp126, f"tmp127": tmp127, f"tmp128": tmp128, f"tmp129": tmp129, f"tmp131": tmp131, f"tmp133": tmp133, f"tmp136": tmp136, f"tmp139": tmp139, f"tmp14": tmp14, f"tmp142": tmp142, f"tmp143": tmp143, f"tmp148": tmp148, f"tmp150": tmp150, f"tmp153": tmp153, f"tmp155": tmp155, f"tmp157": tmp157, f"tmp159": tmp159, f"tmp16": tmp16, f"tmp169": tmp169, f"tmp17": tmp17, f"tmp19": tmp19, f"tmp20": tmp20, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp32": tmp32, f"tmp33": tmp33, f"tmp36": tmp36, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp42": tmp42, f"tmp44": tmp44, f"tmp46": tmp46, f"tmp48": tmp48, f"tmp5": tmp5, f"tmp50": tmp50, f"tmp52": tmp52, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp6": tmp6, f"tmp61": tmp61, f"tmp65": tmp65, f"tmp69": tmp69, f"tmp77": tmp77, f"tmp79": tmp79, f"tmp8": tmp8, f"tmp81": tmp81, f"tmp83": tmp83, f"tmp84": tmp84, f"tmp85": tmp85, f"tmp9": tmp9, f"tmp92": tmp92, f"tmp93": tmp93, f"tmp96": tmp96} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:27:38.525467. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp3 = einsum(v.bbb.xov, (0, 1, 2), r2.bab, (1, 3, 2), (0, 3)) * -1 - tmp2 = einsum(r2.aaa, (0, 1, 2), v.baa.xov, (3, 1, 2), (3, 0)) - tmp52 = np.copy(ints.tmp159) - del ints.tmp159 - tmp52 += ints.tmp157 * 2 - del ints.tmp157 - tmp39 = np.copy(ints.tmp139) - del ints.tmp139 - tmp39 += ints.tmp121 * 2 - del ints.tmp121 - tmp31 = einsum(r2.aba, (0, 1, 2), v.baa.xov, (3, 0, 2), (3, 1)) - tmp50 = np.copy(ints.tmp19) - tmp50 += ints.tmp16 * 2 - tmp32 = einsum(v.bbb.xov, (0, 1, 2), r2.bbb, (3, 1, 2), (0, 3)) - tmp59 = np.copy(ints.tmp17) * 2 - tmp59 += ints.tmp20 - tmp57 = np.copy(ints.tmp16) - tmp57 += ints.tmp19 * 0.5 - tmp61 = np.copy(ints.tmp12) - tmp61 += np.transpose(ints.tmp155, (0, 2, 1, 3)) * 2 - del ints.tmp155 - tmp14 = np.copy(ints.tmp69) - tmp14 += ints.tmp52 * 2 - tmp18 = np.copy(ints.tmp46) - del ints.tmp46 - tmp18 += ints.tmp44 * 2 - del ints.tmp44 - tmp16 = np.copy(tmp2) * 2 - tmp16 += tmp3 - tmp4 = np.copy(tmp2) * 2 - tmp4 += tmp3 - tmp5 = np.copy(ints.tmp5) - tmp5 += ints.tmp8 * 0.5 - tmp7 = np.copy(ints.tmp6) * 2 - tmp7 += ints.tmp9 - tmp9 = np.copy(ints.tmp1) - tmp9 += np.transpose(ints.tmp42, (0, 2, 1, 3)) * 2 - del ints.tmp42 - tmp53 = einsum(r1.b, (0,), tmp52, (1, 0, 2, 3), (1, 2, 3)) - del tmp52 - tmp49 = einsum(tmp39, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (4, 0, 2)) * -1 - tmp51 = einsum(tmp31, (0, 1), tmp50, (0, 2, 3), (1, 2, 3)) - del tmp50 - tmp47 = einsum(r2.bbb, (0, 1, 2), f.bb.oo, (3, 1), (3, 0, 2)) - tmp48 = einsum(tmp32, (0, 1), v.bbb.xov, (0, 2, 3), (1, 2, 3)) - tmp60 = einsum(r2.bbb, (0, 1, 2), tmp59, (3, 1), (0, 3, 2)) * -2 - del tmp59 - tmp58 = einsum(tmp32, (0, 1), tmp57, (0, 2, 3), (1, 2, 3)) * 4 - del tmp57 - tmp55 = einsum(r2.aba, (0, 1, 2), ints.tmp118, (0, 3, 2, 4), (3, 1, 4)) - tmp62 = einsum(r1.b, (0,), tmp61, (1, 0, 2, 3), (1, 2, 3)) - del tmp61 - tmp56 = einsum(v.bbb.xov, (0, 1, 2), tmp31, (0, 3), (3, 1, 2)) - tmp36 = einsum(ints.tmp55, (0, 1, 2, 3), r2.bbb, (1, 0, 2), (3,)) * -1 - del ints.tmp55 - tmp35 = einsum(r2.aba, (0, 1, 2), ints.tmp65, (0, 1, 2, 3), (3,)) - tmp23 = einsum(ints.tmp32, (0, 1, 2, 3), r2.aaa, (0, 1, 2), (3,)) - del ints.tmp32 - tmp24 = einsum(ints.tmp65, (0, 1, 2, 3), r2.bab, (1, 0, 3), (2,)) * -1 - del ints.tmp65 - tmp13 = einsum(ints.tmp56, (0, 1, 2, 3), r2.bab, (1, 4, 3), (0, 4, 2)) * -1 - tmp15 = einsum(tmp14, (0, 1, 2, 3), r2.aaa, (4, 1, 3), (4, 0, 2)) * -1 - del tmp14 - tmp19 = einsum(r1.a, (0,), tmp18, (1, 0, 2, 3), (1, 2, 3)) - del tmp18 - tmp17 = einsum(tmp16, (0, 1), v.baa.xov, (0, 2, 3), (2, 1, 3)) - del tmp16 - tmp12 = einsum(f.aa.oo, (0, 1), r2.aaa, (2, 1, 3), (0, 2, 3)) - tmp6 = einsum(tmp4, (0, 1), tmp5, (0, 2, 3), (1, 2, 3)) * 2 - del tmp4, tmp5 - tmp8 = einsum(r2.aaa, (0, 1, 2), tmp7, (3, 1), (0, 3, 2)) * -2 - del tmp7 - tmp10 = einsum(r1.a, (0,), tmp9, (1, 0, 2, 3), (1, 2, 3)) - del tmp9 - tmp54 = np.copy(tmp47) * 2 - del tmp47 - tmp54 += tmp48 * 2 - del tmp48 - tmp54 += np.transpose(tmp49, (1, 0, 2)) * -2 - del tmp49 - tmp54 += np.transpose(tmp51, (1, 0, 2)) - del tmp51 - tmp54 += tmp53 - del tmp53 - tmp63 = np.copy(tmp55) - del tmp55 - tmp63 += tmp56 - del tmp56 - tmp63 += np.transpose(tmp58, (1, 0, 2)) - del tmp58 - tmp63 += np.transpose(tmp60, (1, 0, 2)) - del tmp60 - tmp63 += tmp62 - del tmp62 - tmp46 = np.copy(f.bb.ov) - tmp46 += ints.tmp111 - del ints.tmp111 - tmp46 += ints.tmp112 * 2 - del ints.tmp112 - tmp46 += ints.tmp143 - del ints.tmp143 - tmp46 += ints.tmp126 * -2 - del ints.tmp126 - tmp46 += ints.tmp127 * -1 - del ints.tmp127 - tmp46 += ints.tmp142 * -2 - del ints.tmp142 - tmp44 = np.copy(np.transpose(ints.tmp129, (1, 0))) * 2 - del ints.tmp129 - tmp44 += np.transpose(ints.tmp131, (1, 0)) - del ints.tmp131 - tmp44 += f.bb.vv * -1 - tmp65 = np.copy(ints.tmp148) - del ints.tmp148 - tmp65 += np.transpose(ints.tmp169, (1, 2, 0, 3)) * -1 - del ints.tmp169 - tmp37 = np.copy(tmp35) * 0.5 - del tmp35 - tmp37 += tmp36 - del tmp36 - tmp64 = np.copy(ints.tmp150) - del ints.tmp150 - tmp64 += np.transpose(ints.tmp153, (0, 2, 1, 3)) * -1 - del ints.tmp153 - tmp25 = np.copy(tmp23) * 2 - del tmp23 - tmp25 += tmp24 * -1 - del tmp24 - tmp42 = np.copy(tmp2) - del tmp2 - tmp42 += tmp3 * 0.5 - del tmp3 - tmp40 = np.copy(ints.tmp133) - del ints.tmp133 - tmp40 += ints.tmp136 * -1 - del ints.tmp136 - tmp1 = np.copy(f.bb.oo) - tmp1 += np.transpose(ints.tmp17, (1, 0)) * 2 - del ints.tmp17 - tmp1 += np.transpose(ints.tmp20, (1, 0)) - del ints.tmp20 - tmp41 = np.copy(ints.tmp79) - tmp41 += ints.tmp81 - tmp43 = np.copy(ints.tmp16) * 2 - del ints.tmp16 - tmp43 += ints.tmp19 - del ints.tmp19 - tmp43 += v.bbb.xov - tmp0 = np.copy(f.aa.oo) - tmp0 += np.transpose(ints.tmp6, (1, 0)) * 2 - del ints.tmp6 - tmp0 += np.transpose(ints.tmp9, (1, 0)) - del ints.tmp9 - tmp45 = np.copy(ints.tmp108) - del ints.tmp108 - tmp45 += np.transpose(ints.tmp115, (1, 0, 2, 3)) - del ints.tmp115 - tmp45 += np.transpose(ints.tmp116, (1, 0, 2, 3)) * 2 - del ints.tmp116 - tmp45 += np.transpose(ints.tmp125, (1, 0, 2, 3)) - del ints.tmp125 - tmp45 += ints.tmp3 - tmp45 += ints.tmp114 * -1 - del ints.tmp114 - tmp45 += ints.tmp128 * -1 - del ints.tmp128 - tmp27 = np.copy(f.aa.ov) - tmp27 += ints.tmp28 - del ints.tmp28 - tmp27 += ints.tmp36 * 2 - del ints.tmp36 - tmp27 += ints.tmp37 - del ints.tmp37 - tmp27 += ints.tmp27 * -2 - del ints.tmp27 - tmp27 += ints.tmp40 * -2 - del ints.tmp40 - tmp27 += ints.tmp41 * -1 - del ints.tmp41 - tmp28 = np.copy(ints.tmp52) * 2 - del ints.tmp52 - tmp28 += ints.tmp69 - del ints.tmp69 - tmp30 = np.copy(ints.tmp79) - del ints.tmp79 - tmp30 += ints.tmp81 - del ints.tmp81 - tmp34 = np.copy(ints.tmp5) * 2 - del ints.tmp5 - tmp34 += ints.tmp8 - del ints.tmp8 - tmp34 += v.baa.xov - tmp29 = np.copy(ints.tmp101) - del ints.tmp101 - tmp29 += ints.tmp96 * -1 - del ints.tmp96 - tmp38 = np.copy(ints.tmp14) - tmp38 += ints.tmp77 - del ints.tmp77 - tmp38 += np.transpose(ints.tmp84, (0, 2, 1, 3)) - del ints.tmp84 - tmp38 += np.transpose(ints.tmp85, (0, 2, 1, 3)) * 2 - del ints.tmp85 - tmp38 += np.transpose(ints.tmp92, (0, 2, 1, 3)) - del ints.tmp92 - tmp38 += ints.tmp83 * -1 - del ints.tmp83 - tmp38 += ints.tmp93 * -1 - del ints.tmp93 - tmp22 = np.copy(np.transpose(ints.tmp48, (1, 0))) * 2 - del ints.tmp48 - tmp22 += np.transpose(ints.tmp50, (1, 0)) - del ints.tmp50 - tmp22 += f.aa.vv * -1 - tmp33 = np.copy(tmp31) * -0.5 - del tmp31 - tmp33 += tmp32 - del tmp32 - tmp21 = np.copy(ints.tmp33) - del ints.tmp33 - tmp21 += np.transpose(ints.tmp38, (0, 2, 1, 3)) * -1 - del ints.tmp38 - tmp26 = np.copy(ints.tmp30) - del ints.tmp30 - tmp26 += np.transpose(ints.tmp61, (1, 2, 0, 3)) * -1 - del ints.tmp61 - tmp20 = np.copy(tmp12) * 2 - del tmp12 - tmp20 += tmp13 - del tmp13 - tmp20 += np.transpose(tmp15, (1, 0, 2)) * -2 - del tmp15 - tmp20 += np.transpose(tmp17, (1, 0, 2)) - del tmp17 - tmp20 += tmp19 - del tmp19 - tmp11 = np.copy(np.transpose(tmp6, (1, 0, 2))) - del tmp6 - tmp11 += np.transpose(tmp8, (1, 0, 2)) - del tmp8 - tmp11 += tmp10 - del tmp10 - r2new.bbb = np.copy(tmp54) - r2new.bbb += np.transpose(tmp54, (1, 0, 2)) * -1 - del tmp54 - r2new.bbb += tmp63 * -1 - r2new.bbb += np.transpose(tmp63, (1, 0, 2)) - del tmp63 - r2new.bbb += einsum(tmp64, (0, 1, 2, 3), r2.bbb, (3, 2, 4), (0, 1, 4)) * -2 - del tmp64 - r2new.bbb += einsum(tmp44, (0, 1), r2.bbb, (2, 3, 0), (2, 3, 1)) * -2 - r2new.bbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp37, (3,), (0, 1, 2)) * -4 - r2new.bbb += einsum(r1.b, (0,), tmp65, (1, 2, 0, 3), (2, 1, 3)) * 2 - del tmp65 - r2new.bbb += einsum(r1.b, (0,), tmp46, (1, 2), (0, 1, 2)) - r2new.bbb += einsum(tmp46, (0, 1), r1.b, (2,), (0, 2, 1)) * -1 - r2new.bab = einsum(r2.aaa, (0, 1, 2), ints.tmp118, (1, 3, 2, 4), (3, 0, 4)) * 2 - del ints.tmp118 - r2new.bab += einsum(tmp39, (0, 1, 2, 3), r2.bab, (1, 4, 3), (0, 4, 2)) * -1 - del tmp39 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp40, (3, 1, 4, 2), (0, 3, 4)) - del tmp40 - r2new.bab += einsum(tmp41, (0, 1, 2, 3), r2.bab, (3, 1, 4), (2, 0, 4)) - del tmp41 - r2new.bab += einsum(tmp43, (0, 1, 2), tmp42, (0, 3), (1, 3, 2)) * -2 - del tmp43, tmp42 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp44, (2, 3), (0, 1, 3)) * -1 - del tmp44 - r2new.bab += einsum(tmp25, (0,), t2.abab, (1, 2, 0, 3), (2, 1, 3)) * -1 - r2new.bab += einsum(r1.a, (0,), tmp45, (1, 0, 2, 3), (2, 1, 3)) - del tmp45 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp0, (1, 3), (0, 3, 2)) * -1 - r2new.bab += einsum(tmp1, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -1 - r2new.bab += einsum(tmp46, (0, 1), r1.a, (2,), (0, 2, 1)) * -1 - del tmp46 - r2new.aba = einsum(r2.bbb, (0, 1, 2), ints.tmp56, (3, 1, 4, 2), (3, 0, 4)) * 2 - del ints.tmp56 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp28, (3, 0, 4, 2), (3, 1, 4)) * -1 - del tmp28 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp29, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp29 - r2new.aba += einsum(tmp30, (0, 1, 2, 3), r2.aba, (1, 3, 4), (0, 2, 4)) - del tmp30 - r2new.aba += einsum(tmp33, (0, 1), tmp34, (0, 2, 3), (2, 1, 3)) * -2 - del tmp33, tmp34 - r2new.aba += einsum(tmp22, (0, 1), r2.aba, (2, 3, 0), (2, 3, 1)) * -1 - r2new.aba += einsum(t2.abab, (0, 1, 2, 3), tmp37, (3,), (0, 1, 2)) * -2 - del tmp37 - r2new.aba += einsum(r1.b, (0,), tmp38, (1, 2, 0, 3), (1, 2, 3)) - del tmp38 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp0, (0, 3), (3, 1, 2)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp1, (1, 3), (0, 3, 2)) * -1 - r2new.aba += einsum(tmp27, (0, 1), r1.b, (2,), (0, 2, 1)) * -1 - r2new.aaa = np.copy(tmp11) * -1 - r2new.aaa += np.transpose(tmp11, (1, 0, 2)) - del tmp11 - r2new.aaa += tmp20 - r2new.aaa += np.transpose(tmp20, (1, 0, 2)) * -1 - del tmp20 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp21, (3, 4, 1, 0), (3, 4, 2)) * -2 - del tmp21 - r2new.aaa += einsum(tmp22, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp22 - r2new.aaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp25, (3,), (0, 1, 2)) * -2 - del tmp25 - r2new.aaa += einsum(r1.a, (0,), tmp26, (1, 2, 0, 3), (2, 1, 3)) * 2 - del tmp26 - r2new.aaa += einsum(tmp27, (0, 1), r1.a, (2,), (2, 0, 1)) - r2new.aaa += einsum(tmp27, (0, 1), r1.a, (2,), (0, 2, 1)) * -1 - del tmp27 - r1new.b = einsum(r2.aba, (0, 1, 2), f.aa.ov, (0, 2), (1,)) * -1 - r1new.b += einsum(f.bb.ov, (0, 1), r2.bbb, (2, 0, 1), (2,)) * 2 - r1new.b += einsum(r2.bbb, (0, 1, 2), ints.tmp12, (3, 1, 0, 2), (3,)) * 2 - del ints.tmp12 - r1new.b += einsum(r2.aba, (0, 1, 2), ints.tmp14, (0, 3, 1, 2), (3,)) - del ints.tmp14 - r1new.b += einsum(r1.b, (0,), tmp1, (0, 1), (1,)) * -1 - del tmp1 - r1new.a = einsum(r2.aaa, (0, 1, 2), f.aa.ov, (1, 2), (0,)) * 2 - r1new.a += einsum(r2.aaa, (0, 1, 2), ints.tmp1, (3, 1, 0, 2), (3,)) * 2 - del ints.tmp1 - r1new.a += einsum(f.bb.ov, (0, 1), r2.bab, (0, 2, 1), (2,)) * -1 - r1new.a += einsum(ints.tmp3, (0, 1, 2, 3), r2.bab, (2, 1, 3), (0,)) - del ints.tmp3 - r1new.a += einsum(r1.a, (0,), tmp0, (0, 1), (1,)) * -1 - del tmp0 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:28:48.043964. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp105 : array - tmp107 : array - tmp110 : array - tmp111 : array - tmp113 : array - tmp12 : array - tmp120 : array - tmp121 : array - tmp122 : array - tmp124 : array - tmp126 : array - tmp127 : array - tmp128 : array - tmp129 : array - tmp130 : array - tmp134 : array - tmp137 : array - tmp14 : array - tmp141 : array - tmp143 : array - tmp144 : array - tmp148 : array - tmp150 : array - tmp152 : array - tmp16 : array - tmp165 : array - tmp17 : array - tmp172 : array - tmp19 : array - tmp20 : array - tmp22 : array - tmp23 : array - tmp29 : array - tmp3 : array - tmp31 : array - tmp33 : array - tmp37 : array - tmp38 : array - tmp41 : array - tmp42 : array - tmp5 : array - tmp50 : array - tmp53 : array - tmp55 : array - tmp56 : array - tmp6 : array - tmp62 : array - tmp66 : array - tmp68 : array - tmp69 : array - tmp70 : array - tmp72 : array - tmp77 : array - tmp8 : array - tmp80 : array - tmp82 : array - tmp9 : array - tmp90 : array - tmp94 : array - tmp95 : array - tmp96 : array - """ - - tmp142 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp19 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp12 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp16 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp112 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp41 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp37 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp1 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp62 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp14 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp5 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp8 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp54 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp3 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp52 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp172 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp165 = einsum(t2.bbbb, (0, 1, 2, 3), tmp142, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp152 = einsum(tmp19, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp150 = einsum(tmp12, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 2), (4, 5, 3, 1)) - tmp148 = einsum(tmp16, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp144 = einsum(tmp112, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) - tmp143 = einsum(t2.bbbb, (0, 1, 2, 3), tmp142, (4, 0, 1, 3), (4, 2)) - del tmp142 - tmp141 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp137 = einsum(t2.bbbb, (0, 1, 2, 3), tmp41, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp134 = einsum(t2.abab, (0, 1, 2, 3), tmp37, (0, 4, 5, 2), (4, 1, 5, 3)) - tmp130 = einsum(tmp16, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp129 = einsum(tmp1, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (4, 3, 1, 5)) - tmp128 = einsum(tmp19, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp127 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp126 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp124 = einsum(v.bbb.xov, (0, 1, 2), tmp19, (0, 3, 2), (3, 1)) - tmp122 = einsum(v.bbb.xov, (0, 1, 2), tmp16, (0, 3, 2), (3, 1)) - tmp121 = einsum(v.bbb.xvv, (0, 1, 2), tmp19, (0, 3, 2), (3, 1)) - tmp120 = einsum(tmp16, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) * -1 - tmp113 = einsum(t2.abab, (0, 1, 2, 3), tmp112, (0, 4, 1, 5), (4, 2, 5, 3)) - del tmp112 - tmp111 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp110 = einsum(t2.abab, (0, 1, 2, 3), tmp62, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp107 = einsum(tmp14, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (4, 5, 1, 2)) - tmp105 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp96 = einsum(tmp5, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp95 = einsum(tmp12, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 5, 3, 1)) - tmp94 = einsum(tmp8, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp90 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp82 = einsum(tmp54, (0, 1, 2, 3), t2.abab, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp80 = einsum(t2.abab, (0, 1, 2, 3), tmp62, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp77 = einsum(tmp3, (0, 1, 2, 3), t2.abab, (4, 0, 2, 5), (4, 1, 5, 3)) - tmp72 = einsum(tmp8, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp70 = einsum(tmp5, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp69 = einsum(v.baa.xvv, (0, 1, 2), tmp8, (0, 3, 2), (3, 1)) - tmp68 = einsum(v.baa.xvv, (0, 1, 2), tmp5, (0, 3, 2), (3, 1)) * -1 - tmp66 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp56 = einsum(t2.aaaa, (0, 1, 2, 3), tmp52, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp55 = einsum(tmp54, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - del tmp54 - tmp53 = einsum(t2.aaaa, (0, 1, 2, 3), tmp52, (4, 0, 1, 3), (4, 2)) - del tmp52 - tmp50 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp42 = einsum(t2.abab, (0, 1, 2, 3), tmp41, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp38 = einsum(t2.aaaa, (0, 1, 2, 3), tmp37, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp33 = einsum(v.baa.xvv, (0, 1, 2), tmp8, (0, 3, 4), (3, 4, 1, 2)) - tmp31 = einsum(tmp1, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (4, 5, 3, 1)) - tmp29 = einsum(v.baa.xvv, (0, 1, 2), tmp5, (0, 3, 4), (3, 4, 1, 2)) - tmp23 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp22 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp20 = einsum(tmp19, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp17 = einsum(v.bbb.xov, (0, 1, 2), tmp16, (0, 1, 3), (3, 2)) - tmp9 = einsum(tmp8, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp6 = einsum(tmp5, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - - return {f"tmp1": tmp1, f"tmp105": tmp105, f"tmp107": tmp107, f"tmp110": tmp110, f"tmp111": tmp111, f"tmp113": tmp113, f"tmp12": tmp12, f"tmp120": tmp120, f"tmp121": tmp121, f"tmp122": tmp122, f"tmp124": tmp124, f"tmp126": tmp126, f"tmp127": tmp127, f"tmp128": tmp128, f"tmp129": tmp129, f"tmp130": tmp130, f"tmp134": tmp134, f"tmp137": tmp137, f"tmp14": tmp14, f"tmp141": tmp141, f"tmp143": tmp143, f"tmp144": tmp144, f"tmp148": tmp148, f"tmp150": tmp150, f"tmp152": tmp152, f"tmp16": tmp16, f"tmp165": tmp165, f"tmp17": tmp17, f"tmp172": tmp172, f"tmp19": tmp19, f"tmp20": tmp20, f"tmp22": tmp22, f"tmp23": tmp23, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp31": tmp31, f"tmp33": tmp33, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp41": tmp41, f"tmp42": tmp42, f"tmp5": tmp5, f"tmp50": tmp50, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp6": tmp6, f"tmp62": tmp62, f"tmp66": tmp66, f"tmp68": tmp68, f"tmp69": tmp69, f"tmp70": tmp70, f"tmp72": tmp72, f"tmp77": tmp77, f"tmp8": tmp8, f"tmp80": tmp80, f"tmp82": tmp82, f"tmp9": tmp9, f"tmp90": tmp90, f"tmp94": tmp94, f"tmp95": tmp95, f"tmp96": tmp96} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:28:48.122475. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp4 = einsum(v.bbb.xov, (0, 1, 2), r2.bab, (2, 3, 1), (0, 3)) * -1 - tmp3 = einsum(r2.aaa, (0, 1, 2), v.baa.xov, (3, 2, 1), (3, 0)) - tmp40 = np.copy(ints.tmp111) - del ints.tmp111 - tmp40 += ints.tmp137 * 2 - del ints.tmp137 - tmp52 = np.copy(ints.tmp12) - tmp52 += ints.tmp150 * 2 - del ints.tmp150 - tmp31 = einsum(r2.bbb, (0, 1, 2), v.bbb.xov, (3, 2, 1), (3, 0)) - tmp50 = np.copy(ints.tmp19) - tmp50 += ints.tmp16 * 2 - tmp30 = einsum(v.baa.xov, (0, 1, 2), r2.aba, (2, 3, 1), (0, 3)) - tmp57 = np.copy(ints.tmp16) * 2 - tmp57 += ints.tmp19 - tmp60 = np.copy(ints.tmp148) - del ints.tmp148 - tmp60 += ints.tmp152 * 0.5 - del ints.tmp152 - tmp44 = np.copy(np.transpose(ints.tmp17, (1, 0))) - tmp44 += np.transpose(ints.tmp20, (1, 0)) * 0.5 - tmp44 += f.bb.vv * -0.5 - tmp14 = np.copy(ints.tmp50) - tmp14 += ints.tmp38 * 2 - tmp16 = np.copy(tmp3) * 2 - tmp16 += tmp4 - tmp18 = np.copy(ints.tmp1) - tmp18 += ints.tmp31 * 2 - del ints.tmp31 - tmp8 = np.copy(np.transpose(ints.tmp6, (1, 0))) - tmp8 += np.transpose(ints.tmp9, (1, 0)) * 0.5 - tmp8 += f.aa.vv * -0.5 - tmp6 = np.copy(ints.tmp5) * 2 - tmp6 += ints.tmp8 - tmp5 = np.copy(tmp3) - del tmp3 - tmp5 += tmp4 * 0.5 - del tmp4 - tmp10 = np.copy(ints.tmp29) - del ints.tmp29 - tmp10 += ints.tmp33 * 0.5 - del ints.tmp33 - tmp49 = einsum(r2.bbb, (0, 1, 2), tmp40, (3, 2, 4, 1), (3, 0, 4)) * -1 - tmp53 = einsum(tmp52, (0, 1, 2, 3), r1.b, (2,), (0, 1, 3)) - del tmp52 - tmp48 = einsum(tmp31, (0, 1), v.bbb.xov, (0, 2, 3), (2, 1, 3)) - tmp51 = einsum(tmp50, (0, 1, 2), tmp30, (0, 3), (1, 3, 2)) - del tmp50 - tmp37 = einsum(r2.bbb, (0, 1, 2), ints.tmp41, (2, 3, 1, 0), (3,)) * -1 - tmp36 = einsum(ints.tmp62, (0, 1, 2, 3), r2.aba, (2, 3, 0), (1,)) - tmp35 = einsum(f.bb.ov, (0, 1), r1.b, (1,), (0,)) - tmp58 = einsum(tmp31, (0, 1), tmp57, (0, 2, 3), (2, 1, 3)) * 2 - del tmp57 - tmp55 = einsum(r2.aba, (0, 1, 2), ints.tmp134, (2, 3, 0, 4), (3, 4, 1)) - tmp61 = einsum(tmp60, (0, 1, 2, 3), r1.b, (2,), (0, 1, 3)) * 2 - del tmp60 - tmp56 = einsum(tmp30, (0, 1), v.bbb.xov, (0, 2, 3), (2, 1, 3)) - tmp59 = einsum(r2.bbb, (0, 1, 2), tmp44, (1, 3), (2, 0, 3)) * -4 - tmp22 = einsum(r2.aaa, (0, 1, 2), ints.tmp37, (2, 3, 1, 0), (3,)) * -1 - tmp23 = einsum(ints.tmp62, (0, 1, 2, 3), r2.bab, (3, 2, 1), (0,)) * -1 - tmp21 = einsum(f.aa.ov, (0, 1), r1.a, (1,), (0,)) - tmp15 = einsum(r2.aaa, (0, 1, 2), tmp14, (3, 2, 4, 1), (3, 0, 4)) * -1 - del tmp14 - tmp17 = einsum(tmp16, (0, 1), v.baa.xov, (0, 2, 3), (2, 3, 1)) - del tmp16 - tmp13 = einsum(r2.bab, (0, 1, 2), ints.tmp42, (3, 2, 4, 0), (3, 4, 1)) * -1 - tmp19 = einsum(r1.a, (0,), tmp18, (1, 2, 0, 3), (1, 2, 3)) - del tmp18 - tmp9 = einsum(tmp8, (0, 1), r2.aaa, (2, 0, 3), (3, 2, 1)) * -4 - del tmp8 - tmp7 = einsum(tmp6, (0, 1, 2), tmp5, (0, 3), (1, 2, 3)) * 2 - del tmp6 - tmp11 = einsum(r1.a, (0,), tmp10, (1, 2, 0, 3), (1, 2, 3)) * 2 - del tmp10 - tmp54 = np.copy(tmp48) * 2 - del tmp48 - tmp54 += np.transpose(tmp49, (0, 2, 1)) * -2 - del tmp49 - tmp54 += np.transpose(tmp51, (0, 2, 1)) - del tmp51 - tmp54 += tmp53 - del tmp53 - tmp47 = einsum(r2.bbb, (0, 1, 2), ints.tmp41, (3, 4, 0, 1), (3, 4, 2)) - del ints.tmp41 - tmp38 = np.copy(tmp35) * -1 - del tmp35 - tmp38 += tmp36 - del tmp36 - tmp38 += tmp37 * 2 - del tmp37 - tmp46 = np.copy(f.bb.ov) - tmp46 += ints.tmp121 - del ints.tmp121 - tmp46 += ints.tmp126 - del ints.tmp126 - tmp46 += ints.tmp127 * 2 - del ints.tmp127 - tmp46 += ints.tmp120 * -2 - del ints.tmp120 - tmp46 += ints.tmp143 * -2 - del ints.tmp143 - tmp46 += ints.tmp144 * -1 - del ints.tmp144 - tmp62 = np.copy(tmp55) - del tmp55 - tmp62 += tmp56 - del tmp56 - tmp62 += np.transpose(tmp58, (0, 2, 1)) - del tmp58 - tmp62 += np.transpose(tmp59, (0, 2, 1)) - del tmp59 - tmp62 += tmp61 - del tmp61 - tmp45 = np.copy(f.bb.oo) - tmp45 += np.transpose(ints.tmp122, (1, 0)) * 2 - del ints.tmp122 - tmp45 += np.transpose(ints.tmp124, (1, 0)) - del ints.tmp124 - tmp24 = np.copy(tmp21) - del tmp21 - tmp24 += tmp22 * -2 - del tmp22 - tmp24 += tmp23 - del tmp23 - tmp42 = np.copy(ints.tmp16) * 2 - del ints.tmp16 - tmp42 += ints.tmp19 - del ints.tmp19 - tmp42 += v.bbb.xov - tmp43 = np.copy(ints.tmp113) - del ints.tmp113 - tmp43 += np.transpose(ints.tmp128, (0, 2, 1, 3)) - del ints.tmp128 - tmp43 += np.transpose(ints.tmp130, (0, 2, 1, 3)) * 2 - del ints.tmp130 - tmp43 += ints.tmp3 - tmp43 += ints.tmp107 * -1 - del ints.tmp107 - tmp43 += np.transpose(ints.tmp129, (0, 2, 1, 3)) * -1 - del ints.tmp129 - tmp41 = np.copy(ints.tmp110) - del ints.tmp110 - tmp41 += ints.tmp141 * -1 - del ints.tmp141 - tmp0 = np.copy(np.transpose(ints.tmp6, (1, 0))) * 2 - del ints.tmp6 - tmp0 += np.transpose(ints.tmp9, (1, 0)) - del ints.tmp9 - tmp0 += f.aa.vv * -1 - tmp39 = einsum(r2.bab, (0, 1, 2), ints.tmp62, (3, 4, 1, 0), (3, 4, 2)) * -1 - tmp27 = einsum(ints.tmp62, (0, 1, 2, 3), r2.aba, (2, 3, 4), (0, 4, 1)) - del ints.tmp62 - tmp33 = np.copy(ints.tmp5) * 2 - del ints.tmp5 - tmp33 += ints.tmp8 - del ints.tmp8 - tmp33 += v.baa.xov - tmp1 = np.copy(np.transpose(ints.tmp17, (1, 0))) * 2 - del ints.tmp17 - tmp1 += np.transpose(ints.tmp20, (1, 0)) - del ints.tmp20 - tmp1 += f.bb.vv * -1 - tmp26 = np.copy(f.aa.ov) - tmp26 += ints.tmp22 * 2 - del ints.tmp22 - tmp26 += ints.tmp23 - del ints.tmp23 - tmp26 += ints.tmp69 - del ints.tmp69 - tmp26 += ints.tmp53 * -2 - del ints.tmp53 - tmp26 += ints.tmp55 * -1 - del ints.tmp55 - tmp26 += ints.tmp68 * -2 - del ints.tmp68 - tmp25 = np.copy(f.aa.oo) - tmp25 += np.transpose(ints.tmp70, (1, 0)) * 2 - del ints.tmp70 - tmp25 += np.transpose(ints.tmp72, (1, 0)) - del ints.tmp72 - tmp34 = np.copy(ints.tmp14) - tmp34 += ints.tmp82 - del ints.tmp82 - tmp34 += np.transpose(ints.tmp94, (0, 1, 3, 2)) - del ints.tmp94 - tmp34 += np.transpose(ints.tmp96, (0, 1, 3, 2)) * 2 - del ints.tmp96 - tmp34 += ints.tmp77 * -1 - del ints.tmp77 - tmp34 += np.transpose(ints.tmp95, (0, 1, 3, 2)) * -1 - del ints.tmp95 - tmp29 = np.copy(ints.tmp105) - del ints.tmp105 - tmp29 += ints.tmp80 * -1 - del ints.tmp80 - tmp28 = np.copy(ints.tmp38) * 2 - del ints.tmp38 - tmp28 += ints.tmp50 - del ints.tmp50 - tmp32 = np.copy(tmp30) * -0.5 - del tmp30 - tmp32 += tmp31 - del tmp31 - tmp2 = einsum(r2.aaa, (0, 1, 2), ints.tmp37, (3, 4, 1, 0), (3, 4, 2)) * -1 - del ints.tmp37 - tmp20 = np.copy(tmp13) - del tmp13 - tmp20 += np.transpose(tmp15, (0, 2, 1)) * -2 - del tmp15 - tmp20 += np.transpose(tmp17, (0, 2, 1)) - del tmp17 - tmp20 += tmp19 - del tmp19 - tmp12 = np.copy(tmp7) - del tmp7 - tmp12 += np.transpose(tmp9, (0, 2, 1)) - del tmp9 - tmp12 += tmp11 - del tmp11 - r2new.bbb = einsum(ints.tmp165, (0, 1, 2, 3), r1.b, (3,), (2, 1, 0)) * 2 - del ints.tmp165 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), ints.tmp172, (3, 0, 4, 1), (3, 4, 2)) * -2 - del ints.tmp172 - r2new.bbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp47, (1, 0, 4), (2, 3, 4)) * -2 - del tmp47 - r2new.bbb += np.transpose(tmp54, (1, 2, 0)) - r2new.bbb += np.transpose(tmp54, (2, 1, 0)) * -1 - del tmp54 - r2new.bbb += np.transpose(tmp62, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp62, (2, 1, 0)) - del tmp62 - r2new.bbb += einsum(tmp38, (0,), t2.bbbb, (1, 0, 2, 3), (2, 3, 1)) * -2 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp45, (2, 3), (0, 1, 3)) * -2 - r2new.bbb += einsum(tmp46, (0, 1), r1.b, (2,), (2, 1, 0)) - r2new.bbb += einsum(tmp46, (0, 1), r1.b, (2,), (1, 2, 0)) * -1 - r2new.bab = einsum(ints.tmp134, (0, 1, 2, 3), r2.aaa, (4, 2, 0), (3, 4, 1)) * 2 - del ints.tmp134 - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp39, (0, 1, 4), (3, 2, 4)) * -1 - del tmp39 - r2new.bab += einsum(r2.bab, (0, 1, 2), ints.tmp90, (3, 1, 4, 0), (4, 3, 2)) - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp40, (3, 2, 4, 0), (4, 1, 3)) * -1 - del tmp40 - r2new.bab += einsum(tmp41, (0, 1, 2, 3), r2.bab, (4, 3, 1), (4, 2, 0)) - del tmp41 - r2new.bab += einsum(tmp42, (0, 1, 2), tmp5, (0, 3), (2, 3, 1)) * -2 - del tmp5, tmp42 - r2new.bab += einsum(r1.a, (0,), tmp43, (1, 2, 0, 3), (3, 2, 1)) * -1 - del tmp43 - r2new.bab += einsum(tmp44, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -2 - del tmp44 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp0, (1, 3), (0, 3, 2)) * -1 - r2new.bab += einsum(tmp24, (0,), t2.abab, (0, 1, 2, 3), (3, 2, 1)) - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp45, (2, 3), (0, 1, 3)) * -1 - del tmp45 - r2new.bab += einsum(tmp46, (0, 1), r1.a, (2,), (1, 2, 0)) * -1 - del tmp46 - r2new.aba = einsum(ints.tmp42, (0, 1, 2, 3), r2.bbb, (4, 3, 1), (2, 4, 0)) * 2 - del ints.tmp42 - r2new.aba += einsum(tmp27, (0, 1, 2), t2.abab, (0, 2, 3, 4), (3, 4, 1)) - del tmp27 - r2new.aba += einsum(ints.tmp90, (0, 1, 2, 3), r2.aba, (1, 3, 4), (0, 2, 4)) - del ints.tmp90 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp28, (3, 2, 4, 0), (4, 1, 3)) * -1 - del tmp28 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp29, (3, 2, 4, 1), (0, 4, 3)) * -1 - del tmp29 - r2new.aba += einsum(tmp33, (0, 1, 2), tmp32, (0, 3), (2, 3, 1)) * -2 - del tmp33, tmp32 - r2new.aba += einsum(r1.b, (0,), tmp34, (1, 2, 3, 0), (2, 3, 1)) * -1 - del tmp34 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp0, (0, 3), (3, 1, 2)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp1, (1, 3), (0, 3, 2)) * -1 - r2new.aba += einsum(tmp38, (0,), t2.abab, (1, 0, 2, 3), (2, 3, 1)) * -1 - del tmp38 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp25, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(tmp26, (0, 1), r1.b, (2,), (1, 2, 0)) * -1 - r2new.aaa = einsum(t2.aaaa, (0, 1, 2, 3), tmp2, (0, 1, 4), (2, 3, 4)) * 2 - del tmp2 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), ints.tmp66, (3, 1, 4, 0), (3, 4, 2)) * 2 - del ints.tmp66 - r2new.aaa += einsum(r1.a, (0,), ints.tmp56, (1, 2, 3, 0), (3, 2, 1)) * 2 - del ints.tmp56 - r2new.aaa += np.transpose(tmp12, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp12, (2, 1, 0)) - del tmp12 - r2new.aaa += np.transpose(tmp20, (1, 2, 0)) - r2new.aaa += np.transpose(tmp20, (2, 1, 0)) * -1 - del tmp20 - r2new.aaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp24, (1,), (2, 3, 0)) * 2 - del tmp24 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp25, (2, 3), (0, 1, 3)) * -2 - del tmp25 - r2new.aaa += einsum(r1.a, (0,), tmp26, (1, 2), (0, 2, 1)) - r2new.aaa += einsum(r1.a, (0,), tmp26, (1, 2), (2, 0, 1)) * -1 - del tmp26 - r1new.b = einsum(f.bb.ov, (0, 1), r2.bbb, (2, 1, 0), (2,)) * 2 - r1new.b += einsum(f.aa.ov, (0, 1), r2.aba, (1, 2, 0), (2,)) * -1 - r1new.b += einsum(ints.tmp12, (0, 1, 2, 3), r2.bbb, (3, 2, 0), (1,)) * -2 - del ints.tmp12 - r1new.b += einsum(ints.tmp14, (0, 1, 2, 3), r2.aba, (1, 3, 0), (2,)) * -1 - del ints.tmp14 - r1new.b += einsum(r1.b, (0,), tmp1, (0, 1), (1,)) * -1 - del tmp1 - r1new.a = einsum(r2.aaa, (0, 1, 2), f.aa.ov, (2, 1), (0,)) * 2 - r1new.a += einsum(r2.bab, (0, 1, 2), f.bb.ov, (2, 0), (1,)) * -1 - r1new.a += einsum(ints.tmp1, (0, 1, 2, 3), r2.aaa, (3, 2, 0), (1,)) * -2 - del ints.tmp1 - r1new.a += einsum(r2.bab, (0, 1, 2), ints.tmp3, (2, 3, 1, 0), (3,)) * -1 - del ints.tmp3 - r1new.a += einsum(r1.a, (0,), tmp0, (0, 1), (1,)) * -1 - del tmp0 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:30:00.495801. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp100 : array - tmp104 : array - tmp105 : array - tmp107 : array - tmp12 : array - tmp125 : array - tmp127 : array - tmp130 : array - tmp132 : array - tmp14 : array - tmp146 : array - tmp153 : array - tmp157 : array - tmp16 : array - tmp161 : array - tmp162 : array - tmp163 : array - tmp165 : array - tmp166 : array - tmp168 : array - tmp17 : array - tmp181 : array - tmp183 : array - tmp185 : array - tmp186 : array - tmp19 : array - tmp20 : array - tmp202 : array - tmp204 : array - tmp22 : array - tmp24 : array - tmp25 : array - tmp27 : array - tmp28 : array - tmp3 : array - tmp30 : array - tmp32 : array - tmp34 : array - tmp35 : array - tmp37 : array - tmp38 : array - tmp39 : array - tmp4 : array - tmp40 : array - tmp42 : array - tmp43 : array - tmp45 : array - tmp47 : array - tmp49 : array - tmp51 : array - tmp54 : array - tmp57 : array - tmp6 : array - tmp63 : array - tmp65 : array - tmp69 : array - tmp71 : array - tmp77 : array - tmp78 : array - tmp8 : array - tmp80 : array - tmp81 : array - tmp83 : array - tmp84 : array - tmp86 : array - tmp93 : array - tmp96 : array - """ - - tmp165 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp146 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp37 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp42 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp19 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp16 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp104 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp95 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp92 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp14 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp24 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp56 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp53 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp27 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp12 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp204 = einsum(t2.bbbb, (0, 1, 2, 3), tmp165, (4, 5, 3, 2), (0, 1, 4, 5)) * -1 - tmp202 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp186 = einsum(t2.abab, (0, 1, 2, 3), tmp146, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp185 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp183 = einsum(tmp37, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp181 = einsum(v.bbb.xov, (0, 1, 2), tmp42, (0, 1, 3), (3, 2)) - tmp168 = einsum(tmp165, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 2), (4, 0, 5, 3)) - tmp166 = einsum(t2.abab, (0, 1, 2, 3), tmp165, (4, 1, 3, 5), (0, 4, 2, 5)) - tmp163 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp162 = einsum(t2.abab, (0, 1, 2, 3), tmp146, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp161 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp157 = einsum(t2.abab, (0, 1, 2, 3), tmp146, (4, 5, 2, 3), (0, 4, 1, 5)) - tmp153 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 2, 3, 4)) - tmp132 = einsum(tmp19, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp130 = einsum(tmp16, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp127 = einsum(t2.aaaa, (0, 1, 2, 3), tmp104, (4, 5, 3, 2), (0, 1, 4, 5)) * -1 - tmp125 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp107 = einsum(t2.abab, (0, 1, 2, 3), tmp104, (4, 0, 2, 5), (4, 1, 5, 3)) - tmp105 = einsum(t2.aaaa, (0, 1, 2, 3), tmp104, (4, 1, 3, 5), (0, 4, 2, 5)) - tmp100 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp96 = einsum(t2.abab, (0, 1, 2, 3), tmp95, (4, 2, 5, 3), (0, 1, 4, 5)) - del tmp95 - tmp93 = einsum(t2.bbbb, (0, 1, 2, 3), tmp92, (4, 2, 5, 3), (0, 1, 4, 5)) * -1 - del tmp92 - tmp86 = einsum(tmp37, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp84 = einsum(tmp16, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp83 = einsum(tmp14, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp81 = einsum(v.bbb.xoo, (0, 1, 2), tmp42, (0, 3, 4), (3, 1, 2, 4)) - tmp80 = einsum(tmp19, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp78 = einsum(t2.bbbb, (0, 1, 2, 3), tmp24, (1, 4, 5, 3), (0, 4, 5, 2)) - tmp77 = einsum(tmp24, (0, 1, 2, 3), t2.abab, (4, 0, 5, 3), (4, 1, 2, 5)) - tmp71 = einsum(v.bbb.xov, (0, 1, 2), tmp37, (0, 3, 2), (3, 1)) - tmp69 = einsum(v.bbb.xov, (0, 1, 2), tmp42, (0, 3, 2), (3, 1)) - tmp65 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp63 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (4, 3), (0, 4, 1, 2)) - tmp57 = einsum(tmp56, (0, 1, 2, 3), t2.abab, (4, 5, 1, 2), (4, 0, 5, 3)) - del tmp56 - tmp54 = einsum(tmp53, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (4, 5, 0, 2)) * -1 - del tmp53 - tmp51 = einsum(tmp19, (0, 1, 2), v.baa.xvv, (0, 3, 2), (1, 3)) - tmp49 = einsum(v.bbb.xvv, (0, 1, 2), tmp37, (0, 3, 2), (3, 1)) - tmp47 = einsum(tmp42, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) * -1 - tmp45 = einsum(tmp16, (0, 1, 2), v.baa.xvv, (0, 3, 2), (1, 3)) * -1 - tmp43 = einsum(v.baa.xoo, (0, 1, 2), tmp42, (0, 3, 4), (1, 2, 3, 4)) - tmp40 = einsum(v.baa.xoo, (0, 1, 2), tmp19, (0, 3, 4), (3, 1, 2, 4)) - tmp39 = einsum(tmp27, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (4, 0, 2, 5)) - tmp38 = einsum(v.baa.xoo, (0, 1, 2), tmp37, (0, 3, 4), (1, 2, 3, 4)) - tmp35 = einsum(v.baa.xoo, (0, 1, 2), tmp16, (0, 3, 4), (3, 1, 2, 4)) - tmp34 = einsum(t2.abab, (0, 1, 2, 3), tmp12, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp32 = einsum(t2.aaaa, (0, 1, 2, 3), tmp12, (1, 4, 5, 3), (0, 4, 5, 2)) - tmp30 = einsum(tmp14, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp28 = einsum(tmp27, (0, 1, 2, 3), t2.abab, (0, 1, 3, 4), (2, 4)) - tmp25 = einsum(t2.bbbb, (0, 1, 2, 3), tmp24, (0, 4, 1, 3), (4, 2)) - tmp22 = einsum(tmp12, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) - tmp20 = einsum(tmp19, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp17 = einsum(tmp16, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp10 = einsum(f.aa.ov, (0, 1), t2.abab, (2, 3, 1, 4), (0, 2, 3, 4)) - tmp8 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (4, 3), (4, 0, 1, 2)) - tmp6 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp4 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp3 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp1 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp100": tmp100, f"tmp104": tmp104, f"tmp105": tmp105, f"tmp107": tmp107, f"tmp12": tmp12, f"tmp125": tmp125, f"tmp127": tmp127, f"tmp130": tmp130, f"tmp132": tmp132, f"tmp14": tmp14, f"tmp146": tmp146, f"tmp153": tmp153, f"tmp157": tmp157, f"tmp16": tmp16, f"tmp161": tmp161, f"tmp162": tmp162, f"tmp163": tmp163, f"tmp165": tmp165, f"tmp166": tmp166, f"tmp168": tmp168, f"tmp17": tmp17, f"tmp181": tmp181, f"tmp183": tmp183, f"tmp185": tmp185, f"tmp186": tmp186, f"tmp19": tmp19, f"tmp20": tmp20, f"tmp202": tmp202, f"tmp204": tmp204, f"tmp22": tmp22, f"tmp24": tmp24, f"tmp25": tmp25, f"tmp27": tmp27, f"tmp28": tmp28, f"tmp3": tmp3, f"tmp30": tmp30, f"tmp32": tmp32, f"tmp34": tmp34, f"tmp35": tmp35, f"tmp37": tmp37, f"tmp38": tmp38, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp42": tmp42, f"tmp43": tmp43, f"tmp45": tmp45, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp51": tmp51, f"tmp54": tmp54, f"tmp57": tmp57, f"tmp6": tmp6, f"tmp63": tmp63, f"tmp65": tmp65, f"tmp69": tmp69, f"tmp71": tmp71, f"tmp77": tmp77, f"tmp78": tmp78, f"tmp8": tmp8, f"tmp80": tmp80, f"tmp81": tmp81, f"tmp83": tmp83, f"tmp84": tmp84, f"tmp86": tmp86, f"tmp93": tmp93, f"tmp96": tmp96} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:30:00.581927. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp18 = np.copy(ints.tmp37) - tmp18 += v.bbb.xov - tmp18 += ints.tmp42 * 2 - tmp16 = np.copy(ints.tmp19) - tmp16 += v.baa.xov - tmp16 += ints.tmp16 * 2 - tmp34 = np.copy(ints.tmp16) * 2 - del ints.tmp16 - tmp34 += ints.tmp19 - del ints.tmp19 - tmp34 += v.baa.xov - tmp38 = einsum(t2.bbbb, (0, 1, 2, 3), r2.bbb, (0, 1, 3), (2,)) - tmp37 = einsum(r2.aba, (0, 1, 2), t2.abab, (0, 1, 2, 3), (3,)) - tmp19 = einsum(tmp18, (0, 1, 2), r2.bab, (1, 3, 2), (0, 3)) * -1 - tmp17 = einsum(tmp16, (0, 1, 2), r2.aaa, (3, 1, 2), (0, 3)) * -1 - del tmp16 - tmp48 = einsum(r2.aba, (0, 1, 2), tmp34, (3, 0, 2), (3, 1)) - tmp51 = np.copy(ints.tmp69) * 2 - tmp51 += ints.tmp71 - tmp39 = np.copy(tmp37) * -0.5 - del tmp37 - tmp39 += tmp38 - del tmp38 - tmp56 = einsum(tmp18, (0, 1, 2), r2.bbb, (3, 1, 2), (0, 3)) * -1 - del tmp18 - tmp40 = np.copy(ints.tmp163) - del ints.tmp163 - tmp40 += np.transpose(ints.tmp168, (1, 0, 3, 2)) * 2 - del ints.tmp168 - tmp24 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (0, 1, 3), (2,)) - tmp26 = np.copy(ints.tmp17) * 2 - tmp26 += ints.tmp20 - tmp12 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (1, 0, 3), (2,)) * -1 - tmp20 = np.copy(tmp17) * -2 - del tmp17 - tmp20 += tmp19 - del tmp19 - tmp14 = np.copy(ints.tmp100) - tmp14 += np.transpose(ints.tmp105, (1, 0, 3, 2)) * 2 - tmp49 = einsum(tmp48, (0, 1), v.bbb.xov, (0, 2, 3), (2, 1, 3)) - del tmp48 - tmp52 = einsum(tmp51, (0, 1), r2.bbb, (2, 0, 3), (2, 1, 3)) * -2 - del tmp51 - tmp47 = einsum(r2.aba, (0, 1, 2), ints.tmp166, (0, 3, 2, 4), (3, 1, 4)) - tmp46 = einsum(r1.b, (0,), ints.tmp24, (1, 0, 2, 3), (1, 2, 3)) - tmp50 = einsum(tmp39, (0,), ints.tmp165, (1, 2, 3, 0), (1, 2, 3)) * 2 - del ints.tmp165 - tmp57 = einsum(tmp56, (0, 1), v.bbb.xov, (0, 2, 3), (2, 1, 3)) * -1 - del tmp56 - tmp54 = einsum(r2.bbb, (0, 1, 2), f.bb.oo, (3, 1), (3, 0, 2)) - tmp55 = einsum(tmp40, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (4, 0, 2)) * -1 - tmp35 = np.copy(ints.tmp37) * 0.5 - del ints.tmp37 - tmp35 += ints.tmp42 - del ints.tmp42 - tmp35 += v.bbb.xov * 0.5 - tmp25 = einsum(tmp24, (0,), ints.tmp104, (1, 2, 3, 0), (1, 2, 3)) - tmp27 = einsum(r2.aaa, (0, 1, 2), tmp26, (1, 3), (0, 3, 2)) * -2 - del tmp26 - tmp23 = einsum(r1.a, (0,), ints.tmp12, (1, 0, 2, 3), (1, 2, 3)) - tmp13 = einsum(tmp12, (0,), ints.tmp104, (1, 2, 3, 0), (1, 2, 3)) - del ints.tmp104 - tmp21 = einsum(tmp20, (0, 1), v.baa.xov, (0, 2, 3), (2, 1, 3)) - del tmp20 - tmp10 = einsum(f.aa.oo, (0, 1), r2.aaa, (2, 1, 3), (0, 2, 3)) - tmp15 = einsum(tmp14, (0, 1, 2, 3), r2.aaa, (4, 1, 3), (4, 0, 2)) * -1 - del tmp14 - tmp11 = einsum(ints.tmp107, (0, 1, 2, 3), r2.bab, (1, 4, 3), (0, 4, 2)) * -1 - tmp53 = einsum(r1.b, (0,), f.bb.ov, (1, 2), (1, 0, 2)) - tmp53 += tmp46 - del tmp46 - tmp53 += tmp47 - del tmp47 - tmp53 += np.transpose(tmp49, (1, 0, 2)) - del tmp49 - tmp53 += tmp50 * -1 - del tmp50 - tmp53 += np.transpose(tmp52, (1, 0, 2)) - del tmp52 - tmp58 = np.copy(tmp54) - del tmp54 - tmp58 += np.transpose(tmp55, (1, 0, 2)) * -1 - del tmp55 - tmp58 += np.transpose(tmp57, (1, 0, 2)) - del tmp57 - tmp44 = np.copy(ints.tmp181) * 2 - del ints.tmp181 - tmp44 += ints.tmp183 - del ints.tmp183 - tmp44 += f.bb.vv * -1 - tmp59 = np.copy(ints.tmp202) - del ints.tmp202 - tmp59 += np.transpose(ints.tmp204, (2, 0, 3, 1)) * -1 - del ints.tmp204 - tmp42 = np.copy(ints.tmp153) - tmp42 += np.transpose(ints.tmp157, (1, 0, 3, 2)) - tmp9 = np.copy(f.bb.oo) - tmp9 += ints.tmp69 * 2 - del ints.tmp69 - tmp9 += ints.tmp71 - del ints.tmp71 - tmp41 = np.copy(ints.tmp185) - del ints.tmp185 - tmp41 += np.transpose(ints.tmp186, (1, 0, 3, 2)) * -1 - del ints.tmp186 - tmp43 = einsum(tmp34, (0, 1, 2), r2.aaa, (3, 1, 2), (0, 3)) - tmp43 += einsum(tmp35, (0, 1, 2), r2.bab, (1, 3, 2), (0, 3)) * -1 - tmp4 = np.copy(f.aa.oo) - tmp4 += ints.tmp17 * 2 - del ints.tmp17 - tmp4 += ints.tmp20 - del ints.tmp20 - tmp45 = np.copy(tmp24) * 2 - del tmp24 - tmp45 += tmp12 - del tmp12 - tmp30 = np.copy(ints.tmp130) * 2 - del ints.tmp130 - tmp30 += ints.tmp132 - del ints.tmp132 - tmp30 += f.aa.vv * -1 - tmp36 = einsum(r2.aba, (0, 1, 2), tmp34, (3, 0, 2), (3, 1)) * -0.5 - del tmp34 - tmp36 += einsum(tmp35, (0, 1, 2), r2.bbb, (3, 1, 2), (0, 3)) * 2 - del tmp35 - tmp31 = np.copy(ints.tmp100) - del ints.tmp100 - tmp31 += np.transpose(ints.tmp105, (1, 0, 3, 2)) * 2 - del ints.tmp105 - tmp32 = np.copy(ints.tmp161) - del ints.tmp161 - tmp32 += np.transpose(ints.tmp162, (1, 0, 3, 2)) * -1 - del ints.tmp162 - tmp33 = np.copy(ints.tmp153) - del ints.tmp153 - tmp33 += np.transpose(ints.tmp157, (1, 0, 3, 2)) - del ints.tmp157 - tmp28 = einsum(r1.a, (0,), f.aa.ov, (1, 2), (1, 0, 2)) * -1 - tmp28 += tmp23 * -1 - del tmp23 - tmp28 += tmp25 * 2 - del tmp25 - tmp28 += np.transpose(tmp27, (1, 0, 2)) * -1 - del tmp27 - tmp22 = np.copy(tmp10) * 2 - del tmp10 - tmp22 += tmp11 - del tmp11 - tmp22 += tmp13 - del tmp13 - tmp22 += np.transpose(tmp15, (1, 0, 2)) * -2 - del tmp15 - tmp22 += np.transpose(tmp21, (1, 0, 2)) - del tmp21 - tmp29 = np.copy(ints.tmp125) - del ints.tmp125 - tmp29 += np.transpose(ints.tmp127, (2, 0, 3, 1)) * -1 - del ints.tmp127 - tmp6 = np.copy(ints.tmp24) - del ints.tmp24 - tmp6 += np.transpose(ints.tmp78, (2, 0, 1, 3)) * 2 - del ints.tmp78 - tmp6 += np.transpose(ints.tmp93, (2, 0, 1, 3)) - del ints.tmp93 - tmp6 += ints.tmp65 * -1 - del ints.tmp65 - tmp6 += np.transpose(ints.tmp81, (2, 0, 1, 3)) * -2 - del ints.tmp81 - tmp6 += np.transpose(ints.tmp86, (2, 0, 1, 3)) * -1 - del ints.tmp86 - tmp7 = np.copy(f.aa.ov) * 0.5 - tmp7 += ints.tmp1 - tmp7 += ints.tmp4 * 0.5 - tmp7 += ints.tmp51 * 0.5 - tmp7 += ints.tmp22 * -1 - tmp7 += ints.tmp30 * -0.5 - tmp7 += ints.tmp45 * -1 - tmp8 = np.copy(f.bb.ov) - tmp8 += ints.tmp3 - tmp8 += ints.tmp49 - tmp8 += ints.tmp6 * 2 - tmp8 += ints.tmp25 * -2 - tmp8 += ints.tmp28 * -1 - tmp8 += ints.tmp47 * -2 - tmp5 = np.copy(ints.tmp27) - tmp5 += ints.tmp63 - del ints.tmp63 - tmp5 += np.transpose(ints.tmp80, (0, 2, 1, 3)) - del ints.tmp80 - tmp5 += np.transpose(ints.tmp84, (0, 2, 1, 3)) * 2 - del ints.tmp84 - tmp5 += np.transpose(ints.tmp96, (0, 2, 1, 3)) - del ints.tmp96 - tmp5 += np.transpose(ints.tmp77, (0, 2, 1, 3)) * -1 - del ints.tmp77 - tmp5 += np.transpose(ints.tmp83, (0, 2, 1, 3)) * -1 - del ints.tmp83 - tmp1 = np.copy(ints.tmp12) - del ints.tmp12 - tmp1 += np.transpose(ints.tmp32, (2, 0, 1, 3)) * 2 - del ints.tmp32 - tmp1 += np.transpose(ints.tmp54, (2, 0, 1, 3)) - del ints.tmp54 - tmp1 += np.transpose(ints.tmp35, (2, 0, 1, 3)) * -2 - del ints.tmp35 - tmp1 += np.transpose(ints.tmp40, (2, 0, 1, 3)) * -1 - del ints.tmp40 - tmp1 += ints.tmp8 * -1 - del ints.tmp8 - tmp2 = np.copy(f.aa.ov) - tmp2 += ints.tmp1 * 2 - del ints.tmp1 - tmp2 += ints.tmp4 - del ints.tmp4 - tmp2 += ints.tmp51 - del ints.tmp51 - tmp2 += ints.tmp22 * -2 - del ints.tmp22 - tmp2 += ints.tmp30 * -1 - del ints.tmp30 - tmp2 += ints.tmp45 * -2 - del ints.tmp45 - tmp0 = np.copy(ints.tmp10) - del ints.tmp10 - tmp0 += ints.tmp14 - tmp0 += np.transpose(ints.tmp38, (1, 0, 2, 3)) - del ints.tmp38 - tmp0 += np.transpose(ints.tmp43, (1, 0, 2, 3)) * 2 - del ints.tmp43 - tmp0 += np.transpose(ints.tmp57, (1, 0, 2, 3)) - del ints.tmp57 - tmp0 += np.transpose(ints.tmp34, (1, 0, 2, 3)) * -1 - del ints.tmp34 - tmp0 += np.transpose(ints.tmp39, (1, 0, 2, 3)) * -1 - del ints.tmp39 - tmp3 = np.copy(f.bb.ov) * 0.5 - tmp3 += ints.tmp3 * 0.5 - del ints.tmp3 - tmp3 += ints.tmp49 * 0.5 - del ints.tmp49 - tmp3 += ints.tmp6 - del ints.tmp6 - tmp3 += ints.tmp25 * -1 - del ints.tmp25 - tmp3 += ints.tmp28 * -0.5 - del ints.tmp28 - tmp3 += ints.tmp47 * -1 - del ints.tmp47 - r2new.bbb = np.copy(tmp53) * -1 - r2new.bbb += np.transpose(tmp53, (1, 0, 2)) - del tmp53 - r2new.bbb += tmp58 * 2 - r2new.bbb += np.transpose(tmp58, (1, 0, 2)) * -2 - del tmp58 - r2new.bbb += einsum(tmp59, (0, 1, 2, 3), r2.bbb, (3, 1, 4), (0, 2, 4)) * 2 - del tmp59 - r2new.bbb += einsum(tmp44, (0, 1), r2.bbb, (2, 3, 0), (2, 3, 1)) * -2 - r2new.bab = einsum(r2.aaa, (0, 1, 2), ints.tmp166, (1, 3, 2, 4), (3, 0, 4)) * 2 - del ints.tmp166 - r2new.bab += einsum(ints.tmp14, (0, 1, 2, 3), r1.a, (1,), (2, 0, 3)) - del ints.tmp14 - r2new.bab += einsum(r1.a, (0,), f.bb.ov, (1, 2), (1, 0, 2)) * -1 - r2new.bab += einsum(tmp40, (0, 1, 2, 3), r2.bab, (1, 4, 3), (0, 4, 2)) * -1 - del tmp40 - r2new.bab += einsum(tmp41, (0, 1, 2, 3), r2.bab, (4, 1, 3), (4, 0, 2)) * -1 - del tmp41 - r2new.bab += einsum(tmp42, (0, 1, 2, 3), r2.bab, (3, 1, 4), (2, 0, 4)) - del tmp42 - r2new.bab += einsum(v.bbb.xov, (0, 1, 2), tmp43, (0, 3), (1, 3, 2)) * -2 - del tmp43 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp44, (2, 3), (0, 1, 3)) * -1 - del tmp44 - r2new.bab += einsum(ints.tmp146, (0, 1, 2, 3), tmp45, (2,), (1, 0, 3)) - del tmp45 - r2new.bab += einsum(tmp4, (0, 1), r2.bab, (2, 0, 3), (2, 1, 3)) * -1 - r2new.bab += einsum(tmp9, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -1 - r2new.aba = einsum(f.aa.ov, (0, 1), r1.b, (2,), (0, 2, 1)) * -1 - r2new.aba += einsum(ints.tmp107, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (0, 4, 2)) * 2 - del ints.tmp107 - r2new.aba += einsum(ints.tmp27, (0, 1, 2, 3), r1.b, (2,), (0, 1, 3)) - del ints.tmp27 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp31, (3, 0, 4, 2), (3, 1, 4)) * -1 - del tmp31 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp32, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp32 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp33, (3, 0, 4, 1), (3, 4, 2)) - del tmp33 - r2new.aba += einsum(tmp36, (0, 1), v.baa.xov, (0, 2, 3), (2, 1, 3)) * -2 - del tmp36 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp30, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(ints.tmp146, (0, 1, 2, 3), tmp39, (3,), (0, 1, 2)) * 2 - del tmp39, ints.tmp146 - r2new.aba += einsum(tmp4, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - r2new.aba += einsum(tmp9, (0, 1), r2.aba, (2, 0, 3), (2, 1, 3)) * -1 - r2new.aaa = np.copy(tmp22) - r2new.aaa += np.transpose(tmp22, (1, 0, 2)) * -1 - del tmp22 - r2new.aaa += tmp28 - r2new.aaa += np.transpose(tmp28, (1, 0, 2)) * -1 - del tmp28 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp29, (3, 1, 4, 0), (3, 4, 2)) * 2 - del tmp29 - r2new.aaa += einsum(tmp30, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp30 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp5, (0, 3, 1, 2), (3,)) - del tmp5 - r1new.b += einsum(tmp6, (0, 1, 2, 3), r2.bbb, (1, 2, 3), (0,)) * -2 - del tmp6 - r1new.b += einsum(tmp7, (0, 1), r2.aba, (0, 2, 1), (2,)) * -2 - del tmp7 - r1new.b += einsum(tmp8, (0, 1), r2.bbb, (2, 0, 1), (2,)) * 2 - del tmp8 - r1new.b += einsum(tmp9, (0, 1), r1.b, (0,), (1,)) * -1 - del tmp9 - r1new.a = einsum(tmp0, (0, 1, 2, 3), r2.bab, (2, 1, 3), (0,)) - del tmp0 - r1new.a += einsum(tmp1, (0, 1, 2, 3), r2.aaa, (1, 2, 3), (0,)) * -2 - del tmp1 - r1new.a += einsum(tmp2, (0, 1), r2.aaa, (2, 0, 1), (2,)) * 2 - del tmp2 - r1new.a += einsum(tmp3, (0, 1), r2.bab, (0, 2, 1), (2,)) * -2 - del tmp3 - r1new.a += einsum(r1.a, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:31:13.403365. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp102 : array - tmp106 : array - tmp108 : array - tmp110 : array - tmp111 : array - tmp113 : array - tmp12 : array - tmp126 : array - tmp14 : array - tmp146 : array - tmp149 : array - tmp157 : array - tmp158 : array - tmp159 : array - tmp16 : array - tmp161 : array - tmp163 : array - tmp165 : array - tmp166 : array - tmp168 : array - tmp17 : array - tmp182 : array - tmp183 : array - tmp19 : array - tmp20 : array - tmp200 : array - tmp23 : array - tmp26 : array - tmp29 : array - tmp3 : array - tmp32 : array - tmp34 : array - tmp36 : array - tmp38 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp43 : array - tmp44 : array - tmp46 : array - tmp48 : array - tmp50 : array - tmp51 : array - tmp53 : array - tmp54 : array - tmp56 : array - tmp58 : array - tmp59 : array - tmp6 : array - tmp68 : array - tmp71 : array - tmp73 : array - tmp79 : array - tmp81 : array - tmp87 : array - tmp88 : array - tmp90 : array - tmp91 : array - tmp93 : array - tmp95 : array - tmp97 : array - """ - - tmp146 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp165 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp43 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp40 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp110 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp19 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp16 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp14 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp68 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp31 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp25 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp58 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp12 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp28 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp22 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp200 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp183 = einsum(t2.abab, (0, 1, 2, 3), tmp146, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp182 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp168 = einsum(tmp165, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 2), (4, 0, 5, 3)) - tmp166 = einsum(t2.abab, (0, 1, 2, 3), tmp165, (4, 1, 3, 5), (0, 4, 2, 5)) - tmp163 = einsum(v.bbb.xov, (0, 1, 2), tmp43, (0, 3, 2), (3, 1)) - tmp161 = einsum(v.bbb.xov, (0, 1, 2), tmp40, (0, 3, 2), (3, 1)) - tmp159 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp158 = einsum(t2.abab, (0, 1, 2, 3), tmp146, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp157 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp149 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp126 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp113 = einsum(t2.abab, (0, 1, 2, 3), tmp110, (4, 0, 2, 5), (4, 1, 5, 3)) - tmp111 = einsum(tmp110, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 2), (4, 0, 5, 3)) - tmp108 = einsum(tmp19, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp106 = einsum(tmp16, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp102 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp97 = einsum(tmp14, (0, 1, 2, 3), t2.abab, (4, 0, 1, 5), (4, 2, 5, 3)) - tmp95 = einsum(tmp43, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp93 = einsum(tmp16, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp91 = einsum(tmp68, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 2), (4, 5, 3, 1)) - tmp90 = einsum(tmp68, (0, 1, 2, 3), t2.abab, (4, 0, 5, 1), (4, 5, 3, 2)) - tmp88 = einsum(tmp40, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp87 = einsum(tmp19, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp81 = einsum(tmp31, (0, 1, 2, 3), t2.abab, (0, 2, 4, 5), (1, 4, 5, 3)) - tmp79 = einsum(t2.bbbb, (0, 1, 2, 3), tmp25, (0, 4, 1, 5), (4, 2, 3, 5)) - tmp73 = einsum(v.bbb.xov, (0, 1, 2), tmp43, (0, 1, 3), (3, 2)) - tmp71 = einsum(v.bbb.xov, (0, 1, 2), tmp40, (0, 1, 3), (3, 2)) - tmp59 = einsum(tmp58, (0, 1, 2, 3), t2.abab, (0, 4, 5, 2), (4, 5, 1, 3)) - tmp56 = einsum(tmp40, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp54 = einsum(tmp19, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp53 = einsum(tmp12, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (4, 3, 1, 5)) - tmp51 = einsum(tmp12, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 1), (4, 5, 3, 2)) - tmp50 = einsum(tmp43, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp48 = einsum(v.baa.xvv, (0, 1, 2), tmp16, (0, 3, 4), (3, 4, 1, 2)) - tmp46 = einsum(tmp19, (0, 1, 2), v.baa.xvv, (0, 3, 2), (1, 3)) - tmp44 = einsum(v.bbb.xvv, (0, 1, 2), tmp43, (0, 3, 2), (3, 1)) - tmp41 = einsum(v.bbb.xvv, (0, 1, 2), tmp40, (0, 3, 2), (3, 1)) * -1 - tmp38 = einsum(tmp16, (0, 1, 2), v.baa.xvv, (0, 3, 2), (1, 3)) * -1 - tmp36 = einsum(tmp28, (0, 1, 2, 3), t2.abab, (0, 1, 4, 5), (2, 4, 3, 5)) - tmp34 = einsum(t2.aaaa, (0, 1, 2, 3), tmp22, (0, 4, 1, 5), (4, 2, 3, 5)) - tmp32 = einsum(tmp31, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (1, 4)) - del tmp31 - tmp29 = einsum(tmp28, (0, 1, 2, 3), t2.abab, (0, 1, 3, 4), (2, 4)) - del tmp28 - tmp26 = einsum(t2.bbbb, (0, 1, 2, 3), tmp25, (0, 4, 1, 3), (4, 2)) - del tmp25 - tmp23 = einsum(tmp22, (0, 1, 2, 3), t2.aaaa, (0, 2, 4, 3), (1, 4)) - del tmp22 - tmp20 = einsum(tmp19, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp17 = einsum(tmp16, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp6 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp4 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp3 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp1 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - - return {f"tmp1": tmp1, f"tmp102": tmp102, f"tmp106": tmp106, f"tmp108": tmp108, f"tmp110": tmp110, f"tmp111": tmp111, f"tmp113": tmp113, f"tmp12": tmp12, f"tmp126": tmp126, f"tmp14": tmp14, f"tmp146": tmp146, f"tmp149": tmp149, f"tmp157": tmp157, f"tmp158": tmp158, f"tmp159": tmp159, f"tmp16": tmp16, f"tmp161": tmp161, f"tmp163": tmp163, f"tmp165": tmp165, f"tmp166": tmp166, f"tmp168": tmp168, f"tmp17": tmp17, f"tmp182": tmp182, f"tmp183": tmp183, f"tmp19": tmp19, f"tmp20": tmp20, f"tmp200": tmp200, f"tmp23": tmp23, f"tmp26": tmp26, f"tmp29": tmp29, f"tmp3": tmp3, f"tmp32": tmp32, f"tmp34": tmp34, f"tmp36": tmp36, f"tmp38": tmp38, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp43": tmp43, f"tmp44": tmp44, f"tmp46": tmp46, f"tmp48": tmp48, f"tmp50": tmp50, f"tmp51": tmp51, f"tmp53": tmp53, f"tmp54": tmp54, f"tmp56": tmp56, f"tmp58": tmp58, f"tmp59": tmp59, f"tmp6": tmp6, f"tmp68": tmp68, f"tmp71": tmp71, f"tmp73": tmp73, f"tmp79": tmp79, f"tmp81": tmp81, f"tmp87": tmp87, f"tmp88": tmp88, f"tmp90": tmp90, f"tmp91": tmp91, f"tmp93": tmp93, f"tmp95": tmp95, f"tmp97": tmp97} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:31:13.481880. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp22 = np.copy(ints.tmp43) - tmp22 += v.bbb.xov - tmp22 += ints.tmp40 * 2 - tmp20 = np.copy(ints.tmp19) - tmp20 += v.baa.xov - tmp20 += ints.tmp16 * 2 - tmp12 = einsum(r2.bbb, (0, 1, 2), t2.bbbb, (3, 2, 0, 1), (3,)) - tmp11 = einsum(t2.abab, (0, 1, 2, 3), r2.aba, (2, 3, 0), (1,)) - tmp34 = np.copy(ints.tmp16) * 2 - del ints.tmp16 - tmp34 += ints.tmp19 - del ints.tmp19 - tmp34 += v.baa.xov - tmp23 = einsum(tmp22, (0, 1, 2), r2.bab, (2, 3, 1), (0, 3)) * -1 - tmp21 = einsum(tmp20, (0, 1, 2), r2.aaa, (3, 2, 1), (0, 3)) * -1 - del tmp20 - tmp39 = np.copy(ints.tmp159) - del ints.tmp159 - tmp39 += np.transpose(ints.tmp168, (1, 0, 3, 2)) * 2 - del ints.tmp168 - tmp53 = einsum(r2.bbb, (0, 1, 2), tmp22, (3, 2, 1), (3, 0)) * -1 - del tmp22 - tmp37 = np.copy(tmp11) * -0.5 - tmp37 += tmp12 - tmp46 = einsum(tmp34, (0, 1, 2), r2.aba, (2, 3, 1), (0, 3)) - tmp42 = np.copy(ints.tmp71) - tmp42 += ints.tmp73 * 0.5 - tmp42 += f.bb.vv * -0.5 - tmp24 = np.copy(tmp21) * -2 - del tmp21 - tmp24 += tmp23 - del tmp23 - tmp18 = np.copy(ints.tmp102) - tmp18 += np.transpose(ints.tmp111, (1, 0, 3, 2)) * 2 - tmp6 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (3, 2, 1), (0,)) * -1 - tmp4 = np.copy(ints.tmp17) * 2 - del ints.tmp17 - tmp4 += ints.tmp20 - del ints.tmp20 - tmp4 += f.aa.vv * -1 - tmp5 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (2, 3, 1), (0,)) - tmp52 = einsum(r2.bbb, (0, 1, 2), tmp39, (3, 2, 4, 1), (3, 0, 4)) * -1 - tmp51 = einsum(ints.tmp68, (0, 1, 2, 3), r1.b, (2,), (0, 1, 3)) - tmp54 = einsum(tmp53, (0, 1), v.bbb.xov, (0, 2, 3), (2, 3, 1)) * -1 - del tmp53 - tmp49 = einsum(tmp37, (0,), ints.tmp165, (1, 0, 2, 3), (1, 2, 3)) * 2 - tmp47 = einsum(tmp46, (0, 1), v.bbb.xov, (0, 2, 3), (2, 3, 1)) - del tmp46 - tmp48 = einsum(tmp42, (0, 1), r2.bbb, (2, 0, 3), (3, 2, 1)) * -4 - tmp45 = einsum(ints.tmp166, (0, 1, 2, 3), r2.aba, (2, 4, 0), (1, 3, 4)) - tmp35 = np.copy(ints.tmp40) * 2 - del ints.tmp40 - tmp35 += ints.tmp43 - del ints.tmp43 - tmp35 += v.bbb.xov - tmp25 = einsum(tmp24, (0, 1), v.baa.xov, (0, 2, 3), (2, 3, 1)) - del tmp24 - tmp16 = einsum(ints.tmp113, (0, 1, 2, 3), r2.bab, (3, 4, 1), (0, 2, 4)) * -1 - tmp19 = einsum(r2.aaa, (0, 1, 2), tmp18, (3, 2, 4, 1), (3, 0, 4)) * -1 - del tmp18 - tmp15 = einsum(r1.a, (0,), ints.tmp12, (1, 2, 0, 3), (1, 2, 3)) - tmp17 = einsum(ints.tmp110, (0, 1, 2, 3), tmp6, (1,), (0, 2, 3)) - tmp28 = einsum(tmp4, (0, 1), r2.aaa, (2, 0, 3), (3, 2, 1)) * -2 - tmp27 = einsum(ints.tmp110, (0, 1, 2, 3), tmp5, (1,), (0, 2, 3)) - tmp43 = np.copy(f.bb.oo) - tmp43 += ints.tmp161 * 2 - del ints.tmp161 - tmp43 += ints.tmp163 - del ints.tmp163 - tmp55 = np.copy(tmp51) - del tmp51 - tmp55 += np.transpose(tmp52, (0, 2, 1)) * -2 - del tmp52 - tmp55 += np.transpose(tmp54, (0, 2, 1)) * 2 - del tmp54 - tmp44 = einsum(r2.bbb, (0, 1, 2), t2.bbbb, (3, 4, 0, 1), (2, 3, 4)) - tmp50 = einsum(r1.b, (0,), f.bb.ov, (1, 2), (1, 2, 0)) - tmp50 += tmp45 - del tmp45 - tmp50 += np.transpose(tmp47, (0, 2, 1)) - del tmp47 - tmp50 += np.transpose(tmp48, (0, 2, 1)) - del tmp48 - tmp50 += tmp49 * -1 - del tmp49 - tmp40 = np.copy(ints.tmp182) - del ints.tmp182 - tmp40 += np.transpose(ints.tmp183, (1, 0, 3, 2)) * -1 - del ints.tmp183 - tmp41 = einsum(r2.aaa, (0, 1, 2), tmp34, (3, 2, 1), (3, 0)) - tmp41 += einsum(tmp35, (0, 1, 2), r2.bab, (2, 3, 1), (0, 3)) * -0.5 - tmp38 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (3, 2, 4), (0, 4, 1)) * -1 - tmp7 = np.copy(tmp5) * 2 - del tmp5 - tmp7 += tmp6 - del tmp6 - tmp30 = np.copy(f.aa.oo) - tmp30 += ints.tmp106 * 2 - del ints.tmp106 - tmp30 += ints.tmp108 - del ints.tmp108 - tmp10 = np.copy(ints.tmp71) * 2 - del ints.tmp71 - tmp10 += ints.tmp73 - del ints.tmp73 - tmp10 += f.bb.vv * -1 - tmp36 = einsum(tmp34, (0, 1, 2), r2.aba, (2, 3, 1), (0, 3)) * -0.5 - del tmp34 - tmp36 += einsum(r2.bbb, (0, 1, 2), tmp35, (3, 2, 1), (3, 0)) - del tmp35 - tmp31 = einsum(t2.abab, (0, 1, 2, 3), r2.aba, (2, 3, 4), (4, 0, 1)) - tmp32 = np.copy(ints.tmp102) - del ints.tmp102 - tmp32 += np.transpose(ints.tmp111, (1, 0, 3, 2)) * 2 - del ints.tmp111 - tmp33 = np.copy(ints.tmp157) - del ints.tmp157 - tmp33 += np.transpose(ints.tmp158, (1, 0, 3, 2)) * -1 - del ints.tmp158 - tmp26 = np.copy(tmp15) - del tmp15 - tmp26 += tmp16 - del tmp16 - tmp26 += tmp17 - del tmp17 - tmp26 += np.transpose(tmp19, (0, 2, 1)) * -2 - del tmp19 - tmp26 += np.transpose(tmp25, (0, 2, 1)) - del tmp25 - tmp29 = einsum(f.aa.ov, (0, 1), r1.a, (2,), (0, 1, 2)) * -1 - tmp29 += tmp27 * 2 - del tmp27 - tmp29 += np.transpose(tmp28, (0, 2, 1)) * -1 - del tmp28 - tmp14 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (2, 3, 4), (4, 0, 1)) - tmp13 = np.copy(tmp11) * -1 - del tmp11 - tmp13 += tmp12 * 2 - del tmp12 - tmp9 = np.copy(np.transpose(ints.tmp79, (0, 3, 1, 2))) * 0.5 - del ints.tmp79 - tmp9 += np.transpose(ints.tmp88, (0, 3, 1, 2)) - del ints.tmp88 - tmp9 += np.transpose(ints.tmp95, (0, 3, 1, 2)) * 0.5 - del ints.tmp95 - tmp9 += ints.tmp68 * -0.5 - del ints.tmp68 - tmp9 += np.transpose(ints.tmp91, (0, 2, 1, 3)) * -1 - del ints.tmp91 - tmp2 = np.copy(f.aa.ov) * 0.5 - tmp2 += ints.tmp1 - del ints.tmp1 - tmp2 += ints.tmp46 * 0.5 - del ints.tmp46 - tmp2 += ints.tmp4 * 0.5 - del ints.tmp4 - tmp2 += ints.tmp23 * -1 - del ints.tmp23 - tmp2 += ints.tmp32 * -0.5 - del ints.tmp32 - tmp2 += ints.tmp38 * -1 - del ints.tmp38 - tmp8 = np.copy(ints.tmp58) - tmp8 += np.transpose(ints.tmp81, (0, 1, 3, 2)) - del ints.tmp81 - tmp8 += np.transpose(ints.tmp87, (0, 1, 3, 2)) - del ints.tmp87 - tmp8 += np.transpose(ints.tmp93, (0, 1, 3, 2)) * 2 - del ints.tmp93 - tmp8 += ints.tmp90 * -1 - del ints.tmp90 - tmp8 += np.transpose(ints.tmp97, (0, 1, 3, 2)) * -1 - del ints.tmp97 - tmp3 = np.copy(f.bb.ov) * 0.5 - tmp3 += ints.tmp3 * 0.5 - del ints.tmp3 - tmp3 += ints.tmp44 * 0.5 - del ints.tmp44 - tmp3 += ints.tmp6 - del ints.tmp6 - tmp3 += ints.tmp26 * -1 - del ints.tmp26 - tmp3 += ints.tmp29 * -0.5 - del ints.tmp29 - tmp3 += ints.tmp41 * -1 - del ints.tmp41 - tmp1 = np.copy(np.transpose(ints.tmp34, (0, 3, 1, 2))) * 0.5 - del ints.tmp34 - tmp1 += np.transpose(ints.tmp48, (0, 3, 1, 2)) - del ints.tmp48 - tmp1 += np.transpose(ints.tmp54, (0, 3, 1, 2)) * 0.5 - del ints.tmp54 - tmp1 += ints.tmp12 * -0.5 - del ints.tmp12 - tmp1 += np.transpose(ints.tmp51, (0, 2, 1, 3)) * -1 - del ints.tmp51 - tmp0 = np.copy(ints.tmp14) - tmp0 += np.transpose(ints.tmp36, (0, 2, 1, 3)) - del ints.tmp36 - tmp0 += np.transpose(ints.tmp50, (0, 2, 1, 3)) - del ints.tmp50 - tmp0 += np.transpose(ints.tmp56, (0, 2, 1, 3)) * 2 - del ints.tmp56 - tmp0 += ints.tmp53 * -1 - del ints.tmp53 - tmp0 += np.transpose(ints.tmp59, (0, 2, 1, 3)) * -1 - del ints.tmp59 - r2new.bbb = einsum(ints.tmp200, (0, 1, 2, 3), r2.bbb, (1, 3, 4), (0, 2, 4)) * -2 - del ints.tmp200 - r2new.bbb += einsum(ints.tmp165, (0, 1, 2, 3), tmp44, (4, 0, 1), (3, 2, 4)) * -2 - del ints.tmp165, tmp44 - r2new.bbb += np.transpose(tmp50, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp50, (2, 1, 0)) - del tmp50 - r2new.bbb += np.transpose(tmp55, (1, 2, 0)) - r2new.bbb += np.transpose(tmp55, (2, 1, 0)) * -1 - del tmp55 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp43, (2, 3), (0, 1, 3)) * -2 - r2new.bab = einsum(r2.aaa, (0, 1, 2), ints.tmp166, (2, 3, 1, 4), (4, 0, 3)) * 2 - del ints.tmp166 - r2new.bab += einsum(ints.tmp146, (0, 1, 2, 3), tmp38, (0, 4, 1), (3, 2, 4)) * -1 - del tmp38 - r2new.bab += einsum(ints.tmp14, (0, 1, 2, 3), r1.a, (2,), (3, 1, 0)) * -1 - del ints.tmp14 - r2new.bab += einsum(r1.a, (0,), f.bb.ov, (1, 2), (2, 0, 1)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), ints.tmp149, (3, 1, 4, 0), (4, 3, 2)) - r2new.bab += einsum(tmp39, (0, 1, 2, 3), r2.bab, (3, 4, 1), (2, 4, 0)) * -1 - del tmp39 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp40, (3, 2, 4, 1), (0, 4, 3)) * -1 - del tmp40 - r2new.bab += einsum(tmp41, (0, 1), v.bbb.xov, (0, 2, 3), (3, 1, 2)) * -2 - del tmp41 - r2new.bab += einsum(tmp42, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -2 - del tmp42 - r2new.bab += einsum(tmp4, (0, 1), r2.bab, (2, 0, 3), (2, 1, 3)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp43, (2, 3), (0, 1, 3)) * -1 - del tmp43 - r2new.bab += einsum(tmp7, (0,), ints.tmp146, (0, 1, 2, 3), (3, 2, 1)) - r2new.aba = einsum(r1.b, (0,), ints.tmp58, (1, 2, 3, 0), (2, 3, 1)) * -1 - del ints.tmp58 - r2new.aba += einsum(r2.bbb, (0, 1, 2), ints.tmp113, (3, 2, 4, 1), (4, 0, 3)) * 2 - del ints.tmp113 - r2new.aba += einsum(f.aa.ov, (0, 1), r1.b, (2,), (1, 2, 0)) * -1 - r2new.aba += einsum(ints.tmp146, (0, 1, 2, 3), tmp31, (4, 0, 1), (2, 3, 4)) - del tmp31 - r2new.aba += einsum(r2.aba, (0, 1, 2), ints.tmp149, (3, 0, 4, 1), (3, 4, 2)) - del ints.tmp149 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp32, (3, 2, 4, 0), (4, 1, 3)) * -1 - del tmp32 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp33, (3, 2, 4, 1), (0, 4, 3)) * -1 - del tmp33 - r2new.aba += einsum(tmp36, (0, 1), v.baa.xov, (0, 2, 3), (3, 1, 2)) * -2 - del tmp36 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp10, (1, 3), (0, 3, 2)) * -1 - r2new.aba += einsum(tmp4, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp30, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(ints.tmp146, (0, 1, 2, 3), tmp37, (1,), (2, 3, 0)) * 2 - del tmp37, ints.tmp146 - r2new.aaa = einsum(tmp14, (0, 1, 2), ints.tmp110, (2, 1, 3, 4), (4, 3, 0)) * 2 - del ints.tmp110, tmp14 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), ints.tmp126, (3, 1, 4, 0), (3, 4, 2)) * 2 - del ints.tmp126 - r2new.aaa += np.transpose(tmp26, (1, 2, 0)) - r2new.aaa += np.transpose(tmp26, (2, 1, 0)) * -1 - del tmp26 - r2new.aaa += np.transpose(tmp29, (1, 2, 0)) - r2new.aaa += np.transpose(tmp29, (2, 1, 0)) * -1 - del tmp29 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp30, (2, 3), (0, 1, 3)) * -2 - del tmp30 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp8, (2, 0, 3, 1), (3,)) * -1 - del tmp8 - r1new.b += einsum(tmp9, (0, 1, 2, 3), r2.bbb, (2, 3, 0), (1,)) * -4 - del tmp9 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp3, (2, 1), (0,)) * 4 - r1new.b += einsum(r2.aba, (0, 1, 2), tmp2, (2, 0), (1,)) * -2 - r1new.b += einsum(r1.b, (0,), tmp10, (0, 1), (1,)) * -1 - del tmp10 - r1new.b += einsum(tmp13, (0,), f.bb.ov, (0, 1), (1,)) * -1 - del tmp13 - r1new.a = einsum(r2.bab, (0, 1, 2), tmp0, (2, 3, 1, 0), (3,)) * -1 - del tmp0 - r1new.a += einsum(r2.aaa, (0, 1, 2), tmp1, (2, 3, 0, 1), (3,)) * -4 - del tmp1 - r1new.a += einsum(tmp2, (0, 1), r2.aaa, (2, 1, 0), (2,)) * 4 - del tmp2 - r1new.a += einsum(tmp3, (0, 1), r2.bab, (1, 2, 0), (2,)) * -2 - del tmp3 - r1new.a += einsum(tmp4, (0, 1), r1.a, (0,), (1,)) * -1 - del tmp4 - r1new.a += einsum(tmp7, (0,), f.aa.ov, (0, 1), (1,)) * -1 - del tmp7 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/UDFCCSD.py b/ebcc/codegen/UDFCCSD.py deleted file mode 100644 index 118cbebb..00000000 --- a/ebcc/codegen/UDFCCSD.py +++ /dev/null @@ -1,7260 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T16:05:42.765972 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:05:44.594754. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (1, 2), (0,)) - tmp1 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) * 0.5 - tmp1 += tmp0 - tmp3 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp5 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp2 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp2 += einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp2 += einsum(t1.aa, (0, 1), tmp1, (2,), (2, 0, 1)) - del tmp1 - tmp4 = np.copy(f.aa.ov) - tmp4 += einsum(v.baa.xov, (0, 1, 2), tmp3, (0, 1, 3), (3, 2)) * -0.5 - del tmp3 - tmp6 = np.copy(f.bb.ov) * 2 - tmp6 += einsum(v.bbb.xov, (0, 1, 2), tmp5, (0, 1, 3), (3, 2)) * -1 - del tmp5 - tmp7 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp7 += einsum(tmp0, (0,), t1.bb, (1, 2), (0, 1, 2)) * 0.5 - del tmp0 - e_cc = einsum(tmp2, (0, 1, 2), v.baa.xov, (0, 1, 2), ()) - del tmp2 - e_cc += einsum(tmp4, (0, 1), t1.aa, (0, 1), ()) - del tmp4 - e_cc += einsum(t1.bb, (0, 1), tmp6, (0, 1), ()) * 0.5 - del tmp6 - e_cc += einsum(v.bbb.xov, (0, 1, 2), tmp7, (0, 1, 2), ()) - del tmp7 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:07:11.932861. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t1new : Namespace of arrays - Updated T1 residuals. - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - tmp6 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (1, 2), (0,)) - tmp5 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp21 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp0 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp9 = np.copy(tmp5) - tmp9 += tmp6 - tmp44 = einsum(v.bbb.xvv, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp143 = einsum(tmp21, (0, 1, 2), t1.bb, (2, 3), (0, 1, 3)) - tmp149 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (1, 3), (0, 3, 2)) - tmp36 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp32 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp7 = np.copy(tmp5) - del tmp5 - tmp7 += tmp6 - del tmp6 - tmp22 = einsum(v.bbb.xov, (0, 1, 2), tmp21, (0, 1, 3), (3, 2)) - tmp80 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 3), (0, 3, 2)) - tmp11 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp3 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp14 = einsum(tmp0, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp20 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp78 = einsum(tmp0, (0, 1, 2), t1.aa, (2, 3), (0, 1, 3)) - tmp35 = einsum(v.bbb.xov, (0, 1, 2), tmp9, (0,), (1, 2)) - tmp166 = np.copy(tmp44) - tmp166 += tmp143 * -1 - tmp202 = np.copy(v.bbb.xvv) - tmp202 += np.transpose(tmp149, (0, 2, 1)) * -1 - tmp42 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp37 = np.copy(tmp32) - tmp37 += tmp36 * 2 - tmp37 += einsum(tmp7, (0,), t1.bb, (1, 2), (0, 1, 2)) - tmp192 = np.copy(f.bb.ov) * -1 - tmp192 += tmp22 - tmp19 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp89 = np.copy(v.baa.xvv) - tmp89 += np.transpose(tmp80, (0, 2, 1)) * -1 - tmp72 = np.copy(tmp11) * 2 - tmp72 += tmp3 - tmp72 += einsum(tmp7, (0,), t1.aa, (1, 2), (0, 1, 2)) - tmp74 = np.copy(f.aa.ov) * -1 - tmp74 += tmp14 - tmp87 = np.copy(tmp20) - tmp87 += tmp78 * -1 - tmp197 = np.copy(v.bbb.xvv) - tmp197 += np.transpose(tmp149, (0, 2, 1)) * -1 - tmp43 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp96 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp101 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp134 = np.copy(f.bb.ov) - tmp134 += tmp22 * -1 - tmp134 += tmp35 - tmp222 = einsum(tmp21, (0, 1, 2), tmp21, (0, 3, 4), (3, 1, 4, 2)) - tmp167 = einsum(tmp166, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp203 = einsum(tmp21, (0, 1, 2), tmp202, (0, 3, 4), (1, 2, 3, 4)) - tmp209 = einsum(v.bbb.xoo, (0, 1, 2), tmp202, (0, 3, 4), (1, 2, 3, 4)) - del tmp202 - tmp159 = einsum(t1.bb, (0, 1), tmp42, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp191 = einsum(v.bbb.xov, (0, 1, 2), tmp37, (0, 3, 2), (1, 3)) - tmp193 = einsum(tmp192, (0, 1), t1.bb, (2, 1), (0, 2)) - del tmp192 - tmp177 = einsum(v.bbb.xoo, (0, 1, 2), tmp9, (0,), (1, 2)) - tmp45 = einsum(v.bbb.xoo, (0, 1, 2), tmp21, (0, 2, 3), (1, 3)) - tmp187 = einsum(tmp21, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp146 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp15 = np.copy(f.aa.ov) - tmp15 += tmp14 * -1 - tmp12 = np.copy(tmp11) - tmp12 += tmp3 * 0.5 - tmp12 += einsum(tmp7, (0,), t1.aa, (1, 2), (0, 1, 2)) * 0.5 - tmp154 = einsum(t1.aa, (0, 1), v.baa.xoo, (2, 3, 0), (2, 3, 1)) - tmp39 = np.copy(f.bb.ov) - tmp39 += tmp22 * -1 - tmp57 = np.copy(tmp20) - tmp57 += tmp11 * 2 - tmp57 += tmp3 - tmp57 += einsum(tmp7, (0,), t1.aa, (1, 2), (0, 1, 2)) - tmp10 = einsum(v.baa.xov, (0, 1, 2), tmp9, (0,), (1, 2)) - tmp94 = einsum(t1.aa, (0, 1), tmp19, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp98 = einsum(tmp89, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp18 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp73 = einsum(tmp72, (0, 1, 2), v.baa.xov, (0, 3, 2), (3, 1)) - del tmp72 - tmp75 = einsum(tmp74, (0, 1), t1.aa, (2, 1), (2, 0)) - del tmp74 - tmp113 = einsum(tmp0, (0, 1, 2), tmp0, (0, 3, 4), (1, 3, 2, 4)) - tmp81 = np.copy(v.baa.xvv) - tmp81 += np.transpose(tmp80, (0, 2, 1)) * -1 - tmp51 = einsum(v.baa.xoo, (0, 1, 2), tmp9, (0,), (1, 2)) - tmp27 = einsum(v.baa.xoo, (0, 1, 2), tmp0, (0, 2, 3), (1, 3)) - tmp88 = einsum(tmp87, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp90 = einsum(tmp0, (0, 1, 2), tmp89, (0, 3, 4), (1, 2, 3, 4)) - del tmp89 - tmp68 = einsum(v.baa.xoo, (0, 1, 2), tmp0, (0, 3, 4), (3, 1, 2, 4)) - tmp200 = np.copy(tmp44) * -1 - tmp200 += tmp143 - tmp231 = einsum(v.bbb.xov, (0, 1, 2), tmp197, (0, 3, 4), (1, 4, 3, 2)) - tmp196 = np.copy(tmp44) - tmp196 += tmp143 * -1 - tmp182 = np.copy(tmp44) - tmp182 += tmp32 - tmp182 += tmp36 * 2 - tmp182 += einsum(tmp7, (0,), t1.bb, (1, 2), (0, 1, 2)) - tmp145 = einsum(tmp43, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) - tmp215 = np.copy(np.transpose(tmp96, (1, 0, 2, 3))) - tmp215 += np.transpose(tmp96, (1, 0, 3, 2)) * -1 - tmp208 = np.copy(np.transpose(tmp101, (1, 0, 2, 3))) - tmp208 += np.transpose(tmp101, (1, 0, 3, 2)) * -1 - tmp174 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp129 = np.copy(tmp32) * 0.5 - tmp129 += tmp36 - tmp185 = einsum(v.bbb.xoo, (0, 1, 2), tmp44, (0, 3, 4), (3, 1, 2, 4)) - tmp31 = einsum(v.bbb.xov, (0, 1, 2), tmp21, (0, 3, 4), (3, 1, 4, 2)) - tmp46 = einsum(tmp7, (0,), v.bbb.xoo, (0, 1, 2), (1, 2)) - tmp229 = einsum(tmp101, (0, 1, 2, 3), t2.bbbb, (4, 5, 3, 2), (4, 5, 1, 0)) - tmp217 = einsum(v.bbb.xoo, (0, 1, 2), tmp32, (0, 3, 4), (3, 1, 2, 4)) - tmp135 = einsum(tmp134, (0, 1), t1.bb, (0, 2), (2, 1)) - del tmp134 - tmp133 = einsum(v.bbb.xvv, (0, 1, 2), tmp9, (0,), (1, 2)) - tmp132 = einsum(tmp44, (0, 1, 2), v.bbb.xov, (0, 1, 3), (3, 2)) - tmp131 = np.copy(tmp32) - tmp131 += tmp36 * 2 - tmp227 = einsum(tmp222, (0, 1, 2, 3), t1.bb, (2, 4), (1, 0, 3, 4)) - tmp224 = einsum(tmp21, (0, 1, 2), tmp44, (0, 3, 4), (1, 3, 2, 4)) - tmp213 = np.copy(np.transpose(tmp101, (1, 0, 2, 3))) - tmp213 += np.transpose(tmp101, (1, 0, 3, 2)) * -1 - tmp204 = np.copy(np.transpose(tmp167, (1, 0, 3, 2))) * -1 - tmp204 += np.transpose(tmp203, (0, 1, 3, 2)) - del tmp203 - tmp144 = np.copy(v.bbb.xov) - tmp144 += tmp44 - tmp144 += tmp143 * -1 - tmp219 = np.copy(tmp159) - tmp219 += np.transpose(tmp209, (1, 0, 3, 2)) - tmp211 = np.copy(np.transpose(tmp96, (1, 0, 2, 3))) - tmp211 += np.transpose(tmp96, (1, 0, 3, 2)) * -1 - tmp194 = np.copy(np.transpose(tmp191, (1, 0))) - del tmp191 - tmp194 += np.transpose(tmp193, (1, 0)) * -1 - del tmp193 - tmp234 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp178 = np.copy(f.bb.oo) - tmp178 += np.transpose(tmp45, (1, 0)) * -1 - tmp178 += np.transpose(tmp177, (1, 0)) - del tmp177 - tmp189 = einsum(tmp187, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp150 = np.copy(v.bbb.xvv) - tmp150 += tmp149 * -1 - tmp141 = np.copy(v.baa.xvv) - tmp141 += tmp80 * -1 - tmp162 = einsum(t1.bb, (0, 1), tmp146, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp163 = np.copy(v.bbb.xvv) - tmp163 += tmp149 * -1 - del tmp149 - tmp16 = einsum(tmp15, (0, 1), t1.aa, (2, 1), (2, 0)) * 0.5 - tmp13 = einsum(tmp12, (0, 1, 2), v.baa.xov, (0, 3, 2), (3, 1)) - del tmp12 - tmp147 = np.copy(v.baa.xvv) - tmp147 += tmp80 * -1 - del tmp80 - tmp170 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 4, 1, 2)) - tmp155 = np.copy(tmp154) * -1 - del tmp154 - tmp155 += tmp11 * 2 - tmp155 += tmp3 - tmp40 = einsum(tmp39, (0, 1), t1.bb, (2, 1), (2, 0)) * 0.5 - tmp38 = einsum(v.bbb.xov, (0, 1, 2), tmp37, (0, 3, 2), (1, 3)) * 0.5 - del tmp37 - tmp60 = einsum(tmp15, (0, 1), t1.aa, (0, 2), (2, 1)) - del tmp15 - tmp59 = einsum(v.baa.xvv, (0, 1, 2), tmp7, (0,), (1, 2)) - tmp58 = einsum(tmp57, (0, 1, 2), v.baa.xov, (0, 1, 3), (3, 2)) - del tmp57 - tmp97 = np.copy(np.transpose(tmp96, (1, 0, 2, 3))) * -1 - tmp97 += np.transpose(tmp96, (1, 0, 3, 2)) - tmp64 = np.copy(f.aa.ov) - tmp64 += tmp14 * -1 - tmp64 += tmp10 - tmp110 = np.copy(tmp94) - tmp110 += np.transpose(tmp98, (1, 0, 3, 2)) - tmp28 = einsum(tmp7, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - tmp102 = np.copy(np.transpose(tmp101, (1, 0, 2, 3))) * -1 - tmp102 += np.transpose(tmp101, (1, 0, 3, 2)) - tmp100 = einsum(t1.aa, (0, 1), tmp18, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp120 = einsum(t2.aaaa, (0, 1, 2, 3), tmp96, (4, 5, 3, 2), (0, 1, 5, 4)) - tmp106 = np.copy(np.transpose(tmp101, (1, 0, 2, 3))) * -1 - tmp106 += np.transpose(tmp101, (1, 0, 3, 2)) - tmp83 = np.copy(v.baa.xov) - tmp83 += tmp20 - tmp83 += tmp78 * -1 - tmp79 = np.copy(tmp20) - tmp79 += tmp78 * -1 - tmp2 = einsum(v.baa.xov, (0, 1, 2), tmp0, (0, 3, 4), (3, 1, 4, 2)) - tmp48 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp76 = np.copy(np.transpose(tmp73, (1, 0))) - del tmp73 - tmp76 += tmp75 * -1 - del tmp75 - tmp62 = np.copy(tmp11) * 2 - tmp62 += tmp3 - tmp125 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp104 = np.copy(np.transpose(tmp96, (1, 0, 2, 3))) * -1 - tmp104 += np.transpose(tmp96, (1, 0, 3, 2)) - tmp117 = einsum(tmp113, (0, 1, 2, 3), t1.aa, (2, 4), (1, 0, 3, 4)) - tmp122 = einsum(v.baa.xov, (0, 1, 2), tmp81, (0, 3, 4), (1, 4, 3, 2)) - tmp66 = einsum(v.baa.xoo, (0, 1, 2), tmp20, (0, 3, 4), (3, 1, 2, 4)) - tmp52 = np.copy(f.aa.oo) - tmp52 += np.transpose(tmp27, (1, 0)) * -1 - tmp52 += np.transpose(tmp51, (1, 0)) - del tmp51 - tmp91 = np.copy(np.transpose(tmp88, (1, 0, 3, 2))) * -1 - tmp91 += np.transpose(tmp90, (0, 1, 3, 2)) - del tmp90 - tmp115 = einsum(tmp20, (0, 1, 2), tmp0, (0, 3, 4), (3, 1, 4, 2)) - tmp85 = np.copy(tmp20) * -1 - tmp85 += tmp78 - del tmp78 - tmp70 = einsum(tmp68, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp108 = einsum(tmp3, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp54 = np.copy(tmp11) * 2 - tmp54 += tmp3 - tmp25 = einsum(tmp7, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp33 = np.copy(t2.bbbb) - tmp33 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -0.5 - tmp23 = einsum(tmp7, (0,), v.bbb.xov, (0, 1, 2), (1, 2)) - tmp4 = np.copy(t2.aaaa) - tmp4 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * -0.5 - tmp221 = einsum(tmp44, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 4, 2)) - tmp201 = einsum(tmp32, (0, 1, 2), tmp200, (0, 3, 4), (3, 1, 4, 2)) - del tmp200 - tmp232 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp232 += einsum(tmp231, (0, 1, 2, 3), t1.bb, (0, 4), (3, 2, 4, 1)) - del tmp231 - tmp198 = einsum(v.bbb.xov, (0, 1, 2), tmp196, (0, 3, 4), (3, 1, 4, 2)) * -1 - del tmp196 - tmp198 += einsum(tmp197, (0, 1, 2), tmp21, (0, 3, 4), (3, 4, 2, 1)) - tmp183 = np.copy(f.bb.vv) * -1 - tmp183 += einsum(v.bbb.xov, (0, 1, 2), tmp182, (0, 1, 3), (2, 3)) - del tmp182 - tmp183 += einsum(tmp7, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) * -1 - tmp183 += einsum(tmp39, (0, 1), t1.bb, (0, 2), (1, 2)) - del tmp39 - tmp216 = np.copy(tmp145) - tmp216 += einsum(tmp215, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp215 - tmp175 = np.copy(t2.bbbb) - tmp175 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) * 2 - tmp206 = einsum(tmp166, (0, 1, 2), tmp32, (0, 3, 4), (3, 1, 4, 2)) - tmp210 = np.copy(tmp159) - tmp210 += einsum(t2.bbbb, (0, 1, 2, 3), tmp208, (1, 4, 5, 3), (0, 4, 2, 5)) * -2 - del tmp208 - tmp210 += np.transpose(tmp209, (1, 0, 3, 2)) - del tmp209 - tmp176 = einsum(t2.bbbb, (0, 1, 2, 3), tmp174, (4, 0, 5, 1), (5, 4, 2, 3)) - tmp180 = einsum(tmp129, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp186 = einsum(t1.bb, (0, 1), tmp185, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp185 - tmp233 = einsum(t1.bb, (0, 1), tmp31, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp223 = einsum(tmp222, (0, 1, 2, 3), t2.bbbb, (3, 2, 4, 5), (1, 0, 4, 5)) - del tmp222 - tmp181 = einsum(t1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * 2 - tmp181 += t2.bbbb * -1 - tmp47 = np.copy(f.bb.oo) - tmp47 += np.transpose(tmp45, (1, 0)) * -1 - del tmp45 - tmp47 += np.transpose(tmp46, (1, 0)) - del tmp46 - tmp230 = einsum(tmp229, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 5), (1, 0, 4, 5)) * -1 - del tmp229 - tmp218 = einsum(t1.bb, (0, 1), tmp217, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp217 - tmp207 = einsum(tmp36, (0, 1, 2), tmp32, (0, 3, 4), (3, 1, 4, 2)) - tmp136 = np.copy(f.bb.vv) - tmp136 += tmp132 * -1 - del tmp132 - tmp136 += np.transpose(tmp133, (1, 0)) - del tmp133 - tmp136 += np.transpose(tmp135, (1, 0)) * -1 - del tmp135 - tmp184 = einsum(tmp131, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp228 = einsum(tmp227, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - del tmp227 - tmp225 = einsum(t1.bb, (0, 1), tmp224, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp224 - tmp214 = np.copy(tmp159) * 0.5 - tmp214 += einsum(t2.bbbb, (0, 1, 2, 3), tmp213, (1, 4, 5, 3), (0, 4, 2, 5)) * -1 - del tmp213 - tmp214 += einsum(v.bbb.xoo, (0, 1, 2), tmp197, (0, 3, 4), (1, 2, 4, 3)) * 0.5 - del tmp197 - tmp205 = einsum(tmp204, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp204 - tmp199 = einsum(v.bbb.xov, (0, 1, 2), tmp144, (0, 3, 4), (1, 3, 2, 4)) - tmp220 = einsum(tmp219, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp219 - tmp212 = np.copy(tmp145) - tmp212 += einsum(tmp211, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp211 - tmp188 = einsum(t2.bbbb, (0, 1, 2, 3), tmp187, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp187 - tmp195 = einsum(t2.bbbb, (0, 1, 2, 3), tmp194, (4, 1), (4, 0, 2, 3)) * -1 - del tmp194 - tmp226 = einsum(tmp44, (0, 1, 2), tmp44, (0, 3, 4), (3, 1, 4, 2)) - tmp235 = einsum(tmp234, (0, 1, 2, 3), t2.bbbb, (4, 5, 2, 3), (4, 5, 0, 1)) * -1 - del tmp234 - tmp179 = einsum(t2.bbbb, (0, 1, 2, 3), tmp178, (1, 4), (4, 0, 2, 3)) * -1 - del tmp178 - tmp190 = einsum(t1.bb, (0, 1), tmp189, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp189 - tmp151 = einsum(v.baa.xoo, (0, 1, 2), tmp150, (0, 3, 4), (1, 2, 4, 3)) - tmp142 = einsum(tmp141, (0, 1, 2), tmp21, (0, 3, 4), (3, 4, 2, 1)) - del tmp141 - tmp139 = einsum(v.bbb.xoo, (0, 1, 2), tmp20, (0, 3, 4), (3, 1, 2, 4)) - tmp160 = np.copy(np.transpose(tmp159, (1, 0, 3, 2))) - tmp160 += einsum(v.bbb.xoo, (0, 1, 2), tmp150, (0, 3, 4), (1, 2, 4, 3)) - tmp130 = einsum(tmp129, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) * 2 - del tmp129 - tmp152 = np.copy(v.bbb.xov) - tmp152 += tmp44 - tmp152 += tmp143 * -1 - del tmp143 - tmp168 = np.copy(np.transpose(tmp167, (1, 0, 2, 3))) * -1 - del tmp167 - tmp168 += einsum(tmp21, (0, 1, 2), tmp150, (0, 3, 4), (1, 2, 4, 3)) - tmp164 = einsum(t1.aa, (0, 1), tmp162, (0, 2, 3, 4), (2, 1, 4, 3)) - del tmp162 - tmp164 += einsum(tmp163, (0, 1, 2), v.baa.xvv, (0, 3, 4), (3, 4, 2, 1)) - del tmp163 - tmp137 = einsum(v.baa.xoo, (0, 1, 2), tmp21, (0, 3, 4), (1, 2, 3, 4)) - tmp140 = einsum(tmp0, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 2, 3, 4)) - tmp17 = np.copy(tmp13) - del tmp13 - tmp17 += np.transpose(tmp16, (1, 0)) - del tmp16 - tmp138 = np.copy(t2.abab) - tmp138 += einsum(t1.bb, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - tmp127 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp165 = np.copy(np.transpose(tmp88, (1, 0, 2, 3))) * -1 - del tmp88 - tmp165 += einsum(tmp0, (0, 1, 2), tmp147, (0, 3, 4), (1, 2, 4, 3)) - tmp173 = einsum(tmp0, (0, 1, 2), tmp44, (0, 3, 4), (1, 2, 3, 4)) - tmp148 = einsum(tmp146, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp148 += einsum(v.bbb.xoo, (0, 1, 2), tmp147, (0, 3, 4), (1, 2, 4, 3)) * -1 - tmp172 = einsum(v.baa.xoo, (0, 1, 2), tmp44, (0, 3, 4), (1, 2, 3, 4)) - tmp153 = einsum(tmp0, (0, 1, 2), tmp21, (0, 3, 4), (1, 2, 3, 4)) - tmp171 = einsum(tmp170, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - del tmp170 - tmp1 = einsum(tmp0, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp157 = einsum(t2.abab, (0, 1, 2, 3), tmp101, (1, 4, 5, 3), (0, 4, 2, 5)) * -1 - del tmp101 - tmp157 += einsum(v.bbb.xov, (0, 1, 2), tmp155, (0, 3, 4), (3, 1, 4, 2)) - tmp169 = einsum(tmp0, (0, 1, 2), tmp150, (0, 3, 4), (1, 2, 4, 3)) - del tmp150 - tmp156 = einsum(t2.aaaa, (0, 1, 2, 3), tmp96, (1, 4, 5, 3), (4, 0, 5, 2)) * 2 - del tmp96 - tmp156 += einsum(tmp155, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) * -1 - del tmp155 - tmp156 += einsum(v.baa.xoo, (0, 1, 2), tmp147, (0, 3, 4), (1, 2, 4, 3)) - del tmp147 - tmp41 = np.copy(tmp38) - del tmp38 - tmp41 += np.transpose(tmp40, (1, 0)) - del tmp40 - tmp128 = np.copy(t2.abab) - tmp128 += einsum(t1.bb, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) * 2 - tmp161 = einsum(t2.abab, (0, 1, 2, 3), tmp146, (4, 5, 2, 3), (0, 4, 1, 5)) - del tmp146 - tmp61 = np.copy(f.aa.vv) * -1 - tmp61 += tmp58 - del tmp58 - tmp61 += np.transpose(tmp59, (1, 0)) * -1 - del tmp59 - tmp61 += np.transpose(tmp60, (1, 0)) - del tmp60 - tmp158 = einsum(v.bbb.xoo, (0, 1, 2), tmp11, (0, 3, 4), (3, 1, 2, 4)) - tmp99 = np.copy(tmp94) - tmp99 += einsum(tmp97, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (4, 1, 5, 3)) * -2 - del tmp97 - tmp99 += np.transpose(tmp98, (1, 0, 3, 2)) - del tmp98 - tmp65 = np.copy(f.aa.vv) - tmp65 += einsum(tmp20, (0, 1, 2), v.baa.xov, (0, 1, 3), (3, 2)) * -1 - tmp65 += einsum(v.baa.xvv, (0, 1, 2), tmp9, (0,), (1, 2)) - del tmp9 - tmp65 += einsum(t1.aa, (0, 1), tmp64, (0, 2), (2, 1)) * -1 - del tmp64 - tmp111 = einsum(t2.aaaa, (0, 1, 2, 3), tmp110, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp110 - tmp119 = einsum(tmp20, (0, 1, 2), tmp20, (0, 3, 4), (1, 3, 2, 4)) - tmp29 = np.copy(f.aa.oo) - tmp29 += np.transpose(tmp27, (1, 0)) * -1 - del tmp27 - tmp29 += np.transpose(tmp28, (1, 0)) - del tmp28 - tmp103 = np.copy(tmp100) - tmp103 += einsum(t2.abab, (0, 1, 2, 3), tmp102, (1, 4, 3, 5), (0, 4, 2, 5)) * -1 - del tmp102 - tmp121 = einsum(t2.aaaa, (0, 1, 2, 3), tmp120, (4, 5, 0, 1), (5, 4, 2, 3)) * -1 - del tmp120 - tmp107 = np.copy(tmp100) - tmp107 += einsum(t2.abab, (0, 1, 2, 3), tmp106, (1, 4, 3, 5), (0, 4, 2, 5)) * -1 - del tmp106 - tmp84 = einsum(tmp83, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - del tmp83 - tmp82 = einsum(v.baa.xov, (0, 1, 2), tmp79, (0, 3, 4), (3, 1, 4, 2)) * -1 - del tmp79 - tmp82 += einsum(tmp0, (0, 1, 2), tmp81, (0, 3, 4), (1, 2, 4, 3)) - del tmp0 - tmp124 = einsum(tmp2, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - tmp50 = einsum(t2.aaaa, (0, 1, 2, 3), tmp48, (4, 0, 5, 1), (5, 4, 2, 3)) - tmp69 = einsum(tmp68, (0, 1, 2, 3), t2.aaaa, (1, 3, 4, 5), (0, 2, 4, 5)) - del tmp68 - tmp77 = einsum(t2.aaaa, (0, 1, 2, 3), tmp76, (4, 1), (0, 4, 2, 3)) * -1 - del tmp76 - tmp63 = einsum(tmp62, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp126 = einsum(t2.aaaa, (0, 1, 2, 3), tmp125, (4, 5, 2, 3), (0, 1, 4, 5)) * -1 - del tmp125 - tmp105 = np.copy(tmp94) * 0.5 - tmp105 += einsum(t2.aaaa, (0, 1, 2, 3), tmp104, (1, 4, 3, 5), (0, 4, 2, 5)) * -1 - del tmp104 - tmp105 += einsum(v.baa.xoo, (0, 1, 2), tmp81, (0, 3, 4), (1, 2, 4, 3)) * 0.5 - del tmp81 - tmp93 = einsum(tmp3, (0, 1, 2), tmp87, (0, 3, 4), (1, 3, 2, 4)) - tmp118 = einsum(t1.aa, (0, 1), tmp117, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp117 - tmp49 = np.copy(t2.aaaa) - tmp49 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) * 2 - tmp114 = einsum(t2.aaaa, (0, 1, 2, 3), tmp113, (4, 5, 1, 0), (5, 4, 2, 3)) - del tmp113 - tmp123 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp123 += einsum(tmp122, (0, 1, 2, 3), t1.aa, (0, 4), (3, 2, 4, 1)) - del tmp122 - tmp67 = einsum(tmp66, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp66 - tmp53 = einsum(t2.aaaa, (0, 1, 2, 3), tmp52, (1, 4), (0, 4, 2, 3)) * -1 - tmp92 = einsum(tmp91, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp91 - tmp116 = einsum(tmp115, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp115 - tmp86 = einsum(tmp85, (0, 1, 2), tmp3, (0, 3, 4), (3, 1, 4, 2)) - del tmp85 - tmp71 = einsum(tmp70, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp70 - tmp109 = einsum(tmp108, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) - del tmp108 - tmp95 = einsum(tmp3, (0, 1, 2), tmp11, (0, 3, 4), (3, 1, 4, 2)) - tmp55 = einsum(tmp54, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - del tmp54 - tmp112 = einsum(tmp20, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 4, 2)) - tmp56 = einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * 2 - tmp56 += t2.aaaa * -1 - tmp26 = np.copy(f.aa.ov) - tmp26 += tmp14 * -1 - del tmp14 - tmp26 += tmp25 - del tmp25 - tmp30 = einsum(tmp21, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - del tmp21 - tmp34 = np.copy(tmp32) - del tmp32 - tmp34 += einsum(tmp33, (0, 1, 2, 3), v.bbb.xov, (4, 0, 2), (4, 1, 3)) * 2 - del tmp33 - tmp34 += einsum(tmp7, (0,), t1.bb, (1, 2), (0, 1, 2)) - tmp24 = np.copy(f.bb.ov) - tmp24 += tmp22 * -1 - del tmp22 - tmp24 += tmp23 - del tmp23 - tmp8 = np.copy(tmp3) - del tmp3 - tmp8 += einsum(v.baa.xov, (0, 1, 2), tmp4, (1, 3, 2, 4), (0, 3, 4)) * 2 - del tmp4 - tmp8 += einsum(tmp7, (0,), t1.aa, (1, 2), (0, 1, 2)) - del tmp7 - t2new.bbbb = einsum(t2.bbbb, (0, 1, 2, 3), tmp47, (1, 4), (0, 4, 2, 3)) * -1 - t2new.bbbb += einsum(tmp174, (0, 1, 2, 3), tmp175, (0, 2, 4, 5), (1, 3, 5, 4)) * 0.5 - del tmp175 - t2new.bbbb += np.transpose(tmp176, (0, 1, 3, 2)) * -1 - del tmp176 - t2new.bbbb += np.transpose(tmp179, (1, 0, 3, 2)) * -1 - t2new.bbbb += einsum(tmp180, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 4, 0)) * -4 - del tmp180 - t2new.bbbb += np.transpose(tmp179, (0, 1, 3, 2)) * 2 - del tmp179 - t2new.bbbb += einsum(tmp174, (0, 1, 2, 3), tmp181, (0, 2, 4, 5), (1, 3, 5, 4)) * -0.5 - del tmp174, tmp181 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp183, (3, 4), (0, 1, 4, 2)) * 2 - del tmp183 - t2new.bbbb += tmp184 - t2new.bbbb += einsum(tmp136, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 4, 1)) * 2 - t2new.bbbb += np.transpose(tmp184, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp186, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp188, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp190, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp190, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp195, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp186, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp186, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp188, (0, 1, 3, 2)) * 2 - del tmp188 - t2new.bbbb += tmp190 * -1 - t2new.bbbb += np.transpose(tmp190, (0, 1, 3, 2)) - del tmp190 - t2new.bbbb += np.transpose(tmp195, (0, 1, 3, 2)) * 2 - del tmp195 - t2new.bbbb += tmp186 - del tmp186 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp198, (4, 1, 5, 3), (0, 4, 5, 2)) * 2 - del tmp198 - t2new.bbbb += tmp199 - t2new.bbbb += np.transpose(tmp201, (1, 0, 2, 3)) - t2new.bbbb += tmp205 * -2 - t2new.bbbb += np.transpose(tmp199, (1, 0, 2, 3)) * -1 - del tmp199 - t2new.bbbb += np.transpose(tmp206, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp159, (0, 1, 3, 2)) - t2new.bbbb += tmp207 * 2 - t2new.bbbb += np.transpose(tmp207, (1, 0, 3, 2)) * 2 - t2new.bbbb += einsum(tmp210, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * -2 - del tmp210 - t2new.bbbb += einsum(tmp212, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) * -1 - del tmp212 - t2new.bbbb += np.transpose(tmp159, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp207, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp207, (1, 0, 2, 3)) * -2 - del tmp207 - t2new.bbbb += einsum(tmp214, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (4, 0, 2, 5)) * 4 - del tmp214 - t2new.bbbb += einsum(t2.abab, (0, 1, 2, 3), tmp216, (0, 4, 2, 5), (1, 4, 5, 3)) - del tmp216 - t2new.bbbb += np.transpose(tmp218, (1, 0, 3, 2)) - t2new.bbbb += tmp159 * -1 - t2new.bbbb += np.transpose(tmp220, (0, 1, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp218, (0, 1, 3, 2)) * -1 - del tmp218 - t2new.bbbb += np.transpose(tmp159, (1, 0, 2, 3)) - del tmp159 - t2new.bbbb += np.transpose(tmp220, (1, 0, 3, 2)) * -2 - del tmp220 - t2new.bbbb += np.transpose(tmp221, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp223, (0, 1, 3, 2)) * -2 - del tmp223 - t2new.bbbb += np.transpose(tmp225, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp225, (1, 0, 3, 2)) * -1 - t2new.bbbb += tmp226 - t2new.bbbb += np.transpose(tmp226, (0, 1, 3, 2)) * -1 - del tmp226 - t2new.bbbb += tmp228 - t2new.bbbb += np.transpose(tmp228, (0, 1, 3, 2)) * -1 - del tmp228 - t2new.bbbb += np.transpose(tmp221, (1, 0, 3, 2)) * -1 - del tmp221 - t2new.bbbb += tmp230 * 2 - del tmp230 - t2new.bbbb += einsum(tmp232, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (4, 5, 3, 2)) * 2 - del tmp232 - t2new.bbbb += np.transpose(tmp184, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp184, (1, 0, 3, 2)) - del tmp184 - t2new.bbbb += np.transpose(tmp233, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp205, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp201, (1, 0, 3, 2)) * -1 - del tmp201 - t2new.bbbb += tmp233 * -1 - del tmp233 - t2new.bbbb += np.transpose(tmp205, (0, 1, 3, 2)) * 2 - del tmp205 - t2new.bbbb += np.transpose(tmp206, (1, 0, 2, 3)) * -1 - del tmp206 - t2new.bbbb += einsum(t1.bb, (0, 1), tmp235, (2, 3, 0, 4), (2, 3, 1, 4)) * -2 - del tmp235 - t2new.bbbb += tmp225 * -1 - t2new.bbbb += np.transpose(tmp225, (1, 0, 2, 3)) - del tmp225 - t2new.abab = einsum(t2.abab, (0, 1, 2, 3), tmp47, (1, 4), (0, 4, 2, 3)) * -1 - t2new.abab += einsum(tmp127, (0, 1, 2, 3), tmp128, (0, 2, 4, 5), (1, 3, 4, 5)) * 0.5 - del tmp128 - t2new.abab += einsum(tmp127, (0, 1, 2, 3), t2.abab, (1, 3, 4, 5), (0, 2, 4, 5)) * 0.5 - del tmp127 - t2new.abab += einsum(tmp130, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 4, 0)) * -1 - del tmp130 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp52, (0, 4), (4, 1, 2, 3)) * -1 - del tmp52 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp61, (2, 4), (0, 1, 4, 3)) * -1 - t2new.abab += einsum(tmp131, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - del tmp131 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp136, (3, 4), (0, 1, 2, 4)) - del tmp136 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp41, (1, 4), (0, 4, 2, 3)) * -2 - t2new.abab += einsum(tmp138, (0, 1, 2, 3), tmp137, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp137 - t2new.abab += einsum(tmp139, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) * -1 - del tmp139 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp17, (0, 4), (4, 1, 2, 3)) * -2 - t2new.abab += einsum(tmp138, (0, 1, 2, 3), tmp140, (4, 0, 1, 5), (4, 5, 2, 3)) - del tmp140 - t2new.abab += einsum(tmp142, (0, 1, 2, 3), t2.abab, (4, 1, 2, 5), (4, 0, 3, 5)) * -1 - del tmp142 - t2new.abab += einsum(v.baa.xov, (0, 1, 2), tmp144, (0, 3, 4), (1, 3, 2, 4)) - del tmp144 - t2new.abab += tmp145 * -1 - del tmp145 - t2new.abab += einsum(tmp148, (0, 1, 2, 3), t2.abab, (4, 0, 2, 5), (4, 1, 3, 5)) - del tmp148 - t2new.abab += tmp100 * -1 - del tmp100 - t2new.abab += einsum(tmp151, (0, 1, 2, 3), t2.abab, (0, 4, 5, 2), (1, 4, 5, 3)) * -1 - del tmp151 - t2new.abab += einsum(tmp152, (0, 1, 2), tmp20, (0, 3, 4), (3, 1, 4, 2)) - del tmp152 - t2new.abab += einsum(tmp138, (0, 1, 2, 3), tmp153, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp138, tmp153 - t2new.abab += einsum(tmp156, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) * -1 - del tmp156 - t2new.abab += einsum(tmp157, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp157 - t2new.abab += einsum(v.bbb.xov, (0, 1, 2), tmp62, (0, 3, 4), (3, 1, 4, 2)) - del tmp62 - t2new.abab += einsum(tmp158, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) * -2 - del tmp158 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp160, (1, 4, 3, 5), (0, 4, 2, 5)) * -1 - del tmp160 - t2new.abab += einsum(tmp161, (0, 1, 2, 3), t2.abab, (1, 3, 4, 5), (0, 2, 4, 5)) - del tmp161 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp164, (2, 4, 3, 5), (0, 1, 4, 5)) - del tmp164 - t2new.abab += einsum(tmp165, (0, 1, 2, 3), t2.abab, (1, 4, 2, 5), (0, 4, 3, 5)) * -1 - del tmp165 - t2new.abab += einsum(tmp87, (0, 1, 2), tmp36, (0, 3, 4), (1, 3, 2, 4)) * 2 - del tmp36, tmp87 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp168, (4, 1, 3, 5), (0, 4, 2, 5)) * -1 - del tmp168 - t2new.abab += einsum(tmp166, (0, 1, 2), tmp11, (0, 3, 4), (3, 1, 4, 2)) * 2 - del tmp11, tmp166 - t2new.abab += einsum(t1.aa, (0, 1), tmp1, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - t2new.abab += einsum(tmp169, (0, 1, 2, 3), t2.abab, (1, 4, 5, 2), (0, 4, 5, 3)) * -1 - del tmp169 - t2new.abab += einsum(tmp171, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - del tmp171 - t2new.abab += einsum(tmp172, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -1 - del tmp172 - t2new.abab += einsum(tmp173, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - del tmp173 - t2new.aaaa = einsum(t2.aaaa, (0, 1, 2, 3), tmp29, (1, 4), (0, 4, 2, 3)) * -1 - t2new.aaaa += einsum(tmp48, (0, 1, 2, 3), tmp49, (0, 2, 4, 5), (1, 3, 5, 4)) * 0.5 - del tmp49 - t2new.aaaa += np.transpose(tmp50, (0, 1, 3, 2)) * -1 - del tmp50 - t2new.aaaa += np.transpose(tmp53, (0, 1, 3, 2)) * -1 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp55, (4, 3), (0, 1, 2, 4)) * -2 - del tmp55 - t2new.aaaa += np.transpose(tmp53, (1, 0, 3, 2)) * 2 - del tmp53 - t2new.aaaa += einsum(tmp48, (0, 1, 2, 3), tmp56, (0, 2, 4, 5), (1, 3, 5, 4)) * -0.5 - del tmp48, tmp56 - t2new.aaaa += einsum(tmp61, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 1, 4)) * 2 - del tmp61 - t2new.aaaa += tmp63 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp65, (3, 4), (0, 1, 2, 4)) * 2 - del tmp65 - t2new.aaaa += np.transpose(tmp63, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp67, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp69, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp71, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(tmp71, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp77, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp67, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp67, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp69, (0, 1, 3, 2)) * 2 - del tmp69 - t2new.aaaa += tmp71 * -1 - t2new.aaaa += np.transpose(tmp71, (0, 1, 3, 2)) - del tmp71 - t2new.aaaa += np.transpose(tmp77, (1, 0, 3, 2)) * 2 - del tmp77 - t2new.aaaa += tmp67 - del tmp67 - t2new.aaaa += einsum(tmp82, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 2, 5)) * 2 - del tmp82 - t2new.aaaa += tmp84 - t2new.aaaa += np.transpose(tmp86, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp92, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp84, (1, 0, 2, 3)) * -1 - del tmp84 - t2new.aaaa += np.transpose(tmp93, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp94, (0, 1, 3, 2)) - t2new.aaaa += tmp95 * 2 - t2new.aaaa += np.transpose(tmp95, (1, 0, 3, 2)) * 2 - t2new.aaaa += einsum(tmp99, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (0, 4, 2, 5)) * -2 - del tmp99 - t2new.aaaa += einsum(tmp103, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - del tmp103 - t2new.aaaa += np.transpose(tmp94, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp95, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp95, (1, 0, 2, 3)) * -2 - del tmp95 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp105, (4, 1, 5, 3), (0, 4, 5, 2)) * 4 - del tmp105 - t2new.aaaa += einsum(t2.abab, (0, 1, 2, 3), tmp107, (4, 1, 5, 3), (0, 4, 5, 2)) - del tmp107 - t2new.aaaa += np.transpose(tmp109, (1, 0, 3, 2)) - t2new.aaaa += tmp94 * -1 - t2new.aaaa += np.transpose(tmp111, (1, 0, 2, 3)) * 2 - t2new.aaaa += np.transpose(tmp109, (0, 1, 3, 2)) * -1 - del tmp109 - t2new.aaaa += np.transpose(tmp94, (1, 0, 2, 3)) - del tmp94 - t2new.aaaa += tmp111 * -2 - del tmp111 - t2new.aaaa += np.transpose(tmp112, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp114, (0, 1, 3, 2)) * -2 - del tmp114 - t2new.aaaa += np.transpose(tmp116, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp116, (1, 0, 3, 2)) * -1 - t2new.aaaa += tmp118 - t2new.aaaa += np.transpose(tmp118, (0, 1, 3, 2)) * -1 - del tmp118 - t2new.aaaa += tmp119 - t2new.aaaa += np.transpose(tmp119, (0, 1, 3, 2)) * -1 - del tmp119 - t2new.aaaa += np.transpose(tmp112, (1, 0, 3, 2)) * -1 - del tmp112 - t2new.aaaa += tmp121 * 2 - del tmp121 - t2new.aaaa += einsum(tmp123, (0, 1, 2, 3), t2.aaaa, (4, 5, 0, 1), (4, 5, 3, 2)) * 2 - del tmp123 - t2new.aaaa += np.transpose(tmp63, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp63, (1, 0, 3, 2)) - del tmp63 - t2new.aaaa += np.transpose(tmp124, (1, 0, 2, 3)) - t2new.aaaa += tmp92 * -2 - t2new.aaaa += tmp86 * -1 - del tmp86 - t2new.aaaa += tmp124 * -1 - del tmp124 - t2new.aaaa += np.transpose(tmp92, (1, 0, 2, 3)) * 2 - del tmp92 - t2new.aaaa += np.transpose(tmp93, (1, 0, 2, 3)) * -1 - del tmp93 - t2new.aaaa += einsum(tmp126, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) * -2 - del tmp126 - t2new.aaaa += tmp116 * -1 - t2new.aaaa += np.transpose(tmp116, (1, 0, 2, 3)) - del tmp116 - t1new.bb = np.copy(f.bb.ov) - t1new.bb += einsum(tmp30, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) * -1 - del tmp30 - t1new.bb += einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp31, (4, 1, 0, 3), (4, 2)) * -2 - del tmp31 - t1new.bb += einsum(tmp34, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) - del tmp34 - t1new.bb += tmp35 - del tmp35 - t1new.bb += einsum(tmp41, (0, 1), t1.bb, (0, 2), (1, 2)) * -2 - del tmp41 - t1new.bb += einsum(tmp42, (0, 1, 2, 3), t2.bbbb, (1, 2, 4, 3), (0, 4)) * -2 - del tmp42 - t1new.bb += einsum(tmp43, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) * -1 - del tmp43 - t1new.bb += einsum(v.bbb.xoo, (0, 1, 2), tmp44, (0, 2, 3), (1, 3)) * -1 - del tmp44 - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), tmp26, (0, 2), (1, 3)) - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp24, (1, 3), (0, 2)) * 2 - t1new.bb += einsum(tmp47, (0, 1), t1.bb, (0, 2), (1, 2)) * -1 - del tmp47 - t1new.aa = np.copy(f.aa.ov) - t1new.aa += einsum(t1.aa, (0, 1), f.aa.vv, (2, 1), (0, 2)) - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), tmp1, (4, 0, 1, 3), (4, 2)) * -1 - del tmp1 - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), tmp2, (4, 1, 0, 3), (4, 2)) * -2 - del tmp2 - t1new.aa += einsum(tmp8, (0, 1, 2), v.baa.xvv, (0, 3, 2), (1, 3)) - del tmp8 - t1new.aa += tmp10 - del tmp10 - t1new.aa += einsum(t1.aa, (0, 1), tmp17, (0, 2), (2, 1)) * -2 - del tmp17 - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), tmp18, (4, 0, 1, 3), (4, 2)) * -1 - del tmp18 - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), tmp19, (4, 0, 1, 3), (4, 2)) * -2 - del tmp19 - t1new.aa += einsum(tmp20, (0, 1, 2), v.baa.xoo, (0, 3, 1), (3, 2)) * -1 - del tmp20 - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), tmp24, (1, 3), (0, 2)) - del tmp24 - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), tmp26, (1, 3), (0, 2)) * 2 - del tmp26 - t1new.aa += einsum(t1.aa, (0, 1), tmp29, (0, 2), (2, 1)) * -1 - del tmp29 - - return {f"t1new": t1new, f"t2new": t2new} - -def update_lams(f=None, l1=None, l2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:09:52.203814. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - l1new : Namespace of arrays - Updated L1 residuals. - l2new : Namespace of arrays - Updated L2 residuals. - """ - - l1new = Namespace() - l2new = Namespace() - tmp12 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp13 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (1, 2), (0,)) - tmp4 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp14 = np.copy(tmp12) - tmp14 += tmp13 - tmp1 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp43 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - tmp44 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 0, 1), (4, 2)) - tmp8 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp9 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp7 = einsum(v.bbb.xvv, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp25 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp24 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp27 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp103 = einsum(v.bbb.xov, (0, 1, 2), tmp4, (0, 1, 3), (3, 2)) - tmp104 = einsum(v.bbb.xov, (0, 1, 2), tmp14, (0,), (1, 2)) - tmp15 = einsum(v.baa.xov, (0, 1, 2), tmp14, (0,), (1, 2)) - tmp11 = einsum(v.baa.xov, (0, 1, 2), tmp1, (0, 1, 3), (3, 2)) - tmp35 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 0, 1), (4, 2)) - tmp36 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - tmp64 = einsum(l1.bb, (0, 1), t1.bb, (2, 0), (1, 2)) - tmp66 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp65 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp54 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp53 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 1), (4, 0)) - tmp52 = einsum(t1.aa, (0, 1), l1.aa, (1, 2), (2, 0)) - tmp118 = np.copy(tmp43) - tmp118 += tmp44 * 2 - tmp206 = np.copy(tmp7) - tmp206 += tmp8 - tmp206 += tmp9 * 2 - tmp161 = np.copy(v.bbb.xov) - tmp161 += tmp7 - tmp161 += tmp8 - tmp161 += tmp9 * 2 - tmp50 = einsum(l2.abab, (0, 1, 2, 3), t1.aa, (4, 0), (2, 4, 3, 1)) - tmp62 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp159 = np.copy(v.baa.xov) - tmp159 += tmp27 - tmp159 += tmp24 * 2 - tmp159 += tmp25 - tmp98 = np.copy(tmp12) - del tmp12 - tmp98 += tmp13 - del tmp13 - tmp105 = np.copy(f.bb.ov) - tmp105 += tmp103 * -1 - tmp105 += tmp104 - tmp123 = np.copy(tmp8) * 0.5 - tmp123 += tmp9 - tmp60 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (4, 1), (2, 3, 4, 0)) - tmp172 = np.copy(tmp27) * 0.5 - tmp172 += tmp24 - tmp172 += tmp25 * 0.5 - tmp74 = np.copy(tmp24) * 2 - tmp74 += tmp25 - tmp16 = np.copy(f.aa.ov) - tmp16 += tmp11 * -1 - tmp16 += tmp15 - tmp48 = einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp37 = np.copy(tmp35) - tmp37 += tmp36 * 0.5 - tmp67 = np.copy(tmp64) - tmp67 += tmp65 - tmp67 += tmp66 * 2 - tmp55 = np.copy(tmp52) * 0.5 - tmp55 += tmp53 - tmp55 += tmp54 * 0.5 - tmp17 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp112 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp29 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp119 = einsum(v.bbb.xov, (0, 1, 2), tmp118, (3, 2), (0, 1, 3)) - tmp197 = np.copy(v.bbb.xoo) - tmp197 += np.transpose(tmp4, (0, 2, 1)) - tmp208 = einsum(v.bbb.xvv, (0, 1, 2), tmp14, (0,), (1, 2)) - tmp207 = einsum(v.bbb.xov, (0, 1, 2), tmp206, (0, 1, 3), (3, 2)) - del tmp206 - tmp194 = einsum(l2.bbbb, (0, 1, 2, 3), tmp161, (4, 3, 1), (4, 2, 0)) - tmp130 = einsum(tmp50, (0, 1, 2, 3), tmp1, (4, 0, 1), (4, 2, 3)) - tmp131 = einsum(tmp62, (0, 1, 2, 3), tmp4, (4, 1, 2), (4, 0, 3)) - tmp128 = einsum(tmp50, (0, 1, 2, 3), v.baa.xoo, (4, 1, 0), (4, 2, 3)) - tmp129 = einsum(tmp62, (0, 1, 2, 3), v.bbb.xoo, (4, 2, 0), (4, 1, 3)) * -1 - tmp193 = einsum(l2.abab, (0, 1, 2, 3), tmp159, (4, 2, 0), (4, 3, 1)) - tmp192 = einsum(l1.bb, (0, 1), v.bbb.xvv, (2, 3, 0), (2, 1, 3)) - tmp141 = einsum(t1.bb, (0, 1), tmp62, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp140 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp199 = einsum(tmp98, (0,), v.bbb.xov, (0, 1, 2), (1, 2)) - tmp135 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp134 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 5), (3, 4, 1, 5)) - tmp126 = einsum(tmp105, (0, 1), t1.bb, (2, 1), (0, 2)) - tmp124 = einsum(v.bbb.xov, (0, 1, 2), tmp123, (0, 3, 2), (3, 1)) * 2 - del tmp123 - tmp125 = einsum(v.bbb.xoo, (0, 1, 2), tmp14, (0,), (1, 2)) - tmp122 = einsum(tmp4, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (3, 2)) - tmp86 = einsum(tmp60, (0, 1, 2, 3), t1.aa, (4, 3), (0, 4, 1, 2)) - tmp95 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 5, 0, 1), (2, 4, 3, 5)) - tmp149 = np.copy(v.baa.xoo) - tmp149 += np.transpose(tmp1, (0, 2, 1)) - tmp173 = einsum(tmp172, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp174 = einsum(v.baa.xvv, (0, 1, 2), tmp14, (0,), (1, 2)) * 0.5 - tmp165 = einsum(tmp98, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp73 = einsum(v.baa.xoo, (0, 1, 2), tmp1, (0, 2, 3), (1, 3)) - tmp75 = einsum(tmp74, (0, 1, 2), v.baa.xov, (0, 3, 2), (3, 1)) - tmp77 = einsum(tmp16, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp76 = einsum(v.baa.xoo, (0, 1, 2), tmp14, (0,), (1, 2)) - tmp81 = einsum(tmp48, (0, 1, 2, 3), tmp1, (4, 0, 2), (4, 1, 3)) * -1 - tmp160 = einsum(tmp159, (0, 1, 2), l2.aaaa, (3, 2, 4, 1), (0, 4, 3)) - del tmp159 - tmp162 = einsum(l2.abab, (0, 1, 2, 3), tmp161, (4, 3, 1), (4, 2, 0)) - del tmp161 - tmp153 = einsum(v.baa.xvv, (0, 1, 2), l1.aa, (2, 3), (0, 3, 1)) - tmp82 = einsum(tmp60, (0, 1, 2, 3), tmp4, (4, 1, 2), (4, 0, 3)) - tmp80 = einsum(v.bbb.xoo, (0, 1, 2), tmp60, (3, 2, 1, 4), (0, 3, 4)) - tmp79 = einsum(v.baa.xoo, (0, 1, 2), tmp48, (2, 3, 1, 4), (0, 3, 4)) * -1 - tmp88 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 5, 1), (5, 0, 4, 2)) - tmp89 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp146 = einsum(tmp37, (0, 1), v.baa.xov, (2, 3, 1), (2, 3, 0)) * 2 - tmp93 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp85 = einsum(tmp48, (0, 1, 2, 3), t1.aa, (4, 3), (1, 0, 2, 4)) - tmp61 = einsum(tmp60, (0, 1, 2, 3), t2.abab, (0, 1, 3, 4), (2, 4)) - tmp68 = einsum(tmp67, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp59 = einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) - tmp63 = einsum(tmp62, (0, 1, 2, 3), t2.bbbb, (1, 0, 4, 3), (2, 4)) - tmp58 = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 0), (1, 3)) - tmp40 = einsum(t1.aa, (0, 1), l1.aa, (2, 0), (2, 1)) - tmp42 = einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp46 = einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) - tmp51 = einsum(tmp50, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (1, 4)) - tmp47 = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) - tmp49 = einsum(t2.aaaa, (0, 1, 2, 3), tmp48, (1, 0, 4, 3), (4, 2)) - tmp56 = einsum(t1.aa, (0, 1), tmp55, (0, 2), (2, 1)) - tmp94 = np.copy(v.bbb.xoo) - tmp94 += np.transpose(tmp4, (0, 2, 1)) - tmp18 = einsum(t2.abab, (0, 1, 2, 3), tmp17, (4, 5, 2, 3), (0, 4, 1, 5)) - tmp2 = np.copy(v.baa.xoo) - tmp2 += tmp1 - tmp5 = np.copy(v.bbb.xoo) - tmp5 += tmp4 - tmp111 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp113 = einsum(tmp112, (0, 1, 2, 3), t2.bbbb, (4, 5, 2, 3), (4, 5, 1, 0)) * -1 - tmp115 = einsum(v.bbb.xoo, (0, 1, 2), tmp4, (0, 3, 4), (3, 1, 2, 4)) - tmp114 = einsum(tmp4, (0, 1, 2), tmp4, (0, 3, 4), (1, 3, 2, 4)) - tmp19 = np.copy(v.baa.xoo) - tmp19 += np.transpose(tmp1, (0, 2, 1)) - tmp31 = einsum(tmp1, (0, 1, 2), tmp1, (0, 3, 4), (3, 1, 4, 2)) - tmp30 = einsum(t2.aaaa, (0, 1, 2, 3), tmp29, (4, 5, 2, 3), (0, 1, 5, 4)) * -1 - tmp32 = einsum(tmp1, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp28 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp190 = np.copy(v.bbb.xov) - tmp190 += tmp119 * -1 - tmp220 = einsum(tmp197, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp209 = np.copy(f.bb.vv) * -1 - tmp209 += tmp207 - del tmp207 - tmp209 += np.transpose(tmp208, (1, 0)) * -1 - del tmp208 - tmp195 = np.copy(tmp192) - tmp195 += tmp128 * -1 - tmp195 += tmp129 * -2 - tmp195 += tmp130 * -1 - tmp195 += tmp131 * -2 - tmp195 += tmp193 - del tmp193 - tmp195 += tmp194 * 2 - del tmp194 - tmp142 = np.copy(np.transpose(tmp140, (1, 0, 3, 2))) - del tmp140 - tmp142 += np.transpose(tmp141, (0, 1, 3, 2)) * -1 - del tmp141 - tmp210 = np.copy(f.bb.ov) - tmp210 += tmp103 * -1 - tmp210 += tmp199 - tmp83 = np.copy(v.baa.xov) - tmp83 += tmp27 - tmp83 += tmp24 * 2 - tmp83 += tmp25 - tmp10 = np.copy(v.bbb.xov) - tmp10 += tmp7 - tmp10 += tmp8 - tmp10 += tmp9 * 2 - tmp239 = np.copy(tmp134) - tmp239 += tmp135 * 4 - tmp217 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp108 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp216 = einsum(v.bbb.xov, (0, 1, 2), tmp4, (0, 3, 4), (3, 1, 4, 2)) - tmp228 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp198 = einsum(tmp197, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp127 = np.copy(f.bb.oo) - tmp127 += tmp122 * -1 - del tmp122 - tmp127 += tmp124 - del tmp124 - tmp127 += np.transpose(tmp125, (1, 0)) - del tmp125 - tmp127 += np.transpose(tmp126, (1, 0)) - del tmp126 - tmp214 = einsum(v.bbb.xov, (0, 1, 2), tmp67, (3, 1), (0, 3, 2)) - tmp139 = np.copy(tmp95) - tmp139 += tmp86 - tmp202 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp150 = einsum(tmp149, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp188 = einsum(v.baa.xov, (0, 1, 2), tmp55, (3, 1), (0, 3, 2)) * 2 - tmp182 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp175 = np.copy(f.aa.vv) * -0.5 - tmp175 += tmp173 - del tmp173 - tmp175 += np.transpose(tmp174, (1, 0)) * -1 - del tmp174 - tmp177 = np.copy(f.aa.ov) - tmp177 += tmp11 * -1 - tmp177 += tmp165 - tmp38 = einsum(tmp37, (0, 1), v.baa.xov, (2, 3, 1), (2, 3, 0)) - del tmp37 - tmp167 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp78 = np.copy(f.aa.oo) - tmp78 += tmp73 * -1 - tmp78 += np.transpose(tmp75, (1, 0)) - del tmp75 - tmp78 += np.transpose(tmp76, (1, 0)) - del tmp76 - tmp78 += tmp77 - del tmp77 - tmp163 = np.copy(tmp153) - tmp163 += tmp79 * -2 - tmp163 += tmp80 * -1 - tmp163 += tmp81 * -2 - tmp163 += tmp82 * -1 - tmp163 += tmp160 * 2 - del tmp160 - tmp163 += tmp162 - del tmp162 - tmp186 = np.copy(tmp88) * 4 - tmp186 += tmp89 - tmp147 = np.copy(v.baa.xov) - tmp147 += tmp146 * -1 - del tmp146 - tmp170 = np.copy(np.transpose(tmp93, (1, 0, 3, 2))) - tmp170 += np.transpose(tmp85, (0, 1, 3, 2)) * -1 - tmp22 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp157 = einsum(v.baa.xvv, (0, 1, 2), tmp149, (0, 3, 4), (3, 4, 1, 2)) - tmp184 = einsum(v.baa.xov, (0, 1, 2), tmp1, (0, 3, 4), (3, 1, 4, 2)) - tmp143 = np.copy(t1.bb) * -1 - tmp143 += tmp58 * -1 - tmp143 += tmp59 * -2 - tmp143 += tmp61 - tmp143 += tmp63 * 2 - tmp143 += tmp68 - tmp137 = einsum(l1.bb, (0, 1), t2.bbbb, (2, 3, 4, 0), (1, 2, 3, 4)) * -1 - tmp137 += einsum(t2.abab, (0, 1, 2, 3), tmp60, (0, 4, 5, 2), (4, 5, 1, 3)) * 0.5 - tmp137 += einsum(t2.bbbb, (0, 1, 2, 3), tmp62, (4, 1, 5, 3), (4, 5, 0, 2)) * -2 - tmp138 = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 4), (0, 4, 1, 2)) - tmp138 += einsum(tmp50, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (1, 2, 4, 5)) * -1 - tmp136 = np.copy(tmp134) - del tmp134 - tmp136 += np.transpose(tmp135, (0, 1, 3, 2)) * 4 - del tmp135 - tmp133 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 5, 1), (3, 4, 0, 5)) - tmp41 = np.copy(tmp40) * 0.5 - del tmp40 - tmp41 += tmp35 - del tmp35 - tmp41 += np.transpose(tmp36, (1, 0)) * 0.5 - del tmp36 - tmp70 = np.copy(tmp52) * 0.5 - del tmp52 - tmp70 += np.transpose(tmp53, (1, 0)) - del tmp53 - tmp70 += tmp54 * 0.5 - del tmp54 - tmp69 = np.copy(np.transpose(l1.bb, (1, 0))) * -1 - tmp69 += t1.bb * -1 - tmp69 += tmp58 * -1 - del tmp58 - tmp69 += tmp59 * -2 - del tmp59 - tmp69 += tmp61 - del tmp61 - tmp69 += tmp63 * 2 - del tmp63 - tmp69 += tmp68 - del tmp68 - tmp71 = np.copy(tmp64) - del tmp64 - tmp71 += tmp65 - del tmp65 - tmp71 += np.transpose(tmp66, (1, 0)) * 2 - del tmp66 - tmp45 = np.copy(tmp42) - del tmp42 - tmp45 += tmp43 - del tmp43 - tmp45 += np.transpose(tmp44, (1, 0)) * 2 - del tmp44 - tmp57 = np.copy(np.transpose(l1.aa, (1, 0))) * -0.5 - tmp57 += t1.aa * -0.5 - tmp57 += tmp46 * -1 - tmp57 += tmp47 * -0.5 - tmp57 += tmp49 - tmp57 += tmp51 * 0.5 - tmp57 += tmp56 - tmp106 = np.copy(np.transpose(tmp18, (1, 0, 2, 3))) - tmp106 += einsum(tmp94, (0, 1, 2), tmp2, (0, 3, 4), (4, 3, 2, 1)) - tmp100 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp101 = einsum(v.bbb.xov, (0, 1, 2), tmp2, (0, 3, 4), (4, 3, 1, 2)) - tmp102 = einsum(tmp5, (0, 1, 2), v.bbb.xov, (0, 3, 4), (2, 1, 3, 4)) - tmp116 = np.copy(np.transpose(tmp111, (3, 2, 1, 0))) - tmp116 += np.transpose(tmp113, (2, 3, 1, 0)) - tmp116 += np.transpose(tmp114, (2, 3, 1, 0)) - tmp116 += np.transpose(tmp115, (1, 3, 0, 2)) - tmp116 += np.transpose(tmp115, (3, 2, 0, 1)) * -1 - tmp109 = einsum(tmp94, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp110 = np.copy(v.bbb.xov) - tmp110 += tmp8 - del tmp8 - tmp110 += tmp9 * 2 - del tmp9 - tmp0 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 4, 1, 2)) - tmp6 = einsum(tmp5, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 2, 1, 4)) - tmp20 = np.copy(np.transpose(tmp18, (0, 1, 3, 2))) - tmp20 += einsum(tmp19, (0, 1, 2), tmp5, (0, 3, 4), (2, 1, 4, 3)) - tmp3 = einsum(tmp2, (0, 1, 2), v.baa.xov, (0, 3, 4), (2, 1, 3, 4)) - tmp91 = einsum(t2.aaaa, (0, 1, 2, 3), l1.aa, (3, 4), (4, 0, 1, 2)) * -1 - tmp91 += einsum(t2.aaaa, (0, 1, 2, 3), tmp48, (4, 1, 5, 3), (4, 5, 0, 2)) * -2 - tmp91 += einsum(t2.abab, (0, 1, 2, 3), tmp50, (4, 5, 1, 3), (4, 5, 0, 2)) * 0.5 - tmp90 = np.copy(tmp88) - del tmp88 - tmp90 += np.transpose(tmp89, (0, 1, 3, 2)) * 0.25 - del tmp89 - tmp87 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 5), (2, 4, 1, 5)) - tmp92 = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 4), (4, 0, 1, 3)) - tmp92 += einsum(tmp60, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (0, 4, 2, 5)) * -1 - tmp96 = np.copy(t1.aa) * -0.5 - tmp96 += tmp46 * -1 - del tmp46 - tmp96 += tmp47 * -0.5 - del tmp47 - tmp96 += tmp49 - del tmp49 - tmp96 += tmp51 * 0.5 - del tmp51 - tmp96 += tmp56 - del tmp56 - tmp26 = np.copy(v.baa.xov) - tmp26 += tmp24 * 2 - del tmp24 - tmp26 += tmp25 - del tmp25 - tmp23 = einsum(tmp19, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp33 = np.copy(np.transpose(tmp28, (3, 2, 1, 0))) - tmp33 += np.transpose(tmp30, (2, 3, 1, 0)) - tmp33 += np.transpose(tmp31, (2, 3, 1, 0)) - tmp33 += np.transpose(tmp32, (1, 3, 0, 2)) - tmp33 += np.transpose(tmp32, (3, 2, 0, 1)) * -1 - tmp219 = einsum(tmp190, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp221 = einsum(tmp220, (0, 1, 2, 3), l1.bb, (4, 1), (2, 0, 3, 4)) - tmp232 = einsum(l2.bbbb, (0, 1, 2, 3), tmp209, (1, 4), (2, 3, 4, 0)) * -1 - tmp227 = einsum(tmp195, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp231 = einsum(tmp112, (0, 1, 2, 3), tmp142, (4, 5, 0, 1), (4, 5, 2, 3)) * 0.5 - tmp234 = einsum(tmp115, (0, 1, 2, 3), l2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - del tmp115 - tmp233 = einsum(tmp62, (0, 1, 2, 3), tmp210, (2, 4), (0, 1, 4, 3)) - tmp223 = np.copy(tmp192) - del tmp192 - tmp223 += tmp128 * -1 - tmp223 += tmp129 * -2 - tmp223 += tmp130 * -1 - tmp223 += tmp131 * -2 - tmp223 += einsum(l2.abab, (0, 1, 2, 3), tmp83, (4, 2, 0), (4, 3, 1)) - tmp223 += einsum(tmp10, (0, 1, 2), l2.bbbb, (3, 2, 4, 1), (0, 4, 3)) * 2 - tmp240 = einsum(tmp112, (0, 1, 2, 3), tmp239, (4, 0, 5, 3), (4, 1, 5, 2)) - del tmp239 - tmp237 = einsum(tmp62, (0, 1, 2, 3), tmp217, (4, 0, 2, 5), (1, 4, 3, 5)) * -1 - tmp230 = einsum(tmp62, (0, 1, 2, 3), tmp108, (2, 4, 3, 5), (1, 0, 5, 4)) - tmp225 = np.copy(f.bb.ov) - tmp225 += tmp104 - del tmp104 - tmp238 = einsum(tmp216, (0, 1, 2, 3), tmp62, (4, 0, 1, 5), (4, 2, 5, 3)) - tmp229 = einsum(tmp228, (0, 1, 2, 3), l2.bbbb, (3, 2, 4, 5), (4, 5, 0, 1)) - del tmp228 - tmp222 = einsum(tmp94, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (2, 1, 3, 4)) - tmp200 = np.copy(f.bb.ov) - tmp200 += tmp199 - del tmp199 - tmp226 = einsum(l2.bbbb, (0, 1, 2, 3), tmp198, (4, 3, 1, 5), (4, 2, 5, 0)) - tmp224 = einsum(l2.bbbb, (0, 1, 2, 3), tmp127, (3, 4), (4, 2, 0, 1)) * -2 - tmp236 = einsum(v.bbb.xov, (0, 1, 2), tmp118, (3, 2), (0, 1, 3)) * -0.5 - del tmp118 - tmp241 = einsum(tmp214, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp235 = np.copy(np.transpose(tmp111, (3, 2, 1, 0))) - del tmp111 - tmp235 += np.transpose(tmp113, (0, 3, 1, 2)) - del tmp113 - tmp235 += np.transpose(tmp114, (0, 3, 1, 2)) - del tmp114 - tmp166 = np.copy(f.aa.ov) - tmp166 += tmp165 - del tmp165 - tmp211 = einsum(v.bbb.xov, (0, 1, 2), tmp149, (0, 3, 4), (3, 4, 1, 2)) - tmp201 = einsum(v.baa.xvv, (0, 1, 2), tmp197, (0, 3, 4), (4, 3, 1, 2)) - del tmp197 - tmp196 = np.copy(f.aa.oo) * 0.5 - tmp196 += tmp73 * -0.5 - del tmp73 - tmp196 += einsum(v.baa.xov, (0, 1, 2), tmp74, (0, 3, 2), (3, 1)) * 0.5 - del tmp74 - tmp196 += einsum(v.baa.xoo, (0, 1, 2), tmp14, (0,), (1, 2)) * 0.5 - tmp196 += einsum(tmp16, (0, 1), t1.aa, (2, 1), (2, 0)) * 0.5 - tmp204 = einsum(tmp17, (0, 1, 2, 3), tmp139, (4, 0, 5, 1), (4, 5, 2, 3)) * 0.5 - tmp218 = einsum(l2.aaaa, (0, 1, 2, 3), t2.abab, (3, 4, 1, 5), (2, 4, 0, 5)) - tmp218 += einsum(l2.abab, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp205 = np.copy(f.aa.vv) * -1 - tmp205 += einsum(tmp172, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) * 2 - del tmp172 - tmp205 += einsum(v.baa.xvv, (0, 1, 2), tmp14, (0,), (1, 2)) * -1 - del tmp14 - tmp215 = einsum(t2.aaaa, (0, 1, 2, 3), l2.abab, (3, 4, 1, 5), (0, 5, 2, 4)) - tmp215 += einsum(t2.abab, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 1), (0, 5, 2, 4)) - tmp212 = np.copy(tmp18) - del tmp18 - tmp212 += einsum(tmp19, (0, 1, 2), tmp94, (0, 3, 4), (2, 1, 4, 3)) - tmp191 = einsum(tmp94, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp213 = einsum(tmp149, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (2, 1, 3, 4)) - del tmp149 - tmp203 = einsum(tmp202, (0, 1, 2, 3), l2.abab, (1, 2, 4, 5), (4, 5, 0, 3)) - del tmp202 - tmp151 = einsum(tmp150, (0, 1, 2, 3), l1.aa, (4, 1), (2, 0, 3, 4)) - tmp189 = einsum(v.baa.xov, (0, 1, 2), tmp188, (0, 3, 4), (3, 1, 4, 2)) - tmp183 = einsum(tmp182, (0, 1, 2, 3), tmp48, (1, 4, 2, 5), (4, 0, 5, 3)) * -1 - tmp180 = np.copy(np.transpose(tmp28, (3, 2, 1, 0))) - del tmp28 - tmp180 += np.transpose(tmp30, (0, 3, 1, 2)) - del tmp30 - tmp180 += np.transpose(tmp31, (0, 3, 1, 2)) - del tmp31 - tmp176 = einsum(l2.aaaa, (0, 1, 2, 3), tmp175, (1, 4), (2, 3, 4, 0)) * -2 - del tmp175 - tmp178 = einsum(tmp48, (0, 1, 2, 3), tmp177, (2, 4), (0, 1, 4, 3)) - tmp152 = einsum(tmp19, (0, 1, 2), v.baa.xvv, (0, 3, 4), (2, 1, 3, 4)) - tmp181 = einsum(v.baa.xov, (0, 1, 2), tmp38, (0, 3, 4), (3, 1, 4, 2)) * -2 - tmp154 = np.copy(tmp153) * 0.5 - del tmp153 - tmp154 += tmp79 * -1 - tmp154 += tmp80 * -0.5 - tmp154 += tmp81 * -1 - tmp154 += tmp82 * -0.5 - tmp154 += einsum(l2.aaaa, (0, 1, 2, 3), tmp83, (4, 3, 1), (4, 2, 0)) - tmp154 += einsum(l2.abab, (0, 1, 2, 3), tmp10, (4, 3, 1), (4, 2, 0)) * 0.5 - tmp168 = einsum(tmp167, (0, 1, 2, 3), l2.aaaa, (3, 2, 4, 5), (4, 5, 0, 1)) - del tmp167 - tmp155 = einsum(l2.aaaa, (0, 1, 2, 3), tmp78, (3, 4), (2, 4, 0, 1)) * -2 - tmp164 = einsum(v.baa.xov, (0, 1, 2), tmp163, (0, 3, 4), (3, 1, 4, 2)) - tmp187 = einsum(tmp186, (0, 1, 2, 3), tmp29, (1, 4, 5, 3), (0, 4, 2, 5)) - del tmp186 - tmp148 = einsum(v.baa.xov, (0, 1, 2), tmp147, (0, 3, 4), (3, 1, 4, 2)) - del tmp147 - tmp171 = einsum(tmp29, (0, 1, 2, 3), tmp170, (4, 5, 0, 1), (4, 5, 2, 3)) * 0.5 - del tmp170 - tmp169 = einsum(tmp48, (0, 1, 2, 3), tmp22, (2, 4, 3, 5), (1, 0, 5, 4)) - tmp156 = np.copy(f.aa.ov) - tmp156 += tmp15 - del tmp15 - tmp179 = einsum(l2.aaaa, (0, 1, 2, 3), tmp32, (2, 3, 4, 5), (4, 5, 0, 1)) - del tmp32 - tmp158 = einsum(tmp157, (0, 1, 2, 3), l2.aaaa, (4, 2, 5, 1), (0, 5, 3, 4)) - tmp185 = einsum(tmp184, (0, 1, 2, 3), tmp48, (4, 0, 1, 5), (4, 2, 5, 3)) - tmp132 = np.copy(tmp128) * -0.5 - del tmp128 - tmp132 += tmp129 * -1 - del tmp129 - tmp132 += tmp130 * -0.5 - del tmp130 - tmp132 += tmp131 * -1 - del tmp131 - tmp132 += einsum(l2.abab, (0, 1, 2, 3), tmp83, (4, 2, 0), (4, 3, 1)) * 0.5 - tmp132 += einsum(tmp10, (0, 1, 2), l2.bbbb, (3, 2, 4, 1), (0, 4, 3)) - tmp144 = einsum(tmp7, (0, 1, 2), l1.bb, (2, 3), (0, 1, 3)) - tmp144 += einsum(tmp133, (0, 1, 2, 3), v.baa.xvv, (4, 3, 2), (4, 1, 0)) - tmp144 += einsum(v.bbb.xvv, (0, 1, 2), tmp136, (3, 4, 1, 2), (0, 4, 3)) - del tmp136 - tmp144 += einsum(tmp60, (0, 1, 2, 3), tmp83, (4, 0, 3), (4, 2, 1)) - tmp144 += einsum(tmp10, (0, 1, 2), tmp62, (1, 3, 4, 2), (0, 4, 3)) * 2 - del tmp62 - tmp144 += einsum(tmp137, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 2, 0)) * -2 - del tmp137 - tmp144 += einsum(tmp138, (0, 1, 2, 3), v.baa.xov, (4, 0, 3), (4, 2, 1)) - del tmp138 - tmp144 += einsum(tmp139, (0, 1, 2, 3), tmp1, (4, 0, 1), (4, 3, 2)) * -1 - tmp144 += einsum(tmp139, (0, 1, 2, 3), v.baa.xoo, (4, 0, 1), (4, 3, 2)) * -1 - del tmp139 - tmp144 += einsum(tmp4, (0, 1, 2), tmp142, (1, 3, 2, 4), (0, 4, 3)) * -2 - tmp144 += einsum(tmp142, (0, 1, 2, 3), v.bbb.xoo, (4, 0, 2), (4, 3, 1)) * -2 - del tmp142 - tmp144 += einsum(v.bbb.xov, (0, 1, 2), tmp143, (3, 2), (0, 3, 1)) * -1 - del tmp143 - tmp144 += einsum(tmp67, (0, 1), v.bbb.xoo, (2, 3, 0), (2, 1, 3)) * -1 - tmp121 = einsum(tmp41, (0, 1), v.baa.xvv, (2, 1, 0), (2,)) - tmp121 += einsum(tmp45, (0, 1), v.bbb.xvv, (2, 1, 0), (2,)) * 0.5 - tmp121 += einsum(tmp57, (0, 1), v.baa.xov, (2, 0, 1), (2,)) * -1 - tmp121 += einsum(tmp69, (0, 1), v.bbb.xov, (2, 0, 1), (2,)) * -0.5 - tmp121 += einsum(tmp70, (0, 1), v.baa.xoo, (2, 1, 0), (2,)) * -1 - tmp121 += einsum(tmp71, (0, 1), v.bbb.xoo, (2, 1, 0), (2,)) * -0.5 - tmp107 = einsum(tmp100, (0, 1, 2, 3), t2.abab, (4, 5, 2, 3), (4, 0, 5, 1)) * 0.5 - tmp107 += einsum(tmp101, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (1, 2, 4, 5)) * -0.5 - del tmp101 - tmp107 += einsum(t2.abab, (0, 1, 2, 3), tmp102, (1, 4, 5, 3), (0, 5, 4, 2)) * -0.5 - del tmp102 - tmp107 += einsum(tmp5, (0, 1, 2), tmp83, (0, 3, 4), (3, 2, 1, 4)) * 0.5 - tmp107 += einsum(t2.abab, (0, 1, 2, 3), tmp105, (4, 3), (0, 4, 1, 2)) * 0.5 - tmp107 += einsum(t1.aa, (0, 1), tmp106, (0, 2, 3, 4), (2, 4, 3, 1)) * -0.5 - del tmp106 - tmp145 = np.copy(f.bb.vv) - tmp145 += einsum(tmp98, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp117 = einsum(tmp108, (0, 1, 2, 3), t2.bbbb, (4, 5, 2, 3), (0, 4, 5, 1)) - del tmp108 - tmp117 += einsum(tmp109, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 3), (2, 4, 1, 5)) * -2 - tmp117 += einsum(tmp5, (0, 1, 2), tmp110, (0, 3, 4), (2, 3, 1, 4)) - del tmp110 - tmp117 += einsum(tmp105, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp117 += einsum(tmp7, (0, 1, 2), tmp5, (0, 3, 4), (4, 3, 1, 2)) * -1 - del tmp7 - tmp117 += einsum(tmp116, (0, 1, 2, 3), t1.bb, (0, 4), (1, 3, 2, 4)) * -1 - del tmp116 - tmp120 = np.copy(tmp119) - tmp120 += einsum(tmp5, (0, 1, 2), l1.bb, (3, 1), (0, 2, 3)) - del tmp5 - tmp99 = np.copy(f.aa.vv) - tmp99 += einsum(tmp98, (0,), v.baa.xvv, (0, 1, 2), (1, 2)) - del tmp98 - tmp21 = einsum(tmp0, (0, 1, 2, 3), t2.abab, (4, 5, 1, 2), (0, 4, 5, 3)) - tmp21 += einsum(t2.abab, (0, 1, 2, 3), tmp3, (0, 4, 5, 2), (5, 4, 1, 3)) * -1 - del tmp3 - tmp21 += einsum(tmp6, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (0, 4, 2, 5)) * -1 - del tmp6 - tmp21 += einsum(tmp2, (0, 1, 2), tmp10, (0, 3, 4), (2, 1, 3, 4)) - tmp21 += einsum(t2.abab, (0, 1, 2, 3), tmp16, (4, 2), (4, 0, 1, 3)) - tmp21 += einsum(tmp20, (0, 1, 2, 3), t1.bb, (2, 4), (1, 0, 3, 4)) * -1 - del tmp20 - tmp72 = einsum(tmp41, (0, 1), v.baa.xvv, (2, 1, 0), (2,)) * 2 - del tmp41 - tmp72 += einsum(tmp45, (0, 1), v.bbb.xvv, (2, 1, 0), (2,)) - del tmp45 - tmp72 += einsum(tmp57, (0, 1), v.baa.xov, (2, 0, 1), (2,)) * -2 - del tmp57 - tmp72 += einsum(tmp69, (0, 1), v.bbb.xov, (2, 0, 1), (2,)) * -1 - del tmp69 - tmp72 += einsum(tmp70, (0, 1), v.baa.xoo, (2, 1, 0), (2,)) * -2 - del tmp70 - tmp72 += einsum(tmp71, (0, 1), v.bbb.xoo, (2, 1, 0), (2,)) * -1 - del tmp71 - tmp97 = einsum(l1.aa, (0, 1), tmp27, (2, 3, 0), (2, 3, 1)) * 0.25 - tmp97 += einsum(tmp85, (0, 1, 2, 3), v.baa.xoo, (4, 2, 1), (4, 3, 0)) * 0.5 - tmp97 += einsum(v.bbb.xoo, (0, 1, 2), tmp86, (3, 4, 2, 1), (0, 4, 3)) * -0.25 - tmp97 += einsum(tmp87, (0, 1, 2, 3), v.bbb.xvv, (4, 2, 3), (4, 1, 0)) * 0.25 - tmp97 += einsum(tmp1, (0, 1, 2), tmp85, (1, 3, 2, 4), (0, 4, 3)) * -0.5 - del tmp1, tmp85 - tmp97 += einsum(tmp86, (0, 1, 2, 3), tmp4, (4, 2, 3), (4, 1, 0)) * -0.25 - del tmp4, tmp86 - tmp97 += einsum(tmp90, (0, 1, 2, 3), v.baa.xvv, (4, 2, 3), (4, 1, 0)) - del tmp90 - tmp97 += einsum(tmp83, (0, 1, 2), tmp48, (1, 3, 4, 2), (0, 4, 3)) * 0.5 - del tmp48 - tmp97 += einsum(tmp50, (0, 1, 2, 3), tmp10, (4, 2, 3), (4, 1, 0)) * 0.25 - tmp97 += einsum(tmp91, (0, 1, 2, 3), v.baa.xov, (4, 1, 3), (4, 2, 0)) * -0.5 - del tmp91 - tmp97 += einsum(tmp92, (0, 1, 2, 3), v.bbb.xov, (4, 2, 3), (4, 1, 0)) * 0.25 - del tmp92 - tmp97 += einsum(tmp19, (0, 1, 2), tmp93, (2, 3, 1, 4), (0, 4, 3)) * -0.5 - del tmp93, tmp19 - tmp97 += einsum(tmp95, (0, 1, 2, 3), tmp94, (4, 3, 2), (4, 1, 0)) * -0.25 - del tmp95, tmp94 - tmp97 += einsum(v.baa.xov, (0, 1, 2), tmp96, (3, 2), (0, 3, 1)) * -0.5 - del tmp96 - tmp97 += einsum(tmp55, (0, 1), v.baa.xoo, (2, 3, 0), (2, 1, 3)) * -0.5 - tmp39 = np.copy(tmp38) - tmp39 += einsum(l1.aa, (0, 1), tmp2, (2, 1, 3), (2, 3, 0)) * 0.5 - tmp34 = einsum(t2.aaaa, (0, 1, 2, 3), tmp22, (4, 5, 2, 3), (4, 0, 1, 5)) * 0.5 - del tmp22 - tmp34 += einsum(tmp23, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - tmp34 += einsum(tmp2, (0, 1, 2), tmp26, (0, 3, 4), (2, 3, 1, 4)) * 0.5 - del tmp26 - tmp34 += einsum(t2.aaaa, (0, 1, 2, 3), tmp16, (4, 3), (4, 0, 1, 2)) * 0.5 - tmp34 += einsum(tmp27, (0, 1, 2), tmp2, (0, 3, 4), (4, 3, 1, 2)) * -0.5 - del tmp27, tmp2 - tmp34 += einsum(tmp33, (0, 1, 2, 3), t1.aa, (0, 4), (1, 3, 2, 4)) * -0.5 - del tmp33 - tmp84 = np.copy(tmp79) * -0.5 - del tmp79 - tmp84 += tmp80 * -0.25 - del tmp80 - tmp84 += tmp81 * -0.5 - del tmp81 - tmp84 += tmp82 * -0.25 - del tmp82 - tmp84 += einsum(l2.aaaa, (0, 1, 2, 3), tmp83, (4, 3, 1), (4, 2, 0)) * 0.5 - del tmp83 - tmp84 += einsum(l2.abab, (0, 1, 2, 3), tmp10, (4, 3, 1), (4, 2, 0)) * 0.25 - del tmp10 - l2new.bbbb = np.copy(np.transpose(tmp219, (3, 2, 1, 0))) - l2new.bbbb += einsum(tmp109, (0, 1, 2, 3), l1.bb, (4, 1), (3, 4, 2, 0)) * -1 - del tmp109 - l2new.bbbb += np.transpose(tmp219, (2, 3, 1, 0)) * -1 - del tmp219 - l2new.bbbb += np.transpose(tmp221, (3, 2, 0, 1)) - l2new.bbbb += einsum(tmp222, (0, 1, 2, 3), l2.bbbb, (4, 3, 5, 0), (2, 4, 5, 1)) * 2 - del tmp222 - l2new.bbbb += einsum(tmp223, (0, 1, 2), v.bbb.xov, (0, 3, 4), (4, 2, 1, 3)) * -1 - del tmp223 - l2new.bbbb += np.transpose(tmp224, (3, 2, 1, 0)) * -1 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp225, (2, 3), (3, 0, 1, 2)) * -1 - del tmp225 - l2new.bbbb += np.transpose(tmp226, (2, 3, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp227, (3, 2, 1, 0)) - l2new.bbbb += np.transpose(tmp224, (3, 2, 0, 1)) - del tmp224 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp200, (2, 3), (3, 0, 2, 1)) - l2new.bbbb += np.transpose(tmp226, (3, 2, 1, 0)) * -2 - l2new.bbbb += np.transpose(tmp227, (2, 3, 0, 1)) - l2new.bbbb += einsum(l1.bb, (0, 1), tmp200, (2, 3), (0, 3, 1, 2)) - l2new.bbbb += np.transpose(tmp226, (3, 2, 0, 1)) * 2 - del tmp226 - l2new.bbbb += np.transpose(tmp227, (2, 3, 1, 0)) * -1 - del tmp227 - l2new.bbbb += einsum(tmp200, (0, 1), l1.bb, (2, 3), (2, 1, 0, 3)) * -1 - l2new.bbbb += np.transpose(tmp229, (2, 3, 1, 0)) * -2 - del tmp229 - l2new.bbbb += np.transpose(tmp230, (2, 3, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp231, (3, 2, 1, 0)) * 4 - del tmp231 - l2new.bbbb += np.transpose(tmp232, (2, 3, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp233, (2, 3, 1, 0)) * -2 - l2new.bbbb += np.transpose(tmp230, (3, 2, 1, 0)) * -2 - del tmp230 - l2new.bbbb += np.transpose(tmp232, (3, 2, 1, 0)) * -2 - del tmp232 - l2new.bbbb += np.transpose(tmp233, (3, 2, 1, 0)) * 2 - del tmp233 - l2new.bbbb += np.transpose(tmp234, (2, 3, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp234, (2, 3, 1, 0)) * 2 - del tmp234 - l2new.bbbb += einsum(l2.bbbb, (0, 1, 2, 3), tmp235, (2, 4, 3, 5), (0, 1, 4, 5)) * -2 - del tmp235 - l2new.bbbb += einsum(v.bbb.xov, (0, 1, 2), tmp119, (0, 3, 4), (2, 4, 3, 1)) - del tmp119 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp220, (2, 1, 3, 4), (4, 0, 2, 3)) - del tmp220 - l2new.bbbb += einsum(tmp236, (0, 1, 2), v.bbb.xov, (0, 3, 4), (2, 4, 1, 3)) * 2 - del tmp236 - l2new.bbbb += np.transpose(tmp221, (3, 2, 1, 0)) * -1 - del tmp221 - l2new.bbbb += einsum(l1.bb, (0, 1), tmp103, (2, 3), (3, 0, 1, 2)) - l2new.bbbb += np.transpose(tmp237, (3, 2, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp238, (3, 2, 0, 1)) * -2 - l2new.bbbb += np.transpose(tmp240, (3, 2, 0, 1)) - l2new.bbbb += np.transpose(tmp241, (2, 3, 0, 1)) * -1 - l2new.bbbb += einsum(tmp103, (0, 1), l1.bb, (2, 3), (2, 1, 3, 0)) * -1 - l2new.bbbb += np.transpose(tmp237, (2, 3, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp238, (2, 3, 0, 1)) * 2 - l2new.bbbb += np.transpose(tmp240, (2, 3, 0, 1)) * -1 - l2new.bbbb += np.transpose(tmp241, (3, 2, 0, 1)) - l2new.bbbb += einsum(l1.bb, (0, 1), tmp103, (2, 3), (3, 0, 2, 1)) * -1 - l2new.bbbb += np.transpose(tmp237, (3, 2, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp238, (3, 2, 1, 0)) * 2 - l2new.bbbb += np.transpose(tmp240, (3, 2, 1, 0)) * -1 - l2new.bbbb += np.transpose(tmp241, (2, 3, 1, 0)) - l2new.bbbb += einsum(tmp103, (0, 1), l1.bb, (2, 3), (2, 1, 0, 3)) - l2new.bbbb += np.transpose(tmp237, (2, 3, 1, 0)) * -2 - del tmp237 - l2new.bbbb += np.transpose(tmp238, (2, 3, 1, 0)) * -2 - del tmp238 - l2new.bbbb += np.transpose(tmp240, (2, 3, 1, 0)) - del tmp240 - l2new.bbbb += np.transpose(tmp241, (3, 2, 1, 0)) * -1 - del tmp241 - l2new.abab = einsum(tmp190, (0, 1, 2), v.baa.xov, (0, 3, 4), (4, 2, 3, 1)) - del tmp190 - l2new.abab += einsum(tmp191, (0, 1, 2, 3), l1.bb, (4, 2), (3, 4, 0, 1)) * -1 - l2new.abab += einsum(tmp157, (0, 1, 2, 3), l2.abab, (3, 4, 1, 5), (2, 4, 0, 5)) * -1 - del tmp157 - l2new.abab += einsum(tmp195, (0, 1, 2), v.baa.xov, (0, 3, 4), (4, 2, 3, 1)) - del tmp195 - l2new.abab += einsum(tmp196, (0, 1), l2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -2 - del tmp196 - l2new.abab += einsum(tmp166, (0, 1), l1.bb, (2, 3), (1, 2, 0, 3)) - l2new.abab += einsum(tmp198, (0, 1, 2, 3), l2.abab, (4, 3, 5, 1), (4, 2, 5, 0)) * -1 - del tmp198 - l2new.abab += einsum(tmp163, (0, 1, 2), v.bbb.xov, (0, 3, 4), (2, 4, 1, 3)) - del tmp163 - l2new.abab += einsum(tmp200, (0, 1), l1.aa, (2, 3), (2, 1, 3, 0)) - del tmp200 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp201, (3, 4, 0, 5), (5, 1, 2, 4)) * -1 - del tmp201 - l2new.abab += einsum(tmp127, (0, 1), l2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -1 - l2new.abab += einsum(tmp50, (0, 1, 2, 3), tmp0, (1, 4, 3, 5), (4, 5, 0, 2)) * -1 - del tmp0 - l2new.abab += np.transpose(tmp203, (2, 3, 0, 1)) - del tmp203 - l2new.abab += np.transpose(tmp204, (2, 3, 0, 1)) * 2 - del tmp204 - l2new.abab += einsum(tmp205, (0, 1), l2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -1 - del tmp205 - l2new.abab += einsum(tmp50, (0, 1, 2, 3), tmp177, (1, 4), (4, 3, 0, 2)) * -1 - del tmp177 - l2new.abab += einsum(tmp60, (0, 1, 2, 3), tmp100, (2, 4, 3, 5), (4, 5, 0, 1)) * -1 - del tmp100 - l2new.abab += einsum(l2.abab, (0, 1, 2, 3), tmp209, (1, 4), (0, 4, 2, 3)) * -1 - del tmp209 - l2new.abab += einsum(tmp60, (0, 1, 2, 3), tmp210, (2, 4), (3, 4, 0, 1)) * -1 - del tmp210 - l2new.abab += einsum(v.bbb.xov, (0, 1, 2), tmp38, (0, 3, 4), (4, 2, 3, 1)) * -2 - del tmp38 - l2new.abab += einsum(l1.aa, (0, 1), tmp211, (2, 1, 3, 4), (0, 4, 2, 3)) * -1 - l2new.abab += einsum(tmp212, (0, 1, 2, 3), l2.abab, (4, 5, 0, 2), (4, 5, 1, 3)) - del tmp212 - l2new.abab += einsum(tmp213, (0, 1, 2, 3), l2.abab, (4, 2, 0, 5), (4, 3, 1, 5)) * -1 - del tmp213 - l2new.abab += einsum(tmp87, (0, 1, 2, 3), tmp17, (1, 4, 5, 3), (5, 2, 0, 4)) - del tmp87 - l2new.abab += einsum(tmp50, (0, 1, 2, 3), tmp191, (1, 4, 2, 5), (5, 3, 0, 4)) - del tmp191 - l2new.abab += einsum(tmp188, (0, 1, 2), v.bbb.xov, (0, 3, 4), (2, 4, 1, 3)) * -1 - del tmp188 - l2new.abab += einsum(tmp133, (0, 1, 2, 3), tmp17, (4, 1, 3, 5), (2, 5, 4, 0)) - del tmp17, tmp133 - l2new.abab += einsum(tmp60, (0, 1, 2, 3), tmp211, (4, 0, 2, 5), (3, 5, 4, 1)) - del tmp211 - l2new.abab += einsum(tmp214, (0, 1, 2), v.baa.xov, (0, 3, 4), (4, 2, 3, 1)) * -1 - del tmp214 - l2new.abab += einsum(tmp182, (0, 1, 2, 3), tmp50, (1, 2, 4, 5), (3, 5, 0, 4)) - del tmp182 - l2new.abab += einsum(l1.bb, (0, 1), tmp11, (2, 3), (3, 0, 2, 1)) * -1 - l2new.abab += einsum(tmp50, (0, 1, 2, 3), tmp184, (0, 1, 4, 5), (5, 3, 4, 2)) - del tmp50, tmp184 - l2new.abab += einsum(tmp215, (0, 1, 2, 3), tmp29, (0, 4, 5, 2), (5, 3, 4, 1)) * -2 - del tmp29, tmp215 - l2new.abab += einsum(l1.aa, (0, 1), tmp103, (2, 3), (0, 3, 1, 2)) * -1 - del tmp103 - l2new.abab += einsum(tmp216, (0, 1, 2, 3), tmp60, (4, 0, 1, 5), (5, 3, 4, 2)) - del tmp216 - l2new.abab += einsum(tmp217, (0, 1, 2, 3), tmp60, (4, 1, 2, 5), (5, 3, 4, 0)) - del tmp60, tmp217 - l2new.abab += einsum(tmp218, (0, 1, 2, 3), tmp112, (1, 4, 5, 3), (2, 5, 0, 4)) * -2 - del tmp112, tmp218 - l2new.aaaa = np.copy(np.transpose(tmp148, (3, 2, 1, 0))) - l2new.aaaa += einsum(l1.aa, (0, 1), tmp23, (2, 3, 1, 4), (4, 0, 2, 3)) * -1 - del tmp23 - l2new.aaaa += np.transpose(tmp148, (2, 3, 1, 0)) * -1 - del tmp148 - l2new.aaaa += np.transpose(tmp151, (3, 2, 0, 1)) - l2new.aaaa += einsum(tmp152, (0, 1, 2, 3), l2.aaaa, (4, 3, 5, 0), (2, 4, 5, 1)) * 2 - del tmp152 - l2new.aaaa += einsum(v.baa.xov, (0, 1, 2), tmp154, (0, 3, 4), (2, 4, 3, 1)) * -2 - del tmp154 - l2new.aaaa += np.transpose(tmp155, (3, 2, 0, 1)) * -1 - l2new.aaaa += einsum(tmp156, (0, 1), l1.aa, (2, 3), (1, 2, 3, 0)) * -1 - del tmp156 - l2new.aaaa += np.transpose(tmp158, (2, 3, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp164, (3, 2, 1, 0)) - l2new.aaaa += np.transpose(tmp155, (3, 2, 1, 0)) - del tmp155 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp166, (2, 3), (3, 0, 2, 1)) - l2new.aaaa += np.transpose(tmp158, (3, 2, 1, 0)) * -2 - l2new.aaaa += np.transpose(tmp164, (2, 3, 0, 1)) - l2new.aaaa += einsum(tmp166, (0, 1), l1.aa, (2, 3), (2, 1, 3, 0)) - l2new.aaaa += np.transpose(tmp158, (3, 2, 0, 1)) * 2 - del tmp158 - l2new.aaaa += np.transpose(tmp164, (2, 3, 1, 0)) * -1 - del tmp164 - l2new.aaaa += einsum(tmp166, (0, 1), l1.aa, (2, 3), (2, 1, 0, 3)) * -1 - del tmp166 - l2new.aaaa += np.transpose(tmp168, (2, 3, 1, 0)) * -2 - del tmp168 - l2new.aaaa += np.transpose(tmp169, (2, 3, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp171, (3, 2, 1, 0)) * 4 - del tmp171 - l2new.aaaa += np.transpose(tmp176, (2, 3, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp178, (2, 3, 1, 0)) * -2 - l2new.aaaa += np.transpose(tmp169, (3, 2, 1, 0)) * -2 - del tmp169 - l2new.aaaa += np.transpose(tmp176, (3, 2, 1, 0)) * -2 - del tmp176 - l2new.aaaa += np.transpose(tmp178, (3, 2, 1, 0)) * 2 - del tmp178 - l2new.aaaa += np.transpose(tmp179, (2, 3, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp179, (2, 3, 1, 0)) * 2 - del tmp179 - l2new.aaaa += einsum(tmp180, (0, 1, 2, 3), l2.aaaa, (4, 5, 0, 2), (4, 5, 1, 3)) * -2 - del tmp180 - l2new.aaaa += np.transpose(tmp181, (3, 2, 0, 1)) * -1 - l2new.aaaa += einsum(tmp150, (0, 1, 2, 3), l1.aa, (4, 1), (3, 4, 0, 2)) - del tmp150 - l2new.aaaa += np.transpose(tmp181, (2, 3, 0, 1)) - del tmp181 - l2new.aaaa += np.transpose(tmp151, (3, 2, 1, 0)) * -1 - del tmp151 - l2new.aaaa += np.transpose(tmp183, (3, 2, 0, 1)) * -2 - l2new.aaaa += einsum(tmp11, (0, 1), l1.aa, (2, 3), (1, 2, 3, 0)) - l2new.aaaa += np.transpose(tmp185, (3, 2, 0, 1)) * -2 - l2new.aaaa += np.transpose(tmp187, (3, 2, 0, 1)) - l2new.aaaa += np.transpose(tmp189, (2, 3, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp183, (2, 3, 0, 1)) * 2 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp11, (2, 3), (0, 3, 1, 2)) * -1 - l2new.aaaa += np.transpose(tmp185, (2, 3, 0, 1)) * 2 - l2new.aaaa += np.transpose(tmp187, (2, 3, 0, 1)) * -1 - l2new.aaaa += np.transpose(tmp189, (3, 2, 0, 1)) - l2new.aaaa += np.transpose(tmp183, (3, 2, 1, 0)) * 2 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp11, (2, 3), (3, 0, 2, 1)) * -1 - l2new.aaaa += np.transpose(tmp185, (3, 2, 1, 0)) * 2 - l2new.aaaa += np.transpose(tmp187, (3, 2, 1, 0)) * -1 - l2new.aaaa += np.transpose(tmp189, (2, 3, 1, 0)) - l2new.aaaa += np.transpose(tmp183, (2, 3, 1, 0)) * -2 - del tmp183 - l2new.aaaa += einsum(l1.aa, (0, 1), tmp11, (2, 3), (0, 3, 2, 1)) - del tmp11 - l2new.aaaa += np.transpose(tmp185, (2, 3, 1, 0)) * -2 - del tmp185 - l2new.aaaa += np.transpose(tmp187, (2, 3, 1, 0)) - del tmp187 - l2new.aaaa += np.transpose(tmp189, (3, 2, 1, 0)) * -1 - del tmp189 - l1new.bb = np.copy(np.transpose(f.bb.ov, (1, 0))) - l1new.bb += einsum(l2.abab, (0, 1, 2, 3), tmp107, (2, 4, 3, 0), (1, 4)) * -2 - del tmp107 - l1new.bb += einsum(tmp117, (0, 1, 2, 3), l2.bbbb, (4, 3, 1, 2), (4, 0)) * 2 - del tmp117 - l1new.bb += einsum(tmp120, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (3, 1)) * -1 - del tmp120 - l1new.bb += einsum(tmp121, (0,), v.bbb.xov, (0, 1, 2), (2, 1)) * 2 - del tmp121 - l1new.bb += einsum(tmp127, (0, 1), l1.bb, (2, 0), (2, 1)) * -1 - del tmp127 - l1new.bb += einsum(tmp132, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (3, 1)) * 2 - del tmp132 - l1new.bb += einsum(v.bbb.xov, (0, 1, 2), tmp144, (0, 1, 3), (2, 3)) * -1 - del tmp144 - l1new.bb += einsum(tmp67, (0, 1), tmp105, (1, 2), (2, 0)) * -1 - del tmp105, tmp67 - l1new.bb += einsum(l1.bb, (0, 1), tmp145, (0, 2), (2, 1)) - del tmp145 - l1new.aa = np.copy(np.transpose(f.aa.ov, (1, 0))) - l1new.aa += einsum(tmp21, (0, 1, 2, 3), l2.abab, (4, 3, 1, 2), (4, 0)) * -1 - del tmp21 - l1new.aa += einsum(l2.aaaa, (0, 1, 2, 3), tmp34, (4, 2, 3, 1), (0, 4)) * 4 - del tmp34 - l1new.aa += einsum(v.baa.xvv, (0, 1, 2), tmp39, (0, 3, 2), (1, 3)) * -2 - del tmp39 - l1new.aa += einsum(tmp72, (0,), v.baa.xov, (0, 1, 2), (2, 1)) - del tmp72 - l1new.aa += einsum(l1.aa, (0, 1), tmp78, (1, 2), (0, 2)) * -1 - del tmp78 - l1new.aa += einsum(tmp84, (0, 1, 2), v.baa.xvv, (0, 3, 2), (3, 1)) * 4 - del tmp84 - l1new.aa += einsum(v.baa.xov, (0, 1, 2), tmp97, (0, 1, 3), (2, 3)) * -4 - del tmp97 - l1new.aa += einsum(tmp16, (0, 1), tmp55, (2, 0), (1, 2)) * -2 - del tmp16, tmp55 - l1new.aa += einsum(tmp99, (0, 1), l1.aa, (0, 2), (1, 2)) - del tmp99 - - return {f"l1new": l1new, f"l2new": l2new} - -def make_rdm1_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:09:55.457370. - - Parameters - ---------- - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm1 : Namespace of arrays - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - rdm1.aa = Namespace() - rdm1.bb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - tmp4 = einsum(l1.bb, (0, 1), t1.bb, (2, 0), (1, 2)) - tmp5 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp3 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp0 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp1 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (2, 4)) - tmp2 = einsum(t1.aa, (0, 1), l1.aa, (1, 2), (2, 0)) - tmp10 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (4, 1), (2, 3, 4, 0)) - tmp11 = np.copy(tmp4) * 0.5 - tmp11 += tmp5 * 0.5 - tmp11 += tmp3 - tmp9 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp8 = np.copy(tmp2) * 0.5 - tmp8 += tmp1 - tmp8 += tmp0 * 0.5 - tmp6 = einsum(l2.abab, (0, 1, 2, 3), t1.aa, (4, 0), (2, 4, 3, 1)) - tmp7 = einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - rdm1.bb.vv = einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - rdm1.bb.vv += einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 0, 1), (4, 2)) * 2 - rdm1.bb.vv += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - rdm1.aa.vv = einsum(t1.aa, (0, 1), l1.aa, (2, 0), (2, 1)) - rdm1.aa.vv += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - rdm1.aa.vv += einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 0, 1), (4, 2)) * 2 - rdm1.bb.vo = np.copy(l1.bb) - rdm1.aa.vo = np.copy(l1.aa) - rdm1.bb.ov = einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) * 2 - rdm1.bb.ov += t1.bb - rdm1.bb.ov += einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 0), (1, 3)) - rdm1.bb.ov += einsum(t2.bbbb, (0, 1, 2, 3), tmp9, (1, 0, 4, 3), (4, 2)) * -2 - del tmp9 - rdm1.bb.ov += einsum(t2.abab, (0, 1, 2, 3), tmp10, (0, 1, 4, 2), (4, 3)) * -1 - del tmp10 - rdm1.bb.ov += einsum(t1.bb, (0, 1), tmp11, (0, 2), (2, 1)) * -2 - del tmp11 - rdm1.aa.ov = np.copy(t1.aa) - rdm1.aa.ov += einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) - rdm1.aa.ov += einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) * 2 - rdm1.aa.ov += einsum(t2.abab, (0, 1, 2, 3), tmp6, (0, 4, 1, 3), (4, 2)) * -1 - del tmp6 - rdm1.aa.ov += einsum(t2.aaaa, (0, 1, 2, 3), tmp7, (1, 0, 4, 3), (4, 2)) * -2 - del tmp7 - rdm1.aa.ov += einsum(tmp8, (0, 1), t1.aa, (0, 2), (1, 2)) * -2 - del tmp8 - rdm1.bb.oo = np.copy(np.transpose(tmp3, (1, 0))) * -2 - del tmp3 - rdm1.bb.oo += np.transpose(tmp4, (1, 0)) * -1 - del tmp4 - rdm1.bb.oo += delta.bb.oo - rdm1.bb.oo += np.transpose(tmp5, (1, 0)) * -1 - del tmp5 - rdm1.aa.oo = np.copy(np.transpose(tmp0, (1, 0))) * -1 - del tmp0 - rdm1.aa.oo += np.transpose(tmp1, (1, 0)) * -2 - del tmp1 - rdm1.aa.oo += np.transpose(tmp2, (1, 0)) * -1 - del tmp2 - rdm1.aa.oo += delta.aa.oo - del delta - rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]]) - rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]]) - - return rdm1 - -def make_rdm2_f(l1=None, l2=None, t1=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:10:59.420749. - - Parameters - ---------- - l1 : Namespace of arrays - L1 amplitudes. - l2 : Namespace of arrays - L2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm2 : Namespace of arrays - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - rdm2.aaaa = Namespace() - rdm2.abab = Namespace() - rdm2.bbbb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - tmp9 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 1), (3, 4)) - tmp8 = einsum(l1.bb, (0, 1), t1.bb, (2, 0), (1, 2)) - tmp10 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (2, 3, 4, 1), (4, 0)) - tmp19 = einsum(t1.bb, (0, 1), l2.bbbb, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp13 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (4, 1), (2, 3, 4, 0)) - tmp0 = einsum(t1.aa, (0, 1), l1.aa, (1, 2), (2, 0)) - tmp1 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 0, 1), (2, 4)) - tmp2 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 1), (2, 4)) - tmp6 = einsum(t1.aa, (0, 1), l2.aaaa, (2, 1, 3, 4), (3, 4, 0, 2)) - tmp27 = einsum(l2.abab, (0, 1, 2, 3), t1.aa, (4, 0), (2, 4, 3, 1)) - tmp88 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 0, 5), (3, 4, 1, 5)) - tmp89 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp70 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp72 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp17 = np.copy(tmp8) - tmp17 += tmp9 - tmp17 += tmp10 * 2 - tmp18 = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 0, 1), (2, 3, 4, 5)) - tmp20 = einsum(t1.bb, (0, 1), tmp19, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp53 = einsum(t2.abab, (0, 1, 2, 3), tmp13, (0, 4, 5, 2), (4, 5, 1, 3)) - tmp54 = einsum(t2.bbbb, (0, 1, 2, 3), tmp19, (4, 1, 5, 3), (4, 5, 0, 2)) * -1 - tmp29 = np.copy(tmp0) * 0.5 - tmp29 += tmp1 - tmp29 += tmp2 * 0.5 - tmp14 = einsum(t1.aa, (0, 1), tmp13, (2, 3, 4, 1), (2, 0, 3, 4)) - tmp12 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 5, 0, 1), (2, 4, 3, 5)) - tmp5 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 5), (4, 5, 0, 1)) - tmp7 = einsum(t1.aa, (0, 1), tmp6, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp32 = einsum(t2.abab, (0, 1, 2, 3), tmp27, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp33 = einsum(tmp6, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (0, 2, 4, 5)) * -1 - tmp90 = np.copy(tmp88) - tmp90 += tmp89 * 4 - tmp111 = einsum(tmp19, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) - tmp83 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 0, 1), (4, 2)) - tmp108 = einsum(l1.bb, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp82 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - tmp86 = einsum(l2.abab, (0, 1, 2, 3), t2.bbbb, (4, 3, 5, 1), (2, 4, 0, 5)) - tmp85 = einsum(l2.aaaa, (0, 1, 2, 3), t2.abab, (3, 4, 1, 5), (2, 4, 0, 5)) - tmp66 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - tmp105 = einsum(t1.aa, (0, 1), l1.aa, (2, 0), (2, 1)) - tmp65 = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 0, 1), (4, 2)) - tmp118 = np.copy(tmp70) * 4 - tmp118 += tmp72 - tmp107 = einsum(t1.aa, (0, 1), tmp6, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp113 = einsum(t2.aaaa, (0, 1, 2, 3), l2.abab, (3, 4, 1, 5), (0, 5, 2, 4)) - tmp68 = einsum(l2.bbbb, (0, 1, 2, 3), t2.abab, (4, 3, 5, 1), (4, 2, 5, 0)) - tmp40 = einsum(t2.abab, (0, 1, 2, 3), tmp13, (0, 1, 4, 2), (4, 3)) - tmp42 = einsum(tmp17, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp41 = einsum(t2.bbbb, (0, 1, 2, 3), tmp19, (1, 0, 4, 3), (4, 2)) - tmp16 = np.copy(tmp8) * 0.5 - tmp16 += tmp9 * 0.5 - tmp16 += tmp10 - tmp55 = np.copy(np.transpose(tmp18, (1, 0, 3, 2))) - tmp55 += np.transpose(tmp20, (0, 1, 3, 2)) * -1 - tmp36 = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 0), (1, 3)) - tmp37 = einsum(l1.bb, (0, 1), t2.bbbb, (2, 1, 3, 0), (2, 3)) - tmp103 = np.copy(tmp53) - tmp103 += tmp54 * 4 - tmp50 = einsum(l1.bb, (0, 1), t2.bbbb, (2, 3, 4, 0), (1, 2, 3, 4)) - tmp30 = einsum(t1.aa, (0, 1), tmp29, (0, 2), (2, 1)) * 2 - tmp26 = einsum(t2.aaaa, (0, 1, 2, 3), tmp6, (1, 0, 4, 3), (4, 2)) - tmp28 = einsum(t2.abab, (0, 1, 2, 3), tmp27, (0, 4, 1, 3), (4, 2)) - tmp46 = np.copy(tmp12) - tmp46 += tmp14 - tmp61 = einsum(t2.abab, (0, 1, 2, 3), tmp19, (4, 1, 5, 3), (0, 4, 5, 2)) * -1 - tmp62 = einsum(tmp13, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 2, 5)) - tmp44 = einsum(t2.abab, (0, 1, 2, 3), tmp6, (4, 0, 5, 2), (4, 5, 1, 3)) * -1 - tmp45 = einsum(t2.bbbb, (0, 1, 2, 3), tmp27, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp22 = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 1), (0, 2)) - tmp21 = einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 0), (2, 3)) - tmp34 = np.copy(np.transpose(tmp5, (1, 0, 3, 2))) - tmp34 += np.transpose(tmp7, (0, 1, 3, 2)) * -1 - tmp80 = np.copy(tmp33) * 4 - tmp80 += tmp32 - tmp25 = einsum(t2.aaaa, (0, 1, 2, 3), l1.aa, (3, 4), (4, 0, 1, 2)) - tmp57 = einsum(t1.aa, (0, 1), tmp29, (0, 2), (2, 1)) - tmp51 = einsum(tmp17, (0, 1), t1.bb, (0, 2), (1, 2)) * 0.5 - tmp131 = einsum(l2.bbbb, (0, 1, 2, 3), t1.bb, (3, 4), (2, 0, 1, 4)) - tmp133 = einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 5, 0, 1), (4, 5, 2, 3)) - tmp130 = einsum(l2.abab, (0, 1, 2, 3), t1.bb, (3, 4), (2, 0, 1, 4)) - tmp129 = einsum(l2.aaaa, (0, 1, 2, 3), t1.aa, (3, 4), (2, 0, 1, 4)) - tmp132 = einsum(l2.aaaa, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 5), (0, 1, 4, 5)) - tmp126 = einsum(tmp90, (0, 1, 2, 3), t1.bb, (0, 4), (1, 4, 2, 3)) - tmp124 = einsum(t2.bbbb, (0, 1, 2, 3), l1.bb, (4, 1), (0, 4, 2, 3)) - tmp128 = einsum(tmp111, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 3, 4)) * -1 - tmp109 = np.copy(tmp108) - tmp109 += tmp82 - tmp109 += tmp83 * 2 - tmp122 = np.copy(tmp108) * 0.5 - del tmp108 - tmp122 += tmp82 * 0.5 - tmp122 += tmp83 - tmp127 = einsum(tmp19, (0, 1, 2, 3), t2.bbbb, (1, 0, 4, 5), (2, 3, 4, 5)) * -1 - tmp87 = np.copy(tmp85) - tmp87 += tmp86 - tmp115 = einsum(tmp13, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) - tmp91 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 4, 5, 1), (3, 4, 0, 5)) - tmp112 = np.copy(tmp105) * 0.5 - tmp112 += tmp65 - tmp112 += tmp66 * 0.5 - tmp116 = einsum(l1.aa, (0, 1), t2.aaaa, (2, 1, 3, 4), (2, 0, 3, 4)) - tmp106 = np.copy(tmp105) - del tmp105 - tmp106 += tmp65 * 2 - tmp106 += tmp66 - tmp119 = einsum(t1.aa, (0, 1), tmp118, (0, 2, 3, 4), (2, 1, 3, 4)) - del tmp118 - tmp121 = einsum(tmp107, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 3, 4)) * -1 - tmp120 = einsum(tmp6, (0, 1, 2, 3), t2.aaaa, (1, 0, 4, 5), (2, 3, 4, 5)) * -1 - tmp125 = np.copy(tmp88) * 0.25 - tmp125 += tmp89 - tmp114 = einsum(t1.aa, (0, 1), tmp27, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp110 = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (4, 3, 0, 5), (2, 4, 1, 5)) - tmp123 = np.copy(tmp113) - tmp123 += tmp68 - tmp117 = np.copy(tmp70) * 4 - tmp117 += tmp72 - tmp99 = np.copy(tmp82) - tmp99 += tmp83 * 2 - tmp43 = np.copy(tmp40) - tmp43 += tmp41 * 2 - tmp43 += tmp42 - del tmp42 - tmp100 = einsum(t2.bbbb, (0, 1, 2, 3), tmp16, (1, 4), (0, 4, 2, 3)) * -2 - tmp94 = einsum(t2.abab, (0, 1, 2, 3), tmp85, (0, 4, 2, 5), (4, 1, 5, 3)) - tmp101 = einsum(t2.bbbb, (0, 1, 2, 3), tmp55, (0, 1, 4, 5), (4, 5, 2, 3)) - tmp38 = np.copy(t1.bb) - tmp38 += tmp36 - tmp38 += tmp37 * 2 - tmp64 = np.copy(t1.bb) - tmp64 += tmp36 - tmp64 += tmp37 * 2 - tmp97 = np.copy(tmp36) - tmp97 += tmp37 * 2 - tmp95 = einsum(t2.bbbb, (0, 1, 2, 3), tmp89, (1, 4, 3, 5), (4, 0, 5, 2)) - tmp102 = einsum(tmp55, (0, 1, 2, 3), t1.bb, (0, 4), (1, 3, 2, 4)) - tmp104 = einsum(t1.bb, (0, 1), tmp103, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp103 - tmp84 = np.copy(tmp82) * 0.5 - del tmp82 - tmp84 += tmp83 - del tmp83 - tmp96 = einsum(tmp88, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 2), (1, 4, 3, 5)) - tmp98 = einsum(t1.bb, (0, 1), tmp50, (0, 2, 3, 4), (2, 3, 1, 4)) - tmp39 = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (2, 4), (4, 0, 1, 3)) - tmp31 = np.copy(tmp26) * 2 - tmp31 += tmp28 - tmp31 += tmp30 - del tmp30 - tmp4 = np.copy(tmp0) - tmp4 += tmp1 * 2 - tmp4 += tmp2 - tmp47 = einsum(t1.bb, (0, 1), tmp46, (2, 3, 0, 4), (2, 3, 4, 1)) - tmp63 = einsum(tmp27, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (1, 2, 4, 5)) - tmp76 = np.copy(tmp65) * 2 - tmp76 += tmp66 - tmp93 = np.copy(tmp62) - tmp93 += tmp61 - tmp60 = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (3, 4), (0, 4, 1, 2)) - tmp92 = np.copy(tmp44) - tmp92 += tmp45 - tmp74 = np.copy(tmp21) * 2 - tmp74 += tmp22 - tmp48 = einsum(tmp13, (0, 1, 2, 3), t2.abab, (4, 1, 3, 5), (0, 4, 2, 5)) - tmp79 = einsum(tmp34, (0, 1, 2, 3), t1.aa, (0, 4), (1, 3, 2, 4)) - tmp73 = einsum(t2.aaaa, (0, 1, 2, 3), tmp72, (1, 4, 3, 5), (0, 4, 2, 5)) - tmp81 = einsum(t1.aa, (0, 1), tmp80, (0, 2, 3, 4), (2, 3, 1, 4)) - del tmp80 - tmp78 = einsum(t2.aaaa, (0, 1, 2, 3), tmp34, (0, 1, 4, 5), (4, 5, 2, 3)) - tmp75 = einsum(tmp25, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - tmp69 = einsum(t2.abab, (0, 1, 2, 3), tmp68, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp59 = np.copy(t1.aa) * 0.5 - tmp59 += tmp21 - tmp59 += tmp22 * 0.5 - tmp71 = einsum(t2.aaaa, (0, 1, 2, 3), tmp70, (1, 4, 3, 5), (4, 0, 5, 2)) - tmp77 = einsum(tmp29, (0, 1), t2.aaaa, (2, 0, 3, 4), (1, 2, 3, 4)) * -2 - tmp67 = np.copy(tmp65) - del tmp65 - tmp67 += tmp66 * 0.5 - del tmp66 - tmp24 = np.copy(t1.aa) - tmp24 += tmp21 * 2 - tmp24 += tmp22 - tmp56 = einsum(tmp55, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 3, 4)) * 2 - del tmp55 - tmp58 = np.copy(tmp26) - del tmp26 - tmp58 += tmp28 * 0.5 - del tmp28 - tmp58 += tmp57 - del tmp57 - tmp35 = einsum(tmp34, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 3, 4)) * 2 - del tmp34 - tmp23 = np.copy(t1.aa) - tmp23 += tmp21 * 2 - del tmp21 - tmp23 += tmp22 - del tmp22 - tmp52 = np.copy(tmp40) * 0.5 - del tmp40 - tmp52 += tmp41 - del tmp41 - tmp52 += tmp51 - del tmp51 - tmp49 = np.copy(t1.bb) * 0.5 - tmp49 += tmp36 * 0.5 - del tmp36 - tmp49 += tmp37 - del tmp37 - tmp15 = np.copy(delta.bb.oo) * -1 - tmp15 += tmp8 - tmp15 += tmp9 - tmp15 += tmp10 * 2 - tmp11 = np.copy(delta.bb.oo) * -0.5 - tmp11 += tmp8 * 0.5 - del tmp8 - tmp11 += tmp9 * 0.5 - del tmp9 - tmp11 += tmp10 - del tmp10 - tmp3 = np.copy(delta.aa.oo) * -1 - tmp3 += tmp0 - del tmp0 - tmp3 += tmp1 * 2 - del tmp1 - tmp3 += tmp2 - del tmp2 - rdm2.bbbb.vvvv = np.copy(np.transpose(tmp133, (1, 0, 3, 2))) * 2 - del tmp133 - rdm2.bbbb.vvvv += einsum(tmp131, (0, 1, 2, 3), t1.bb, (0, 4), (1, 2, 4, 3)) * 2 - rdm2.abab.vvvv = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 5), (0, 1, 4, 5)) - rdm2.abab.vvvv += einsum(t1.aa, (0, 1), tmp130, (0, 2, 3, 4), (2, 3, 1, 4)) - rdm2.aaaa.vvvv = np.copy(np.transpose(tmp132, (1, 0, 3, 2))) * 2 - del tmp132 - rdm2.aaaa.vvvv += einsum(tmp129, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * 2 - rdm2.bbbb.vvvo = np.copy(np.transpose(tmp131, (2, 1, 3, 0))) * 2 - rdm2.abab.vvvo = einsum(l2.abab, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - rdm2.aaaa.vvvo = np.copy(np.transpose(tmp129, (2, 1, 3, 0))) * 2 - rdm2.bbbb.vvov = np.copy(np.transpose(tmp131, (2, 1, 0, 3))) * -2 - del tmp131 - rdm2.abab.vvov = np.copy(np.transpose(tmp130, (1, 2, 0, 3))) - del tmp130 - rdm2.aaaa.vvov = np.copy(np.transpose(tmp129, (2, 1, 0, 3))) * -2 - del tmp129 - rdm2.bbbb.vovv = np.copy(np.transpose(tmp124, (1, 0, 3, 2))) * 2 - rdm2.bbbb.vovv += einsum(tmp122, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -2 - rdm2.bbbb.vovv += einsum(t1.bb, (0, 1), tmp109, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.vovv += np.transpose(tmp126, (2, 0, 1, 3)) - rdm2.bbbb.vovv += np.transpose(tmp126, (2, 0, 3, 1)) * -1 - rdm2.bbbb.vovv += np.transpose(tmp127, (1, 0, 3, 2)) * 2 - rdm2.bbbb.vovv += np.transpose(tmp128, (1, 0, 3, 2)) * 2 - rdm2.abab.vovv = einsum(t2.abab, (0, 1, 2, 3), l1.aa, (4, 0), (4, 1, 2, 3)) - rdm2.abab.vovv += einsum(tmp112, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.abab.vovv += einsum(t1.aa, (0, 1), tmp87, (0, 2, 3, 4), (3, 2, 1, 4)) * 2 - rdm2.abab.vovv += einsum(tmp91, (0, 1, 2, 3), t1.bb, (0, 4), (2, 1, 3, 4)) * -1 - rdm2.abab.vovv += einsum(tmp13, (0, 1, 2, 3), t2.abab, (0, 1, 4, 5), (3, 2, 4, 5)) * -1 - rdm2.abab.vovv += einsum(t1.aa, (0, 1), tmp115, (0, 2, 3, 4), (3, 2, 1, 4)) * -1 - rdm2.aaaa.vovv = np.copy(np.transpose(tmp116, (1, 0, 3, 2))) * 2 - rdm2.aaaa.vovv += einsum(t1.aa, (0, 1), tmp106, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.vovv += einsum(tmp112, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.aaaa.vovv += np.transpose(tmp119, (2, 0, 1, 3)) - rdm2.aaaa.vovv += np.transpose(tmp119, (2, 0, 3, 1)) * -1 - rdm2.aaaa.vovv += np.transpose(tmp120, (1, 0, 3, 2)) * 2 - rdm2.aaaa.vovv += np.transpose(tmp121, (1, 0, 3, 2)) * 2 - rdm2.bbbb.ovvv = np.copy(np.transpose(tmp124, (0, 1, 3, 2))) * -2 - del tmp124 - rdm2.bbbb.ovvv += einsum(tmp122, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) * 2 - rdm2.bbbb.ovvv += einsum(t1.bb, (0, 1), tmp109, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.ovvv += einsum(t1.bb, (0, 1), tmp125, (0, 2, 3, 4), (2, 3, 1, 4)) * -4 - del tmp125 - rdm2.bbbb.ovvv += np.transpose(tmp126, (0, 2, 3, 1)) - del tmp126 - rdm2.bbbb.ovvv += np.transpose(tmp127, (0, 1, 3, 2)) * -2 - del tmp127 - rdm2.bbbb.ovvv += np.transpose(tmp128, (0, 1, 3, 2)) * -2 - del tmp128 - rdm2.abab.ovvv = einsum(t2.abab, (0, 1, 2, 3), l1.bb, (4, 1), (0, 4, 2, 3)) - rdm2.abab.ovvv += einsum(tmp122, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) * 2 - del tmp122 - rdm2.abab.ovvv += einsum(tmp110, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -1 - rdm2.abab.ovvv += einsum(tmp123, (0, 1, 2, 3), t1.bb, (1, 4), (0, 3, 2, 4)) * 2 - del tmp123 - rdm2.abab.ovvv += einsum(tmp27, (0, 1, 2, 3), t2.abab, (0, 2, 4, 5), (1, 3, 4, 5)) * -1 - rdm2.abab.ovvv += einsum(tmp114, (0, 1, 2, 3), t1.bb, (1, 4), (0, 3, 2, 4)) * -1 - rdm2.aaaa.ovvv = np.copy(np.transpose(tmp116, (0, 1, 3, 2))) * -2 - del tmp116 - rdm2.aaaa.ovvv += einsum(t1.aa, (0, 1), tmp106, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.ovvv += einsum(tmp112, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.aaaa.ovvv += einsum(tmp117, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -1 - del tmp117 - rdm2.aaaa.ovvv += np.transpose(tmp119, (0, 2, 3, 1)) - del tmp119 - rdm2.aaaa.ovvv += np.transpose(tmp120, (0, 1, 3, 2)) * -2 - del tmp120 - rdm2.aaaa.ovvv += np.transpose(tmp121, (0, 1, 3, 2)) * -2 - del tmp121 - rdm2.bbbb.vvoo = np.copy(l2.bbbb) * 2 - rdm2.abab.vvoo = np.copy(l2.abab) - rdm2.aaaa.vvoo = np.copy(l2.aaaa) * 2 - rdm2.bbbb.vovo = einsum(delta.bb.oo, (0, 1), tmp109, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.vovo += np.transpose(tmp89, (2, 1, 3, 0)) * -4 - rdm2.bbbb.vovo += einsum(t1.bb, (0, 1), l1.bb, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.vovo += np.transpose(tmp88, (2, 1, 3, 0)) * -1 - rdm2.bbbb.vovo += np.transpose(tmp111, (2, 1, 3, 0)) * 2 - rdm2.abab.vovo = einsum(tmp112, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.abab.vovo += np.transpose(tmp91, (2, 1, 3, 0)) * -1 - rdm2.abab.vovo += einsum(tmp13, (0, 1, 2, 3), t1.aa, (0, 4), (3, 2, 4, 1)) * -1 - rdm2.aaaa.vovo = einsum(tmp112, (0, 1), delta.aa.oo, (2, 3), (0, 2, 1, 3)) * 2 - rdm2.aaaa.vovo += np.transpose(tmp70, (2, 1, 3, 0)) * -4 - rdm2.aaaa.vovo += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.vovo += np.transpose(tmp72, (2, 1, 3, 0)) * -1 - rdm2.aaaa.vovo += np.transpose(tmp107, (2, 1, 3, 0)) * 2 - rdm2.bbbb.voov = einsum(delta.bb.oo, (0, 1), tmp109, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.voov += np.transpose(tmp89, (2, 1, 0, 3)) * 4 - rdm2.bbbb.voov += einsum(t1.bb, (0, 1), l1.bb, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.voov += np.transpose(tmp88, (2, 1, 0, 3)) - rdm2.bbbb.voov += np.transpose(tmp111, (2, 1, 0, 3)) * -2 - rdm2.abab.voov = np.copy(np.transpose(tmp86, (2, 1, 0, 3))) * 2 - del tmp86 - rdm2.abab.voov += einsum(l1.aa, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.voov += np.transpose(tmp85, (2, 1, 0, 3)) * 2 - del tmp85 - rdm2.abab.voov += np.transpose(tmp115, (2, 1, 0, 3)) * -1 - del tmp115 - rdm2.aaaa.voov = einsum(tmp106, (0, 1), delta.aa.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.voov += np.transpose(tmp70, (2, 1, 0, 3)) * 4 - rdm2.aaaa.voov += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.voov += np.transpose(tmp72, (2, 1, 0, 3)) - rdm2.aaaa.voov += np.transpose(tmp107, (2, 1, 0, 3)) * -2 - rdm2.bbbb.ovvo = einsum(delta.bb.oo, (0, 1), tmp109, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.ovvo += np.transpose(tmp89, (1, 2, 3, 0)) * 4 - rdm2.bbbb.ovvo += einsum(t1.bb, (0, 1), l1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.ovvo += np.transpose(tmp88, (1, 2, 3, 0)) - rdm2.bbbb.ovvo += np.transpose(tmp111, (1, 2, 3, 0)) * -2 - rdm2.abab.ovvo = np.copy(np.transpose(tmp68, (0, 3, 2, 1))) * 2 - del tmp68 - rdm2.abab.ovvo += einsum(l1.bb, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.abab.ovvo += np.transpose(tmp113, (0, 3, 2, 1)) * 2 - del tmp113 - rdm2.abab.ovvo += np.transpose(tmp114, (0, 3, 2, 1)) * -1 - del tmp114 - rdm2.aaaa.ovvo = einsum(tmp112, (0, 1), delta.aa.oo, (2, 3), (2, 0, 1, 3)) * -2 - del tmp112 - rdm2.aaaa.ovvo += np.transpose(tmp70, (1, 2, 3, 0)) * 4 - rdm2.aaaa.ovvo += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.ovvo += np.transpose(tmp72, (1, 2, 3, 0)) - rdm2.aaaa.ovvo += np.transpose(tmp107, (1, 2, 3, 0)) * -2 - rdm2.bbbb.ovov = einsum(delta.bb.oo, (0, 1), tmp109, (2, 3), (0, 2, 1, 3)) - rdm2.bbbb.ovov += np.transpose(tmp89, (1, 2, 0, 3)) * -4 - del tmp89 - rdm2.bbbb.ovov += einsum(t1.bb, (0, 1), l1.bb, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.ovov += np.transpose(tmp88, (1, 2, 0, 3)) * -1 - del tmp88 - rdm2.bbbb.ovov += np.transpose(tmp111, (1, 2, 0, 3)) * 2 - del tmp111 - rdm2.abab.ovov = einsum(delta.aa.oo, (0, 1), tmp109, (2, 3), (0, 2, 1, 3)) - del tmp109 - rdm2.abab.ovov += np.transpose(tmp110, (1, 2, 0, 3)) * -1 - del tmp110 - rdm2.abab.ovov += einsum(tmp27, (0, 1, 2, 3), t1.bb, (2, 4), (1, 3, 0, 4)) * -1 - rdm2.aaaa.ovov = einsum(tmp106, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) - del tmp106 - rdm2.aaaa.ovov += np.transpose(tmp70, (1, 2, 0, 3)) * -4 - del tmp70 - rdm2.aaaa.ovov += einsum(l1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.ovov += np.transpose(tmp72, (1, 2, 0, 3)) * -1 - del tmp72 - rdm2.aaaa.ovov += np.transpose(tmp107, (1, 2, 0, 3)) * 2 - del tmp107 - rdm2.bbbb.oovv = np.copy(t2.bbbb) * 2 - rdm2.bbbb.oovv += einsum(tmp84, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 4, 1)) * -4 - rdm2.bbbb.oovv += np.transpose(tmp94, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp95, (0, 1, 3, 2)) * -8 - rdm2.bbbb.oovv += np.transpose(tmp96, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += np.transpose(tmp96, (1, 0, 2, 3)) * -2 - rdm2.bbbb.oovv += einsum(tmp64, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.oovv += np.transpose(tmp94, (1, 0, 3, 2)) * 2 - del tmp94 - rdm2.bbbb.oovv += tmp95 * 8 - del tmp95 - rdm2.bbbb.oovv += tmp96 * 2 - rdm2.bbbb.oovv += np.transpose(tmp96, (1, 0, 3, 2)) * 2 - del tmp96 - rdm2.bbbb.oovv += einsum(tmp38, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp97, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.oovv += einsum(tmp97, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) * -1 - del tmp97 - rdm2.bbbb.oovv += tmp98 * 2 - rdm2.bbbb.oovv += einsum(tmp99, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 1, 4)) * 2 - del tmp99 - rdm2.bbbb.oovv += np.transpose(tmp98, (0, 1, 3, 2)) * -2 - del tmp98 - rdm2.bbbb.oovv += np.transpose(tmp100, (0, 1, 3, 2)) * -2 - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp43, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.bbbb.oovv += einsum(tmp43, (0, 1), t1.bb, (2, 3), (2, 0, 1, 3)) - rdm2.bbbb.oovv += np.transpose(tmp100, (1, 0, 3, 2)) * 2 - del tmp100 - rdm2.bbbb.oovv += einsum(tmp43, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp43, (2, 3), (2, 0, 3, 1)) * -1 - rdm2.bbbb.oovv += np.transpose(tmp101, (1, 0, 3, 2)) * 2 - del tmp101 - rdm2.bbbb.oovv += einsum(t1.bb, (0, 1), tmp102, (0, 2, 3, 4), (2, 3, 1, 4)) * 2 - del tmp102 - rdm2.bbbb.oovv += np.transpose(tmp104, (1, 0, 2, 3)) - rdm2.bbbb.oovv += tmp104 * -1 - rdm2.bbbb.oovv += np.transpose(tmp104, (1, 0, 3, 2)) * -1 - rdm2.bbbb.oovv += np.transpose(tmp104, (0, 1, 3, 2)) - del tmp104 - rdm2.abab.oovv = np.copy(t2.abab) - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp84, (3, 4), (0, 1, 2, 4)) * -2 - del tmp84 - rdm2.abab.oovv += einsum(t2.aaaa, (0, 1, 2, 3), tmp87, (1, 4, 3, 5), (0, 4, 2, 5)) * 4 - del tmp87 - rdm2.abab.oovv += einsum(tmp90, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) - del tmp90 - rdm2.abab.oovv += einsum(tmp38, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.abab.oovv += einsum(tmp74, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp39, (0, 2, 3, 4), (2, 3, 1, 4)) * -1 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp76, (2, 4), (0, 1, 4, 3)) * -1 - rdm2.abab.oovv += einsum(tmp60, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) * -1 - rdm2.abab.oovv += einsum(t2.abab, (0, 1, 2, 3), tmp16, (1, 4), (0, 4, 2, 3)) * -2 - rdm2.abab.oovv += einsum(tmp43, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) * -1 - rdm2.abab.oovv += einsum(tmp4, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -1 - rdm2.abab.oovv += einsum(tmp46, (0, 1, 2, 3), t2.abab, (0, 2, 4, 5), (1, 3, 4, 5)) - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp47, (0, 2, 3, 4), (2, 3, 1, 4)) - rdm2.abab.oovv += einsum(tmp91, (0, 1, 2, 3), t2.abab, (4, 0, 2, 5), (4, 1, 3, 5)) - del tmp91 - rdm2.abab.oovv += einsum(tmp31, (0, 1), t1.bb, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.abab.oovv += einsum(t1.aa, (0, 1), tmp48, (0, 2, 3, 4), (2, 3, 1, 4)) - rdm2.abab.oovv += einsum(tmp92, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -2 - del tmp92 - rdm2.abab.oovv += einsum(tmp93, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) * -2 - del tmp93 - rdm2.abab.oovv += einsum(tmp63, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 3, 4)) - rdm2.aaaa.oovv = np.copy(t2.aaaa) * 2 - rdm2.aaaa.oovv += einsum(t2.aaaa, (0, 1, 2, 3), tmp67, (3, 4), (0, 1, 2, 4)) * -4 - del tmp67 - rdm2.aaaa.oovv += np.transpose(tmp69, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp71, (0, 1, 3, 2)) * -8 - rdm2.aaaa.oovv += np.transpose(tmp73, (0, 1, 3, 2)) * -2 - rdm2.aaaa.oovv += np.transpose(tmp73, (1, 0, 2, 3)) * -2 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp59, (2, 3), (2, 0, 1, 3)) * -2 - rdm2.aaaa.oovv += tmp69 * 2 - del tmp69 - rdm2.aaaa.oovv += tmp71 * 8 - del tmp71 - rdm2.aaaa.oovv += tmp73 * 2 - rdm2.aaaa.oovv += np.transpose(tmp73, (1, 0, 3, 2)) * 2 - del tmp73 - rdm2.aaaa.oovv += einsum(tmp24, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.oovv += einsum(tmp74, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp74, (2, 3), (0, 2, 3, 1)) * -1 - del tmp74 - rdm2.aaaa.oovv += tmp75 * 2 - rdm2.aaaa.oovv += einsum(t2.aaaa, (0, 1, 2, 3), tmp76, (3, 4), (0, 1, 4, 2)) * 2 - del tmp76 - rdm2.aaaa.oovv += np.transpose(tmp75, (0, 1, 3, 2)) * -2 - del tmp75 - rdm2.aaaa.oovv += np.transpose(tmp77, (1, 0, 3, 2)) * -2 - rdm2.aaaa.oovv += einsum(tmp31, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) * -1 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp31, (2, 3), (0, 2, 3, 1)) - rdm2.aaaa.oovv += np.transpose(tmp77, (0, 1, 3, 2)) * 2 - del tmp77 - rdm2.aaaa.oovv += einsum(t1.aa, (0, 1), tmp31, (2, 3), (2, 0, 1, 3)) - rdm2.aaaa.oovv += einsum(tmp31, (0, 1), t1.aa, (2, 3), (0, 2, 1, 3)) * -1 - rdm2.aaaa.oovv += np.transpose(tmp78, (1, 0, 3, 2)) * 2 - del tmp78 - rdm2.aaaa.oovv += einsum(tmp79, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * 2 - del tmp79 - rdm2.aaaa.oovv += np.transpose(tmp81, (1, 0, 2, 3)) - rdm2.aaaa.oovv += tmp81 * -1 - rdm2.aaaa.oovv += np.transpose(tmp81, (1, 0, 3, 2)) * -1 - rdm2.aaaa.oovv += np.transpose(tmp81, (0, 1, 3, 2)) - del tmp81 - rdm2.bbbb.vooo = einsum(delta.bb.oo, (0, 1), l1.bb, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.vooo += einsum(l1.bb, (0, 1), delta.bb.oo, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.vooo += np.transpose(tmp19, (3, 2, 1, 0)) * 2 - rdm2.abab.vooo = einsum(l1.aa, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - rdm2.abab.vooo += np.transpose(tmp13, (3, 2, 0, 1)) * -1 - del tmp13 - rdm2.aaaa.vooo = einsum(l1.aa, (0, 1), delta.aa.oo, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.vooo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.vooo += np.transpose(tmp6, (3, 2, 1, 0)) * 2 - rdm2.bbbb.ovoo = einsum(delta.bb.oo, (0, 1), l1.bb, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.bbbb.ovoo += einsum(l1.bb, (0, 1), delta.bb.oo, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.ovoo += np.transpose(tmp19, (2, 3, 1, 0)) * -2 - del tmp19 - rdm2.abab.ovoo = einsum(l1.bb, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) - rdm2.abab.ovoo += np.transpose(tmp27, (1, 3, 0, 2)) * -1 - del tmp27 - rdm2.aaaa.ovoo = einsum(l1.aa, (0, 1), delta.aa.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.aaaa.ovoo += einsum(delta.aa.oo, (0, 1), l1.aa, (2, 3), (0, 2, 1, 3)) - rdm2.aaaa.ovoo += np.transpose(tmp6, (2, 3, 1, 0)) * -2 - del tmp6 - rdm2.bbbb.oovo = einsum(tmp64, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) - del tmp64 - rdm2.bbbb.oovo += einsum(tmp38, (0, 1), delta.bb.oo, (2, 3), (2, 0, 1, 3)) * -1 - rdm2.bbbb.oovo += np.transpose(tmp50, (2, 1, 3, 0)) * 2 - rdm2.bbbb.oovo += einsum(delta.bb.oo, (0, 1), tmp43, (2, 3), (2, 0, 3, 1)) * -1 - rdm2.bbbb.oovo += einsum(delta.bb.oo, (0, 1), tmp43, (2, 3), (0, 2, 3, 1)) - rdm2.bbbb.oovo += np.transpose(tmp53, (1, 2, 3, 0)) - rdm2.bbbb.oovo += np.transpose(tmp54, (1, 2, 3, 0)) * 4 - rdm2.bbbb.oovo += einsum(tmp17, (0, 1), t1.bb, (2, 3), (1, 2, 3, 0)) - rdm2.bbbb.oovo += np.transpose(tmp53, (2, 1, 3, 0)) * -1 - rdm2.bbbb.oovo += np.transpose(tmp54, (2, 1, 3, 0)) * -4 - rdm2.bbbb.oovo += einsum(tmp17, (0, 1), t1.bb, (2, 3), (2, 1, 3, 0)) * -1 - rdm2.bbbb.oovo += np.transpose(tmp56, (2, 1, 3, 0)) * -1 - rdm2.abab.oovo = einsum(tmp59, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) * 2 - del tmp59 - rdm2.abab.oovo += np.transpose(tmp60, (0, 2, 3, 1)) * -1 - del tmp60 - rdm2.abab.oovo += einsum(tmp58, (0, 1), delta.bb.oo, (2, 3), (0, 2, 1, 3)) * -2 - rdm2.abab.oovo += np.transpose(tmp61, (0, 2, 3, 1)) * -2 - del tmp61 - rdm2.abab.oovo += np.transpose(tmp62, (0, 2, 3, 1)) * -2 - del tmp62 - rdm2.abab.oovo += einsum(tmp16, (0, 1), t1.aa, (2, 3), (2, 1, 3, 0)) * -2 - rdm2.abab.oovo += einsum(t1.aa, (0, 1), tmp46, (0, 2, 3, 4), (2, 4, 1, 3)) - del tmp46 - rdm2.abab.oovo += np.transpose(tmp63, (0, 2, 3, 1)) - del tmp63 - rdm2.aaaa.oovo = einsum(delta.aa.oo, (0, 1), tmp23, (2, 3), (2, 0, 3, 1)) - rdm2.aaaa.oovo += einsum(delta.aa.oo, (0, 1), tmp24, (2, 3), (0, 2, 3, 1)) * -1 - rdm2.aaaa.oovo += np.transpose(tmp25, (2, 1, 3, 0)) * 2 - rdm2.aaaa.oovo += einsum(delta.aa.oo, (0, 1), tmp58, (2, 3), (2, 0, 3, 1)) * -2 - rdm2.aaaa.oovo += einsum(delta.aa.oo, (0, 1), tmp58, (2, 3), (0, 2, 3, 1)) * 2 - del tmp58 - rdm2.aaaa.oovo += np.transpose(tmp32, (1, 2, 3, 0)) - rdm2.aaaa.oovo += np.transpose(tmp33, (1, 2, 3, 0)) * 4 - rdm2.aaaa.oovo += einsum(t1.aa, (0, 1), tmp4, (2, 3), (3, 0, 1, 2)) - rdm2.aaaa.oovo += np.transpose(tmp32, (2, 1, 3, 0)) * -1 - rdm2.aaaa.oovo += np.transpose(tmp33, (2, 1, 3, 0)) * -4 - rdm2.aaaa.oovo += einsum(tmp4, (0, 1), t1.aa, (2, 3), (2, 1, 3, 0)) * -1 - rdm2.aaaa.oovo += np.transpose(tmp35, (2, 1, 3, 0)) * -1 - rdm2.bbbb.ooov = einsum(tmp49, (0, 1), delta.bb.oo, (2, 3), (0, 2, 3, 1)) * -2 - del tmp49 - rdm2.bbbb.ooov += einsum(tmp38, (0, 1), delta.bb.oo, (2, 3), (2, 0, 3, 1)) - rdm2.bbbb.ooov += np.transpose(tmp50, (2, 1, 0, 3)) * -2 - del tmp50 - rdm2.bbbb.ooov += einsum(tmp52, (0, 1), delta.bb.oo, (2, 3), (0, 2, 3, 1)) * 2 - rdm2.bbbb.ooov += einsum(delta.bb.oo, (0, 1), tmp52, (2, 3), (0, 2, 1, 3)) * -2 - del tmp52 - rdm2.bbbb.ooov += np.transpose(tmp53, (1, 2, 0, 3)) * -1 - rdm2.bbbb.ooov += np.transpose(tmp54, (1, 2, 0, 3)) * -4 - rdm2.bbbb.ooov += einsum(tmp17, (0, 1), t1.bb, (2, 3), (1, 2, 0, 3)) * -1 - rdm2.bbbb.ooov += np.transpose(tmp53, (2, 1, 0, 3)) - del tmp53 - rdm2.bbbb.ooov += np.transpose(tmp54, (2, 1, 0, 3)) * 4 - del tmp54 - rdm2.bbbb.ooov += einsum(tmp17, (0, 1), t1.bb, (2, 3), (2, 1, 0, 3)) - rdm2.bbbb.ooov += np.transpose(tmp56, (2, 1, 0, 3)) - del tmp56 - rdm2.abab.ooov = einsum(tmp38, (0, 1), delta.aa.oo, (2, 3), (2, 0, 3, 1)) - del tmp38 - rdm2.abab.ooov += np.transpose(tmp39, (1, 2, 0, 3)) * -1 - del tmp39 - rdm2.abab.ooov += einsum(delta.aa.oo, (0, 1), tmp43, (2, 3), (0, 2, 1, 3)) * -1 - del tmp43 - rdm2.abab.ooov += np.transpose(tmp44, (1, 2, 0, 3)) * -2 - del tmp44 - rdm2.abab.ooov += np.transpose(tmp45, (1, 2, 0, 3)) * -2 - del tmp45 - rdm2.abab.ooov += einsum(tmp4, (0, 1), t1.bb, (2, 3), (1, 2, 0, 3)) * -1 - rdm2.abab.ooov += np.transpose(tmp47, (1, 2, 0, 3)) - del tmp47 - rdm2.abab.ooov += np.transpose(tmp48, (1, 2, 0, 3)) - del tmp48 - rdm2.aaaa.ooov = einsum(delta.aa.oo, (0, 1), tmp23, (2, 3), (2, 0, 1, 3)) * -1 - del tmp23 - rdm2.aaaa.ooov += einsum(delta.aa.oo, (0, 1), tmp24, (2, 3), (0, 2, 1, 3)) - del tmp24 - rdm2.aaaa.ooov += np.transpose(tmp25, (2, 1, 0, 3)) * -2 - del tmp25 - rdm2.aaaa.ooov += einsum(tmp31, (0, 1), delta.aa.oo, (2, 3), (0, 2, 3, 1)) - rdm2.aaaa.ooov += einsum(delta.aa.oo, (0, 1), tmp31, (2, 3), (0, 2, 1, 3)) * -1 - del tmp31 - rdm2.aaaa.ooov += np.transpose(tmp32, (1, 2, 0, 3)) * -1 - rdm2.aaaa.ooov += np.transpose(tmp33, (1, 2, 0, 3)) * -4 - rdm2.aaaa.ooov += einsum(tmp29, (0, 1), t1.aa, (2, 3), (1, 2, 0, 3)) * -2 - rdm2.aaaa.ooov += np.transpose(tmp32, (2, 1, 0, 3)) - del tmp32 - rdm2.aaaa.ooov += np.transpose(tmp33, (2, 1, 0, 3)) * 4 - del tmp33 - rdm2.aaaa.ooov += einsum(tmp29, (0, 1), t1.aa, (2, 3), (2, 1, 0, 3)) * 2 - del tmp29 - rdm2.aaaa.ooov += np.transpose(tmp35, (2, 1, 0, 3)) - del tmp35 - rdm2.bbbb.oooo = einsum(delta.bb.oo, (0, 1), tmp15, (2, 3), (0, 3, 1, 2)) * -1 - rdm2.bbbb.oooo += einsum(delta.bb.oo, (0, 1), tmp15, (2, 3), (3, 0, 1, 2)) - del tmp15 - rdm2.bbbb.oooo += einsum(delta.bb.oo, (0, 1), tmp16, (2, 3), (3, 0, 2, 1)) * -2 - del tmp16 - rdm2.bbbb.oooo += einsum(tmp17, (0, 1), delta.bb.oo, (2, 3), (2, 1, 0, 3)) - del tmp17 - rdm2.bbbb.oooo += np.transpose(tmp18, (3, 2, 1, 0)) * 2 - del tmp18 - rdm2.bbbb.oooo += np.transpose(tmp20, (2, 3, 1, 0)) * -2 - del tmp20 - rdm2.abab.oooo = einsum(delta.aa.oo, (0, 1), tmp11, (2, 3), (0, 3, 1, 2)) * -2 - del tmp11 - rdm2.abab.oooo += einsum(tmp4, (0, 1), delta.bb.oo, (2, 3), (1, 2, 0, 3)) * -1 - rdm2.abab.oooo += np.transpose(tmp12, (1, 3, 0, 2)) - del tmp12 - rdm2.abab.oooo += np.transpose(tmp14, (1, 3, 0, 2)) - del tmp14 - rdm2.aaaa.oooo = einsum(delta.aa.oo, (0, 1), tmp3, (2, 3), (0, 3, 1, 2)) * -1 - rdm2.aaaa.oooo += einsum(delta.aa.oo, (0, 1), tmp3, (2, 3), (3, 0, 1, 2)) - del tmp3 - rdm2.aaaa.oooo += einsum(delta.aa.oo, (0, 1), tmp4, (2, 3), (3, 0, 2, 1)) * -1 - rdm2.aaaa.oooo += einsum(tmp4, (0, 1), delta.aa.oo, (2, 3), (2, 1, 0, 3)) - del delta, tmp4 - rdm2.aaaa.oooo += np.transpose(tmp5, (3, 2, 1, 0)) * 2 - del tmp5 - rdm2.aaaa.oooo += np.transpose(tmp7, (2, 3, 1, 0)) * -2 - del tmp7 - rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv) - rdm2.abab = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv) - rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv) - rdm2 = Namespace( - aaaa=np.transpose(rdm2.aaaa, (0, 2, 1, 3)), - aabb=np.transpose(rdm2.abab, (0, 2, 1, 3)), - bbbb=np.transpose(rdm2.bbbb, (0, 2, 1, 3)), - ) - - return rdm2 - -def hbar_matvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:15:26.065422. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp101 : array - tmp102 : array - tmp103 : array - tmp105 : array - tmp11 : array - tmp116 : array - tmp117 : array - tmp118 : array - tmp12 : array - tmp120 : array - tmp122 : array - tmp124 : array - tmp126 : array - tmp128 : array - tmp131 : array - tmp132 : array - tmp137 : array - tmp138 : array - tmp139 : array - tmp14 : array - tmp140 : array - tmp141 : array - tmp142 : array - tmp143 : array - tmp144 : array - tmp145 : array - tmp152 : array - tmp156 : array - tmp159 : array - tmp16 : array - tmp161 : array - tmp163 : array - tmp166 : array - tmp168 : array - tmp17 : array - tmp170 : array - tmp171 : array - tmp173 : array - tmp177 : array - tmp178 : array - tmp179 : array - tmp18 : array - tmp181 : array - tmp183 : array - tmp185 : array - tmp186 : array - tmp187 : array - tmp189 : array - tmp19 : array - tmp2 : array - tmp200 : array - tmp201 : array - tmp202 : array - tmp206 : array - tmp208 : array - tmp21 : array - tmp210 : array - tmp212 : array - tmp214 : array - tmp216 : array - tmp218 : array - tmp219 : array - tmp22 : array - tmp220 : array - tmp228 : array - tmp233 : array - tmp236 : array - tmp24 : array - tmp241 : array - tmp242 : array - tmp243 : array - tmp248 : array - tmp249 : array - tmp251 : array - tmp252 : array - tmp256 : array - tmp257 : array - tmp258 : array - tmp26 : array - tmp260 : array - tmp262 : array - tmp263 : array - tmp264 : array - tmp268 : array - tmp269 : array - tmp27 : array - tmp275 : array - tmp276 : array - tmp277 : array - tmp278 : array - tmp279 : array - tmp281 : array - tmp284 : array - tmp286 : array - tmp287 : array - tmp289 : array - tmp29 : array - tmp291 : array - tmp292 : array - tmp293 : array - tmp295 : array - tmp298 : array - tmp30 : array - tmp302 : array - tmp303 : array - tmp304 : array - tmp305 : array - tmp306 : array - tmp307 : array - tmp308 : array - tmp310 : array - tmp315 : array - tmp316 : array - tmp317 : array - tmp318 : array - tmp32 : array - tmp320 : array - tmp322 : array - tmp325 : array - tmp326 : array - tmp327 : array - tmp328 : array - tmp329 : array - tmp33 : array - tmp330 : array - tmp334 : array - tmp335 : array - tmp337 : array - tmp338 : array - tmp339 : array - tmp34 : array - tmp340 : array - tmp341 : array - tmp342 : array - tmp344 : array - tmp345 : array - tmp346 : array - tmp350 : array - tmp351 : array - tmp352 : array - tmp354 : array - tmp356 : array - tmp357 : array - tmp358 : array - tmp36 : array - tmp362 : array - tmp363 : array - tmp364 : array - tmp365 : array - tmp366 : array - tmp367 : array - tmp37 : array - tmp372 : array - tmp373 : array - tmp374 : array - tmp385 : array - tmp387 : array - tmp389 : array - tmp39 : array - tmp392 : array - tmp394 : array - tmp396 : array - tmp4 : array - tmp401 : array - tmp403 : array - tmp41 : array - tmp414 : array - tmp416 : array - tmp418 : array - tmp42 : array - tmp43 : array - tmp434 : array - tmp438 : array - tmp440 : array - tmp442 : array - tmp447 : array - tmp449 : array - tmp453 : array - tmp455 : array - tmp457 : array - tmp459 : array - tmp461 : array - tmp47 : array - tmp49 : array - tmp51 : array - tmp52 : array - tmp54 : array - tmp55 : array - tmp57 : array - tmp58 : array - tmp59 : array - tmp6 : array - tmp61 : array - tmp67 : array - tmp69 : array - tmp7 : array - tmp70 : array - tmp72 : array - tmp74 : array - tmp78 : array - tmp79 : array - tmp80 : array - tmp81 : array - tmp82 : array - tmp83 : array - tmp85 : array - tmp87 : array - tmp9 : array - tmp90 : array - tmp92 : array - tmp93 : array - tmp95 : array - tmp98 : array - """ - - tmp8 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp10 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (1, 2), (0,)) - tmp16 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp6 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp131 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp21 = einsum(tmp8, (0,), v.bbb.xov, (0, 1, 2), (1, 2)) - tmp18 = einsum(v.bbb.xov, (0, 1, 2), tmp10, (0,), (1, 2)) - tmp17 = einsum(tmp16, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp54 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp51 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp156 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp19 = einsum(tmp10, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp14 = einsum(tmp8, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp12 = einsum(v.baa.xov, (0, 1, 2), tmp6, (0, 1, 3), (3, 2)) - tmp29 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp26 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp92 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp449 = einsum(tmp16, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp47 = einsum(v.bbb.xov, (0, 1, 2), tmp16, (0, 3, 4), (3, 1, 4, 2)) - tmp276 = einsum(v.bbb.xvv, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp37 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp401 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp394 = einsum(t2.bbbb, (0, 1, 2, 3), tmp131, (4, 5, 3, 2), (0, 1, 5, 4)) - tmp391 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp387 = einsum(tmp16, (0, 1, 2), tmp16, (0, 3, 4), (3, 1, 4, 2)) - tmp59 = einsum(tmp21, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp58 = einsum(tmp18, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp57 = einsum(tmp17, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp252 = einsum(v.baa.xoo, (0, 1, 2), tmp16, (0, 3, 4), (1, 2, 3, 4)) - tmp55 = einsum(v.bbb.xov, (0, 1, 2), tmp54, (0, 3, 2), (3, 1)) - tmp52 = einsum(v.bbb.xov, (0, 1, 2), tmp51, (0, 3, 2), (3, 1)) - tmp49 = einsum(tmp16, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp36 = einsum(f.bb.ov, (0, 1), t1.bb, (2, 1), (0, 2)) - tmp264 = einsum(v.bbb.xoo, (0, 1, 2), tmp6, (0, 3, 4), (3, 4, 1, 2)) - tmp22 = einsum(tmp6, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp249 = einsum(tmp6, (0, 1, 2), tmp16, (0, 3, 4), (1, 2, 3, 4)) - tmp278 = einsum(tmp8, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp275 = einsum(tmp10, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp43 = einsum(tmp8, (0,), v.bbb.xoo, (0, 1, 2), (1, 2)) - tmp42 = einsum(v.bbb.xoo, (0, 1, 2), tmp10, (0,), (1, 2)) - tmp41 = einsum(tmp16, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (3, 2)) - tmp39 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp2 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp214 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp210 = einsum(t2.abab, (0, 1, 2, 3), tmp156, (4, 5, 2, 3), (0, 4, 1, 5)) - tmp280 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 4, 1, 2)) - tmp24 = einsum(v.bbb.xov, (0, 1, 2), tmp6, (0, 3, 4), (3, 4, 1, 2)) - tmp69 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp4 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp207 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp34 = einsum(tmp19, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp33 = einsum(tmp14, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp32 = einsum(tmp12, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp173 = einsum(v.baa.xoo, (0, 1, 2), tmp6, (0, 3, 4), (3, 1, 2, 4)) - tmp30 = einsum(tmp29, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp27 = einsum(tmp26, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp1 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp11 = einsum(tmp10, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - tmp9 = einsum(tmp8, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - tmp7 = einsum(v.baa.xoo, (0, 1, 2), tmp6, (0, 2, 3), (1, 3)) - tmp103 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp93 = einsum(t2.aaaa, (0, 1, 2, 3), tmp92, (4, 5, 3, 2), (0, 1, 5, 4)) - tmp89 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp85 = einsum(tmp6, (0, 1, 2), tmp6, (0, 3, 4), (1, 3, 2, 4)) - tmp72 = einsum(v.baa.xvv, (0, 1, 2), tmp10, (0,), (1, 2)) - del tmp10 - tmp67 = einsum(v.baa.xvv, (0, 1, 2), tmp8, (0,), (1, 2)) - del tmp8 - tmp461 = einsum(tmp449, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp459 = einsum(tmp449, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) - tmp457 = einsum(tmp16, (0, 1, 2), tmp54, (0, 3, 4), (1, 3, 2, 4)) - tmp455 = einsum(tmp47, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp453 = einsum(tmp16, (0, 1, 2), tmp51, (0, 3, 4), (1, 3, 2, 4)) - tmp447 = einsum(v.bbb.xoo, (0, 1, 2), tmp276, (0, 3, 4), (3, 1, 2, 4)) - tmp442 = einsum(tmp21, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp440 = einsum(tmp18, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp438 = einsum(t2.bbbb, (0, 1, 2, 3), tmp17, (4, 3), (0, 1, 4, 2)) - tmp434 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp418 = einsum(tmp54, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp416 = einsum(tmp51, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp414 = einsum(t2.bbbb, (0, 1, 2, 3), tmp37, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp403 = einsum(tmp401, (0, 1, 2, 3), t1.bb, (3, 4), (1, 2, 0, 4)) - tmp396 = einsum(tmp394, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp392 = einsum(tmp391, (0, 1, 2, 3), t2.bbbb, (4, 5, 2, 3), (4, 5, 0, 1)) * -1 - del tmp391 - tmp389 = einsum(tmp387, (0, 1, 2, 3), t1.bb, (2, 4), (1, 0, 3, 4)) - tmp385 = einsum(tmp16, (0, 1, 2), tmp276, (0, 3, 4), (1, 3, 2, 4)) - tmp374 = einsum(tmp59, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp373 = einsum(tmp58, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp372 = einsum(tmp57, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp367 = einsum(tmp252, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp366 = einsum(tmp55, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp365 = einsum(tmp52, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp364 = einsum(t2.abab, (0, 1, 2, 3), tmp49, (4, 5, 1, 2), (0, 4, 5, 3)) - tmp363 = einsum(t2.abab, (0, 1, 2, 3), tmp49, (0, 4, 1, 2), (4, 3)) - tmp362 = einsum(tmp47, (0, 1, 2, 3), t2.bbbb, (2, 1, 4, 3), (0, 4)) - tmp358 = einsum(v.baa.xoo, (0, 1, 2), tmp276, (0, 3, 4), (1, 2, 3, 4)) - tmp357 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp356 = einsum(tmp36, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp354 = einsum(tmp264, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp352 = einsum(tmp6, (0, 1, 2), tmp51, (0, 3, 4), (1, 2, 3, 4)) - tmp351 = einsum(t2.abab, (0, 1, 2, 3), tmp22, (4, 5, 0, 2), (4, 5, 1, 3)) - tmp350 = einsum(tmp6, (0, 1, 2), tmp54, (0, 3, 4), (1, 2, 3, 4)) - tmp346 = einsum(v.bbb.xoo, (0, 1, 2), tmp276, (0, 2, 3), (1, 3)) - tmp345 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp344 = einsum(tmp249, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp342 = einsum(tmp6, (0, 1, 2), tmp276, (0, 3, 4), (1, 2, 3, 4)) - tmp341 = einsum(tmp278, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp340 = einsum(tmp276, (0, 1, 2), tmp16, (0, 3, 1), (3, 2)) - tmp339 = einsum(tmp275, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp338 = einsum(tmp54, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) - tmp337 = einsum(tmp51, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) * -1 - tmp335 = einsum(tmp16, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp334 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp330 = einsum(t1.bb, (0, 1), tmp43, (2, 0), (2, 1)) - tmp329 = einsum(tmp42, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp328 = einsum(tmp41, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp327 = einsum(tmp19, (0, 1), t2.abab, (2, 3, 1, 4), (2, 0, 3, 4)) - tmp326 = einsum(tmp14, (0, 1), t2.abab, (2, 3, 1, 4), (2, 0, 3, 4)) - tmp325 = einsum(t2.abab, (0, 1, 2, 3), tmp12, (4, 2), (0, 4, 1, 3)) - tmp322 = einsum(t2.abab, (0, 1, 2, 3), tmp156, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp320 = einsum(v.bbb.xov, (0, 1, 2), tmp54, (0, 1, 3), (3, 2)) - tmp318 = einsum(v.bbb.xov, (0, 1, 2), tmp51, (0, 1, 3), (3, 2)) - tmp317 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (4, 5, 1, 2), (0, 4, 5, 3)) - tmp316 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (0, 4, 1, 2), (4, 3)) - tmp315 = einsum(t2.bbbb, (0, 1, 2, 3), tmp37, (4, 0, 1, 3), (4, 2)) - tmp310 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (4, 2), (4, 0, 1, 3)) - tmp308 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp307 = einsum(t2.bbbb, (0, 1, 2, 3), tmp21, (1, 3), (0, 2)) - tmp306 = einsum(tmp19, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp305 = einsum(t2.bbbb, (0, 1, 2, 3), tmp18, (1, 3), (0, 2)) - tmp304 = einsum(t2.bbbb, (0, 1, 2, 3), tmp17, (1, 3), (0, 2)) - tmp303 = einsum(t2.abab, (0, 1, 2, 3), tmp14, (0, 2), (1, 3)) - tmp302 = einsum(t2.abab, (0, 1, 2, 3), tmp12, (0, 2), (1, 3)) - tmp298 = einsum(t2.bbbb, (0, 1, 2, 3), tmp131, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp295 = einsum(t2.abab, (0, 1, 2, 3), tmp92, (0, 4, 5, 2), (4, 1, 5, 3)) - tmp293 = einsum(v.baa.xoo, (0, 1, 2), tmp51, (0, 3, 4), (1, 2, 3, 4)) - tmp292 = einsum(v.baa.xoo, (0, 1, 2), tmp54, (0, 3, 4), (1, 2, 3, 4)) - tmp291 = einsum(t2.abab, (0, 1, 2, 3), tmp2, (4, 0, 5, 2), (4, 5, 1, 3)) - tmp289 = einsum(t1.bb, (0, 1), tmp214, (2, 3, 4, 0), (3, 2, 4, 1)) - tmp287 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp286 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp284 = einsum(tmp210, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp281 = einsum(tmp280, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - del tmp280 - tmp279 = einsum(tmp6, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp277 = einsum(tmp276, (0, 1, 2), v.bbb.xov, (0, 1, 3), (3, 2)) - tmp269 = einsum(t1.aa, (0, 1), tmp264, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp268 = einsum(tmp24, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp263 = einsum(v.bbb.xoo, (0, 1, 2), tmp69, (0, 3, 4), (3, 1, 2, 4)) - tmp262 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp260 = einsum(t1.aa, (0, 1), tmp252, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp258 = einsum(tmp26, (0, 1, 2), tmp16, (0, 3, 4), (1, 3, 4, 2)) - tmp257 = einsum(t2.abab, (0, 1, 2, 3), tmp47, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp256 = einsum(tmp29, (0, 1, 2), tmp16, (0, 3, 4), (1, 3, 4, 2)) - tmp251 = einsum(t1.aa, (0, 1), tmp249, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp248 = einsum(tmp69, (0, 1, 2), tmp16, (0, 3, 4), (1, 3, 4, 2)) - tmp243 = einsum(t2.abab, (0, 1, 2, 3), tmp21, (4, 3), (0, 1, 4, 2)) - tmp242 = einsum(t2.abab, (0, 1, 2, 3), tmp18, (4, 3), (0, 1, 4, 2)) - tmp241 = einsum(t2.abab, (0, 1, 2, 3), tmp17, (4, 3), (0, 1, 4, 2)) - tmp236 = einsum(tmp156, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (4, 1, 5, 2)) - tmp233 = einsum(t2.abab, (0, 1, 2, 3), tmp4, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp228 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (4, 3), (0, 4, 1, 2)) - tmp220 = einsum(v.bbb.xoo, (0, 1, 2), tmp26, (0, 3, 4), (3, 1, 2, 4)) - tmp219 = einsum(v.bbb.xoo, (0, 1, 2), tmp29, (0, 3, 4), (3, 1, 2, 4)) - tmp218 = einsum(t2.abab, (0, 1, 2, 3), tmp37, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp216 = einsum(t1.aa, (0, 1), tmp214, (2, 0, 3, 4), (2, 4, 3, 1)) - tmp212 = einsum(t1.aa, (0, 1), tmp210, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp208 = einsum(t2.abab, (0, 1, 2, 3), tmp207, (4, 5, 2, 3), (0, 1, 4, 5)) - del tmp207 - tmp206 = einsum(v.baa.xvv, (0, 1, 2), tmp16, (0, 3, 4), (3, 4, 1, 2)) - tmp202 = einsum(t1.aa, (0, 1), tmp34, (2, 0), (2, 1)) - tmp201 = einsum(tmp33, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp200 = einsum(tmp32, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp189 = einsum(tmp173, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp187 = einsum(tmp173, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 3, 4)) - tmp186 = einsum(tmp30, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp185 = einsum(t1.aa, (0, 1), tmp27, (2, 0), (2, 1)) - tmp183 = einsum(tmp6, (0, 1, 2), tmp29, (0, 3, 4), (1, 3, 2, 4)) - tmp181 = einsum(tmp22, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp179 = einsum(tmp6, (0, 1, 2), tmp26, (0, 3, 4), (1, 3, 2, 4)) - tmp178 = einsum(t2.abab, (0, 1, 2, 3), tmp24, (4, 0, 1, 3), (4, 2)) - tmp177 = einsum(t2.aaaa, (0, 1, 2, 3), tmp22, (4, 1, 0, 3), (4, 2)) - tmp171 = einsum(v.baa.xoo, (0, 1, 2), tmp69, (0, 3, 4), (3, 1, 2, 4)) - tmp170 = einsum(tmp69, (0, 1, 2), v.baa.xoo, (0, 3, 1), (3, 2)) - tmp168 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp166 = einsum(t1.aa, (0, 1), tmp1, (0, 2), (2, 1)) - tmp163 = einsum(t2.aaaa, (0, 1, 2, 3), tmp19, (4, 3), (0, 1, 4, 2)) - tmp161 = einsum(t2.aaaa, (0, 1, 2, 3), tmp14, (4, 3), (0, 1, 4, 2)) - tmp159 = einsum(t2.aaaa, (0, 1, 2, 3), tmp12, (4, 3), (0, 1, 4, 2)) - tmp152 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (4, 3), (4, 0, 1, 2)) - tmp145 = einsum(tmp11, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp144 = einsum(t1.aa, (0, 1), tmp9, (2, 0), (2, 1)) - tmp143 = einsum(t1.aa, (0, 1), tmp7, (2, 0), (2, 1)) - tmp142 = einsum(t2.abab, (0, 1, 2, 3), tmp21, (1, 3), (0, 2)) - tmp141 = einsum(t2.aaaa, (0, 1, 2, 3), tmp19, (1, 3), (0, 2)) - tmp140 = einsum(tmp18, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp139 = einsum(t2.abab, (0, 1, 2, 3), tmp17, (1, 3), (0, 2)) - tmp138 = einsum(t2.aaaa, (0, 1, 2, 3), tmp14, (1, 3), (0, 2)) - tmp137 = einsum(tmp12, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp132 = einsum(t2.abab, (0, 1, 2, 3), tmp131, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp128 = einsum(t2.aaaa, (0, 1, 2, 3), tmp92, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp126 = einsum(tmp29, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp124 = einsum(tmp26, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp122 = einsum(tmp29, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp120 = einsum(tmp26, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp118 = einsum(t2.aaaa, (0, 1, 2, 3), tmp2, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp117 = einsum(tmp4, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) - tmp116 = einsum(t2.aaaa, (0, 1, 2, 3), tmp2, (4, 0, 1, 3), (4, 2)) - tmp105 = einsum(tmp103, (0, 1, 2, 3), t1.aa, (3, 4), (1, 2, 0, 4)) - tmp102 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp101 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp98 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp95 = einsum(tmp93, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp90 = einsum(t2.aaaa, (0, 1, 2, 3), tmp89, (4, 5, 2, 3), (0, 1, 4, 5)) * -1 - del tmp89 - tmp87 = einsum(tmp85, (0, 1, 2, 3), t1.aa, (2, 4), (1, 0, 3, 4)) - tmp83 = einsum(tmp6, (0, 1, 2), tmp69, (0, 3, 4), (1, 3, 2, 4)) - tmp82 = einsum(t1.aa, (0, 1), tmp72, (2, 1), (0, 2)) - tmp81 = einsum(tmp69, (0, 1, 2), tmp6, (0, 3, 1), (3, 2)) - tmp80 = einsum(t1.aa, (0, 1), tmp67, (2, 1), (0, 2)) - tmp79 = einsum(v.baa.xvv, (0, 1, 2), tmp29, (0, 3, 2), (3, 1)) - tmp78 = einsum(v.baa.xvv, (0, 1, 2), tmp26, (0, 3, 2), (3, 1)) * -1 - tmp74 = einsum(v.baa.xvv, (0, 1, 2), tmp6, (0, 3, 4), (3, 4, 1, 2)) - tmp70 = einsum(tmp69, (0, 1, 2), v.baa.xov, (0, 1, 3), (3, 2)) - tmp61 = einsum(t1.aa, (0, 1), f.aa.vv, (2, 1), (0, 2)) - - return {f"tmp1": tmp1, f"tmp101": tmp101, f"tmp102": tmp102, f"tmp103": tmp103, f"tmp105": tmp105, f"tmp11": tmp11, f"tmp116": tmp116, f"tmp117": tmp117, f"tmp118": tmp118, f"tmp12": tmp12, f"tmp120": tmp120, f"tmp122": tmp122, f"tmp124": tmp124, f"tmp126": tmp126, f"tmp128": tmp128, f"tmp131": tmp131, f"tmp132": tmp132, f"tmp137": tmp137, f"tmp138": tmp138, f"tmp139": tmp139, f"tmp14": tmp14, f"tmp140": tmp140, f"tmp141": tmp141, f"tmp142": tmp142, f"tmp143": tmp143, f"tmp144": tmp144, f"tmp145": tmp145, f"tmp152": tmp152, f"tmp156": tmp156, f"tmp159": tmp159, f"tmp16": tmp16, f"tmp161": tmp161, f"tmp163": tmp163, f"tmp166": tmp166, f"tmp168": tmp168, f"tmp17": tmp17, f"tmp170": tmp170, f"tmp171": tmp171, f"tmp173": tmp173, f"tmp177": tmp177, f"tmp178": tmp178, f"tmp179": tmp179, f"tmp18": tmp18, f"tmp181": tmp181, f"tmp183": tmp183, f"tmp185": tmp185, f"tmp186": tmp186, f"tmp187": tmp187, f"tmp189": tmp189, f"tmp19": tmp19, f"tmp2": tmp2, f"tmp200": tmp200, f"tmp201": tmp201, f"tmp202": tmp202, f"tmp206": tmp206, f"tmp208": tmp208, f"tmp21": tmp21, f"tmp210": tmp210, f"tmp212": tmp212, f"tmp214": tmp214, f"tmp216": tmp216, f"tmp218": tmp218, f"tmp219": tmp219, f"tmp22": tmp22, f"tmp220": tmp220, f"tmp228": tmp228, f"tmp233": tmp233, f"tmp236": tmp236, f"tmp24": tmp24, f"tmp241": tmp241, f"tmp242": tmp242, f"tmp243": tmp243, f"tmp248": tmp248, f"tmp249": tmp249, f"tmp251": tmp251, f"tmp252": tmp252, f"tmp256": tmp256, f"tmp257": tmp257, f"tmp258": tmp258, f"tmp26": tmp26, f"tmp260": tmp260, f"tmp262": tmp262, f"tmp263": tmp263, f"tmp264": tmp264, f"tmp268": tmp268, f"tmp269": tmp269, f"tmp27": tmp27, f"tmp275": tmp275, f"tmp276": tmp276, f"tmp277": tmp277, f"tmp278": tmp278, f"tmp279": tmp279, f"tmp281": tmp281, f"tmp284": tmp284, f"tmp286": tmp286, f"tmp287": tmp287, f"tmp289": tmp289, f"tmp29": tmp29, f"tmp291": tmp291, f"tmp292": tmp292, f"tmp293": tmp293, f"tmp295": tmp295, f"tmp298": tmp298, f"tmp30": tmp30, f"tmp302": tmp302, f"tmp303": tmp303, f"tmp304": tmp304, f"tmp305": tmp305, f"tmp306": tmp306, f"tmp307": tmp307, f"tmp308": tmp308, f"tmp310": tmp310, f"tmp315": tmp315, f"tmp316": tmp316, f"tmp317": tmp317, f"tmp318": tmp318, f"tmp32": tmp32, f"tmp320": tmp320, f"tmp322": tmp322, f"tmp325": tmp325, f"tmp326": tmp326, f"tmp327": tmp327, f"tmp328": tmp328, f"tmp329": tmp329, f"tmp33": tmp33, f"tmp330": tmp330, f"tmp334": tmp334, f"tmp335": tmp335, f"tmp337": tmp337, f"tmp338": tmp338, f"tmp339": tmp339, f"tmp34": tmp34, f"tmp340": tmp340, f"tmp341": tmp341, f"tmp342": tmp342, f"tmp344": tmp344, f"tmp345": tmp345, f"tmp346": tmp346, f"tmp350": tmp350, f"tmp351": tmp351, f"tmp352": tmp352, f"tmp354": tmp354, f"tmp356": tmp356, f"tmp357": tmp357, f"tmp358": tmp358, f"tmp36": tmp36, f"tmp362": tmp362, f"tmp363": tmp363, f"tmp364": tmp364, f"tmp365": tmp365, f"tmp366": tmp366, f"tmp367": tmp367, f"tmp37": tmp37, f"tmp372": tmp372, f"tmp373": tmp373, f"tmp374": tmp374, f"tmp385": tmp385, f"tmp387": tmp387, f"tmp389": tmp389, f"tmp39": tmp39, f"tmp392": tmp392, f"tmp394": tmp394, f"tmp396": tmp396, f"tmp4": tmp4, f"tmp401": tmp401, f"tmp403": tmp403, f"tmp41": tmp41, f"tmp414": tmp414, f"tmp416": tmp416, f"tmp418": tmp418, f"tmp42": tmp42, f"tmp43": tmp43, f"tmp434": tmp434, f"tmp438": tmp438, f"tmp440": tmp440, f"tmp442": tmp442, f"tmp447": tmp447, f"tmp449": tmp449, f"tmp453": tmp453, f"tmp455": tmp455, f"tmp457": tmp457, f"tmp459": tmp459, f"tmp461": tmp461, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp51": tmp51, f"tmp52": tmp52, f"tmp54": tmp54, f"tmp55": tmp55, f"tmp57": tmp57, f"tmp58": tmp58, f"tmp59": tmp59, f"tmp6": tmp6, f"tmp61": tmp61, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp7": tmp7, f"tmp70": tmp70, f"tmp72": tmp72, f"tmp74": tmp74, f"tmp78": tmp78, f"tmp79": tmp79, f"tmp80": tmp80, f"tmp81": tmp81, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp85": tmp85, f"tmp87": tmp87, f"tmp9": tmp9, f"tmp90": tmp90, f"tmp92": tmp92, f"tmp93": tmp93, f"tmp95": tmp95, f"tmp98": tmp98} - -def hbar_matvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:15:26.265626. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp47 = einsum(r2.aba, (0, 1, 2), v.baa.xov, (3, 0, 2), (3, 1)) - tmp48 = einsum(r2.bbb, (0, 1, 2), v.bbb.xov, (3, 1, 2), (3, 0)) - tmp9 = einsum(v.baa.xov, (0, 1, 2), r2.aaa, (3, 1, 2), (0, 3)) - tmp10 = einsum(r2.bab, (0, 1, 2), v.bbb.xov, (3, 0, 2), (3, 1)) * -1 - tmp49 = np.copy(tmp47) * -0.5 - tmp49 += tmp48 - tmp66 = np.copy(ints.tmp37) - tmp66 += np.transpose(ints.tmp47, (0, 2, 1, 3)) - tmp53 = np.copy(tmp47) * -1 - tmp53 += tmp48 * 2 - tmp17 = np.copy(tmp9) - tmp17 += tmp10 * 0.5 - tmp14 = np.copy(ints.tmp22) - tmp14 += np.transpose(ints.tmp2, (0, 2, 1, 3)) - tmp11 = np.copy(tmp9) * 2 - tmp11 += tmp10 - tmp78 = einsum(v.bbb.xoo, (0, 1, 2), tmp49, (0, 3), (3, 1, 2)) * 2 - tmp76 = einsum(tmp66, (0, 1, 2, 3), r2.bbb, (4, 1, 3), (4, 0, 2)) * -2 - tmp77 = einsum(ints.tmp16, (0, 1, 2), tmp53, (0, 3), (3, 1, 2)) - tmp18 = einsum(ints.tmp6, (0, 1, 2), tmp17, (0, 3), (1, 2, 3)) - del tmp17 - tmp15 = einsum(tmp14, (0, 1, 2, 3), r2.aaa, (4, 2, 3), (4, 0, 1)) * -1 - tmp16 = einsum(tmp11, (0, 1), v.baa.xoo, (0, 2, 3), (2, 3, 1)) * 0.5 - tmp92 = np.copy(ints.tmp389) - del ints.tmp389 - tmp92 += np.transpose(ints.tmp403, (1, 2, 0, 3)) - del ints.tmp403 - tmp92 += np.transpose(ints.tmp418, (0, 2, 1, 3)) - del ints.tmp418 - tmp92 += np.transpose(ints.tmp447, (0, 2, 1, 3)) - del ints.tmp447 - tmp92 += ints.tmp459 - del ints.tmp459 - tmp92 += np.transpose(ints.tmp416, (0, 2, 1, 3)) * 2 - del ints.tmp416 - tmp92 += ints.tmp455 * 2 - del ints.tmp455 - tmp88 = np.copy(ints.tmp276) - tmp88 += ints.tmp54 - tmp88 += ints.tmp51 * 2 - tmp59 = np.copy(ints.tmp335) - del ints.tmp335 - tmp59 += ints.tmp345 - del ints.tmp345 - tmp59 += ints.tmp298 * 2 - del ints.tmp298 - tmp90 = np.copy(f.bb.oo) - tmp90 += ints.tmp36 - tmp90 += np.transpose(ints.tmp42, (1, 0)) - tmp90 += np.transpose(ints.tmp43, (1, 0)) - tmp90 += np.transpose(ints.tmp58, (1, 0)) - tmp90 += np.transpose(ints.tmp59, (1, 0)) - tmp74 = np.copy(ints.tmp276) - tmp74 += ints.tmp51 * 2 - tmp74 += ints.tmp54 - tmp83 = np.copy(ints.tmp52) * 2 - tmp83 += ints.tmp55 - tmp83 += ints.tmp41 * -1 - tmp83 += ints.tmp57 * -1 - tmp81 = np.copy(ints.tmp37) - tmp81 += np.transpose(ints.tmp385, (0, 2, 1, 3)) - del ints.tmp385 - tmp81 += np.transpose(ints.tmp414, (0, 2, 1, 3)) * 2 - del ints.tmp414 - tmp81 += np.transpose(ints.tmp453, (0, 2, 1, 3)) * 2 - del ints.tmp453 - tmp81 += np.transpose(ints.tmp457, (0, 2, 1, 3)) - del ints.tmp457 - tmp81 += ints.tmp461 - del ints.tmp461 - tmp81 += np.transpose(ints.tmp47, (0, 2, 1, 3)) - tmp79 = np.copy(np.transpose(tmp76, (1, 2, 0))) * -1 - del tmp76 - tmp79 += np.transpose(tmp77, (1, 2, 0)) * -1 - del tmp77 - tmp79 += np.transpose(tmp78, (0, 2, 1)) - del tmp78 - tmp2 = np.copy(f.bb.ov) - tmp2 += ints.tmp18 - tmp2 += ints.tmp21 - tmp2 += ints.tmp17 * -1 - del ints.tmp17 - tmp3 = np.copy(f.aa.ov) - tmp3 += ints.tmp14 - tmp3 += ints.tmp19 - tmp3 += ints.tmp12 * -1 - del ints.tmp12 - tmp29 = np.copy(tmp9) * 2 - del tmp9 - tmp29 += tmp10 - del tmp10 - tmp31 = np.copy(f.aa.oo) - tmp31 += np.transpose(ints.tmp11, (1, 0)) - tmp31 += ints.tmp1 - tmp31 += np.transpose(ints.tmp33, (1, 0)) - tmp31 += np.transpose(ints.tmp34, (1, 0)) - tmp31 += np.transpose(ints.tmp9, (1, 0)) - tmp33 = np.copy(ints.tmp105) - del ints.tmp105 - tmp33 += np.transpose(ints.tmp122, (1, 0, 2, 3)) - del ints.tmp122 - tmp33 += np.transpose(ints.tmp171, (1, 0, 2, 3)) - del ints.tmp171 - tmp33 += np.transpose(ints.tmp187, (2, 0, 1, 3)) - del ints.tmp187 - tmp33 += np.transpose(ints.tmp87, (2, 0, 1, 3)) - del ints.tmp87 - tmp33 += np.transpose(ints.tmp120, (1, 0, 2, 3)) * 2 - del ints.tmp120 - tmp33 += np.transpose(ints.tmp181, (2, 0, 1, 3)) * 2 - del ints.tmp181 - tmp27 = np.copy(ints.tmp168) - tmp27 += ints.tmp74 - tmp27 += ints.tmp128 * 2 - tmp21 = np.copy(ints.tmp118) - del ints.tmp118 - tmp21 += ints.tmp179 - del ints.tmp179 - tmp21 += ints.tmp183 * 0.5 - del ints.tmp183 - tmp21 += np.transpose(ints.tmp189, (0, 2, 1, 3)) * 0.5 - del ints.tmp189 - tmp21 += ints.tmp22 * 0.5 - tmp21 += np.transpose(ints.tmp2, (0, 2, 1, 3)) * 0.5 - tmp21 += ints.tmp83 * 0.5 - del ints.tmp83 - tmp19 = np.copy(np.transpose(tmp15, (1, 2, 0))) * -1 - del tmp15 - tmp19 += np.transpose(tmp16, (2, 1, 0)) - del tmp16 - tmp19 += tmp18 * -1 - del tmp18 - tmp23 = np.copy(ints.tmp27) * 2 - tmp23 += ints.tmp30 - tmp23 += ints.tmp32 * -1 - tmp23 += ints.tmp7 * -1 - tmp12 = np.copy(ints.tmp26) - tmp12 += ints.tmp29 * 0.5 - tmp12 += ints.tmp69 * 0.5 - tmp86 = einsum(v.bbb.xov, (0, 1, 2), tmp48, (0, 3), (3, 1, 2)) - tmp93 = einsum(r1.b, (0,), tmp92, (1, 2, 0, 3), (1, 2, 3)) - del tmp92 - tmp89 = einsum(tmp88, (0, 1, 2), tmp47, (0, 3), (1, 3, 2)) - del tmp88 - tmp87 = einsum(r2.bbb, (0, 1, 2), tmp59, (3, 1, 4, 2), (0, 3, 4)) * -1 - tmp91 = einsum(tmp90, (0, 1), r2.bbb, (2, 0, 3), (1, 2, 3)) * -1 - del tmp90 - tmp73 = einsum(tmp47, (0, 1), v.bbb.xov, (0, 2, 3), (1, 2, 3)) - del tmp47 - tmp72 = einsum(ints.tmp449, (0, 1, 2, 3), r2.bbb, (3, 1, 4), (0, 2, 4)) * -1 - del ints.tmp449 - tmp75 = einsum(tmp74, (0, 1, 2), tmp48, (0, 3), (1, 3, 2)) * 2 - del tmp48, tmp74 - tmp71 = einsum(r2.aba, (0, 1, 2), ints.tmp295, (0, 3, 2, 4), (3, 1, 4)) - tmp84 = einsum(tmp83, (0, 1), r2.bbb, (2, 1, 3), (0, 2, 3)) * -2 - del tmp83 - tmp82 = einsum(r1.b, (0,), tmp81, (1, 0, 2, 3), (1, 2, 3)) - del tmp81 - tmp80 = einsum(t1.bb, (0, 1), tmp79, (2, 0, 3), (2, 3, 1)) - del tmp79 - tmp63 = einsum(tmp2, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp56 = einsum(r2.aba, (0, 1, 2), ints.tmp156, (0, 1, 2, 3), (3,)) - tmp57 = einsum(ints.tmp131, (0, 1, 2, 3), r2.bbb, (1, 0, 2), (3,)) * -1 - del ints.tmp131 - tmp40 = einsum(r2.bab, (0, 1, 2), ints.tmp156, (1, 0, 3, 2), (3,)) * -1 - del ints.tmp156 - tmp39 = einsum(ints.tmp92, (0, 1, 2, 3), r2.aaa, (1, 0, 2), (3,)) * -1 - del ints.tmp92 - tmp0 = np.copy(ints.tmp24) - tmp0 += ints.tmp4 - tmp67 = np.copy(ints.tmp16) - del ints.tmp16 - tmp67 += v.bbb.xoo - tmp37 = einsum(t1.aa, (0, 1), tmp3, (0, 2), (2, 1)) - tmp54 = np.copy(ints.tmp6) - del ints.tmp6 - tmp54 += v.baa.xoo - tmp52 = np.copy(ints.tmp39) - tmp52 += ints.tmp49 - tmp26 = einsum(r2.bab, (0, 1, 2), ints.tmp132, (3, 0, 4, 2), (3, 1, 4)) * -1 - tmp30 = einsum(tmp29, (0, 1), v.baa.xov, (0, 2, 3), (2, 1, 3)) - del tmp29 - tmp32 = einsum(tmp31, (0, 1), r2.aaa, (2, 0, 3), (2, 1, 3)) * -1 - del tmp31 - tmp34 = einsum(tmp33, (0, 1, 2, 3), r1.a, (0,), (1, 2, 3)) - del tmp33 - tmp28 = einsum(r2.aaa, (0, 1, 2), tmp27, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp27 - tmp8 = einsum(r2.aaa, (0, 1, 2), ints.tmp173, (3, 1, 4, 0), (3, 4, 2)) * -1 - del ints.tmp173 - tmp22 = einsum(tmp21, (0, 1, 2, 3), r1.a, (2,), (0, 1, 3)) * 2 - del tmp21 - tmp20 = einsum(tmp19, (0, 1, 2), t1.aa, (1, 3), (0, 2, 3)) * 2 - del tmp19 - tmp24 = einsum(tmp23, (0, 1), r2.aaa, (2, 1, 3), (2, 0, 3)) * -2 - del tmp23 - tmp13 = einsum(tmp12, (0, 1, 2), tmp11, (0, 3), (3, 1, 2)) * 2 - del tmp12 - tmp94 = np.copy(tmp86) * 2 - del tmp86 - tmp94 += np.transpose(tmp87, (1, 0, 2)) * -2 - del tmp87 - tmp94 += tmp89 - del tmp89 - tmp94 += tmp91 * -2 - del tmp91 - tmp94 += tmp93 - del tmp93 - tmp70 = np.copy(ints.tmp302) - del ints.tmp302 - tmp70 += ints.tmp304 * 2 - del ints.tmp304 - tmp70 += ints.tmp308 - del ints.tmp308 - tmp70 += ints.tmp315 * 2 - del ints.tmp315 - tmp70 += ints.tmp316 - del ints.tmp316 - tmp70 += ints.tmp329 - del ints.tmp329 - tmp70 += ints.tmp330 - del ints.tmp330 - tmp70 += ints.tmp337 * 2 - del ints.tmp337 - tmp70 += ints.tmp340 - del ints.tmp340 - tmp70 += ints.tmp346 - del ints.tmp346 - tmp70 += ints.tmp356 - del ints.tmp356 - tmp70 += ints.tmp362 * 2 - del ints.tmp362 - tmp70 += ints.tmp363 - del ints.tmp363 - tmp70 += ints.tmp365 * 2 - del ints.tmp365 - tmp70 += ints.tmp366 - del ints.tmp366 - tmp70 += ints.tmp373 - del ints.tmp373 - tmp70 += ints.tmp374 - del ints.tmp374 - tmp70 += f.bb.ov * -1 - tmp70 += ints.tmp18 * -1 - del ints.tmp18 - tmp70 += ints.tmp21 * -1 - del ints.tmp21 - tmp70 += ints.tmp286 * -1 - del ints.tmp286 - tmp70 += ints.tmp287 * -2 - del ints.tmp287 - tmp70 += ints.tmp303 * -1 - del ints.tmp303 - tmp70 += ints.tmp305 * -2 - del ints.tmp305 - tmp70 += ints.tmp306 * -1 - del ints.tmp306 - tmp70 += ints.tmp307 * -2 - del ints.tmp307 - tmp70 += ints.tmp328 * -1 - del ints.tmp328 - tmp70 += ints.tmp334 * -1 - del ints.tmp334 - tmp70 += ints.tmp338 * -1 - del ints.tmp338 - tmp70 += ints.tmp339 * -1 - del ints.tmp339 - tmp70 += ints.tmp341 * -1 - del ints.tmp341 - tmp70 += ints.tmp372 * -1 - del ints.tmp372 - tmp85 = np.copy(tmp71) - del tmp71 - tmp85 += tmp72 * 2 - del tmp72 - tmp85 += tmp73 - del tmp73 - tmp85 += tmp75 - del tmp75 - tmp85 += tmp80 - del tmp80 - tmp85 += tmp82 - del tmp82 - tmp85 += tmp84 - del tmp84 - tmp64 = np.copy(ints.tmp277) - del ints.tmp277 - tmp64 += np.transpose(ints.tmp318, (1, 0)) * 2 - del ints.tmp318 - tmp64 += np.transpose(ints.tmp320, (1, 0)) - del ints.tmp320 - tmp64 += f.bb.vv * -1 - tmp64 += np.transpose(ints.tmp275, (1, 0)) * -1 - del ints.tmp275 - tmp64 += np.transpose(ints.tmp278, (1, 0)) * -1 - del ints.tmp278 - tmp64 += tmp63 - del tmp63 - tmp97 = np.copy(ints.tmp396) - del ints.tmp396 - tmp97 += np.transpose(ints.tmp434, (1, 2, 0, 3)) - del ints.tmp434 - tmp97 += ints.tmp440 - del ints.tmp440 - tmp97 += ints.tmp442 - del ints.tmp442 - tmp97 += ints.tmp392 * -1 - del ints.tmp392 - tmp97 += ints.tmp438 * -1 - del ints.tmp438 - tmp95 = np.copy(ints.tmp387) - del ints.tmp387 - tmp95 += ints.tmp394 - del ints.tmp394 - tmp95 += np.transpose(ints.tmp401, (0, 2, 1, 3)) * -1 - del ints.tmp401 - tmp96 = np.copy(tmp56) * 0.5 - tmp96 += tmp57 - tmp69 = np.copy(tmp39) * 2 - tmp69 += tmp40 * -1 - tmp62 = np.copy(ints.tmp276) - del ints.tmp276 - tmp62 += ints.tmp51 * 2 - del ints.tmp51 - tmp62 += ints.tmp54 - del ints.tmp54 - tmp62 += v.bbb.xov - tmp4 = np.copy(f.aa.oo) - tmp4 += np.transpose(ints.tmp11, (1, 0)) - del ints.tmp11 - tmp4 += ints.tmp1 - del ints.tmp1 - tmp4 += np.transpose(ints.tmp27, (1, 0)) * 2 - del ints.tmp27 - tmp4 += np.transpose(ints.tmp30, (1, 0)) - del ints.tmp30 - tmp4 += np.transpose(ints.tmp33, (1, 0)) - del ints.tmp33 - tmp4 += np.transpose(ints.tmp34, (1, 0)) - del ints.tmp34 - tmp4 += np.transpose(ints.tmp9, (1, 0)) - del ints.tmp9 - tmp4 += np.transpose(ints.tmp32, (1, 0)) * -1 - del ints.tmp32 - tmp4 += np.transpose(ints.tmp7, (1, 0)) * -1 - del ints.tmp7 - tmp68 = einsum(tmp0, (0, 1, 2, 3), r2.bab, (4, 1, 3), (0, 2, 4)) * 0.5 - tmp68 += einsum(r2.bab, (0, 1, 2), tmp66, (3, 0, 4, 2), (1, 4, 3)) * 0.5 - del tmp66 - tmp68 += einsum(tmp67, (0, 1, 2), tmp11, (0, 3), (3, 2, 1)) * 0.5 - del tmp67 - tmp61 = np.copy(ints.tmp210) - tmp61 += ints.tmp214 - tmp61 += ints.tmp249 - tmp61 += np.transpose(ints.tmp252, (1, 0, 2, 3)) - tmp61 += np.transpose(ints.tmp264, (0, 1, 3, 2)) - tmp65 = np.copy(ints.tmp24) - del ints.tmp24 - tmp65 += ints.tmp281 - del ints.tmp281 - tmp65 += np.transpose(ints.tmp292, (1, 0, 2, 3)) - del ints.tmp292 - tmp65 += np.transpose(ints.tmp293, (1, 0, 2, 3)) * 2 - del ints.tmp293 - tmp65 += np.transpose(ints.tmp310, (1, 0, 2, 3)) - del ints.tmp310 - tmp65 += ints.tmp326 - del ints.tmp326 - tmp65 += ints.tmp327 - del ints.tmp327 - tmp65 += ints.tmp342 - del ints.tmp342 - tmp65 += ints.tmp350 - del ints.tmp350 - tmp65 += ints.tmp352 * 2 - del ints.tmp352 - tmp65 += np.transpose(ints.tmp358, (1, 0, 2, 3)) - del ints.tmp358 - tmp65 += ints.tmp4 - del ints.tmp4 - tmp65 += ints.tmp284 * -1 - del ints.tmp284 - tmp65 += np.transpose(ints.tmp289, (1, 0, 2, 3)) * -1 - del ints.tmp289 - tmp65 += ints.tmp291 * -1 - del ints.tmp291 - tmp65 += ints.tmp317 * -1 - del ints.tmp317 - tmp65 += ints.tmp325 * -1 - del ints.tmp325 - tmp65 += ints.tmp344 * -1 - del ints.tmp344 - tmp65 += ints.tmp351 * -1 - del ints.tmp351 - tmp65 += ints.tmp354 * -1 - del ints.tmp354 - tmp65 += ints.tmp364 * -1 - del ints.tmp364 - tmp65 += np.transpose(ints.tmp367, (1, 0, 2, 3)) * -1 - del ints.tmp367 - tmp60 = np.copy(ints.tmp279) - del ints.tmp279 - tmp60 += ints.tmp357 - del ints.tmp357 - tmp60 += ints.tmp322 * -1 - del ints.tmp322 - tmp7 = np.copy(f.bb.oo) - tmp7 += ints.tmp36 - del ints.tmp36 - tmp7 += np.transpose(ints.tmp42, (1, 0)) - del ints.tmp42 - tmp7 += np.transpose(ints.tmp43, (1, 0)) - del ints.tmp43 - tmp7 += np.transpose(ints.tmp52, (1, 0)) * 2 - del ints.tmp52 - tmp7 += np.transpose(ints.tmp55, (1, 0)) - del ints.tmp55 - tmp7 += np.transpose(ints.tmp58, (1, 0)) - del ints.tmp58 - tmp7 += np.transpose(ints.tmp59, (1, 0)) - del ints.tmp59 - tmp7 += np.transpose(ints.tmp41, (1, 0)) * -1 - del ints.tmp41 - tmp7 += np.transpose(ints.tmp57, (1, 0)) * -1 - del ints.tmp57 - tmp43 = np.copy(ints.tmp116) * 2 - del ints.tmp116 - tmp43 += ints.tmp117 - del ints.tmp117 - tmp43 += ints.tmp137 * 2 - del ints.tmp137 - tmp43 += ints.tmp139 - del ints.tmp139 - tmp43 += ints.tmp144 - del ints.tmp144 - tmp43 += ints.tmp145 - del ints.tmp145 - tmp43 += ints.tmp166 - del ints.tmp166 - tmp43 += ints.tmp170 - del ints.tmp170 - tmp43 += ints.tmp177 * 2 - del ints.tmp177 - tmp43 += ints.tmp178 - del ints.tmp178 - tmp43 += ints.tmp185 * 2 - del ints.tmp185 - tmp43 += ints.tmp186 - del ints.tmp186 - tmp43 += ints.tmp201 - del ints.tmp201 - tmp43 += ints.tmp202 - del ints.tmp202 - tmp43 += ints.tmp78 * 2 - del ints.tmp78 - tmp43 += ints.tmp81 - del ints.tmp81 - tmp43 += ints.tmp98 - del ints.tmp98 - tmp43 += f.aa.ov * -1 - tmp43 += ints.tmp101 * -2 - del ints.tmp101 - tmp43 += ints.tmp102 * -1 - del ints.tmp102 - tmp43 += ints.tmp138 * -2 - del ints.tmp138 - tmp43 += ints.tmp140 * -1 - del ints.tmp140 - tmp43 += ints.tmp141 * -2 - del ints.tmp141 - tmp43 += ints.tmp142 * -1 - del ints.tmp142 - tmp43 += ints.tmp143 * -1 - del ints.tmp143 - tmp43 += ints.tmp14 * -1 - del ints.tmp14 - tmp43 += ints.tmp19 * -1 - del ints.tmp19 - tmp43 += ints.tmp200 * -1 - del ints.tmp200 - tmp43 += ints.tmp61 * -1 - del ints.tmp61 - tmp43 += ints.tmp79 * -1 - del ints.tmp79 - tmp43 += ints.tmp80 * -1 - del ints.tmp80 - tmp43 += ints.tmp82 * -1 - del ints.tmp82 - tmp50 = np.copy(ints.tmp26) * 2 - del ints.tmp26 - tmp50 += ints.tmp29 - del ints.tmp29 - tmp50 += ints.tmp69 - del ints.tmp69 - tmp50 += v.baa.xov - tmp46 = np.copy(ints.tmp210) - del ints.tmp210 - tmp46 += ints.tmp214 - del ints.tmp214 - tmp46 += ints.tmp249 - del ints.tmp249 - tmp46 += np.transpose(ints.tmp252, (1, 0, 2, 3)) - del ints.tmp252 - tmp46 += np.transpose(ints.tmp264, (0, 1, 3, 2)) - del ints.tmp264 - tmp51 = np.copy(ints.tmp208) - del ints.tmp208 - tmp51 += np.transpose(ints.tmp219, (0, 2, 1, 3)) - del ints.tmp219 - tmp51 += np.transpose(ints.tmp220, (0, 2, 1, 3)) * 2 - del ints.tmp220 - tmp51 += np.transpose(ints.tmp228, (0, 2, 1, 3)) - del ints.tmp228 - tmp51 += ints.tmp242 - del ints.tmp242 - tmp51 += ints.tmp243 - del ints.tmp243 - tmp51 += ints.tmp248 - del ints.tmp248 - tmp51 += ints.tmp256 - del ints.tmp256 - tmp51 += ints.tmp258 * 2 - del ints.tmp258 - tmp51 += np.transpose(ints.tmp263, (0, 2, 1, 3)) - del ints.tmp263 - tmp51 += ints.tmp39 - tmp51 += ints.tmp49 - tmp51 += ints.tmp212 * -1 - del ints.tmp212 - tmp51 += np.transpose(ints.tmp216, (0, 2, 1, 3)) * -1 - del ints.tmp216 - tmp51 += ints.tmp218 * -1 - del ints.tmp218 - tmp51 += ints.tmp233 * -1 - del ints.tmp233 - tmp51 += ints.tmp241 * -1 - del ints.tmp241 - tmp51 += ints.tmp251 * -1 - del ints.tmp251 - tmp51 += ints.tmp257 * -1 - del ints.tmp257 - tmp51 += ints.tmp260 * -1 - del ints.tmp260 - tmp51 += ints.tmp268 * -1 - del ints.tmp268 - tmp51 += np.transpose(ints.tmp269, (0, 2, 1, 3)) * -1 - del ints.tmp269 - tmp38 = np.copy(np.transpose(ints.tmp124, (1, 0))) * 2 - del ints.tmp124 - tmp38 += np.transpose(ints.tmp126, (1, 0)) - del ints.tmp126 - tmp38 += ints.tmp70 - del ints.tmp70 - tmp38 += f.aa.vv * -1 - tmp38 += np.transpose(ints.tmp67, (1, 0)) * -1 - del ints.tmp67 - tmp38 += np.transpose(ints.tmp72, (1, 0)) * -1 - del ints.tmp72 - tmp38 += tmp37 - del tmp37 - tmp45 = np.copy(ints.tmp206) - del ints.tmp206 - tmp45 += ints.tmp262 - del ints.tmp262 - tmp45 += ints.tmp236 * -1 - del ints.tmp236 - tmp55 = einsum(tmp14, (0, 1, 2, 3), r2.aba, (2, 4, 3), (0, 1, 4)) - del tmp14 - tmp55 += einsum(r2.aba, (0, 1, 2), tmp52, (3, 4, 1, 2), (0, 3, 4)) - del tmp52 - tmp55 += einsum(tmp53, (0, 1), tmp54, (0, 2, 3), (2, 3, 1)) - del tmp53, tmp54 - tmp44 = np.copy(ints.tmp128) * 2 - del ints.tmp128 - tmp44 += ints.tmp168 - del ints.tmp168 - tmp44 += ints.tmp74 - del ints.tmp74 - tmp58 = np.copy(tmp56) - del tmp56 - tmp58 += tmp57 * 2 - del tmp57 - tmp35 = np.copy(tmp26) - del tmp26 - tmp35 += np.transpose(tmp28, (1, 0, 2)) * -2 - del tmp28 - tmp35 += np.transpose(tmp30, (1, 0, 2)) - del tmp30 - tmp35 += np.transpose(tmp32, (1, 0, 2)) * -2 - del tmp32 - tmp35 += tmp34 - del tmp34 - tmp36 = np.copy(np.transpose(ints.tmp85, (0, 2, 1, 3))) - del ints.tmp85 - tmp36 += np.transpose(ints.tmp93, (0, 2, 1, 3)) - del ints.tmp93 - tmp36 += ints.tmp103 * -1 - del ints.tmp103 - tmp41 = np.copy(tmp39) - del tmp39 - tmp41 += tmp40 * -0.5 - del tmp40 - tmp25 = np.copy(tmp8) * 2 - del tmp8 - tmp25 += np.transpose(tmp13, (1, 0, 2)) - del tmp13 - tmp25 += tmp20 - del tmp20 - tmp25 += tmp22 - del tmp22 - tmp25 += np.transpose(tmp24, (1, 0, 2)) - del tmp24 - tmp42 = np.copy(ints.tmp152) - del ints.tmp152 - tmp42 += np.transpose(ints.tmp161, (2, 0, 1, 3)) - del ints.tmp161 - tmp42 += np.transpose(ints.tmp163, (2, 0, 1, 3)) - del ints.tmp163 - tmp42 += np.transpose(ints.tmp95, (2, 0, 1, 3)) - del ints.tmp95 - tmp42 += np.transpose(ints.tmp159, (2, 0, 1, 3)) * -1 - del ints.tmp159 - tmp42 += np.transpose(ints.tmp90, (2, 0, 1, 3)) * -1 - del ints.tmp90 - tmp5 = np.copy(ints.tmp39) - del ints.tmp39 - tmp5 += ints.tmp49 - del ints.tmp49 - tmp6 = np.copy(ints.tmp37) - del ints.tmp37 - tmp6 += ints.tmp47 * -1 - del ints.tmp47 - tmp1 = np.copy(ints.tmp22) - del ints.tmp22 - tmp1 += ints.tmp2 * -1 - del ints.tmp2 - r2new.bbb = np.copy(tmp85) * -1 - r2new.bbb += np.transpose(tmp85, (1, 0, 2)) - del tmp85 - r2new.bbb += tmp94 - r2new.bbb += np.transpose(tmp94, (1, 0, 2)) * -1 - del tmp94 - r2new.bbb += einsum(tmp95, (0, 1, 2, 3), r2.bbb, (2, 3, 4), (0, 1, 4)) * 2 - del tmp95 - r2new.bbb += einsum(tmp64, (0, 1), r2.bbb, (2, 3, 0), (2, 3, 1)) * -2 - r2new.bbb += einsum(tmp96, (0,), t2.bbbb, (1, 2, 3, 0), (1, 2, 3)) * -4 - del tmp96 - r2new.bbb += einsum(r1.b, (0,), tmp97, (1, 2, 0, 3), (2, 1, 3)) * -2 - del tmp97 - r2new.bbb += einsum(tmp70, (0, 1), r1.b, (2,), (2, 0, 1)) * -1 - r2new.bbb += einsum(r1.b, (0,), tmp70, (1, 2), (1, 0, 2)) - r2new.bab = einsum(r2.aaa, (0, 1, 2), ints.tmp295, (1, 3, 2, 4), (3, 0, 4)) * 2 - del ints.tmp295 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp59, (3, 0, 4, 2), (3, 1, 4)) * -1 - del tmp59 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp60, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp60 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp61, (3, 1, 4, 0), (4, 3, 2)) - del tmp61 - r2new.bab += einsum(tmp62, (0, 1, 2), tmp11, (0, 3), (1, 3, 2)) * -1 - del tmp11, tmp62 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp64, (2, 3), (0, 1, 3)) * -1 - del tmp64 - r2new.bab += einsum(tmp65, (0, 1, 2, 3), r1.a, (1,), (2, 0, 3)) - del tmp65 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp4, (1, 3), (0, 3, 2)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp7, (0, 3), (3, 1, 2)) * -1 - r2new.bab += einsum(tmp68, (0, 1, 2), t1.bb, (1, 3), (2, 0, 3)) * 2 - del tmp68 - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp69, (2,), (1, 0, 3)) * -1 - del tmp69 - r2new.bab += einsum(r1.a, (0,), tmp70, (1, 2), (1, 0, 2)) - del tmp70 - r2new.aba = einsum(r2.bbb, (0, 1, 2), ints.tmp132, (3, 1, 4, 2), (3, 0, 4)) * 2 - del ints.tmp132 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp44, (3, 0, 4, 2), (3, 1, 4)) * -1 - del tmp44 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp45, (3, 1, 4, 2), (0, 3, 4)) * -1 - del tmp45 - r2new.aba += einsum(tmp46, (0, 1, 2, 3), r2.aba, (1, 3, 4), (0, 2, 4)) - del tmp46 - r2new.aba += einsum(tmp50, (0, 1, 2), tmp49, (0, 3), (1, 3, 2)) * -2 - del tmp49, tmp50 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp38, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(tmp51, (0, 1, 2, 3), r1.b, (2,), (0, 1, 3)) - del tmp51 - r2new.aba += einsum(tmp4, (0, 1), r2.aba, (0, 2, 3), (1, 2, 3)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp7, (1, 3), (0, 3, 2)) * -1 - r2new.aba += einsum(t1.aa, (0, 1), tmp55, (2, 0, 3), (2, 3, 1)) - del tmp55 - r2new.aba += einsum(tmp58, (0,), t2.abab, (1, 2, 3, 0), (1, 2, 3)) * -1 - del tmp58 - r2new.aba += einsum(tmp43, (0, 1), r1.b, (2,), (0, 2, 1)) - r2new.aaa = np.copy(tmp25) * -1 - r2new.aaa += np.transpose(tmp25, (1, 0, 2)) - del tmp25 - r2new.aaa += tmp35 - r2new.aaa += np.transpose(tmp35, (1, 0, 2)) * -1 - del tmp35 - r2new.aaa += einsum(tmp36, (0, 1, 2, 3), r2.aaa, (1, 3, 4), (0, 2, 4)) * 2 - del tmp36 - r2new.aaa += einsum(tmp38, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp38 - r2new.aaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp41, (3,), (0, 1, 2)) * -4 - del tmp41 - r2new.aaa += einsum(tmp42, (0, 1, 2, 3), r1.a, (0,), (2, 1, 3)) * -2 - del tmp42 - r2new.aaa += einsum(tmp43, (0, 1), r1.a, (2,), (2, 0, 1)) * -1 - r2new.aaa += einsum(r1.a, (0,), tmp43, (1, 2), (1, 0, 2)) - del tmp43 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp5, (0, 3, 1, 2), (3,)) - del tmp5 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp6, (3, 0, 1, 2), (3,)) * -2 - del tmp6 - r1new.b += einsum(tmp2, (0, 1), r2.bbb, (2, 0, 1), (2,)) * 2 - r1new.b += einsum(r2.aba, (0, 1, 2), tmp3, (0, 2), (1,)) * -1 - r1new.b += einsum(r1.b, (0,), tmp7, (0, 1), (1,)) * -1 - del tmp7 - r1new.a = einsum(r2.bab, (0, 1, 2), tmp0, (3, 1, 0, 2), (3,)) - del tmp0 - r1new.a += einsum(tmp1, (0, 1, 2, 3), r2.aaa, (2, 1, 3), (0,)) * -2 - del tmp1 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp2, (0, 2), (1,)) * -1 - del tmp2 - r1new.a += einsum(r2.aaa, (0, 1, 2), tmp3, (1, 2), (0,)) * 2 - del tmp3 - r1new.a += einsum(r1.a, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:20:15.106031. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp100 : array - tmp105 : array - tmp11 : array - tmp115 : array - tmp117 : array - tmp119 : array - tmp12 : array - tmp122 : array - tmp124 : array - tmp126 : array - tmp13 : array - tmp130 : array - tmp135 : array - tmp136 : array - tmp137 : array - tmp138 : array - tmp147 : array - tmp148 : array - tmp149 : array - tmp15 : array - tmp156 : array - tmp157 : array - tmp159 : array - tmp160 : array - tmp162 : array - tmp167 : array - tmp17 : array - tmp171 : array - tmp172 : array - tmp173 : array - tmp175 : array - tmp177 : array - tmp178 : array - tmp179 : array - tmp18 : array - tmp180 : array - tmp181 : array - tmp183 : array - tmp184 : array - tmp185 : array - tmp186 : array - tmp187 : array - tmp19 : array - tmp190 : array - tmp193 : array - tmp195 : array - tmp197 : array - tmp2 : array - tmp20 : array - tmp205 : array - tmp206 : array - tmp207 : array - tmp218 : array - tmp22 : array - tmp221 : array - tmp227 : array - tmp23 : array - tmp237 : array - tmp239 : array - tmp243 : array - tmp245 : array - tmp250 : array - tmp256 : array - tmp26 : array - tmp265 : array - tmp266 : array - tmp267 : array - tmp276 : array - tmp279 : array - tmp29 : array - tmp290 : array - tmp293 : array - tmp298 : array - tmp299 : array - tmp30 : array - tmp300 : array - tmp301 : array - tmp302 : array - tmp303 : array - tmp305 : array - tmp315 : array - tmp316 : array - tmp318 : array - tmp319 : array - tmp32 : array - tmp321 : array - tmp322 : array - tmp323 : array - tmp325 : array - tmp327 : array - tmp328 : array - tmp33 : array - tmp330 : array - tmp331 : array - tmp332 : array - tmp333 : array - tmp335 : array - tmp336 : array - tmp337 : array - tmp341 : array - tmp342 : array - tmp343 : array - tmp344 : array - tmp345 : array - tmp346 : array - tmp347 : array - tmp353 : array - tmp354 : array - tmp355 : array - tmp356 : array - tmp357 : array - tmp360 : array - tmp364 : array - tmp365 : array - tmp366 : array - tmp367 : array - tmp368 : array - tmp370 : array - tmp371 : array - tmp374 : array - tmp375 : array - tmp376 : array - tmp380 : array - tmp383 : array - tmp387 : array - tmp388 : array - tmp389 : array - tmp390 : array - tmp391 : array - tmp392 : array - tmp393 : array - tmp396 : array - tmp4 : array - tmp40 : array - tmp411 : array - tmp413 : array - tmp415 : array - tmp42 : array - tmp425 : array - tmp430 : array - tmp44 : array - tmp45 : array - tmp453 : array - tmp46 : array - tmp469 : array - tmp47 : array - tmp471 : array - tmp481 : array - tmp485 : array - tmp51 : array - tmp56 : array - tmp57 : array - tmp59 : array - tmp60 : array - tmp67 : array - tmp68 : array - tmp7 : array - tmp78 : array - tmp8 : array - tmp80 : array - tmp82 : array - tmp86 : array - tmp89 : array - tmp9 : array - tmp94 : array - tmp95 : array - tmp96 : array - tmp97 : array - tmp98 : array - tmp99 : array - """ - - tmp6 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp10 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (1, 2), (0,)) - tmp17 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp12 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp22 = einsum(v.bbb.xov, (0, 1, 2), tmp6, (0,), (1, 2)) - tmp19 = einsum(v.bbb.xov, (0, 1, 2), tmp10, (0,), (1, 2)) - tmp18 = einsum(v.bbb.xov, (0, 1, 2), tmp17, (0, 1, 3), (3, 2)) - tmp59 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp56 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp20 = einsum(tmp10, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp15 = einsum(v.baa.xov, (0, 1, 2), tmp6, (0,), (1, 2)) - tmp13 = einsum(tmp12, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp32 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp29 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp45 = einsum(v.bbb.xvv, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp343 = einsum(v.bbb.xov, (0, 1, 2), tmp17, (0, 3, 4), (3, 1, 4, 2)) - tmp360 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp40 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp51 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp23 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp2 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp302 = einsum(v.bbb.xoo, (0, 1, 2), tmp6, (0,), (1, 2)) - tmp301 = einsum(v.bbb.xoo, (0, 1, 2), tmp10, (0,), (1, 2)) - tmp300 = einsum(tmp17, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (3, 2)) - tmp303 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp337 = einsum(tmp22, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp336 = einsum(tmp19, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp335 = einsum(tmp18, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp325 = einsum(v.bbb.xov, (0, 1, 2), tmp59, (0, 3, 2), (3, 1)) - tmp323 = einsum(v.bbb.xov, (0, 1, 2), tmp56, (0, 3, 2), (3, 1)) - tmp327 = einsum(tmp17, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp316 = einsum(f.bb.ov, (0, 1), t1.bb, (2, 1), (0, 2)) - tmp47 = einsum(v.bbb.xvv, (0, 1, 2), tmp6, (0,), (1, 2)) - tmp44 = einsum(tmp10, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp26 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp42 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 4, 1, 2)) - tmp8 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp179 = einsum(tmp12, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp136 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp4 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp197 = einsum(tmp20, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp195 = einsum(tmp15, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp193 = einsum(tmp13, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp11 = einsum(v.baa.xvv, (0, 1, 2), tmp10, (0,), (1, 2)) - tmp7 = einsum(v.baa.xvv, (0, 1, 2), tmp6, (0,), (1, 2)) - tmp175 = einsum(tmp32, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp173 = einsum(tmp29, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp177 = einsum(v.baa.xov, (0, 1, 2), tmp12, (0, 3, 4), (3, 1, 4, 2)) - tmp157 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp126 = einsum(tmp10, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - del tmp10 - tmp124 = einsum(v.baa.xoo, (0, 1, 2), tmp6, (0,), (1, 2)) - del tmp6 - tmp122 = einsum(v.baa.xoo, (0, 1, 2), tmp12, (0, 2, 3), (1, 3)) - tmp130 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp485 = einsum(v.bbb.xov, (0, 1, 2), tmp45, (0, 3, 4), (3, 1, 2, 4)) - tmp481 = einsum(t2.bbbb, (0, 1, 2, 3), tmp343, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp471 = einsum(v.bbb.xvv, (0, 1, 2), tmp45, (0, 3, 4), (3, 1, 2, 4)) - tmp469 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp453 = einsum(tmp360, (0, 1, 2, 3), t2.bbbb, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp430 = einsum(v.bbb.xov, (0, 1, 2), tmp59, (0, 3, 4), (3, 1, 4, 2)) - tmp425 = einsum(v.bbb.xov, (0, 1, 2), tmp56, (0, 3, 4), (3, 1, 4, 2)) - tmp415 = einsum(v.bbb.xvv, (0, 1, 2), tmp59, (0, 3, 4), (3, 4, 1, 2)) - tmp413 = einsum(t2.bbbb, (0, 1, 2, 3), tmp40, (1, 4, 3, 5), (0, 2, 5, 4)) - tmp411 = einsum(v.bbb.xvv, (0, 1, 2), tmp56, (0, 3, 4), (3, 4, 1, 2)) - tmp396 = einsum(tmp56, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp393 = einsum(tmp59, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp392 = einsum(tmp22, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp391 = einsum(tmp20, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp390 = einsum(tmp19, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp389 = einsum(t2.bbbb, (0, 1, 2, 3), tmp18, (1, 3), (0, 2)) - tmp388 = einsum(t2.abab, (0, 1, 2, 3), tmp15, (0, 2), (1, 3)) - tmp387 = einsum(t2.abab, (0, 1, 2, 3), tmp13, (0, 2), (1, 3)) - tmp383 = einsum(t2.bbbb, (0, 1, 2, 3), tmp51, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp380 = einsum(tmp23, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 4, 2, 5)) - tmp376 = einsum(v.baa.xvv, (0, 1, 2), tmp56, (0, 3, 4), (3, 1, 2, 4)) - tmp375 = einsum(t2.abab, (0, 1, 2, 3), tmp2, (0, 4, 2, 5), (1, 5, 4, 3)) - tmp374 = einsum(v.baa.xvv, (0, 1, 2), tmp59, (0, 3, 4), (3, 1, 2, 4)) - tmp371 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp370 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp368 = einsum(tmp302, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp367 = einsum(tmp301, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp366 = einsum(tmp300, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp365 = einsum(t2.abab, (0, 1, 2, 3), tmp303, (0, 4, 1, 2), (4, 3)) - tmp364 = einsum(t2.bbbb, (0, 1, 2, 3), tmp360, (4, 0, 1, 3), (4, 2)) - tmp357 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp356 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp355 = einsum(tmp337, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp354 = einsum(tmp336, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp353 = einsum(t1.bb, (0, 1), tmp335, (2, 0), (2, 1)) - tmp347 = einsum(t1.bb, (0, 1), tmp325, (2, 0), (2, 1)) - tmp346 = einsum(tmp323, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp345 = einsum(t2.abab, (0, 1, 2, 3), tmp327, (0, 4, 1, 2), (4, 3)) - tmp344 = einsum(t2.bbbb, (0, 1, 2, 3), tmp343, (4, 1, 0, 3), (4, 2)) - tmp342 = einsum(v.baa.xvv, (0, 1, 2), tmp17, (0, 3, 4), (3, 4, 1, 2)) - tmp341 = einsum(tmp316, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp333 = einsum(tmp45, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp332 = einsum(tmp47, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp331 = einsum(tmp45, (0, 1, 2), tmp17, (0, 3, 1), (3, 2)) - tmp330 = einsum(tmp44, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp328 = einsum(t2.abab, (0, 1, 2, 3), tmp327, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp322 = einsum(v.bbb.xvv, (0, 1, 2), tmp59, (0, 3, 2), (3, 1)) - tmp321 = einsum(tmp56, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) * -1 - tmp319 = einsum(v.bbb.xvv, (0, 1, 2), tmp17, (0, 3, 4), (3, 4, 1, 2)) - tmp318 = einsum(v.baa.xvv, (0, 1, 2), tmp45, (0, 3, 4), (3, 1, 2, 4)) - tmp315 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp305 = einsum(t2.abab, (0, 1, 2, 3), tmp303, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp299 = einsum(tmp45, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (3, 2)) - tmp298 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp293 = einsum(t2.abab, (0, 1, 2, 3), tmp26, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp290 = einsum(t2.abab, (0, 1, 2, 3), tmp42, (0, 4, 5, 3), (1, 2, 4, 5)) - tmp279 = einsum(tmp29, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp276 = einsum(v.bbb.xov, (0, 1, 2), tmp32, (0, 3, 4), (3, 1, 4, 2)) - tmp267 = einsum(tmp29, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp266 = einsum(tmp40, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 5, 3, 1)) - tmp265 = einsum(tmp32, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp256 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp250 = einsum(tmp12, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp245 = einsum(v.bbb.xov, (0, 1, 2), tmp8, (0, 3, 4), (3, 1, 4, 2)) - tmp243 = einsum(t2.abab, (0, 1, 2, 3), tmp179, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp239 = einsum(v.bbb.xvv, (0, 1, 2), tmp8, (0, 3, 4), (3, 4, 1, 2)) - tmp237 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp227 = einsum(t2.abab, (0, 1, 2, 3), tmp136, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp221 = einsum(t2.abab, (0, 1, 2, 3), tmp26, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp218 = einsum(t2.abab, (0, 1, 2, 3), tmp4, (1, 4, 2, 5), (0, 4, 3, 5)) - tmp207 = einsum(t1.aa, (0, 1), tmp197, (2, 0), (2, 1)) - tmp206 = einsum(tmp195, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp205 = einsum(t1.aa, (0, 1), tmp193, (2, 0), (2, 1)) - tmp190 = einsum(tmp8, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 4, 2)) - tmp187 = einsum(tmp11, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp186 = einsum(tmp12, (0, 1, 2), tmp8, (0, 2, 3), (1, 3)) - tmp185 = einsum(t1.aa, (0, 1), tmp7, (2, 1), (0, 2)) - tmp184 = einsum(t1.aa, (0, 1), tmp175, (2, 0), (2, 1)) - tmp183 = einsum(t1.aa, (0, 1), tmp173, (2, 0), (2, 1)) - tmp181 = einsum(t2.aaaa, (0, 1, 2, 3), tmp177, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp180 = einsum(t2.abab, (0, 1, 2, 3), tmp179, (4, 0, 1, 3), (4, 2)) - tmp178 = einsum(t2.aaaa, (0, 1, 2, 3), tmp177, (4, 1, 0, 3), (4, 2)) - tmp172 = einsum(tmp32, (0, 1, 2), v.baa.xvv, (0, 3, 2), (1, 3)) - tmp171 = einsum(v.baa.xvv, (0, 1, 2), tmp29, (0, 3, 2), (3, 1)) * -1 - tmp167 = einsum(tmp12, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp162 = einsum(tmp8, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp160 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp159 = einsum(t1.aa, (0, 1), tmp157, (0, 2), (2, 1)) - tmp156 = einsum(t1.aa, (0, 1), f.aa.vv, (2, 1), (0, 2)) - tmp149 = einsum(t1.aa, (0, 1), tmp126, (2, 0), (2, 1)) - tmp148 = einsum(tmp124, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp147 = einsum(tmp122, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp138 = einsum(t2.aaaa, (0, 1, 2, 3), tmp130, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp137 = einsum(t2.abab, (0, 1, 2, 3), tmp136, (4, 0, 1, 3), (4, 2)) - tmp135 = einsum(t2.aaaa, (0, 1, 2, 3), tmp130, (4, 0, 1, 3), (4, 2)) - tmp119 = einsum(tmp8, (0, 1, 2), v.baa.xoo, (0, 3, 1), (3, 2)) - tmp117 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp115 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp105 = einsum(v.baa.xov, (0, 1, 2), tmp32, (0, 3, 4), (3, 1, 4, 2)) - tmp100 = einsum(v.baa.xov, (0, 1, 2), tmp29, (0, 3, 4), (3, 1, 4, 2)) - tmp99 = einsum(t2.abab, (0, 1, 2, 3), tmp22, (1, 3), (0, 2)) - tmp98 = einsum(t2.aaaa, (0, 1, 2, 3), tmp20, (1, 3), (0, 2)) - tmp97 = einsum(tmp19, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp96 = einsum(tmp18, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp95 = einsum(t2.aaaa, (0, 1, 2, 3), tmp15, (1, 3), (0, 2)) - tmp94 = einsum(t2.aaaa, (0, 1, 2, 3), tmp13, (1, 3), (0, 2)) - tmp89 = einsum(t2.abab, (0, 1, 2, 3), tmp51, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp86 = einsum(tmp23, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp82 = einsum(v.baa.xvv, (0, 1, 2), tmp32, (0, 3, 4), (3, 4, 1, 2)) - tmp80 = einsum(t2.aaaa, (0, 1, 2, 3), tmp2, (1, 4, 3, 5), (0, 2, 5, 4)) - tmp78 = einsum(tmp29, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp68 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp67 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp60 = einsum(v.bbb.xov, (0, 1, 2), tmp59, (0, 1, 3), (3, 2)) - tmp57 = einsum(v.bbb.xov, (0, 1, 2), tmp56, (0, 1, 3), (3, 2)) - tmp46 = einsum(v.bbb.xov, (0, 1, 2), tmp45, (0, 1, 3), (2, 3)) - tmp33 = einsum(tmp32, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp30 = einsum(tmp29, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp9 = einsum(tmp8, (0, 1, 2), v.baa.xov, (0, 1, 3), (3, 2)) - - return {f"tmp100": tmp100, f"tmp105": tmp105, f"tmp11": tmp11, f"tmp115": tmp115, f"tmp117": tmp117, f"tmp119": tmp119, f"tmp12": tmp12, f"tmp122": tmp122, f"tmp124": tmp124, f"tmp126": tmp126, f"tmp13": tmp13, f"tmp130": tmp130, f"tmp135": tmp135, f"tmp136": tmp136, f"tmp137": tmp137, f"tmp138": tmp138, f"tmp147": tmp147, f"tmp148": tmp148, f"tmp149": tmp149, f"tmp15": tmp15, f"tmp156": tmp156, f"tmp157": tmp157, f"tmp159": tmp159, f"tmp160": tmp160, f"tmp162": tmp162, f"tmp167": tmp167, f"tmp17": tmp17, f"tmp171": tmp171, f"tmp172": tmp172, f"tmp173": tmp173, f"tmp175": tmp175, f"tmp177": tmp177, f"tmp178": tmp178, f"tmp179": tmp179, f"tmp18": tmp18, f"tmp180": tmp180, f"tmp181": tmp181, f"tmp183": tmp183, f"tmp184": tmp184, f"tmp185": tmp185, f"tmp186": tmp186, f"tmp187": tmp187, f"tmp19": tmp19, f"tmp190": tmp190, f"tmp193": tmp193, f"tmp195": tmp195, f"tmp197": tmp197, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp205": tmp205, f"tmp206": tmp206, f"tmp207": tmp207, f"tmp218": tmp218, f"tmp22": tmp22, f"tmp221": tmp221, f"tmp227": tmp227, f"tmp23": tmp23, f"tmp237": tmp237, f"tmp239": tmp239, f"tmp243": tmp243, f"tmp245": tmp245, f"tmp250": tmp250, f"tmp256": tmp256, f"tmp26": tmp26, f"tmp265": tmp265, f"tmp266": tmp266, f"tmp267": tmp267, f"tmp276": tmp276, f"tmp279": tmp279, f"tmp29": tmp29, f"tmp290": tmp290, f"tmp293": tmp293, f"tmp298": tmp298, f"tmp299": tmp299, f"tmp30": tmp30, f"tmp300": tmp300, f"tmp301": tmp301, f"tmp302": tmp302, f"tmp303": tmp303, f"tmp305": tmp305, f"tmp315": tmp315, f"tmp316": tmp316, f"tmp318": tmp318, f"tmp319": tmp319, f"tmp32": tmp32, f"tmp321": tmp321, f"tmp322": tmp322, f"tmp323": tmp323, f"tmp325": tmp325, f"tmp327": tmp327, f"tmp328": tmp328, f"tmp33": tmp33, f"tmp330": tmp330, f"tmp331": tmp331, f"tmp332": tmp332, f"tmp333": tmp333, f"tmp335": tmp335, f"tmp336": tmp336, f"tmp337": tmp337, f"tmp341": tmp341, f"tmp342": tmp342, f"tmp343": tmp343, f"tmp344": tmp344, f"tmp345": tmp345, f"tmp346": tmp346, f"tmp347": tmp347, f"tmp353": tmp353, f"tmp354": tmp354, f"tmp355": tmp355, f"tmp356": tmp356, f"tmp357": tmp357, f"tmp360": tmp360, f"tmp364": tmp364, f"tmp365": tmp365, f"tmp366": tmp366, f"tmp367": tmp367, f"tmp368": tmp368, f"tmp370": tmp370, f"tmp371": tmp371, f"tmp374": tmp374, f"tmp375": tmp375, f"tmp376": tmp376, f"tmp380": tmp380, f"tmp383": tmp383, f"tmp387": tmp387, f"tmp388": tmp388, f"tmp389": tmp389, f"tmp390": tmp390, f"tmp391": tmp391, f"tmp392": tmp392, f"tmp393": tmp393, f"tmp396": tmp396, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp411": tmp411, f"tmp413": tmp413, f"tmp415": tmp415, f"tmp42": tmp42, f"tmp425": tmp425, f"tmp430": tmp430, f"tmp44": tmp44, f"tmp45": tmp45, f"tmp453": tmp453, f"tmp46": tmp46, f"tmp469": tmp469, f"tmp47": tmp47, f"tmp471": tmp471, f"tmp481": tmp481, f"tmp485": tmp485, f"tmp51": tmp51, f"tmp56": tmp56, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp60": tmp60, f"tmp67": tmp67, f"tmp68": tmp68, f"tmp7": tmp7, f"tmp78": tmp78, f"tmp8": tmp8, f"tmp80": tmp80, f"tmp82": tmp82, f"tmp86": tmp86, f"tmp89": tmp89, f"tmp9": tmp9, f"tmp94": tmp94, f"tmp95": tmp95, f"tmp96": tmp96, f"tmp97": tmp97, f"tmp98": tmp98, f"tmp99": tmp99} - -def hbar_matvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:20:15.278661. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp63 = einsum(v.bbb.xov, (0, 1, 2), r2.bbb, (3, 2, 1), (0, 3)) - tmp62 = einsum(r2.aba, (0, 1, 2), v.baa.xov, (3, 2, 0), (3, 1)) - tmp14 = einsum(r2.aaa, (0, 1, 2), v.baa.xov, (3, 2, 1), (3, 0)) - tmp15 = einsum(r2.bab, (0, 1, 2), v.bbb.xov, (3, 2, 0), (3, 1)) * -1 - tmp81 = np.copy(ints.tmp17) - del ints.tmp17 - tmp81 += v.bbb.xoo - tmp64 = np.copy(tmp62) * -1 - tmp64 += tmp63 * 2 - tmp120 = np.copy(f.bb.ov) - tmp120 += ints.tmp19 - tmp120 += ints.tmp22 - tmp116 = einsum(r1.b, (0,), ints.tmp360, (1, 2, 3, 0), (1, 2, 3)) - tmp122 = np.copy(ints.tmp298) - tmp122 += ints.tmp319 - tmp122 += ints.tmp383 * 2 - tmp103 = np.copy(ints.tmp430) - del ints.tmp430 - tmp103 += np.transpose(ints.tmp485, (0, 1, 3, 2)) - del ints.tmp485 - tmp103 += ints.tmp51 - tmp103 += ints.tmp425 * 2 - del ints.tmp425 - tmp101 = np.copy(ints.tmp343) - tmp101 += np.transpose(ints.tmp360, (0, 2, 1, 3)) - tmp99 = einsum(r1.b, (0,), ints.tmp343, (1, 2, 3, 0), (1, 2, 3)) - tmp42 = einsum(r1.a, (0,), ints.tmp177, (1, 2, 3, 0), (1, 2, 3)) - tmp44 = np.copy(ints.tmp130) - tmp44 += np.transpose(ints.tmp177, (0, 2, 1, 3)) - tmp46 = np.copy(ints.tmp105) - del ints.tmp105 - tmp46 += np.transpose(ints.tmp190, (0, 1, 3, 2)) - del ints.tmp190 - tmp46 += ints.tmp23 - tmp46 += ints.tmp100 * 2 - del ints.tmp100 - tmp21 = einsum(ints.tmp130, (0, 1, 2, 3), r1.a, (3,), (0, 1, 2)) - tmp28 = np.copy(ints.tmp117) - tmp28 += ints.tmp167 - tmp28 += ints.tmp86 * 2 - tmp16 = np.copy(tmp14) - tmp16 += tmp15 * 0.5 - tmp24 = np.copy(ints.tmp12) - del ints.tmp12 - tmp24 += v.baa.xoo - tmp26 = np.copy(f.aa.ov) - tmp26 += ints.tmp15 - tmp26 += ints.tmp20 - tmp119 = einsum(tmp81, (0, 1, 2), tmp64, (0, 3), (1, 2, 3)) - tmp118 = einsum(ints.tmp40, (0, 1, 2, 3), r2.bbb, (2, 3, 4), (0, 4, 1)) - tmp121 = einsum(r2.bbb, (0, 1, 2), tmp120, (3, 1), (3, 2, 0)) * -2 - del tmp120 - tmp117 = einsum(t1.bb, (0, 1), tmp116, (2, 0, 3), (2, 3, 1)) - del tmp116 - tmp123 = einsum(r1.b, (0,), tmp122, (1, 2, 3, 0), (1, 2, 3)) - del tmp122 - tmp98 = einsum(ints.tmp18, (0, 1), r2.bbb, (2, 1, 3), (0, 3, 2)) - tmp104 = einsum(tmp103, (0, 1, 2, 3), r1.b, (3,), (0, 1, 2)) - del tmp103 - tmp102 = einsum(r2.bbb, (0, 1, 2), tmp101, (3, 4, 2, 1), (3, 4, 0)) * -1 - del tmp101 - tmp100 = einsum(t1.bb, (0, 1), tmp99, (2, 0, 3), (2, 3, 1)) - del tmp99 - tmp43 = einsum(t1.aa, (0, 1), tmp42, (2, 0, 3), (2, 3, 1)) - del tmp42 - tmp45 = einsum(tmp44, (0, 1, 2, 3), r2.aaa, (4, 3, 1), (0, 2, 4)) * -1 - del tmp44 - tmp41 = einsum(ints.tmp13, (0, 1), r2.aaa, (2, 1, 3), (0, 3, 2)) - tmp47 = einsum(r1.a, (0,), tmp46, (1, 2, 3, 0), (1, 2, 3)) - del tmp46 - tmp22 = einsum(tmp21, (0, 1, 2), t1.aa, (1, 3), (0, 2, 3)) - del tmp21 - tmp29 = einsum(r1.a, (0,), tmp28, (1, 2, 3, 0), (1, 2, 3)) - del tmp28 - tmp25 = einsum(tmp24, (0, 1, 2), tmp16, (0, 3), (1, 2, 3)) * 2 - tmp23 = einsum(ints.tmp2, (0, 1, 2, 3), r2.aaa, (3, 2, 4), (0, 4, 1)) * -1 - tmp27 = einsum(r2.aaa, (0, 1, 2), tmp26, (3, 1), (2, 3, 0)) * -2 - del tmp26 - tmp0 = np.copy(f.bb.ov) - tmp0 += ints.tmp19 - tmp0 += ints.tmp22 - tmp0 += ints.tmp18 * -1 - del ints.tmp18 - tmp112 = np.copy(ints.tmp45) * 0.5 - tmp112 += ints.tmp56 - tmp112 += ints.tmp59 * 0.5 - tmp124 = np.copy(np.transpose(tmp117, (1, 0, 2))) - del tmp117 - tmp124 += tmp118 * 2 - del tmp118 - tmp124 += np.transpose(tmp119, (1, 0, 2)) - del tmp119 - tmp124 += tmp121 * -1 - del tmp121 - tmp124 += np.transpose(tmp123, (1, 0, 2)) - del tmp123 - tmp126 = np.copy(ints.tmp411) - del ints.tmp411 - tmp126 += ints.tmp415 * 0.5 - del ints.tmp415 - tmp114 = np.copy(f.bb.vv) * 0.5 - tmp114 += np.transpose(ints.tmp44, (1, 0)) * 0.5 - tmp114 += np.transpose(ints.tmp47, (1, 0)) * 0.5 - tmp114 += np.transpose(ints.tmp57, (1, 0)) * -1 - tmp114 += np.transpose(ints.tmp60, (1, 0)) * -0.5 - tmp105 = np.copy(tmp98) * 2 - del tmp98 - tmp105 += np.transpose(tmp100, (1, 0, 2)) - del tmp100 - tmp105 += np.transpose(tmp102, (1, 0, 2)) * -2 - del tmp102 - tmp105 += np.transpose(tmp104, (1, 0, 2)) - del tmp104 - tmp107 = np.copy(ints.tmp40) - tmp107 += np.transpose(ints.tmp471, (0, 2, 1, 3)) - del ints.tmp471 - tmp107 += ints.tmp413 * 2 - del ints.tmp413 - tmp96 = np.copy(ints.tmp45) - tmp96 += ints.tmp59 - tmp96 += ints.tmp56 * 2 - tmp94 = np.copy(ints.tmp298) - tmp94 += ints.tmp319 - tmp94 += ints.tmp383 * 2 - tmp1 = np.copy(f.aa.ov) - tmp1 += ints.tmp15 - tmp1 += ints.tmp20 - tmp1 += ints.tmp13 * -1 - del ints.tmp13 - tmp56 = einsum(r2.aba, (0, 1, 2), ints.tmp26, (3, 4, 0, 1), (3, 2, 4)) - tmp72 = np.copy(ints.tmp136) - tmp72 += np.transpose(ints.tmp179, (1, 0, 2, 3)) - tmp39 = np.copy(tmp14) * 2 - del tmp14 - tmp39 += tmp15 - del tmp15 - tmp50 = np.copy(ints.tmp162) - del ints.tmp162 - tmp50 += np.transpose(ints.tmp2, (0, 2, 1, 3)) - tmp50 += np.transpose(ints.tmp80, (0, 2, 1, 3)) * 2 - del ints.tmp80 - tmp37 = np.copy(ints.tmp117) - tmp37 += ints.tmp167 - tmp37 += ints.tmp86 * 2 - tmp48 = np.copy(np.transpose(tmp41, (1, 0, 2))) * 2 - del tmp41 - tmp48 += tmp43 - del tmp43 - tmp48 += tmp45 * -2 - del tmp45 - tmp48 += tmp47 - del tmp47 - tmp32 = np.copy(ints.tmp78) - del ints.tmp78 - tmp32 += ints.tmp82 * 0.5 - del ints.tmp82 - tmp17 = np.copy(ints.tmp29) * 2 - tmp17 += ints.tmp32 - tmp17 += ints.tmp8 - tmp30 = np.copy(np.transpose(tmp22, (1, 0, 2))) - del tmp22 - tmp30 += tmp23 * 2 - del tmp23 - tmp30 += np.transpose(tmp25, (1, 0, 2)) - del tmp25 - tmp30 += np.transpose(tmp27, (1, 0, 2)) * -1 - del tmp27 - tmp30 += np.transpose(tmp29, (1, 0, 2)) - del tmp29 - tmp19 = np.copy(f.aa.vv) * 0.5 - tmp19 += np.transpose(ints.tmp11, (1, 0)) * 0.5 - tmp19 += np.transpose(ints.tmp7, (1, 0)) * 0.5 - tmp19 += np.transpose(ints.tmp30, (1, 0)) * -1 - tmp19 += np.transpose(ints.tmp33, (1, 0)) * -0.5 - tmp9 = einsum(r2.bbb, (0, 1, 2), ints.tmp51, (2, 3, 1, 0), (3,)) * -1 - tmp8 = einsum(r2.aba, (0, 1, 2), ints.tmp26, (2, 3, 0, 1), (3,)) - tmp10 = einsum(r1.b, (0,), tmp0, (1, 0), (1,)) - tmp113 = einsum(tmp112, (0, 1, 2), tmp63, (0, 3), (1, 2, 3)) * 4 - del tmp112 - tmp111 = einsum(tmp62, (0, 1), v.bbb.xov, (0, 2, 3), (2, 1, 3)) - tmp125 = einsum(t1.bb, (0, 1), tmp124, (0, 2, 3), (2, 3, 1)) - del tmp124 - tmp110 = einsum(r2.aba, (0, 1, 2), ints.tmp380, (2, 3, 0, 4), (3, 4, 1)) - tmp127 = einsum(r1.b, (0,), tmp126, (1, 2, 0, 3), (1, 2, 3)) * 2 - del tmp126 - tmp115 = einsum(tmp114, (0, 1), r2.bbb, (2, 0, 3), (3, 1, 2)) * -4 - del tmp114 - tmp92 = einsum(ints.tmp46, (0, 1), r2.bbb, (2, 0, 3), (3, 1, 2)) - tmp106 = einsum(t1.bb, (0, 1), tmp105, (0, 2, 3), (2, 3, 1)) - del tmp105 - tmp108 = einsum(r1.b, (0,), tmp107, (1, 2, 0, 3), (1, 2, 3)) - del tmp107 - tmp93 = einsum(v.bbb.xov, (0, 1, 2), tmp63, (0, 3), (1, 3, 2)) - del tmp63 - tmp97 = einsum(tmp62, (0, 1), tmp96, (0, 2, 3), (2, 3, 1)) - del tmp62, tmp96 - tmp95 = einsum(r2.bbb, (0, 1, 2), tmp94, (3, 2, 4, 1), (3, 4, 0)) * -1 - del tmp94 - tmp90 = einsum(r2.bbb, (0, 1, 2), ints.tmp51, (3, 4, 0, 1), (3, 4, 2)) - del ints.tmp51 - tmp4 = einsum(r2.bab, (0, 1, 2), ints.tmp26, (3, 2, 1, 0), (3,)) * -1 - tmp5 = einsum(tmp1, (0, 1), r1.a, (1,), (0,)) - tmp3 = einsum(r2.aaa, (0, 1, 2), ints.tmp23, (2, 3, 1, 0), (3,)) * -1 - tmp86 = np.copy(ints.tmp26) - tmp86 += ints.tmp333 - del ints.tmp333 - tmp86 += ints.tmp393 - del ints.tmp393 - tmp86 += ints.tmp396 * 2 - del ints.tmp396 - tmp86 += ints.tmp380 * -1 - tmp85 = np.copy(ints.tmp303) - del ints.tmp303 - tmp85 += ints.tmp327 - del ints.tmp327 - tmp75 = einsum(r2.bab, (0, 1, 2), ints.tmp26, (3, 4, 1, 0), (3, 4, 2)) * -1 - tmp77 = np.copy(np.transpose(r2.bab, (2, 1, 0))) * -1 - tmp77 += einsum(r1.a, (0,), t1.bb, (1, 2), (1, 0, 2)) - tmp66 = einsum(tmp1, (0, 1), t1.aa, (0, 2), (2, 1)) - tmp79 = np.copy(ints.tmp343) - del ints.tmp343 - tmp79 += np.transpose(ints.tmp360, (0, 2, 1, 3)) - del ints.tmp360 - tmp70 = np.copy(ints.tmp136) - del ints.tmp136 - tmp70 += ints.tmp179 - del ints.tmp179 - tmp71 = np.copy(ints.tmp245) - del ints.tmp245 - tmp71 += ints.tmp26 - del ints.tmp26 - tmp71 += ints.tmp276 - del ints.tmp276 - tmp71 += ints.tmp279 * 2 - del ints.tmp279 - tmp71 += ints.tmp89 * -1 - tmp73 = np.copy(tmp56) * -1 - tmp73 += einsum(r1.b, (0,), tmp72, (1, 2, 3, 0), (1, 2, 3)) - del tmp72 - tmp60 = np.copy(ints.tmp130) - del ints.tmp130 - tmp60 += np.transpose(ints.tmp177, (0, 2, 1, 3)) - del ints.tmp177 - tmp35 = einsum(ints.tmp9, (0, 1), r2.aaa, (2, 0, 3), (3, 1, 2)) - tmp40 = einsum(tmp39, (0, 1), v.baa.xov, (0, 2, 3), (2, 3, 1)) - del tmp39 - tmp36 = einsum(ints.tmp89, (0, 1, 2, 3), r2.bab, (3, 4, 1), (0, 2, 4)) * -1 - tmp51 = einsum(tmp50, (0, 1, 2, 3), r1.a, (1,), (0, 2, 3)) - del tmp50 - tmp38 = einsum(tmp37, (0, 1, 2, 3), r2.aaa, (4, 3, 1), (0, 4, 2)) * -1 - del tmp37 - tmp49 = einsum(t1.aa, (0, 1), tmp48, (2, 0, 3), (2, 1, 3)) - del tmp48 - tmp33 = einsum(tmp32, (0, 1, 2, 3), r1.a, (2,), (0, 1, 3)) * 2 - del tmp32 - tmp18 = einsum(tmp16, (0, 1), tmp17, (0, 2, 3), (2, 3, 1)) * 2 - del tmp17 - tmp31 = einsum(t1.aa, (0, 1), tmp30, (0, 2, 3), (2, 1, 3)) - del tmp30 - tmp20 = einsum(tmp19, (0, 1), r2.aaa, (2, 0, 3), (3, 2, 1)) * -4 - del tmp19 - tmp12 = einsum(ints.tmp23, (0, 1, 2, 3), r2.aaa, (3, 2, 4), (0, 1, 4)) * -1 - del ints.tmp23 - tmp89 = np.copy(ints.tmp299) - del ints.tmp299 - tmp89 += ints.tmp321 * 2 - del ints.tmp321 - tmp89 += ints.tmp331 - del ints.tmp331 - tmp89 += ints.tmp341 - del ints.tmp341 - tmp89 += ints.tmp344 * 2 - del ints.tmp344 - tmp89 += ints.tmp345 - del ints.tmp345 - tmp89 += ints.tmp346 * 2 - del ints.tmp346 - tmp89 += ints.tmp347 - del ints.tmp347 - tmp89 += ints.tmp354 - del ints.tmp354 - tmp89 += ints.tmp355 - del ints.tmp355 - tmp89 += ints.tmp356 - del ints.tmp356 - tmp89 += ints.tmp364 * 2 - del ints.tmp364 - tmp89 += ints.tmp365 - del ints.tmp365 - tmp89 += ints.tmp367 - del ints.tmp367 - tmp89 += ints.tmp368 - del ints.tmp368 - tmp89 += ints.tmp387 - del ints.tmp387 - tmp89 += ints.tmp389 * 2 - del ints.tmp389 - tmp89 += f.bb.ov * -1 - tmp89 += ints.tmp19 * -1 - del ints.tmp19 - tmp89 += ints.tmp22 * -1 - del ints.tmp22 - tmp89 += ints.tmp315 * -1 - del ints.tmp315 - tmp89 += ints.tmp322 * -1 - del ints.tmp322 - tmp89 += ints.tmp330 * -1 - del ints.tmp330 - tmp89 += ints.tmp332 * -1 - del ints.tmp332 - tmp89 += ints.tmp353 * -1 - del ints.tmp353 - tmp89 += ints.tmp366 * -1 - del ints.tmp366 - tmp89 += ints.tmp370 * -1 - del ints.tmp370 - tmp89 += ints.tmp371 * -2 - del ints.tmp371 - tmp89 += ints.tmp388 * -1 - del ints.tmp388 - tmp89 += ints.tmp390 * -2 - del ints.tmp390 - tmp89 += ints.tmp391 * -1 - del ints.tmp391 - tmp89 += ints.tmp392 * -2 - del ints.tmp392 - tmp11 = np.copy(tmp8) - del tmp8 - tmp11 += tmp9 * 2 - del tmp9 - tmp11 += tmp10 * -1 - del tmp10 - tmp128 = np.copy(tmp110) - del tmp110 - tmp128 += tmp111 - del tmp111 - tmp128 += tmp113 - del tmp113 - tmp128 += tmp115 * -1 - del tmp115 - tmp128 += tmp125 - del tmp125 - tmp128 += tmp127 - del tmp127 - tmp88 = np.copy(f.bb.oo) - tmp88 += np.transpose(ints.tmp301, (1, 0)) - del ints.tmp301 - tmp88 += np.transpose(ints.tmp302, (1, 0)) - del ints.tmp302 - tmp88 += ints.tmp316 - del ints.tmp316 - tmp88 += np.transpose(ints.tmp323, (1, 0)) * 2 - del ints.tmp323 - tmp88 += np.transpose(ints.tmp325, (1, 0)) - del ints.tmp325 - tmp88 += np.transpose(ints.tmp336, (1, 0)) - del ints.tmp336 - tmp88 += np.transpose(ints.tmp337, (1, 0)) - del ints.tmp337 - tmp88 += np.transpose(ints.tmp300, (1, 0)) * -1 - del ints.tmp300 - tmp88 += np.transpose(ints.tmp335, (1, 0)) * -1 - del ints.tmp335 - tmp129 = np.copy(ints.tmp453) - del ints.tmp453 - tmp129 += ints.tmp481 * -1 - del ints.tmp481 - tmp109 = np.copy(tmp92) * 2 - del tmp92 - tmp109 += tmp93 * 2 - del tmp93 - tmp109 += tmp95 * -2 - del tmp95 - tmp109 += tmp97 - del tmp97 - tmp109 += tmp106 - del tmp106 - tmp109 += tmp108 - del tmp108 - tmp91 = einsum(t1.bb, (0, 1), tmp90, (2, 0, 3), (2, 3, 1)) - tmp83 = np.copy(ints.tmp46) * 0.5 - tmp83 += np.transpose(ints.tmp57, (1, 0)) - tmp83 += np.transpose(ints.tmp60, (1, 0)) * 0.5 - tmp83 += f.bb.vv * -0.5 - tmp83 += np.transpose(ints.tmp44, (1, 0)) * -0.5 - tmp83 += np.transpose(ints.tmp47, (1, 0)) * -0.5 - tmp83 += einsum(tmp0, (0, 1), t1.bb, (0, 2), (1, 2)) * 0.5 - tmp6 = np.copy(tmp3) * -2 - del tmp3 - tmp6 += tmp4 - del tmp4 - tmp6 += tmp5 - del tmp5 - tmp84 = np.copy(ints.tmp305) - del ints.tmp305 - tmp84 += np.transpose(ints.tmp318, (0, 2, 1, 3)) - del ints.tmp318 - tmp84 += ints.tmp328 - del ints.tmp328 - tmp84 += np.transpose(ints.tmp374, (0, 2, 1, 3)) - del ints.tmp374 - tmp84 += np.transpose(ints.tmp376, (0, 2, 1, 3)) * 2 - del ints.tmp376 - tmp84 += ints.tmp4 - tmp84 += ints.tmp290 * -1 - del ints.tmp290 - tmp84 += np.transpose(ints.tmp375, (0, 2, 1, 3)) * -1 - del ints.tmp375 - tmp82 = np.copy(ints.tmp45) - del ints.tmp45 - tmp82 += ints.tmp56 * 2 - del ints.tmp56 - tmp82 += ints.tmp59 - del ints.tmp59 - tmp82 += v.bbb.xov - tmp82 += einsum(tmp81, (0, 1, 2), t1.bb, (2, 3), (0, 1, 3)) * -1 - del tmp81 - tmp76 = einsum(ints.tmp4, (0, 1, 2, 3), r2.bab, (3, 2, 4), (0, 4, 1)) * -1 - tmp87 = einsum(ints.tmp42, (0, 1, 2, 3), r2.bab, (3, 1, 4), (0, 4, 2)) - tmp87 += einsum(tmp75, (0, 1, 2), t1.bb, (1, 3), (0, 2, 3)) - tmp87 += einsum(tmp77, (0, 1, 2), tmp85, (3, 4, 0, 1), (3, 4, 2)) - del tmp85 - tmp87 += einsum(r1.a, (0,), tmp86, (1, 2, 0, 3), (1, 2, 3)) * -1 - del tmp86 - tmp78 = np.copy(ints.tmp342) - del ints.tmp342 - tmp78 += ints.tmp357 - del ints.tmp357 - tmp78 += ints.tmp293 * -1 - del ints.tmp293 - tmp67 = np.copy(np.transpose(ints.tmp30, (1, 0))) * 2 - tmp67 += np.transpose(ints.tmp33, (1, 0)) - tmp67 += ints.tmp9 - tmp67 += f.aa.vv * -1 - tmp67 += np.transpose(ints.tmp11, (1, 0)) * -1 - tmp67 += np.transpose(ints.tmp7, (1, 0)) * -1 - tmp67 += np.transpose(tmp66, (1, 0)) - del tmp66 - tmp80 = np.copy(ints.tmp298) - del ints.tmp298 - tmp80 += ints.tmp319 - del ints.tmp319 - tmp80 += ints.tmp383 * 2 - del ints.tmp383 - tmp80 += einsum(t1.bb, (0, 1), tmp79, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp79 - tmp65 = np.copy(ints.tmp29) * 2 - del ints.tmp29 - tmp65 += ints.tmp32 - del ints.tmp32 - tmp65 += ints.tmp8 - del ints.tmp8 - tmp65 += v.baa.xov - tmp65 += einsum(tmp24, (0, 1, 2), t1.aa, (2, 3), (0, 1, 3)) * -1 - del tmp24 - tmp58 = np.copy(np.transpose(r2.aba, (2, 0, 1))) - tmp58 += einsum(r1.b, (0,), t1.aa, (1, 2), (1, 2, 0)) * -1 - tmp69 = np.copy(ints.tmp227) - del ints.tmp227 - tmp69 += np.transpose(ints.tmp239, (0, 1, 3, 2)) - del ints.tmp239 - tmp69 += ints.tmp243 - del ints.tmp243 - tmp69 += np.transpose(ints.tmp265, (0, 1, 3, 2)) - del ints.tmp265 - tmp69 += np.transpose(ints.tmp267, (0, 1, 3, 2)) * 2 - del ints.tmp267 - tmp69 += ints.tmp42 - tmp69 += ints.tmp218 * -1 - del ints.tmp218 - tmp69 += np.transpose(ints.tmp266, (0, 1, 3, 2)) * -1 - del ints.tmp266 - tmp68 = np.copy(ints.tmp46) - tmp68 += np.transpose(ints.tmp57, (1, 0)) * 2 - tmp68 += np.transpose(ints.tmp60, (1, 0)) - tmp68 += f.bb.vv * -1 - tmp68 += np.transpose(ints.tmp44, (1, 0)) * -1 - tmp68 += np.transpose(ints.tmp47, (1, 0)) * -1 - tmp68 += einsum(tmp0, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp53 = np.copy(f.aa.oo) - tmp53 += np.transpose(ints.tmp124, (1, 0)) - del ints.tmp124 - tmp53 += np.transpose(ints.tmp126, (1, 0)) - del ints.tmp126 - tmp53 += ints.tmp157 - del ints.tmp157 - tmp53 += np.transpose(ints.tmp173, (1, 0)) * 2 - del ints.tmp173 - tmp53 += np.transpose(ints.tmp175, (1, 0)) - del ints.tmp175 - tmp53 += np.transpose(ints.tmp195, (1, 0)) - del ints.tmp195 - tmp53 += np.transpose(ints.tmp197, (1, 0)) - del ints.tmp197 - tmp53 += np.transpose(ints.tmp122, (1, 0)) * -1 - del ints.tmp122 - tmp53 += np.transpose(ints.tmp193, (1, 0)) * -1 - del ints.tmp193 - tmp74 = einsum(r2.aba, (0, 1, 2), ints.tmp4, (3, 4, 0, 1), (2, 3, 4)) * -1 - tmp74 += einsum(tmp70, (0, 1, 2, 3), r2.aba, (4, 3, 1), (0, 2, 4)) - del tmp70 - tmp74 += einsum(tmp71, (0, 1, 2, 3), r1.b, (3,), (0, 1, 2)) - del tmp71 - tmp74 += einsum(t1.aa, (0, 1), tmp73, (0, 2, 3), (2, 3, 1)) * -1 - del tmp73 - tmp61 = np.copy(ints.tmp117) - del ints.tmp117 - tmp61 += ints.tmp167 - del ints.tmp167 - tmp61 += ints.tmp86 * 2 - del ints.tmp86 - tmp61 += einsum(tmp60, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) * -1 - del tmp60 - tmp59 = np.copy(ints.tmp250) - del ints.tmp250 - tmp59 += ints.tmp256 - del ints.tmp256 - tmp59 += ints.tmp221 * -1 - del ints.tmp221 - tmp57 = einsum(ints.tmp42, (0, 1, 2, 3), r2.aba, (1, 3, 4), (0, 4, 2)) - tmp55 = np.copy(ints.tmp115) - del ints.tmp115 - tmp55 += ints.tmp119 - del ints.tmp119 - tmp55 += ints.tmp135 * 2 - del ints.tmp135 - tmp55 += ints.tmp137 - del ints.tmp137 - tmp55 += ints.tmp148 - del ints.tmp148 - tmp55 += ints.tmp149 - del ints.tmp149 - tmp55 += ints.tmp159 - del ints.tmp159 - tmp55 += ints.tmp171 * 2 - del ints.tmp171 - tmp55 += ints.tmp178 * 2 - del ints.tmp178 - tmp55 += ints.tmp180 - del ints.tmp180 - tmp55 += ints.tmp183 * 2 - del ints.tmp183 - tmp55 += ints.tmp184 - del ints.tmp184 - tmp55 += ints.tmp186 - del ints.tmp186 - tmp55 += ints.tmp206 - del ints.tmp206 - tmp55 += ints.tmp207 - del ints.tmp207 - tmp55 += ints.tmp94 * 2 - del ints.tmp94 - tmp55 += ints.tmp96 - del ints.tmp96 - tmp55 += f.aa.ov * -1 - tmp55 += ints.tmp147 * -1 - del ints.tmp147 - tmp55 += ints.tmp156 * -1 - del ints.tmp156 - tmp55 += ints.tmp15 * -1 - del ints.tmp15 - tmp55 += ints.tmp172 * -1 - del ints.tmp172 - tmp55 += ints.tmp185 * -1 - del ints.tmp185 - tmp55 += ints.tmp187 * -1 - del ints.tmp187 - tmp55 += ints.tmp205 * -1 - del ints.tmp205 - tmp55 += ints.tmp20 * -1 - del ints.tmp20 - tmp55 += ints.tmp67 * -2 - del ints.tmp67 - tmp55 += ints.tmp68 * -1 - del ints.tmp68 - tmp55 += ints.tmp95 * -2 - del ints.tmp95 - tmp55 += ints.tmp97 * -1 - del ints.tmp97 - tmp55 += ints.tmp98 * -2 - del ints.tmp98 - tmp55 += ints.tmp99 * -1 - del ints.tmp99 - tmp52 = np.copy(tmp35) * 2 - del tmp35 - tmp52 += tmp36 - del tmp36 - tmp52 += np.transpose(tmp38, (0, 2, 1)) * -2 - del tmp38 - tmp52 += np.transpose(tmp40, (0, 2, 1)) - del tmp40 - tmp52 += np.transpose(tmp49, (0, 2, 1)) - del tmp49 - tmp52 += tmp51 - del tmp51 - tmp54 = np.copy(ints.tmp138) - del ints.tmp138 - tmp54 += ints.tmp181 * -1 - del ints.tmp181 - tmp34 = np.copy(tmp18) - del tmp18 - tmp34 += np.transpose(tmp20, (0, 2, 1)) * -1 - del tmp20 - tmp34 += np.transpose(tmp31, (0, 2, 1)) - del tmp31 - tmp34 += tmp33 - del tmp33 - tmp13 = einsum(t1.aa, (0, 1), tmp12, (2, 0, 3), (2, 3, 1)) - tmp7 = np.copy(ints.tmp46) - del ints.tmp46 - tmp7 += np.transpose(ints.tmp57, (1, 0)) * 2 - del ints.tmp57 - tmp7 += np.transpose(ints.tmp60, (1, 0)) - del ints.tmp60 - tmp7 += f.bb.vv * -1 - tmp7 += np.transpose(ints.tmp44, (1, 0)) * -1 - del ints.tmp44 - tmp7 += np.transpose(ints.tmp47, (1, 0)) * -1 - del ints.tmp47 - tmp2 = np.copy(np.transpose(ints.tmp30, (1, 0))) * 2 - del ints.tmp30 - tmp2 += np.transpose(ints.tmp33, (1, 0)) - del ints.tmp33 - tmp2 += ints.tmp9 - del ints.tmp9 - tmp2 += f.aa.vv * -1 - tmp2 += np.transpose(ints.tmp11, (1, 0)) * -1 - del ints.tmp11 - tmp2 += np.transpose(ints.tmp7, (1, 0)) * -1 - del ints.tmp7 - r2new.bbb = einsum(r2.bbb, (0, 1, 2), ints.tmp469, (3, 0, 4, 1), (3, 4, 2)) * -2 - del ints.tmp469 - r2new.bbb += einsum(tmp90, (0, 1, 2), t2.bbbb, (1, 0, 3, 4), (3, 4, 2)) * -2 - del tmp90 - r2new.bbb += einsum(t1.bb, (0, 1), tmp91, (0, 2, 3), (3, 1, 2)) * -2 - del tmp91 - r2new.bbb += np.transpose(tmp109, (1, 2, 0)) - r2new.bbb += np.transpose(tmp109, (2, 1, 0)) * -1 - del tmp109 - r2new.bbb += np.transpose(tmp128, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp128, (2, 1, 0)) - del tmp128 - r2new.bbb += einsum(r2.bbb, (0, 1, 2), tmp88, (2, 3), (0, 1, 3)) * -2 - r2new.bbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp11, (1,), (2, 3, 0)) * -2 - r2new.bbb += einsum(r1.b, (0,), tmp129, (1, 2, 3, 0), (3, 2, 1)) * 2 - del tmp129 - r2new.bbb += einsum(r1.b, (0,), tmp89, (1, 2), (0, 2, 1)) * -1 - r2new.bbb += einsum(r1.b, (0,), tmp89, (1, 2), (2, 0, 1)) - r2new.bab = einsum(ints.tmp237, (0, 1, 2, 3), r2.bab, (3, 1, 4), (2, 0, 4)) - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp75, (0, 1, 4), (3, 2, 4)) * -1 - del tmp75 - r2new.bab += einsum(tmp76, (0, 1, 2), t1.bb, (0, 3), (3, 2, 1)) - del tmp76 - r2new.bab += einsum(r2.aaa, (0, 1, 2), ints.tmp380, (2, 3, 1, 4), (4, 0, 3)) * 2 - del ints.tmp380 - r2new.bab += einsum(tmp78, (0, 1, 2, 3), tmp77, (1, 3, 4), (4, 2, 0)) - del tmp77, tmp78 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp80, (3, 2, 4, 0), (4, 1, 3)) * -1 - del tmp80 - r2new.bab += einsum(tmp16, (0, 1), tmp82, (0, 2, 3), (3, 1, 2)) * -2 - del tmp16, tmp82 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp67, (1, 3), (0, 3, 2)) * -1 - r2new.bab += einsum(tmp83, (0, 1), r2.bab, (0, 2, 3), (1, 2, 3)) * -2 - del tmp83 - r2new.bab += einsum(r1.a, (0,), tmp84, (1, 2, 0, 3), (3, 2, 1)) * -1 - del tmp84 - r2new.bab += einsum(tmp87, (0, 1, 2), t1.aa, (0, 3), (2, 3, 1)) * -1 - del tmp87 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp88, (2, 3), (0, 1, 3)) * -1 - del tmp88 - r2new.bab += einsum(t2.abab, (0, 1, 2, 3), tmp6, (0,), (3, 2, 1)) - r2new.bab += einsum(r1.a, (0,), tmp89, (1, 2), (2, 0, 1)) - del tmp89 - r2new.aba = einsum(ints.tmp237, (0, 1, 2, 3), r2.aba, (1, 3, 4), (0, 2, 4)) - del ints.tmp237 - r2new.aba += einsum(t2.abab, (0, 1, 2, 3), tmp56, (0, 4, 1), (2, 3, 4)) - del tmp56 - r2new.aba += einsum(tmp57, (0, 1, 2), t1.aa, (0, 3), (3, 2, 1)) * -1 - del tmp57 - r2new.aba += einsum(ints.tmp89, (0, 1, 2, 3), r2.bbb, (4, 3, 1), (2, 4, 0)) * 2 - del ints.tmp89 - r2new.aba += einsum(tmp58, (0, 1, 2), tmp59, (3, 0, 4, 2), (1, 4, 3)) * -1 - del tmp58, tmp59 - r2new.aba += einsum(tmp61, (0, 1, 2, 3), r2.aba, (3, 4, 1), (2, 4, 0)) * -1 - del tmp61 - r2new.aba += einsum(tmp65, (0, 1, 2), tmp64, (0, 3), (2, 3, 1)) * -1 - del tmp64, tmp65 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp67, (0, 3), (3, 1, 2)) * -1 - del tmp67 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp68, (1, 3), (0, 3, 2)) * -1 - del tmp68 - r2new.aba += einsum(tmp69, (0, 1, 2, 3), r1.b, (3,), (1, 2, 0)) * -1 - del tmp69 - r2new.aba += einsum(tmp74, (0, 1, 2), t1.bb, (1, 3), (2, 3, 0)) - del tmp74 - r2new.aba += einsum(tmp53, (0, 1), r2.aba, (2, 3, 0), (2, 3, 1)) * -1 - r2new.aba += einsum(t2.abab, (0, 1, 2, 3), tmp11, (1,), (2, 3, 0)) * -1 - r2new.aba += einsum(tmp55, (0, 1), r1.b, (2,), (1, 2, 0)) - r2new.aaa = einsum(ints.tmp160, (0, 1, 2, 3), r2.aaa, (3, 1, 4), (0, 2, 4)) * 2 - del ints.tmp160 - r2new.aaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp12, (1, 0, 4), (2, 3, 4)) * -2 - del tmp12 - r2new.aaa += einsum(tmp13, (0, 1, 2), t1.aa, (0, 3), (2, 3, 1)) * -2 - del tmp13 - r2new.aaa += np.transpose(tmp34, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp34, (2, 1, 0)) - del tmp34 - r2new.aaa += np.transpose(tmp52, (1, 2, 0)) - r2new.aaa += np.transpose(tmp52, (2, 1, 0)) * -1 - del tmp52 - r2new.aaa += einsum(r2.aaa, (0, 1, 2), tmp53, (2, 3), (0, 1, 3)) * -2 - del tmp53 - r2new.aaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp6, (1,), (2, 3, 0)) * 2 - r2new.aaa += einsum(tmp54, (0, 1, 2, 3), r1.a, (3,), (2, 1, 0)) * 2 - del tmp54 - r2new.aaa += einsum(r1.a, (0,), tmp55, (1, 2), (0, 2, 1)) * -1 - r2new.aaa += einsum(r1.a, (0,), tmp55, (1, 2), (2, 0, 1)) - del tmp55 - r1new.b = einsum(ints.tmp42, (0, 1, 2, 3), r2.aba, (1, 3, 0), (2,)) * -1 - del ints.tmp42 - r1new.b += einsum(r2.bbb, (0, 1, 2), ints.tmp40, (2, 3, 1, 0), (3,)) * -2 - del ints.tmp40 - r1new.b += einsum(tmp1, (0, 1), r2.aba, (1, 2, 0), (2,)) * -1 - r1new.b += einsum(tmp0, (0, 1), r2.bbb, (2, 1, 0), (2,)) * 2 - r1new.b += einsum(r1.b, (0,), tmp7, (0, 1), (1,)) * -1 - del tmp7 - r1new.b += einsum(t1.bb, (0, 1), tmp11, (0,), (1,)) - del tmp11 - r1new.a = einsum(ints.tmp4, (0, 1, 2, 3), r2.bab, (3, 2, 0), (1,)) * -1 - del ints.tmp4 - r1new.a += einsum(ints.tmp2, (0, 1, 2, 3), r2.aaa, (3, 2, 0), (1,)) * -2 - del ints.tmp2 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp0, (2, 0), (1,)) * -1 - del tmp0 - r1new.a += einsum(r2.aaa, (0, 1, 2), tmp1, (2, 1), (0,)) * 2 - del tmp1 - r1new.a += einsum(r1.a, (0,), tmp2, (0, 1), (1,)) * -1 - del tmp2 - r1new.a += einsum(tmp6, (0,), t1.aa, (0, 1), (1,)) * -1 - del tmp6 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ip_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:24:45.344414. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp1 : array - tmp10 : array - tmp100 : array - tmp102 : array - tmp103 : array - tmp105 : array - tmp106 : array - tmp107 : array - tmp108 : array - tmp11 : array - tmp110 : array - tmp112 : array - tmp114 : array - tmp116 : array - tmp118 : array - tmp119 : array - tmp121 : array - tmp123 : array - tmp125 : array - tmp127 : array - tmp129 : array - tmp13 : array - tmp131 : array - tmp133 : array - tmp135 : array - tmp137 : array - tmp138 : array - tmp140 : array - tmp142 : array - tmp143 : array - tmp145 : array - tmp147 : array - tmp148 : array - tmp15 : array - tmp150 : array - tmp151 : array - tmp153 : array - tmp155 : array - tmp156 : array - tmp158 : array - tmp159 : array - tmp161 : array - tmp162 : array - tmp164 : array - tmp166 : array - tmp167 : array - tmp168 : array - tmp17 : array - tmp170 : array - tmp171 : array - tmp172 : array - tmp174 : array - tmp175 : array - tmp176 : array - tmp177 : array - tmp179 : array - tmp181 : array - tmp182 : array - tmp183 : array - tmp184 : array - tmp185 : array - tmp187 : array - tmp188 : array - tmp189 : array - tmp19 : array - tmp190 : array - tmp192 : array - tmp194 : array - tmp195 : array - tmp196 : array - tmp197 : array - tmp198 : array - tmp199 : array - tmp2 : array - tmp201 : array - tmp203 : array - tmp204 : array - tmp205 : array - tmp206 : array - tmp207 : array - tmp208 : array - tmp209 : array - tmp21 : array - tmp211 : array - tmp213 : array - tmp215 : array - tmp217 : array - tmp219 : array - tmp22 : array - tmp220 : array - tmp221 : array - tmp222 : array - tmp223 : array - tmp225 : array - tmp226 : array - tmp227 : array - tmp228 : array - tmp23 : array - tmp230 : array - tmp231 : array - tmp239 : array - tmp241 : array - tmp246 : array - tmp247 : array - tmp249 : array - tmp25 : array - tmp255 : array - tmp257 : array - tmp264 : array - tmp265 : array - tmp267 : array - tmp268 : array - tmp27 : array - tmp270 : array - tmp271 : array - tmp273 : array - tmp28 : array - tmp280 : array - tmp283 : array - tmp294 : array - tmp296 : array - tmp298 : array - tmp30 : array - tmp300 : array - tmp302 : array - tmp304 : array - tmp310 : array - tmp311 : array - tmp313 : array - tmp314 : array - tmp316 : array - tmp318 : array - tmp32 : array - tmp320 : array - tmp325 : array - tmp326 : array - tmp327 : array - tmp329 : array - tmp33 : array - tmp334 : array - tmp335 : array - tmp337 : array - tmp339 : array - tmp34 : array - tmp340 : array - tmp344 : array - tmp346 : array - tmp351 : array - tmp352 : array - tmp354 : array - tmp358 : array - tmp36 : array - tmp369 : array - tmp37 : array - tmp375 : array - tmp377 : array - tmp39 : array - tmp4 : array - tmp41 : array - tmp415 : array - tmp418 : array - tmp42 : array - tmp420 : array - tmp44 : array - tmp45 : array - tmp46 : array - tmp461 : array - tmp462 : array - tmp463 : array - tmp464 : array - tmp467 : array - tmp469 : array - tmp47 : array - tmp471 : array - tmp48 : array - tmp486 : array - tmp487 : array - tmp489 : array - tmp491 : array - tmp492 : array - tmp493 : array - tmp5 : array - tmp50 : array - tmp52 : array - tmp54 : array - tmp55 : array - tmp56 : array - tmp57 : array - tmp59 : array - tmp60 : array - tmp62 : array - tmp64 : array - tmp65 : array - tmp67 : array - tmp68 : array - tmp7 : array - tmp70 : array - tmp72 : array - tmp74 : array - tmp75 : array - tmp77 : array - tmp78 : array - tmp79 : array - tmp8 : array - tmp80 : array - tmp82 : array - tmp83 : array - tmp85 : array - tmp87 : array - tmp89 : array - tmp91 : array - tmp94 : array - tmp97 : array - tmp99 : array - """ - - tmp29 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp31 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (1, 2), (0,)) - tmp106 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp27 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp170 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp325 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp47 = einsum(tmp29, (0,), v.bbb.xov, (0, 1, 2), (1, 2)) - tmp48 = einsum(tmp31, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp44 = einsum(v.bbb.xov, (0, 1, 2), tmp31, (0,), (1, 2)) - tmp107 = einsum(v.bbb.xov, (0, 1, 2), tmp106, (0, 1, 3), (3, 2)) - tmp39 = einsum(tmp29, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp99 = einsum(tmp27, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp166 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp59 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp77 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp82 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp56 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp45 = einsum(v.bbb.xvv, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp41 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp230 = einsum(tmp27, (0, 1, 2), tmp106, (0, 3, 4), (1, 2, 3, 4)) - tmp351 = einsum(tmp106, (0, 1, 2), tmp106, (0, 3, 4), (3, 1, 4, 2)) - tmp194 = einsum(tmp27, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 2, 3, 4)) - tmp196 = einsum(v.baa.xoo, (0, 1, 2), tmp106, (0, 3, 4), (1, 2, 3, 4)) - tmp334 = einsum(v.bbb.xoo, (0, 1, 2), tmp106, (0, 3, 4), (3, 1, 2, 4)) - tmp171 = einsum(tmp170, (0, 1, 2, 3), t2.abab, (4, 5, 2, 3), (4, 0, 5, 1)) - tmp326 = einsum(t2.bbbb, (0, 1, 2, 3), tmp325, (4, 5, 2, 3), (0, 1, 5, 4)) * -1 - tmp54 = einsum(tmp27, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp137 = einsum(v.bbb.xov, (0, 1, 2), tmp106, (0, 3, 4), (3, 1, 4, 2)) - tmp282 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp279 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp25 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp64 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp36 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp246 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp227 = einsum(tmp27, (0, 1, 2), tmp27, (0, 3, 4), (3, 1, 4, 2)) - tmp225 = einsum(tmp47, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp176 = einsum(tmp48, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp221 = einsum(t1.bb, (0, 1), tmp44, (2, 1), (0, 2)) - tmp219 = einsum(tmp107, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp175 = einsum(tmp39, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp174 = einsum(tmp99, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp208 = einsum(v.baa.xvv, (0, 1, 2), tmp31, (0,), (1, 2)) - tmp206 = einsum(tmp29, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp203 = einsum(tmp31, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp198 = einsum(tmp29, (0,), v.baa.xvv, (0, 1, 2), (1, 2)) - tmp189 = einsum(tmp27, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp187 = einsum(tmp29, (0,), v.bbb.xoo, (0, 1, 2), (1, 2)) - tmp32 = einsum(v.baa.xoo, (0, 1, 2), tmp31, (0,), (1, 2)) - tmp183 = einsum(v.bbb.xoo, (0, 1, 2), tmp31, (0,), (1, 2)) - del tmp31 - tmp181 = einsum(tmp106, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (3, 2)) - tmp30 = einsum(tmp29, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - del tmp29 - tmp28 = einsum(v.baa.xoo, (0, 1, 2), tmp27, (0, 2, 3), (1, 3)) - tmp167 = einsum(t2.aaaa, (0, 1, 2, 3), tmp166, (4, 5, 2, 3), (0, 1, 5, 4)) * -1 - tmp60 = einsum(tmp59, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp161 = einsum(v.bbb.xov, (0, 1, 2), tmp77, (0, 3, 2), (3, 1)) - tmp158 = einsum(v.bbb.xov, (0, 1, 2), tmp82, (0, 3, 2), (3, 1)) - tmp57 = einsum(v.baa.xov, (0, 1, 2), tmp56, (0, 3, 2), (3, 1)) - tmp142 = einsum(tmp106, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp50 = einsum(v.baa.xov, (0, 1, 2), tmp27, (0, 3, 4), (3, 1, 4, 2)) - tmp96 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 4, 1, 2)) - tmp93 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp67 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp23 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp33 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp21 = einsum(f.bb.ov, (0, 1), t1.bb, (2, 1), (0, 2)) - tmp1 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp493 = einsum(t2.abab, (0, 1, 2, 3), tmp170, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp492 = einsum(tmp27, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp491 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp489 = einsum(v.bbb.xov, (0, 1, 2), tmp77, (0, 1, 3), (3, 2)) - tmp487 = einsum(v.bbb.xov, (0, 1, 2), tmp82, (0, 1, 3), (3, 2)) - tmp486 = einsum(v.bbb.xov, (0, 1, 2), tmp45, (0, 1, 3), (2, 3)) - tmp471 = einsum(t2.bbbb, (0, 1, 2, 3), tmp325, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp469 = einsum(t2.abab, (0, 1, 2, 3), tmp325, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp467 = einsum(v.bbb.xvv, (0, 1, 2), tmp106, (0, 3, 4), (3, 4, 1, 2)) - tmp464 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp463 = einsum(t2.abab, (0, 1, 2, 3), tmp170, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp462 = einsum(v.baa.xvv, (0, 1, 2), tmp106, (0, 3, 4), (3, 4, 1, 2)) - tmp461 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp420 = einsum(tmp59, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp418 = einsum(v.baa.xov, (0, 1, 2), tmp56, (0, 1, 3), (3, 2)) - tmp415 = einsum(tmp41, (0, 1, 2), v.baa.xov, (0, 1, 3), (3, 2)) - tmp377 = einsum(tmp166, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 4, 2, 5)) - tmp375 = einsum(t2.aaaa, (0, 1, 2, 3), tmp166, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp369 = einsum(tmp27, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp358 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp354 = einsum(tmp230, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 3, 4)) - tmp352 = einsum(tmp351, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp346 = einsum(tmp106, (0, 1, 2), tmp41, (0, 3, 4), (3, 1, 2, 4)) - tmp344 = einsum(tmp45, (0, 1, 2), tmp106, (0, 3, 4), (3, 1, 4, 2)) - tmp340 = einsum(t1.aa, (0, 1), tmp194, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp339 = einsum(t1.aa, (0, 1), tmp196, (0, 2, 3, 4), (2, 3, 4, 1)) - tmp337 = einsum(tmp334, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp335 = einsum(tmp334, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) - tmp329 = einsum(t1.aa, (0, 1), tmp171, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp327 = einsum(tmp326, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) * -1 - tmp320 = einsum(t2.abab, (0, 1, 2, 3), tmp54, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp318 = einsum(tmp106, (0, 1, 2), tmp77, (0, 3, 4), (1, 3, 2, 4)) - tmp316 = einsum(tmp106, (0, 1, 2), tmp56, (0, 3, 4), (3, 1, 2, 4)) - tmp314 = einsum(tmp137, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp313 = einsum(t2.abab, (0, 1, 2, 3), tmp137, (4, 5, 1, 3), (0, 4, 5, 2)) - tmp311 = einsum(tmp106, (0, 1, 2), tmp82, (0, 3, 4), (1, 3, 2, 4)) - tmp310 = einsum(tmp59, (0, 1, 2), tmp106, (0, 3, 4), (1, 3, 4, 2)) - tmp304 = einsum(t2.bbbb, (0, 1, 2, 3), tmp47, (4, 3), (0, 1, 4, 2)) - tmp302 = einsum(t2.abab, (0, 1, 2, 3), tmp47, (4, 3), (0, 1, 4, 2)) - tmp300 = einsum(t2.bbbb, (0, 1, 2, 3), tmp44, (4, 3), (0, 1, 4, 2)) - tmp298 = einsum(t2.abab, (0, 1, 2, 3), tmp44, (4, 3), (0, 1, 4, 2)) - tmp296 = einsum(tmp107, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) - tmp294 = einsum(t2.abab, (0, 1, 2, 3), tmp107, (4, 3), (0, 1, 4, 2)) - tmp283 = einsum(t2.abab, (0, 1, 2, 3), tmp282, (4, 5, 2, 3), (0, 1, 4, 5)) - del tmp282 - tmp280 = einsum(tmp279, (0, 1, 2, 3), t2.bbbb, (4, 5, 1, 3), (4, 5, 0, 2)) * -1 - del tmp279 - tmp273 = einsum(tmp77, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp271 = einsum(v.bbb.xoo, (0, 1, 2), tmp56, (0, 3, 4), (3, 1, 2, 4)) - tmp270 = einsum(t2.abab, (0, 1, 2, 3), tmp25, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp268 = einsum(v.bbb.xoo, (0, 1, 2), tmp82, (0, 3, 4), (3, 1, 2, 4)) - tmp267 = einsum(v.bbb.xoo, (0, 1, 2), tmp59, (0, 3, 4), (3, 1, 2, 4)) - tmp265 = einsum(t2.bbbb, (0, 1, 2, 3), tmp64, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp264 = einsum(t2.abab, (0, 1, 2, 3), tmp64, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp257 = einsum(v.bbb.xoo, (0, 1, 2), tmp41, (0, 3, 4), (3, 1, 2, 4)) - tmp255 = einsum(v.bbb.xoo, (0, 1, 2), tmp45, (0, 3, 4), (3, 1, 2, 4)) - tmp249 = einsum(t1.aa, (0, 1), tmp36, (2, 0, 3, 4), (2, 3, 4, 1)) - tmp247 = einsum(tmp246, (0, 1, 2, 3), t1.bb, (1, 4), (3, 0, 2, 4)) - tmp241 = einsum(f.bb.ov, (0, 1), t2.bbbb, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp239 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (4, 3), (0, 4, 1, 2)) - tmp231 = einsum(tmp230, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp228 = einsum(tmp227, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp226 = einsum(t1.bb, (0, 1), tmp225, (2, 0), (2, 1)) - tmp223 = einsum(t1.aa, (0, 1), tmp176, (2, 0), (2, 1)) - tmp222 = einsum(tmp221, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp220 = einsum(tmp219, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp217 = einsum(t1.aa, (0, 1), tmp175, (2, 0), (2, 1)) - tmp215 = einsum(t1.aa, (0, 1), tmp174, (2, 0), (2, 1)) - tmp213 = einsum(tmp27, (0, 1, 2), tmp45, (0, 3, 4), (1, 2, 3, 4)) - tmp211 = einsum(tmp27, (0, 1, 2), tmp41, (0, 3, 4), (1, 3, 2, 4)) - tmp209 = einsum(t1.aa, (0, 1), tmp208, (2, 1), (0, 2)) - tmp207 = einsum(tmp206, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp205 = einsum(tmp45, (0, 1, 2), tmp106, (0, 3, 1), (3, 2)) - tmp204 = einsum(tmp203, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp201 = einsum(tmp27, (0, 1, 2), tmp41, (0, 2, 3), (1, 3)) - tmp199 = einsum(tmp198, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp197 = einsum(tmp196, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp195 = einsum(t1.bb, (0, 1), tmp194, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp192 = einsum(tmp189, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp190 = einsum(tmp189, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 3, 4)) - tmp188 = einsum(tmp187, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp185 = einsum(tmp32, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp184 = einsum(tmp183, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp182 = einsum(tmp181, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp179 = einsum(tmp30, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp177 = einsum(tmp28, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp172 = einsum(tmp171, (0, 1, 2, 3), t1.bb, (3, 4), (0, 1, 2, 4)) - tmp168 = einsum(tmp167, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 3, 4)) * -1 - tmp164 = einsum(tmp60, (0, 1), t1.aa, (1, 2), (0, 2)) - tmp162 = einsum(tmp161, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp159 = einsum(tmp158, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp156 = einsum(t1.aa, (0, 1), tmp57, (2, 0), (2, 1)) - tmp155 = einsum(t2.abab, (0, 1, 2, 3), tmp142, (4, 5, 1, 2), (0, 4, 5, 3)) - tmp153 = einsum(tmp27, (0, 1, 2), tmp82, (0, 3, 4), (1, 2, 3, 4)) - tmp151 = einsum(tmp59, (0, 1, 2), tmp27, (0, 3, 4), (3, 1, 4, 2)) - tmp150 = einsum(t2.abab, (0, 1, 2, 3), tmp50, (4, 5, 0, 2), (4, 5, 1, 3)) - tmp148 = einsum(tmp50, (0, 1, 2, 3), t2.aaaa, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp147 = einsum(tmp27, (0, 1, 2), tmp77, (0, 3, 4), (1, 2, 3, 4)) - tmp145 = einsum(tmp56, (0, 1, 2), tmp27, (0, 3, 4), (3, 1, 4, 2)) - tmp143 = einsum(t2.abab, (0, 1, 2, 3), tmp142, (0, 4, 1, 2), (4, 3)) - tmp140 = einsum(t2.abab, (0, 1, 2, 3), tmp54, (4, 0, 1, 3), (4, 2)) - tmp138 = einsum(t2.bbbb, (0, 1, 2, 3), tmp137, (4, 1, 0, 3), (4, 2)) - tmp135 = einsum(t2.aaaa, (0, 1, 2, 3), tmp50, (4, 1, 0, 3), (4, 2)) - tmp133 = einsum(t2.abab, (0, 1, 2, 3), tmp48, (4, 2), (0, 4, 1, 3)) - tmp131 = einsum(t2.aaaa, (0, 1, 2, 3), tmp48, (4, 3), (0, 1, 4, 2)) - tmp129 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (4, 2), (0, 4, 1, 3)) - tmp127 = einsum(t2.aaaa, (0, 1, 2, 3), tmp39, (4, 3), (0, 1, 4, 2)) - tmp125 = einsum(t2.abab, (0, 1, 2, 3), tmp99, (4, 2), (0, 4, 1, 3)) - tmp123 = einsum(t2.aaaa, (0, 1, 2, 3), tmp99, (4, 3), (0, 1, 4, 2)) - tmp121 = einsum(tmp47, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp119 = einsum(t2.abab, (0, 1, 2, 3), tmp47, (1, 3), (0, 2)) - tmp118 = einsum(tmp48, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - tmp116 = einsum(tmp48, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp114 = einsum(tmp44, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp112 = einsum(tmp44, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp110 = einsum(tmp107, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp108 = einsum(tmp107, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp105 = einsum(t2.abab, (0, 1, 2, 3), tmp39, (0, 2), (1, 3)) - tmp103 = einsum(tmp39, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp102 = einsum(t2.abab, (0, 1, 2, 3), tmp99, (0, 2), (1, 3)) - tmp100 = einsum(tmp99, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp97 = einsum(tmp96, (0, 1, 2, 3), t2.abab, (4, 5, 1, 2), (4, 0, 5, 3)) - del tmp96 - tmp94 = einsum(t2.aaaa, (0, 1, 2, 3), tmp93, (4, 5, 2, 3), (0, 1, 4, 5)) * -1 - del tmp93 - tmp91 = einsum(v.baa.xvv, (0, 1, 2), tmp59, (0, 3, 2), (3, 1)) - tmp89 = einsum(v.bbb.xvv, (0, 1, 2), tmp77, (0, 3, 2), (3, 1)) - tmp87 = einsum(v.bbb.xvv, (0, 1, 2), tmp82, (0, 3, 2), (3, 1)) * -1 - tmp85 = einsum(v.baa.xvv, (0, 1, 2), tmp56, (0, 3, 2), (3, 1)) * -1 - tmp83 = einsum(v.baa.xoo, (0, 1, 2), tmp82, (0, 3, 4), (1, 2, 3, 4)) - tmp80 = einsum(tmp59, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp79 = einsum(t2.abab, (0, 1, 2, 3), tmp67, (4, 1, 5, 2), (0, 4, 5, 3)) - tmp78 = einsum(v.baa.xoo, (0, 1, 2), tmp77, (0, 3, 4), (1, 2, 3, 4)) - tmp75 = einsum(v.baa.xoo, (0, 1, 2), tmp56, (0, 3, 4), (3, 1, 2, 4)) - tmp74 = einsum(t2.abab, (0, 1, 2, 3), tmp23, (0, 4, 5, 2), (4, 5, 1, 3)) - tmp72 = einsum(t2.aaaa, (0, 1, 2, 3), tmp23, (4, 1, 5, 3), (0, 4, 5, 2)) - tmp70 = einsum(tmp25, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (1, 4)) - tmp68 = einsum(tmp67, (0, 1, 2, 3), t2.abab, (0, 1, 3, 4), (2, 4)) - tmp65 = einsum(tmp64, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 3), (1, 4)) - tmp62 = einsum(t2.aaaa, (0, 1, 2, 3), tmp23, (0, 4, 1, 3), (4, 2)) - tmp55 = einsum(v.baa.xoo, (0, 1, 2), tmp45, (0, 3, 4), (1, 2, 3, 4)) - tmp52 = einsum(v.baa.xoo, (0, 1, 2), tmp41, (0, 3, 4), (3, 1, 2, 4)) - tmp46 = einsum(tmp45, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (3, 2)) - tmp42 = einsum(v.baa.xoo, (0, 1, 2), tmp41, (0, 2, 3), (1, 3)) - tmp37 = einsum(tmp36, (0, 1, 2, 3), t1.bb, (3, 4), (1, 0, 2, 4)) - tmp34 = einsum(tmp33, (0, 1, 2, 3), t1.aa, (1, 4), (3, 0, 2, 4)) - tmp22 = einsum(tmp21, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp19 = einsum(t1.aa, (0, 1), tmp1, (0, 2), (2, 1)) - tmp17 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (4, 2), (4, 0, 1, 3)) - tmp15 = einsum(t2.aaaa, (0, 1, 2, 3), f.aa.ov, (4, 3), (4, 0, 1, 2)) - tmp13 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp11 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp10 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp8 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp7 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp5 = einsum(t1.aa, (0, 1), f.aa.vv, (2, 1), (0, 2)) - tmp4 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp2 = einsum(t1.aa, (0, 1), f.aa.oo, (2, 0), (2, 1)) - - return {f"tmp1": tmp1, f"tmp10": tmp10, f"tmp100": tmp100, f"tmp102": tmp102, f"tmp103": tmp103, f"tmp105": tmp105, f"tmp106": tmp106, f"tmp107": tmp107, f"tmp108": tmp108, f"tmp11": tmp11, f"tmp110": tmp110, f"tmp112": tmp112, f"tmp114": tmp114, f"tmp116": tmp116, f"tmp118": tmp118, f"tmp119": tmp119, f"tmp121": tmp121, f"tmp123": tmp123, f"tmp125": tmp125, f"tmp127": tmp127, f"tmp129": tmp129, f"tmp13": tmp13, f"tmp131": tmp131, f"tmp133": tmp133, f"tmp135": tmp135, f"tmp137": tmp137, f"tmp138": tmp138, f"tmp140": tmp140, f"tmp142": tmp142, f"tmp143": tmp143, f"tmp145": tmp145, f"tmp147": tmp147, f"tmp148": tmp148, f"tmp15": tmp15, f"tmp150": tmp150, f"tmp151": tmp151, f"tmp153": tmp153, f"tmp155": tmp155, f"tmp156": tmp156, f"tmp158": tmp158, f"tmp159": tmp159, f"tmp161": tmp161, f"tmp162": tmp162, f"tmp164": tmp164, f"tmp166": tmp166, f"tmp167": tmp167, f"tmp168": tmp168, f"tmp17": tmp17, f"tmp170": tmp170, f"tmp171": tmp171, f"tmp172": tmp172, f"tmp174": tmp174, f"tmp175": tmp175, f"tmp176": tmp176, f"tmp177": tmp177, f"tmp179": tmp179, f"tmp181": tmp181, f"tmp182": tmp182, f"tmp183": tmp183, f"tmp184": tmp184, f"tmp185": tmp185, f"tmp187": tmp187, f"tmp188": tmp188, f"tmp189": tmp189, f"tmp19": tmp19, f"tmp190": tmp190, f"tmp192": tmp192, f"tmp194": tmp194, f"tmp195": tmp195, f"tmp196": tmp196, f"tmp197": tmp197, f"tmp198": tmp198, f"tmp199": tmp199, f"tmp2": tmp2, f"tmp201": tmp201, f"tmp203": tmp203, f"tmp204": tmp204, f"tmp205": tmp205, f"tmp206": tmp206, f"tmp207": tmp207, f"tmp208": tmp208, f"tmp209": tmp209, f"tmp21": tmp21, f"tmp211": tmp211, f"tmp213": tmp213, f"tmp215": tmp215, f"tmp217": tmp217, f"tmp219": tmp219, f"tmp22": tmp22, f"tmp220": tmp220, f"tmp221": tmp221, f"tmp222": tmp222, f"tmp223": tmp223, f"tmp225": tmp225, f"tmp226": tmp226, f"tmp227": tmp227, f"tmp228": tmp228, f"tmp23": tmp23, f"tmp230": tmp230, f"tmp231": tmp231, f"tmp239": tmp239, f"tmp241": tmp241, f"tmp246": tmp246, f"tmp247": tmp247, f"tmp249": tmp249, f"tmp25": tmp25, f"tmp255": tmp255, f"tmp257": tmp257, f"tmp264": tmp264, f"tmp265": tmp265, f"tmp267": tmp267, f"tmp268": tmp268, f"tmp27": tmp27, f"tmp270": tmp270, f"tmp271": tmp271, f"tmp273": tmp273, f"tmp28": tmp28, f"tmp280": tmp280, f"tmp283": tmp283, f"tmp294": tmp294, f"tmp296": tmp296, f"tmp298": tmp298, f"tmp30": tmp30, f"tmp300": tmp300, f"tmp302": tmp302, f"tmp304": tmp304, f"tmp310": tmp310, f"tmp311": tmp311, f"tmp313": tmp313, f"tmp314": tmp314, f"tmp316": tmp316, f"tmp318": tmp318, f"tmp32": tmp32, f"tmp320": tmp320, f"tmp325": tmp325, f"tmp326": tmp326, f"tmp327": tmp327, f"tmp329": tmp329, f"tmp33": tmp33, f"tmp334": tmp334, f"tmp335": tmp335, f"tmp337": tmp337, f"tmp339": tmp339, f"tmp34": tmp34, f"tmp340": tmp340, f"tmp344": tmp344, f"tmp346": tmp346, f"tmp351": tmp351, f"tmp352": tmp352, f"tmp354": tmp354, f"tmp358": tmp358, f"tmp36": tmp36, f"tmp369": tmp369, f"tmp37": tmp37, f"tmp375": tmp375, f"tmp377": tmp377, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp41": tmp41, f"tmp415": tmp415, f"tmp418": tmp418, f"tmp42": tmp42, f"tmp420": tmp420, f"tmp44": tmp44, f"tmp45": tmp45, f"tmp46": tmp46, f"tmp461": tmp461, f"tmp462": tmp462, f"tmp463": tmp463, f"tmp464": tmp464, f"tmp467": tmp467, f"tmp469": tmp469, f"tmp47": tmp47, f"tmp471": tmp471, f"tmp48": tmp48, f"tmp486": tmp486, f"tmp487": tmp487, f"tmp489": tmp489, f"tmp491": tmp491, f"tmp492": tmp492, f"tmp493": tmp493, f"tmp5": tmp5, f"tmp50": tmp50, f"tmp52": tmp52, f"tmp54": tmp54, f"tmp55": tmp55, f"tmp56": tmp56, f"tmp57": tmp57, f"tmp59": tmp59, f"tmp60": tmp60, f"tmp62": tmp62, f"tmp64": tmp64, f"tmp65": tmp65, f"tmp67": tmp67, f"tmp68": tmp68, f"tmp7": tmp7, f"tmp70": tmp70, f"tmp72": tmp72, f"tmp74": tmp74, f"tmp75": tmp75, f"tmp77": tmp77, f"tmp78": tmp78, f"tmp79": tmp79, f"tmp8": tmp8, f"tmp80": tmp80, f"tmp82": tmp82, f"tmp83": tmp83, f"tmp85": tmp85, f"tmp87": tmp87, f"tmp89": tmp89, f"tmp91": tmp91, f"tmp94": tmp94, f"tmp97": tmp97, f"tmp99": tmp99} - -def hbar_lmatvec_ip(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:24:45.546867. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp50 = np.copy(ints.tmp41) - tmp50 += ints.tmp56 * 2 - tmp50 += ints.tmp59 - tmp50 += v.baa.xov - tmp47 = einsum(t1.aa, (0, 1), r2.aba, (2, 3, 1), (2, 0, 3)) - tmp30 = np.copy(ints.tmp27) - del ints.tmp27 - tmp30 += v.baa.xoo - tmp33 = np.copy(ints.tmp106) - del ints.tmp106 - tmp33 += v.bbb.xoo - tmp52 = einsum(r2.bbb, (0, 1, 2), t1.bb, (3, 2), (0, 1, 3)) - tmp16 = np.copy(ints.tmp45) - tmp16 += ints.tmp77 - tmp16 += v.bbb.xov - tmp16 += ints.tmp82 * 2 - tmp14 = np.copy(ints.tmp41) - del ints.tmp41 - tmp14 += ints.tmp59 - del ints.tmp59 - tmp14 += v.baa.xov - tmp14 += ints.tmp56 * 2 - del ints.tmp56 - tmp27 = einsum(t1.aa, (0, 1), r2.aaa, (2, 3, 1), (2, 3, 0)) - tmp32 = einsum(r2.bab, (0, 1, 2), t1.bb, (3, 2), (1, 0, 3)) * -1 - tmp74 = einsum(tmp50, (0, 1, 2), r2.aba, (1, 3, 2), (0, 3)) * 0.5 - tmp75 = einsum(tmp30, (0, 1, 2), tmp47, (1, 2, 3), (0, 3)) * 0.5 - tmp76 = einsum(tmp52, (0, 1, 2), tmp33, (3, 0, 2), (3, 1)) - tmp55 = einsum(t2.abab, (0, 1, 2, 3), r2.aba, (0, 1, 2), (3,)) - tmp56 = einsum(t2.bbbb, (0, 1, 2, 3), r2.bbb, (0, 1, 3), (2,)) - tmp17 = einsum(r2.bab, (0, 1, 2), tmp16, (3, 0, 2), (3, 1)) * -1 - tmp15 = einsum(r2.aaa, (0, 1, 2), tmp14, (3, 1, 2), (3, 0)) * -1 - del tmp14 - tmp31 = einsum(tmp30, (0, 1, 2), tmp27, (1, 3, 2), (0, 3)) - tmp34 = einsum(tmp32, (0, 1, 2), tmp33, (3, 1, 2), (3, 0)) * 0.5 - tmp64 = np.copy(f.bb.ov) - tmp64 += ints.tmp44 - tmp64 += ints.tmp47 - tmp64 += ints.tmp107 * -1 - del ints.tmp107 - tmp88 = np.copy(f.bb.oo) - tmp88 += ints.tmp183 - tmp88 += ints.tmp187 - tmp88 += np.transpose(ints.tmp21, (1, 0)) - tmp88 += ints.tmp221 - tmp88 += ints.tmp225 - tmp58 = np.copy(ints.tmp464) - del ints.tmp464 - tmp58 += ints.tmp467 - del ints.tmp467 - tmp58 += ints.tmp471 * 2 - del ints.tmp471 - tmp86 = einsum(tmp16, (0, 1, 2), r2.bbb, (3, 1, 2), (0, 3)) * -1 - del tmp16 - tmp62 = np.copy(ints.tmp137) - tmp62 += np.transpose(ints.tmp64, (0, 2, 1, 3)) - tmp77 = np.copy(tmp74) - del tmp74 - tmp77 += tmp75 * -1 - del tmp75 - tmp77 += tmp76 * -1 - del tmp76 - tmp81 = np.copy(ints.tmp158) * 2 - tmp81 += ints.tmp161 - tmp81 += ints.tmp181 * -1 - tmp81 += ints.tmp219 * -1 - tmp79 = np.copy(tmp55) * -0.5 - tmp79 += tmp56 - tmp41 = np.copy(f.aa.ov) - tmp41 += ints.tmp39 - tmp41 += ints.tmp48 - tmp41 += ints.tmp99 * -1 - del ints.tmp99 - tmp18 = np.copy(tmp15) * -2 - del tmp15 - tmp18 += tmp17 - del tmp17 - tmp20 = np.copy(f.aa.oo) - tmp20 += ints.tmp175 - tmp20 += ints.tmp176 - tmp20 += np.transpose(ints.tmp1, (1, 0)) - tmp20 += ints.tmp30 - tmp20 += ints.tmp32 - tmp10 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (1, 0, 3), (2,)) * -1 - tmp12 = np.copy(ints.tmp358) - tmp12 += ints.tmp369 - tmp12 += ints.tmp375 * 2 - tmp25 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (0, 1, 3), (2,)) - tmp35 = np.copy(tmp31) * -1 - del tmp31 - tmp35 += tmp34 - del tmp34 - tmp28 = np.copy(ints.tmp23) - tmp28 += np.transpose(ints.tmp50, (0, 2, 1, 3)) - tmp37 = np.copy(ints.tmp57) * 2 - tmp37 += ints.tmp60 - tmp37 += ints.tmp174 * -1 - tmp37 += ints.tmp28 * -1 - tmp65 = einsum(tmp64, (0, 1), t1.bb, (0, 2), (2, 1)) - tmp84 = einsum(r1.b, (0,), ints.tmp137, (0, 1, 2, 3), (1, 2, 3)) - tmp89 = einsum(r2.bbb, (0, 1, 2), tmp88, (1, 3), (0, 3, 2)) * -1 - del tmp88 - tmp85 = einsum(tmp58, (0, 1, 2, 3), r2.bbb, (4, 0, 2), (4, 1, 3)) * -1 - tmp87 = einsum(v.bbb.xov, (0, 1, 2), tmp86, (0, 3), (1, 3, 2)) * -1 - del tmp86 - tmp73 = einsum(tmp52, (0, 1, 2), tmp62, (0, 2, 3, 4), (1, 3, 4)) * 2 - tmp70 = einsum(r1.b, (0,), ints.tmp64, (1, 0, 2, 3), (1, 2, 3)) - tmp78 = einsum(v.bbb.xov, (0, 1, 2), tmp77, (0, 3), (1, 3, 2)) * 2 - del tmp77 - tmp72 = einsum(ints.tmp334, (0, 1, 2, 3), r2.bbb, (1, 0, 4), (2, 3, 4)) * -1 - del ints.tmp334 - tmp71 = einsum(ints.tmp469, (0, 1, 2, 3), r2.aba, (0, 4, 2), (1, 4, 3)) - tmp82 = einsum(r2.bbb, (0, 1, 2), tmp81, (1, 3), (0, 3, 2)) * -2 - del tmp81 - tmp80 = einsum(ints.tmp325, (0, 1, 2, 3), tmp79, (3,), (0, 1, 2)) * 2 - del ints.tmp325, tmp79 - tmp51 = np.copy(ints.tmp45) - del ints.tmp45 - tmp51 += ints.tmp77 - del ints.tmp77 - tmp51 += ints.tmp82 * 2 - del ints.tmp82 - tmp51 += v.bbb.xov - tmp42 = einsum(tmp41, (0, 1), t1.aa, (0, 2), (2, 1)) - tmp8 = einsum(ints.tmp50, (0, 1, 2, 3), r1.a, (0,), (1, 2, 3)) - tmp19 = einsum(tmp18, (0, 1), v.baa.xov, (0, 2, 3), (2, 1, 3)) - del tmp18 - tmp21 = einsum(tmp20, (0, 1), r2.aaa, (2, 0, 3), (2, 1, 3)) * -1 - del tmp20 - tmp9 = einsum(r2.bab, (0, 1, 2), ints.tmp377, (3, 0, 4, 2), (3, 1, 4)) * -1 - tmp11 = einsum(tmp10, (0,), ints.tmp166, (1, 2, 3, 0), (1, 2, 3)) - tmp13 = einsum(tmp12, (0, 1, 2, 3), r2.aaa, (4, 0, 2), (4, 1, 3)) * -1 - del tmp12 - tmp26 = einsum(tmp25, (0,), ints.tmp166, (1, 2, 3, 0), (1, 2, 3)) - del ints.tmp166 - tmp36 = einsum(tmp35, (0, 1), v.baa.xov, (0, 2, 3), (2, 1, 3)) * 2 - del tmp35 - tmp29 = einsum(tmp28, (0, 1, 2, 3), tmp27, (0, 4, 2), (4, 1, 3)) * 2 - del tmp28 - tmp38 = einsum(tmp37, (0, 1), r2.aaa, (2, 0, 3), (2, 1, 3)) * -2 - del tmp37 - tmp23 = einsum(ints.tmp23, (0, 1, 2, 3), r1.a, (1,), (0, 2, 3)) - tmp24 = einsum(r2.aaa, (0, 1, 2), ints.tmp189, (1, 0, 3, 4), (3, 4, 2)) * -1 - del ints.tmp189 - tmp66 = np.copy(np.transpose(ints.tmp486, (1, 0))) - del ints.tmp486 - tmp66 += ints.tmp487 * 2 - del ints.tmp487 - tmp66 += ints.tmp489 - del ints.tmp489 - tmp66 += f.bb.vv * -1 - tmp66 += ints.tmp203 * -1 - del ints.tmp203 - tmp66 += ints.tmp206 * -1 - del ints.tmp206 - tmp66 += tmp65 - del tmp65 - tmp90 = np.copy(tmp84) - del tmp84 - tmp90 += np.transpose(tmp85, (1, 0, 2)) * -2 - del tmp85 - tmp90 += np.transpose(tmp87, (1, 0, 2)) * 2 - del tmp87 - tmp90 += np.transpose(tmp89, (1, 0, 2)) * -2 - del tmp89 - tmp83 = np.copy(tmp70) - del tmp70 - tmp83 += tmp71 - del tmp71 - tmp83 += tmp72 * 2 - del tmp72 - tmp83 += np.transpose(tmp73, (1, 0, 2)) * -1 - del tmp73 - tmp83 += np.transpose(tmp78, (1, 0, 2)) - del tmp78 - tmp83 += tmp80 * -1 - del tmp80 - tmp83 += np.transpose(tmp82, (1, 0, 2)) - del tmp82 - tmp91 = np.copy(np.transpose(ints.tmp326, (2, 3, 0, 1))) - del ints.tmp326 - tmp91 += np.transpose(ints.tmp351, (2, 3, 0, 1)) - del ints.tmp351 - tmp91 += ints.tmp246 * -1 - del ints.tmp246 - tmp4 = np.copy(f.aa.oo) - tmp4 += ints.tmp175 - tmp4 += ints.tmp176 - tmp4 += np.transpose(ints.tmp1, (1, 0)) - tmp4 += np.transpose(ints.tmp30, (1, 0)) - tmp4 += np.transpose(ints.tmp32, (1, 0)) - tmp4 += ints.tmp57 * 2 - tmp4 += ints.tmp60 - tmp4 += ints.tmp174 * -1 - tmp4 += ints.tmp28 * -1 - tmp69 = np.copy(ints.tmp25) - tmp69 += np.transpose(ints.tmp54, (1, 0, 2, 3)) - tmp68 = np.copy(tmp25) * 2 - del tmp25 - tmp68 += tmp10 - del tmp10 - tmp63 = einsum(r2.aaa, (0, 1, 2), tmp50, (3, 1, 2), (3, 0)) * 2 - tmp63 += einsum(r2.bab, (0, 1, 2), tmp51, (3, 0, 2), (3, 1)) * -1 - tmp63 += einsum(tmp30, (0, 1, 2), tmp27, (1, 3, 2), (0, 3)) * 2 - del tmp27 - tmp63 += einsum(tmp32, (0, 1, 2), tmp33, (3, 1, 2), (3, 0)) * -1 - tmp60 = np.copy(ints.tmp171) - tmp60 += ints.tmp194 - tmp60 += np.transpose(ints.tmp196, (1, 0, 2, 3)) - tmp60 += ints.tmp230 - tmp60 += np.transpose(ints.tmp36, (1, 0, 2, 3)) - tmp67 = np.copy(f.bb.oo) - tmp67 += ints.tmp158 * 2 - tmp67 += ints.tmp161 - tmp67 += ints.tmp183 - tmp67 += ints.tmp187 - tmp67 += np.transpose(ints.tmp21, (1, 0)) - tmp67 += ints.tmp221 - tmp67 += ints.tmp225 - tmp67 += ints.tmp181 * -1 - tmp67 += ints.tmp219 * -1 - tmp61 = np.copy(ints.tmp25) - tmp61 += np.transpose(ints.tmp54, (1, 0, 2, 3)) - tmp59 = np.copy(ints.tmp491) - del ints.tmp491 - tmp59 += np.transpose(ints.tmp492, (1, 0, 2, 3)) - del ints.tmp492 - tmp59 += np.transpose(ints.tmp493, (1, 0, 2, 3)) * -1 - del ints.tmp493 - tmp54 = np.copy(f.aa.oo) - tmp54 += ints.tmp175 - del ints.tmp175 - tmp54 += ints.tmp176 - del ints.tmp176 - tmp54 += np.transpose(ints.tmp1, (1, 0)) - del ints.tmp1 - tmp54 += ints.tmp30 - del ints.tmp30 - tmp54 += ints.tmp32 - del ints.tmp32 - tmp54 += ints.tmp57 * 2 - del ints.tmp57 - tmp54 += ints.tmp60 - del ints.tmp60 - tmp54 += ints.tmp174 * -1 - del ints.tmp174 - tmp54 += ints.tmp28 * -1 - del ints.tmp28 - tmp48 = np.copy(ints.tmp23) - tmp48 += np.transpose(ints.tmp50, (0, 2, 1, 3)) - tmp43 = np.copy(np.transpose(ints.tmp415, (1, 0))) - del ints.tmp415 - tmp43 += ints.tmp418 * 2 - del ints.tmp418 - tmp43 += ints.tmp420 - del ints.tmp420 - tmp43 += f.aa.vv * -1 - tmp43 += ints.tmp198 * -1 - del ints.tmp198 - tmp43 += ints.tmp208 * -1 - del ints.tmp208 - tmp43 += tmp42 - del tmp42 - tmp46 = np.copy(ints.tmp171) - del ints.tmp171 - tmp46 += np.transpose(ints.tmp194, (0, 1, 3, 2)) - del ints.tmp194 - tmp46 += np.transpose(ints.tmp196, (1, 0, 2, 3)) - del ints.tmp196 - tmp46 += ints.tmp230 - del ints.tmp230 - tmp46 += np.transpose(ints.tmp36, (0, 1, 3, 2)) - del ints.tmp36 - tmp49 = np.copy(ints.tmp142) - tmp49 += np.transpose(ints.tmp67, (0, 2, 1, 3)) - tmp7 = np.copy(f.bb.oo) - tmp7 += ints.tmp158 * 2 - del ints.tmp158 - tmp7 += ints.tmp161 - del ints.tmp161 - tmp7 += np.transpose(ints.tmp183, (1, 0)) - del ints.tmp183 - tmp7 += np.transpose(ints.tmp187, (1, 0)) - del ints.tmp187 - tmp7 += np.transpose(ints.tmp21, (1, 0)) - del ints.tmp21 - tmp7 += ints.tmp221 - del ints.tmp221 - tmp7 += ints.tmp225 - del ints.tmp225 - tmp7 += ints.tmp181 * -1 - del ints.tmp181 - tmp7 += ints.tmp219 * -1 - del ints.tmp219 - tmp45 = np.copy(ints.tmp461) - del ints.tmp461 - tmp45 += np.transpose(ints.tmp462, (1, 0, 2, 3)) - del ints.tmp462 - tmp45 += np.transpose(ints.tmp463, (1, 0, 2, 3)) * -1 - del ints.tmp463 - tmp57 = np.copy(tmp55) * -1 - del tmp55 - tmp57 += tmp56 * 2 - del tmp56 - tmp44 = np.copy(ints.tmp358) - del ints.tmp358 - tmp44 += ints.tmp369 - del ints.tmp369 - tmp44 += ints.tmp375 * 2 - del ints.tmp375 - tmp53 = einsum(tmp50, (0, 1, 2), r2.aba, (1, 3, 2), (0, 3)) * -1 - del tmp50 - tmp53 += einsum(tmp51, (0, 1, 2), r2.bbb, (3, 1, 2), (0, 3)) * 2 - del tmp51 - tmp53 += einsum(tmp30, (0, 1, 2), tmp47, (1, 2, 3), (0, 3)) - del tmp30 - tmp53 += einsum(tmp52, (0, 1, 2), tmp33, (3, 0, 2), (3, 1)) * 2 - del tmp52, tmp33 - tmp40 = np.copy(ints.tmp167) - del ints.tmp167 - tmp40 += ints.tmp227 - del ints.tmp227 - tmp40 += np.transpose(ints.tmp33, (2, 3, 0, 1)) * -1 - del ints.tmp33 - tmp22 = np.copy(tmp8) - del tmp8 - tmp22 += tmp9 - del tmp9 - tmp22 += tmp11 - del tmp11 - tmp22 += np.transpose(tmp13, (1, 0, 2)) * -2 - del tmp13 - tmp22 += np.transpose(tmp19, (1, 0, 2)) - del tmp19 - tmp22 += np.transpose(tmp21, (1, 0, 2)) * -2 - del tmp21 - tmp39 = np.copy(tmp23) - del tmp23 - tmp39 += tmp24 * 2 - del tmp24 - tmp39 += tmp26 * -2 - del tmp26 - tmp39 += np.transpose(tmp29, (1, 0, 2)) * -1 - del tmp29 - tmp39 += np.transpose(tmp36, (1, 0, 2)) - del tmp36 - tmp39 += np.transpose(tmp38, (1, 0, 2)) - del tmp38 - tmp5 = np.copy(ints.tmp142) - del ints.tmp142 - tmp5 += np.transpose(ints.tmp239, (0, 2, 1, 3)) - del ints.tmp239 - tmp5 += np.transpose(ints.tmp257, (0, 2, 1, 3)) - del ints.tmp257 - tmp5 += ints.tmp267 - del ints.tmp267 - tmp5 += ints.tmp271 * 2 - del ints.tmp271 - tmp5 += ints.tmp283 - del ints.tmp283 - tmp5 += ints.tmp298 - del ints.tmp298 - tmp5 += ints.tmp302 - del ints.tmp302 - tmp5 += ints.tmp310 - del ints.tmp310 - tmp5 += ints.tmp316 * 2 - del ints.tmp316 - tmp5 += ints.tmp346 - del ints.tmp346 - tmp5 += np.transpose(ints.tmp67, (0, 2, 1, 3)) - del ints.tmp67 - tmp5 += np.transpose(ints.tmp249, (0, 2, 1, 3)) * -1 - del ints.tmp249 - tmp5 += ints.tmp264 * -1 - del ints.tmp264 - tmp5 += ints.tmp270 * -1 - del ints.tmp270 - tmp5 += ints.tmp294 * -1 - del ints.tmp294 - tmp5 += ints.tmp313 * -1 - del ints.tmp313 - tmp5 += ints.tmp320 * -1 - del ints.tmp320 - tmp5 += ints.tmp329 * -1 - del ints.tmp329 - tmp5 += ints.tmp339 * -1 - del ints.tmp339 - tmp5 += np.transpose(ints.tmp340, (0, 2, 1, 3)) * -1 - del ints.tmp340 - tmp5 += ints.tmp354 * -1 - del ints.tmp354 - tmp2 = np.copy(ints.tmp102) * 0.5 - del ints.tmp102 - tmp2 += ints.tmp110 - del ints.tmp110 - tmp2 += ints.tmp138 - del ints.tmp138 - tmp2 += ints.tmp143 * 0.5 - del ints.tmp143 - tmp2 += ints.tmp159 - del ints.tmp159 - tmp2 += ints.tmp162 * 0.5 - del ints.tmp162 - tmp2 += ints.tmp184 * 0.5 - del ints.tmp184 - tmp2 += ints.tmp188 * 0.5 - del ints.tmp188 - tmp2 += ints.tmp205 * 0.5 - del ints.tmp205 - tmp2 += ints.tmp222 * 0.5 - del ints.tmp222 - tmp2 += ints.tmp226 * 0.5 - del ints.tmp226 - tmp2 += ints.tmp22 * 0.5 - del ints.tmp22 - tmp2 += ints.tmp46 * 0.5 - del ints.tmp46 - tmp2 += ints.tmp4 * 0.5 - del ints.tmp4 - tmp2 += ints.tmp65 - del ints.tmp65 - tmp2 += ints.tmp68 * 0.5 - del ints.tmp68 - tmp2 += ints.tmp87 - del ints.tmp87 - tmp2 += f.bb.ov * -0.5 - tmp2 += ints.tmp105 * -0.5 - del ints.tmp105 - tmp2 += ints.tmp10 * -0.5 - del ints.tmp10 - tmp2 += ints.tmp114 * -1 - del ints.tmp114 - tmp2 += ints.tmp118 * -0.5 - del ints.tmp118 - tmp2 += ints.tmp121 * -1 - del ints.tmp121 - tmp2 += ints.tmp13 * -1 - del ints.tmp13 - tmp2 += ints.tmp182 * -0.5 - del ints.tmp182 - tmp2 += ints.tmp204 * -0.5 - del ints.tmp204 - tmp2 += ints.tmp207 * -0.5 - del ints.tmp207 - tmp2 += ints.tmp220 * -0.5 - del ints.tmp220 - tmp2 += ints.tmp44 * -0.5 - del ints.tmp44 - tmp2 += ints.tmp47 * -0.5 - del ints.tmp47 - tmp2 += ints.tmp7 * -0.5 - del ints.tmp7 - tmp2 += ints.tmp89 * -0.5 - del ints.tmp89 - tmp6 = np.copy(np.transpose(ints.tmp241, (1, 2, 0, 3))) - del ints.tmp241 - tmp6 += np.transpose(ints.tmp247, (0, 2, 1, 3)) - del ints.tmp247 - tmp6 += np.transpose(ints.tmp255, (0, 2, 1, 3)) - del ints.tmp255 - tmp6 += ints.tmp268 * 2 - del ints.tmp268 - tmp6 += ints.tmp273 - del ints.tmp273 - tmp6 += ints.tmp300 - del ints.tmp300 - tmp6 += ints.tmp304 - del ints.tmp304 - tmp6 += ints.tmp314 * 2 - del ints.tmp314 - tmp6 += ints.tmp327 - del ints.tmp327 - tmp6 += ints.tmp335 - del ints.tmp335 - tmp6 += ints.tmp352 - del ints.tmp352 - tmp6 += ints.tmp137 * -1 - del ints.tmp137 - tmp6 += ints.tmp265 * -2 - del ints.tmp265 - tmp6 += ints.tmp280 * -1 - del ints.tmp280 - tmp6 += ints.tmp296 * -1 - del ints.tmp296 - tmp6 += ints.tmp311 * -2 - del ints.tmp311 - tmp6 += ints.tmp318 * -1 - del ints.tmp318 - tmp6 += np.transpose(ints.tmp337, (0, 2, 1, 3)) * -1 - del ints.tmp337 - tmp6 += ints.tmp344 * -1 - del ints.tmp344 - tmp6 += np.transpose(ints.tmp64, (1, 2, 0, 3)) * -1 - del ints.tmp64 - tmp3 = np.copy(ints.tmp100) - del ints.tmp100 - tmp3 += ints.tmp108 * 0.5 - del ints.tmp108 - tmp3 += ints.tmp135 - del ints.tmp135 - tmp3 += ints.tmp140 * 0.5 - del ints.tmp140 - tmp3 += ints.tmp156 - del ints.tmp156 - tmp3 += ints.tmp164 * 0.5 - del ints.tmp164 - tmp3 += ints.tmp179 * 0.5 - del ints.tmp179 - tmp3 += ints.tmp185 * 0.5 - del ints.tmp185 - tmp3 += ints.tmp19 * 0.5 - del ints.tmp19 - tmp3 += ints.tmp201 * 0.5 - del ints.tmp201 - tmp3 += ints.tmp217 * 0.5 - del ints.tmp217 - tmp3 += ints.tmp223 * 0.5 - del ints.tmp223 - tmp3 += ints.tmp2 * 0.5 - del ints.tmp2 - tmp3 += ints.tmp42 * 0.5 - del ints.tmp42 - tmp3 += ints.tmp62 - del ints.tmp62 - tmp3 += ints.tmp70 * 0.5 - del ints.tmp70 - tmp3 += ints.tmp85 - del ints.tmp85 - tmp3 += f.aa.ov * -0.5 - tmp3 += ints.tmp103 * -1 - del ints.tmp103 - tmp3 += ints.tmp112 * -0.5 - del ints.tmp112 - tmp3 += ints.tmp116 * -1 - del ints.tmp116 - tmp3 += ints.tmp119 * -0.5 - del ints.tmp119 - tmp3 += ints.tmp11 * -0.5 - del ints.tmp11 - tmp3 += ints.tmp177 * -0.5 - del ints.tmp177 - tmp3 += ints.tmp199 * -0.5 - del ints.tmp199 - tmp3 += ints.tmp209 * -0.5 - del ints.tmp209 - tmp3 += ints.tmp215 * -0.5 - del ints.tmp215 - tmp3 += ints.tmp39 * -0.5 - del ints.tmp39 - tmp3 += ints.tmp48 * -0.5 - del ints.tmp48 - tmp3 += ints.tmp5 * -0.5 - del ints.tmp5 - tmp3 += ints.tmp8 * -1 - del ints.tmp8 - tmp3 += ints.tmp91 * -0.5 - del ints.tmp91 - tmp0 = np.copy(ints.tmp129) - del ints.tmp129 - tmp0 += ints.tmp133 - del ints.tmp133 - tmp0 += ints.tmp147 - del ints.tmp147 - tmp0 += ints.tmp153 * 2 - del ints.tmp153 - tmp0 += np.transpose(ints.tmp17, (1, 0, 2, 3)) - del ints.tmp17 - tmp0 += ints.tmp213 - del ints.tmp213 - tmp0 += np.transpose(ints.tmp25, (1, 0, 2, 3)) - del ints.tmp25 - tmp0 += ints.tmp54 - del ints.tmp54 - tmp0 += np.transpose(ints.tmp55, (1, 0, 2, 3)) - del ints.tmp55 - tmp0 += ints.tmp78 - del ints.tmp78 - tmp0 += ints.tmp83 * 2 - del ints.tmp83 - tmp0 += ints.tmp97 - del ints.tmp97 - tmp0 += ints.tmp125 * -1 - del ints.tmp125 - tmp0 += ints.tmp150 * -1 - del ints.tmp150 - tmp0 += ints.tmp155 * -1 - del ints.tmp155 - tmp0 += ints.tmp172 * -1 - del ints.tmp172 - tmp0 += ints.tmp195 * -1 - del ints.tmp195 - tmp0 += np.transpose(ints.tmp197, (1, 0, 2, 3)) * -1 - del ints.tmp197 - tmp0 += ints.tmp231 * -1 - del ints.tmp231 - tmp0 += ints.tmp37 * -1 - del ints.tmp37 - tmp0 += ints.tmp74 * -1 - del ints.tmp74 - tmp0 += ints.tmp79 * -1 - del ints.tmp79 - tmp1 = np.copy(ints.tmp127) - del ints.tmp127 - tmp1 += ints.tmp131 - del ints.tmp131 - tmp1 += ints.tmp148 * 2 - del ints.tmp148 - tmp1 += np.transpose(ints.tmp15, (1, 2, 0, 3)) - del ints.tmp15 - tmp1 += ints.tmp168 - del ints.tmp168 - tmp1 += ints.tmp190 - del ints.tmp190 - tmp1 += ints.tmp228 - del ints.tmp228 - tmp1 += np.transpose(ints.tmp34, (0, 2, 1, 3)) - del ints.tmp34 - tmp1 += np.transpose(ints.tmp52, (0, 2, 1, 3)) - del ints.tmp52 - tmp1 += ints.tmp75 * 2 - del ints.tmp75 - tmp1 += ints.tmp80 - del ints.tmp80 - tmp1 += ints.tmp123 * -1 - del ints.tmp123 - tmp1 += ints.tmp145 * -2 - del ints.tmp145 - tmp1 += ints.tmp151 * -1 - del ints.tmp151 - tmp1 += np.transpose(ints.tmp192, (0, 2, 1, 3)) * -1 - del ints.tmp192 - tmp1 += ints.tmp211 * -1 - del ints.tmp211 - tmp1 += np.transpose(ints.tmp23, (1, 2, 0, 3)) * -1 - del ints.tmp23 - tmp1 += ints.tmp50 * -1 - del ints.tmp50 - tmp1 += ints.tmp72 * -2 - del ints.tmp72 - tmp1 += ints.tmp94 * -1 - del ints.tmp94 - r2new.bbb = np.copy(tmp83) * -1 - r2new.bbb += np.transpose(tmp83, (1, 0, 2)) - del tmp83 - r2new.bbb += tmp90 - r2new.bbb += np.transpose(tmp90, (1, 0, 2)) * -1 - del tmp90 - r2new.bbb += einsum(tmp91, (0, 1, 2, 3), r2.bbb, (2, 3, 4), (0, 1, 4)) * 2 - del tmp91 - r2new.bbb += einsum(tmp66, (0, 1), r2.bbb, (2, 3, 0), (2, 3, 1)) * -2 - r2new.bbb += einsum(r1.b, (0,), tmp64, (1, 2), (0, 1, 2)) - r2new.bbb += einsum(tmp64, (0, 1), r1.b, (2,), (0, 2, 1)) * -1 - r2new.bab = einsum(ints.tmp469, (0, 1, 2, 3), r2.aaa, (4, 0, 2), (1, 4, 3)) * 2 - del ints.tmp469 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp58, (0, 3, 2, 4), (3, 1, 4)) * -1 - del tmp58 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp59, (3, 1, 2, 4), (0, 3, 4)) * -1 - del tmp59 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp60, (1, 3, 0, 4), (4, 3, 2)) - del tmp60 - r2new.bab += einsum(tmp32, (0, 1, 2), tmp61, (3, 0, 2, 4), (1, 3, 4)) * -1 - del tmp61 - r2new.bab += einsum(tmp62, (0, 1, 2, 3), tmp32, (4, 0, 1), (2, 4, 3)) * -1 - del tmp32, tmp62 - r2new.bab += einsum(v.bbb.xov, (0, 1, 2), tmp63, (0, 3), (1, 3, 2)) * -1 - del tmp63 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp66, (2, 3), (0, 1, 3)) * -1 - del tmp66 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp4, (1, 3), (0, 3, 2)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp67, (0, 3), (3, 1, 2)) * -1 - del tmp67 - r2new.bab += einsum(tmp68, (0,), ints.tmp170, (1, 2, 0, 3), (2, 1, 3)) - del tmp68 - r2new.bab += einsum(r1.a, (0,), tmp69, (1, 0, 2, 3), (2, 1, 3)) - del tmp69 - r2new.bab += einsum(tmp64, (0, 1), r1.a, (2,), (0, 2, 1)) * -1 - del tmp64 - r2new.aba = einsum(r2.bbb, (0, 1, 2), ints.tmp377, (3, 1, 4, 2), (3, 0, 4)) * 2 - del ints.tmp377 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp44, (0, 3, 2, 4), (3, 1, 4)) * -1 - del tmp44 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp45, (3, 1, 2, 4), (0, 3, 4)) * -1 - del tmp45 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp46, (0, 3, 1, 4), (3, 4, 2)) - del tmp46 - r2new.aba += einsum(tmp47, (0, 1, 2), tmp48, (0, 3, 1, 4), (3, 2, 4)) - del tmp48 - r2new.aba += einsum(tmp47, (0, 1, 2), tmp49, (1, 2, 3, 4), (0, 3, 4)) - del tmp47 - r2new.aba += einsum(tmp53, (0, 1), v.baa.xov, (0, 2, 3), (2, 1, 3)) * -1 - del tmp53 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp43, (2, 3), (0, 1, 3)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp54, (0, 3), (3, 1, 2)) * -1 - del tmp54 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp7, (1, 3), (0, 3, 2)) * -1 - r2new.aba += einsum(ints.tmp170, (0, 1, 2, 3), tmp57, (3,), (0, 1, 2)) - del ints.tmp170, tmp57 - r2new.aba += einsum(r1.b, (0,), tmp49, (1, 0, 2, 3), (1, 2, 3)) - del tmp49 - r2new.aba += einsum(r1.b, (0,), tmp41, (1, 2), (1, 0, 2)) * -1 - r2new.aaa = np.copy(tmp22) - r2new.aaa += np.transpose(tmp22, (1, 0, 2)) * -1 - del tmp22 - r2new.aaa += tmp39 * -1 - r2new.aaa += np.transpose(tmp39, (1, 0, 2)) - del tmp39 - r2new.aaa += einsum(tmp40, (0, 1, 2, 3), r2.aaa, (0, 1, 4), (2, 3, 4)) * 2 - del tmp40 - r2new.aaa += einsum(tmp43, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp43 - r2new.aaa += einsum(r1.a, (0,), tmp41, (1, 2), (0, 1, 2)) - r2new.aaa += einsum(r1.a, (0,), tmp41, (1, 2), (1, 0, 2)) * -1 - del tmp41 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp5, (0, 1, 3, 2), (3,)) - del tmp5 - r1new.b += einsum(r2.bbb, (0, 1, 2), tmp6, (0, 1, 3, 2), (3,)) * 2 - del tmp6 - r1new.b += einsum(tmp2, (0, 1), r2.bbb, (2, 0, 1), (2,)) * -4 - r1new.b += einsum(r2.aba, (0, 1, 2), tmp3, (0, 2), (1,)) * 2 - r1new.b += einsum(r1.b, (0,), tmp7, (0, 1), (1,)) * -1 - del tmp7 - r1new.a = einsum(r2.bab, (0, 1, 2), tmp0, (1, 3, 0, 2), (3,)) - del tmp0 - r1new.a += einsum(tmp1, (0, 1, 2, 3), r2.aaa, (1, 0, 3), (2,)) * -2 - del tmp1 - r1new.a += einsum(r2.bab, (0, 1, 2), tmp2, (0, 2), (1,)) * 2 - del tmp2 - r1new.a += einsum(r2.aaa, (0, 1, 2), tmp3, (1, 2), (0,)) * -4 - del tmp3 - r1new.a += einsum(r1.a, (0,), tmp4, (0, 1), (1,)) * -1 - del tmp4 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_lmatvec_ea_intermediates(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:29:26.557922. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp10 : array - tmp100 : array - tmp101 : array - tmp102 : array - tmp103 : array - tmp105 : array - tmp106 : array - tmp108 : array - tmp109 : array - tmp11 : array - tmp110 : array - tmp111 : array - tmp113 : array - tmp115 : array - tmp117 : array - tmp119 : array - tmp121 : array - tmp122 : array - tmp124 : array - tmp13 : array - tmp132 : array - tmp133 : array - tmp135 : array - tmp136 : array - tmp138 : array - tmp139 : array - tmp141 : array - tmp142 : array - tmp144 : array - tmp146 : array - tmp148 : array - tmp149 : array - tmp151 : array - tmp152 : array - tmp154 : array - tmp155 : array - tmp157 : array - tmp158 : array - tmp160 : array - tmp162 : array - tmp163 : array - tmp165 : array - tmp166 : array - tmp168 : array - tmp170 : array - tmp171 : array - tmp172 : array - tmp174 : array - tmp175 : array - tmp177 : array - tmp178 : array - tmp179 : array - tmp180 : array - tmp181 : array - tmp182 : array - tmp184 : array - tmp185 : array - tmp19 : array - tmp190 : array - tmp192 : array - tmp194 : array - tmp195 : array - tmp196 : array - tmp197 : array - tmp198 : array - tmp199 : array - tmp2 : array - tmp20 : array - tmp201 : array - tmp203 : array - tmp205 : array - tmp206 : array - tmp207 : array - tmp208 : array - tmp210 : array - tmp211 : array - tmp213 : array - tmp214 : array - tmp215 : array - tmp216 : array - tmp217 : array - tmp218 : array - tmp22 : array - tmp220 : array - tmp221 : array - tmp23 : array - tmp236 : array - tmp239 : array - tmp24 : array - tmp243 : array - tmp246 : array - tmp250 : array - tmp251 : array - tmp253 : array - tmp255 : array - tmp257 : array - tmp26 : array - tmp263 : array - tmp265 : array - tmp271 : array - tmp272 : array - tmp274 : array - tmp275 : array - tmp277 : array - tmp279 : array - tmp281 : array - tmp29 : array - tmp30 : array - tmp301 : array - tmp303 : array - tmp309 : array - tmp31 : array - tmp310 : array - tmp312 : array - tmp313 : array - tmp315 : array - tmp317 : array - tmp319 : array - tmp33 : array - tmp330 : array - tmp332 : array - tmp334 : array - tmp335 : array - tmp34 : array - tmp36 : array - tmp38 : array - tmp387 : array - tmp39 : array - tmp4 : array - tmp40 : array - tmp41 : array - tmp42 : array - tmp426 : array - tmp44 : array - tmp47 : array - tmp49 : array - tmp490 : array - tmp5 : array - tmp52 : array - tmp53 : array - tmp55 : array - tmp57 : array - tmp58 : array - tmp60 : array - tmp61 : array - tmp63 : array - tmp64 : array - tmp66 : array - tmp67 : array - tmp69 : array - tmp7 : array - tmp70 : array - tmp72 : array - tmp73 : array - tmp75 : array - tmp77 : array - tmp79 : array - tmp8 : array - tmp81 : array - tmp82 : array - tmp84 : array - tmp85 : array - tmp87 : array - tmp89 : array - tmp91 : array - tmp92 : array - tmp94 : array - tmp95 : array - tmp97 : array - tmp99 : array - """ - - tmp28 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp32 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (1, 2), (0,)) - tmp109 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp101 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp41 = einsum(tmp28, (0,), v.bbb.xov, (0, 1, 2), (1, 2)) - tmp42 = einsum(tmp32, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp38 = einsum(tmp32, (0,), v.bbb.xov, (0, 1, 2), (1, 2)) - tmp110 = einsum(v.bbb.xov, (0, 1, 2), tmp109, (0, 1, 3), (3, 2)) - tmp34 = einsum(tmp28, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp102 = einsum(tmp101, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp60 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp84 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp81 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp57 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp30 = einsum(t1.aa, (0, 1), v.baa.xvv, (2, 3, 1), (2, 0, 3)) - tmp39 = einsum(v.bbb.xvv, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp49 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp243 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp138 = einsum(tmp101, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp135 = einsum(tmp109, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp26 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp236 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp72 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp66 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp220 = einsum(tmp41, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp217 = einsum(tmp42, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp215 = einsum(tmp38, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp213 = einsum(tmp110, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp210 = einsum(tmp34, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp207 = einsum(tmp102, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp33 = einsum(tmp32, (0,), v.baa.xvv, (0, 1, 2), (1, 2)) - tmp197 = einsum(tmp28, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp194 = einsum(tmp32, (0,), v.bbb.xvv, (0, 1, 2), (1, 2)) - tmp29 = einsum(tmp28, (0,), v.baa.xvv, (0, 1, 2), (1, 2)) - tmp184 = einsum(tmp28, (0,), v.bbb.xoo, (0, 1, 2), (1, 2)) - tmp181 = einsum(tmp32, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - tmp179 = einsum(tmp32, (0,), v.bbb.xoo, (0, 1, 2), (1, 2)) - del tmp32 - tmp177 = einsum(v.bbb.xoo, (0, 1, 2), tmp109, (0, 2, 3), (1, 3)) - tmp174 = einsum(tmp28, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - del tmp28 - tmp171 = einsum(v.baa.xoo, (0, 1, 2), tmp101, (0, 2, 3), (1, 3)) - tmp44 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp157 = einsum(tmp60, (0, 1, 2), v.baa.xov, (0, 3, 2), (1, 3)) - tmp154 = einsum(v.bbb.xov, (0, 1, 2), tmp84, (0, 3, 2), (3, 1)) - tmp151 = einsum(tmp81, (0, 1, 2), v.bbb.xov, (0, 3, 2), (1, 3)) - tmp148 = einsum(v.baa.xov, (0, 1, 2), tmp57, (0, 3, 2), (3, 1)) - tmp141 = einsum(tmp109, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp132 = einsum(v.baa.xov, (0, 1, 2), tmp101, (0, 3, 4), (3, 1, 4, 2)) - tmp99 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 4, 1, 2)) - tmp24 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp69 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp63 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp22 = einsum(f.bb.ov, (0, 1), t1.bb, (2, 1), (0, 2)) - tmp19 = einsum(t1.aa, (0, 1), f.aa.ov, (2, 1), (2, 0)) - tmp490 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp426 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp387 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp335 = einsum(v.bbb.xov, (0, 1, 2), tmp30, (0, 3, 4), (3, 1, 4, 2)) - tmp334 = einsum(tmp101, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp332 = einsum(v.bbb.xov, (0, 1, 2), tmp39, (0, 3, 4), (3, 1, 2, 4)) - tmp330 = einsum(tmp109, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp319 = einsum(t2.abab, (0, 1, 2, 3), tmp49, (4, 1, 2, 5), (0, 4, 3, 5)) - tmp317 = einsum(v.bbb.xov, (0, 1, 2), tmp84, (0, 3, 4), (3, 1, 4, 2)) - tmp315 = einsum(v.bbb.xov, (0, 1, 2), tmp57, (0, 3, 4), (3, 1, 4, 2)) - tmp313 = einsum(t2.bbbb, (0, 1, 2, 3), tmp243, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp312 = einsum(t2.abab, (0, 1, 2, 3), tmp243, (1, 4, 5, 3), (0, 4, 2, 5)) - tmp310 = einsum(tmp81, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp309 = einsum(tmp60, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp303 = einsum(tmp138, (0, 1, 2, 3), t2.abab, (1, 2, 4, 5), (0, 4, 5, 3)) - tmp301 = einsum(t2.bbbb, (0, 1, 2, 3), tmp135, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp281 = einsum(t2.abab, (0, 1, 2, 3), tmp26, (1, 4, 2, 5), (0, 4, 3, 5)) - tmp279 = einsum(v.bbb.xvv, (0, 1, 2), tmp84, (0, 3, 4), (3, 4, 1, 2)) - tmp277 = einsum(v.bbb.xvv, (0, 1, 2), tmp57, (0, 3, 4), (3, 4, 1, 2)) - tmp275 = einsum(tmp236, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 1), (4, 5, 3, 2)) - tmp274 = einsum(t2.abab, (0, 1, 2, 3), tmp236, (1, 4, 3, 5), (0, 2, 5, 4)) - tmp272 = einsum(tmp81, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp271 = einsum(tmp60, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp265 = einsum(t2.abab, (0, 1, 2, 3), tmp72, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp263 = einsum(t2.bbbb, (0, 1, 2, 3), tmp66, (0, 4, 1, 5), (4, 2, 3, 5)) - tmp257 = einsum(v.bbb.xov, (0, 1, 2), tmp84, (0, 1, 3), (3, 2)) - tmp255 = einsum(tmp81, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp253 = einsum(tmp30, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp251 = einsum(tmp39, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp250 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp246 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp239 = einsum(tmp39, (0, 1, 2), v.bbb.xov, (0, 1, 3), (3, 2)) - tmp221 = einsum(t1.bb, (0, 1), tmp220, (2, 0), (2, 1)) - tmp218 = einsum(t1.aa, (0, 1), tmp217, (2, 0), (2, 1)) - tmp216 = einsum(tmp215, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp214 = einsum(tmp213, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp211 = einsum(t1.aa, (0, 1), tmp210, (2, 0), (2, 1)) - tmp208 = einsum(t1.aa, (0, 1), tmp207, (2, 0), (2, 1)) - tmp206 = einsum(tmp39, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp205 = einsum(v.baa.xvv, (0, 1, 2), tmp109, (0, 3, 4), (3, 4, 1, 2)) - tmp203 = einsum(tmp30, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 4, 2)) - tmp201 = einsum(tmp101, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp199 = einsum(t1.aa, (0, 1), tmp33, (2, 1), (0, 2)) - tmp198 = einsum(tmp197, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp196 = einsum(tmp39, (0, 1, 2), tmp109, (0, 3, 1), (3, 2)) - tmp195 = einsum(tmp194, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp192 = einsum(tmp101, (0, 1, 2), tmp30, (0, 2, 3), (1, 3)) - tmp190 = einsum(t1.aa, (0, 1), tmp29, (2, 1), (0, 2)) - tmp185 = einsum(tmp184, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp182 = einsum(t1.aa, (0, 1), tmp181, (2, 0), (2, 1)) - tmp180 = einsum(t1.bb, (0, 1), tmp179, (2, 0), (2, 1)) - tmp178 = einsum(tmp177, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp175 = einsum(t1.aa, (0, 1), tmp174, (2, 0), (2, 1)) - tmp172 = einsum(t1.aa, (0, 1), tmp171, (2, 0), (2, 1)) - tmp170 = einsum(t2.abab, (0, 1, 2, 3), tmp49, (0, 4, 5, 3), (1, 4, 2, 5)) - tmp168 = einsum(tmp81, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp166 = einsum(v.baa.xov, (0, 1, 2), tmp60, (0, 3, 4), (3, 1, 4, 2)) - tmp165 = einsum(tmp44, (0, 1, 2, 3), t2.abab, (0, 4, 3, 5), (1, 4, 2, 5)) - tmp163 = einsum(tmp44, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 3), (4, 1, 5, 2)) - tmp162 = einsum(tmp84, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp160 = einsum(v.baa.xov, (0, 1, 2), tmp57, (0, 3, 4), (3, 1, 4, 2)) - tmp158 = einsum(t1.aa, (0, 1), tmp157, (2, 0), (2, 1)) - tmp155 = einsum(tmp154, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp152 = einsum(tmp151, (0, 1), t1.bb, (1, 2), (0, 2)) - tmp149 = einsum(t1.aa, (0, 1), tmp148, (2, 0), (2, 1)) - tmp146 = einsum(t2.abab, (0, 1, 2, 3), tmp141, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp144 = einsum(t2.aaaa, (0, 1, 2, 3), tmp132, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp142 = einsum(t2.abab, (0, 1, 2, 3), tmp141, (0, 4, 1, 2), (4, 3)) - tmp139 = einsum(t2.abab, (0, 1, 2, 3), tmp138, (4, 0, 1, 3), (4, 2)) - tmp136 = einsum(tmp135, (0, 1, 2, 3), t2.bbbb, (2, 1, 4, 3), (0, 4)) - tmp133 = einsum(t2.aaaa, (0, 1, 2, 3), tmp132, (4, 1, 0, 3), (4, 2)) - tmp124 = einsum(tmp41, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp122 = einsum(t2.abab, (0, 1, 2, 3), tmp41, (1, 3), (0, 2)) - tmp121 = einsum(t2.abab, (0, 1, 2, 3), tmp42, (0, 2), (1, 3)) - tmp119 = einsum(tmp42, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp117 = einsum(tmp38, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp115 = einsum(tmp38, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - tmp113 = einsum(tmp110, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) - tmp111 = einsum(t2.abab, (0, 1, 2, 3), tmp110, (1, 3), (0, 2)) - tmp108 = einsum(t2.abab, (0, 1, 2, 3), tmp34, (0, 2), (1, 3)) - tmp106 = einsum(tmp34, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp105 = einsum(t2.abab, (0, 1, 2, 3), tmp102, (0, 2), (1, 3)) - tmp103 = einsum(tmp102, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp100 = einsum(t2.abab, (0, 1, 2, 3), tmp99, (0, 4, 3, 5), (1, 2, 4, 5)) - tmp97 = einsum(tmp81, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp95 = einsum(tmp60, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp94 = einsum(t2.abab, (0, 1, 2, 3), tmp24, (0, 4, 2, 5), (1, 5, 4, 3)) - tmp92 = einsum(t2.aaaa, (0, 1, 2, 3), tmp24, (1, 3, 4, 5), (0, 2, 5, 4)) - tmp91 = einsum(v.baa.xvv, (0, 1, 2), tmp84, (0, 3, 4), (3, 1, 2, 4)) - tmp89 = einsum(v.baa.xvv, (0, 1, 2), tmp57, (0, 3, 4), (3, 4, 1, 2)) - tmp87 = einsum(v.baa.xvv, (0, 1, 2), tmp60, (0, 3, 2), (3, 1)) - tmp85 = einsum(v.bbb.xvv, (0, 1, 2), tmp84, (0, 3, 2), (3, 1)) - tmp82 = einsum(tmp81, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) * -1 - tmp79 = einsum(v.baa.xvv, (0, 1, 2), tmp57, (0, 3, 2), (3, 1)) * -1 - tmp77 = einsum(t2.abab, (0, 1, 2, 3), tmp69, (0, 1, 4, 5), (4, 2, 5, 3)) - tmp75 = einsum(t2.aaaa, (0, 1, 2, 3), tmp63, (4, 0, 1, 5), (4, 2, 3, 5)) - tmp73 = einsum(t2.abab, (0, 1, 2, 3), tmp72, (4, 0, 1, 3), (4, 2)) - tmp70 = einsum(t2.abab, (0, 1, 2, 3), tmp69, (0, 1, 4, 2), (4, 3)) - tmp67 = einsum(tmp66, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 3), (1, 4)) - tmp64 = einsum(tmp63, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) - tmp61 = einsum(tmp60, (0, 1, 2), v.baa.xov, (0, 1, 3), (2, 3)) - tmp58 = einsum(v.baa.xov, (0, 1, 2), tmp57, (0, 1, 3), (3, 2)) - tmp55 = einsum(tmp39, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp53 = einsum(v.baa.xvv, (0, 1, 2), tmp30, (0, 3, 4), (3, 1, 2, 4)) - tmp52 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp47 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp40 = einsum(tmp39, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (3, 2)) - tmp36 = einsum(tmp30, (0, 1, 2), v.baa.xoo, (0, 3, 1), (3, 2)) - tmp31 = einsum(tmp30, (0, 1, 2), v.baa.xov, (0, 1, 3), (3, 2)) - tmp23 = einsum(tmp22, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp20 = einsum(tmp19, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp13 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp11 = einsum(t2.abab, (0, 1, 2, 3), f.bb.ov, (1, 3), (0, 2)) - tmp10 = einsum(t2.abab, (0, 1, 2, 3), f.aa.ov, (0, 2), (1, 3)) - tmp8 = einsum(f.aa.ov, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) - tmp7 = einsum(f.bb.vv, (0, 1), t1.bb, (2, 1), (2, 0)) - tmp5 = einsum(t1.aa, (0, 1), f.aa.vv, (2, 1), (0, 2)) - tmp4 = einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) - tmp2 = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) - - return {f"tmp10": tmp10, f"tmp100": tmp100, f"tmp101": tmp101, f"tmp102": tmp102, f"tmp103": tmp103, f"tmp105": tmp105, f"tmp106": tmp106, f"tmp108": tmp108, f"tmp109": tmp109, f"tmp11": tmp11, f"tmp110": tmp110, f"tmp111": tmp111, f"tmp113": tmp113, f"tmp115": tmp115, f"tmp117": tmp117, f"tmp119": tmp119, f"tmp121": tmp121, f"tmp122": tmp122, f"tmp124": tmp124, f"tmp13": tmp13, f"tmp132": tmp132, f"tmp133": tmp133, f"tmp135": tmp135, f"tmp136": tmp136, f"tmp138": tmp138, f"tmp139": tmp139, f"tmp141": tmp141, f"tmp142": tmp142, f"tmp144": tmp144, f"tmp146": tmp146, f"tmp148": tmp148, f"tmp149": tmp149, f"tmp151": tmp151, f"tmp152": tmp152, f"tmp154": tmp154, f"tmp155": tmp155, f"tmp157": tmp157, f"tmp158": tmp158, f"tmp160": tmp160, f"tmp162": tmp162, f"tmp163": tmp163, f"tmp165": tmp165, f"tmp166": tmp166, f"tmp168": tmp168, f"tmp170": tmp170, f"tmp171": tmp171, f"tmp172": tmp172, f"tmp174": tmp174, f"tmp175": tmp175, f"tmp177": tmp177, f"tmp178": tmp178, f"tmp179": tmp179, f"tmp180": tmp180, f"tmp181": tmp181, f"tmp182": tmp182, f"tmp184": tmp184, f"tmp185": tmp185, f"tmp19": tmp19, f"tmp190": tmp190, f"tmp192": tmp192, f"tmp194": tmp194, f"tmp195": tmp195, f"tmp196": tmp196, f"tmp197": tmp197, f"tmp198": tmp198, f"tmp199": tmp199, f"tmp2": tmp2, f"tmp20": tmp20, f"tmp201": tmp201, f"tmp203": tmp203, f"tmp205": tmp205, f"tmp206": tmp206, f"tmp207": tmp207, f"tmp208": tmp208, f"tmp210": tmp210, f"tmp211": tmp211, f"tmp213": tmp213, f"tmp214": tmp214, f"tmp215": tmp215, f"tmp216": tmp216, f"tmp217": tmp217, f"tmp218": tmp218, f"tmp22": tmp22, f"tmp220": tmp220, f"tmp221": tmp221, f"tmp23": tmp23, f"tmp236": tmp236, f"tmp239": tmp239, f"tmp24": tmp24, f"tmp243": tmp243, f"tmp246": tmp246, f"tmp250": tmp250, f"tmp251": tmp251, f"tmp253": tmp253, f"tmp255": tmp255, f"tmp257": tmp257, f"tmp26": tmp26, f"tmp263": tmp263, f"tmp265": tmp265, f"tmp271": tmp271, f"tmp272": tmp272, f"tmp274": tmp274, f"tmp275": tmp275, f"tmp277": tmp277, f"tmp279": tmp279, f"tmp281": tmp281, f"tmp29": tmp29, f"tmp30": tmp30, f"tmp301": tmp301, f"tmp303": tmp303, f"tmp309": tmp309, f"tmp31": tmp31, f"tmp310": tmp310, f"tmp312": tmp312, f"tmp313": tmp313, f"tmp315": tmp315, f"tmp317": tmp317, f"tmp319": tmp319, f"tmp33": tmp33, f"tmp330": tmp330, f"tmp332": tmp332, f"tmp334": tmp334, f"tmp335": tmp335, f"tmp34": tmp34, f"tmp36": tmp36, f"tmp38": tmp38, f"tmp387": tmp387, f"tmp39": tmp39, f"tmp4": tmp4, f"tmp40": tmp40, f"tmp41": tmp41, f"tmp42": tmp42, f"tmp426": tmp426, f"tmp44": tmp44, f"tmp47": tmp47, f"tmp49": tmp49, f"tmp490": tmp490, f"tmp5": tmp5, f"tmp52": tmp52, f"tmp53": tmp53, f"tmp55": tmp55, f"tmp57": tmp57, f"tmp58": tmp58, f"tmp60": tmp60, f"tmp61": tmp61, f"tmp63": tmp63, f"tmp64": tmp64, f"tmp66": tmp66, f"tmp67": tmp67, f"tmp69": tmp69, f"tmp7": tmp7, f"tmp70": tmp70, f"tmp72": tmp72, f"tmp73": tmp73, f"tmp75": tmp75, f"tmp77": tmp77, f"tmp79": tmp79, f"tmp8": tmp8, f"tmp81": tmp81, f"tmp82": tmp82, f"tmp84": tmp84, f"tmp85": tmp85, f"tmp87": tmp87, f"tmp89": tmp89, f"tmp91": tmp91, f"tmp92": tmp92, f"tmp94": tmp94, f"tmp95": tmp95, f"tmp97": tmp97, f"tmp99": tmp99} - -def hbar_lmatvec_ea(f=None, r1=None, r2=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:29:26.733647. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp58 = np.copy(ints.tmp101) - del ints.tmp101 - tmp58 += v.baa.xoo - tmp75 = einsum(t1.aa, (0, 1), tmp58, (2, 3, 0), (2, 3, 1)) - tmp101 = np.copy(f.bb.ov) - tmp101 += ints.tmp38 - tmp101 += ints.tmp41 - tmp60 = np.copy(ints.tmp109) - del ints.tmp109 - tmp60 += v.bbb.xoo - tmp22 = einsum(t1.bb, (0, 1), r2.bbb, (2, 1, 3), (3, 0, 2)) - tmp76 = np.copy(ints.tmp30) - tmp76 += ints.tmp57 * 2 - tmp76 += ints.tmp60 - tmp76 += v.baa.xov - tmp76 += tmp75 * -1 - del tmp75 - tmp46 = np.copy(ints.tmp39) - tmp46 += ints.tmp84 - tmp46 += v.bbb.xov - tmp46 += ints.tmp81 * 2 - tmp44 = np.copy(ints.tmp30) - del ints.tmp30 - tmp44 += ints.tmp60 - del ints.tmp60 - tmp44 += v.baa.xov - tmp44 += ints.tmp57 * 2 - del ints.tmp57 - tmp50 = np.copy(f.aa.ov) - tmp50 += ints.tmp34 - tmp50 += ints.tmp42 - tmp2 = einsum(r2.aaa, (0, 1, 2), t1.aa, (3, 1), (2, 3, 0)) - tmp6 = einsum(r2.bab, (0, 1, 2), t1.bb, (3, 0), (2, 3, 1)) * -1 - tmp102 = einsum(tmp101, (0, 1), t1.bb, (0, 2), (1, 2)) - del tmp101 - tmp36 = einsum(r2.bbb, (0, 1, 2), t2.bbbb, (3, 2, 0, 1), (3,)) - tmp34 = einsum(r1.b, (0,), t1.bb, (1, 0), (1,)) - tmp110 = einsum(tmp60, (0, 1, 2), tmp22, (1, 2, 3), (0, 3)) - tmp109 = einsum(tmp76, (0, 1, 2), r2.aba, (2, 3, 1), (0, 3)) * 0.5 - tmp113 = einsum(ints.tmp110, (0, 1), t1.bb, (0, 2), (1, 2)) - tmp47 = einsum(r2.bab, (0, 1, 2), tmp46, (3, 2, 0), (3, 1)) * -1 - tmp45 = einsum(tmp44, (0, 1, 2), r2.aaa, (3, 2, 1), (0, 3)) * -1 - del tmp44 - tmp51 = einsum(tmp50, (0, 1), t1.aa, (0, 2), (2, 1)) - del tmp50 - tmp64 = einsum(ints.tmp102, (0, 1), t1.aa, (0, 2), (1, 2)) - tmp17 = einsum(t2.abab, (0, 1, 2, 3), r2.bab, (3, 2, 1), (0,)) * -1 - tmp15 = einsum(r1.a, (0,), t1.aa, (1, 0), (1,)) - tmp16 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (2, 3, 1), (0,)) - tmp59 = einsum(tmp2, (0, 1, 2), tmp58, (3, 0, 1), (3, 2)) - del tmp58 - tmp61 = einsum(tmp6, (0, 1, 2), tmp60, (3, 0, 1), (3, 2)) * 0.5 - tmp99 = einsum(r2.bbb, (0, 1, 2), tmp46, (3, 2, 1), (3, 0)) * -1 - del tmp46 - tmp97 = np.copy(ints.tmp246) - tmp97 += ints.tmp330 - tmp97 += ints.tmp313 * 2 - tmp103 = np.copy(ints.tmp239) - tmp103 += tmp102 - del tmp102 - tmp35 = einsum(t2.abab, (0, 1, 2, 3), r2.aba, (2, 3, 0), (1,)) - tmp86 = np.copy(ints.tmp135) - tmp86 += np.transpose(ints.tmp66, (0, 2, 1, 3)) - tmp116 = np.copy(tmp34) * 0.5 - tmp116 += tmp36 - tmp111 = np.copy(tmp109) - del tmp109 - tmp111 += tmp110 - del tmp110 - tmp114 = np.copy(f.bb.vv) * 0.5 - tmp114 += ints.tmp194 * 0.5 - tmp114 += ints.tmp197 * 0.5 - tmp114 += ints.tmp255 * -1 - tmp114 += ints.tmp257 * -0.5 - tmp114 += np.transpose(tmp113, (1, 0)) * 0.5 - del tmp113 - tmp19 = np.copy(f.aa.ov) - tmp19 += ints.tmp34 - tmp19 += ints.tmp42 - tmp19 += ints.tmp102 * -1 - del ints.tmp102 - tmp77 = einsum(tmp60, (0, 1, 2), t1.bb, (2, 3), (0, 1, 3)) - del tmp60 - tmp42 = np.copy(ints.tmp201) - tmp42 += ints.tmp47 - tmp42 += ints.tmp163 * 2 - tmp48 = np.copy(tmp45) * -2 - del tmp45 - tmp48 += tmp47 - del tmp47 - tmp52 = np.copy(ints.tmp31) - tmp52 += np.transpose(tmp51, (1, 0)) - del tmp51 - tmp65 = np.copy(f.aa.vv) * 0.5 - tmp65 += ints.tmp29 * 0.5 - tmp65 += ints.tmp33 * 0.5 - tmp65 += ints.tmp58 * -1 - tmp65 += ints.tmp61 * -0.5 - tmp65 += np.transpose(tmp64, (1, 0)) * 0.5 - del tmp64 - tmp67 = np.copy(tmp15) * 0.5 - tmp67 += tmp16 - tmp67 += tmp17 * 0.5 - tmp56 = np.copy(ints.tmp132) - tmp56 += np.transpose(ints.tmp63, (0, 2, 1, 3)) - tmp62 = np.copy(tmp59) - del tmp59 - tmp62 += tmp61 - del tmp61 - tmp100 = einsum(tmp99, (0, 1), v.bbb.xov, (0, 2, 3), (2, 1, 3)) * -1 - del tmp99 - tmp98 = einsum(r2.bbb, (0, 1, 2), tmp97, (2, 3, 1, 4), (3, 4, 0)) * -1 - del tmp97 - tmp95 = einsum(r1.b, (0,), ints.tmp236, (1, 2, 0, 3), (1, 2, 3)) - tmp104 = einsum(r2.bbb, (0, 1, 2), tmp103, (3, 1), (2, 3, 0)) * -1 - del tmp103 - tmp96 = einsum(tmp35, (0,), ints.tmp243, (0, 1, 2, 3), (1, 2, 3)) - tmp106 = einsum(r2.aba, (0, 1, 2), ints.tmp312, (2, 3, 0, 4), (3, 4, 1)) - tmp108 = einsum(tmp22, (0, 1, 2), tmp86, (0, 1, 3, 4), (3, 4, 2)) * 2 - tmp107 = einsum(ints.tmp236, (0, 1, 2, 3), tmp22, (4, 0, 2), (4, 1, 3)) - tmp117 = einsum(tmp116, (0,), ints.tmp243, (0, 1, 2, 3), (1, 2, 3)) * 2 - del tmp116 - tmp112 = einsum(v.bbb.xov, (0, 1, 2), tmp111, (0, 3), (1, 3, 2)) * 2 - del tmp111 - tmp115 = einsum(tmp114, (0, 1), r2.bbb, (2, 0, 3), (3, 1, 2)) * -4 - del tmp114 - tmp84 = np.copy(ints.tmp141) - tmp84 += ints.tmp69 - tmp80 = einsum(tmp19, (0, 1), t1.aa, (0, 2), (2, 1)) - tmp88 = np.copy(t2.abab) - tmp88 += einsum(t1.bb, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - tmp78 = np.copy(ints.tmp39) - del ints.tmp39 - tmp78 += ints.tmp81 * 2 - del ints.tmp81 - tmp78 += ints.tmp84 - del ints.tmp84 - tmp78 += v.bbb.xov - tmp78 += tmp77 * -1 - del tmp77 - tmp38 = np.copy(f.bb.ov) - tmp38 += ints.tmp38 - tmp38 += ints.tmp41 - tmp38 += ints.tmp110 * -1 - del ints.tmp110 - tmp30 = np.copy(ints.tmp138) - del ints.tmp138 - tmp30 += ints.tmp72 - del ints.tmp72 - tmp73 = np.copy(t2.abab) - tmp73 += einsum(t1.bb, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - tmp43 = einsum(r2.aaa, (0, 1, 2), tmp42, (2, 3, 1, 4), (3, 0, 4)) * -1 - del tmp42 - tmp41 = einsum(ints.tmp165, (0, 1, 2, 3), r2.bab, (3, 4, 1), (0, 2, 4)) * -1 - tmp40 = einsum(ints.tmp24, (0, 1, 2, 3), r1.a, (2,), (0, 1, 3)) - tmp49 = einsum(tmp48, (0, 1), v.baa.xov, (0, 2, 3), (2, 3, 1)) - del tmp48 - tmp53 = einsum(tmp52, (0, 1), r2.aaa, (2, 1, 3), (3, 2, 0)) * -1 - del tmp52 - tmp66 = einsum(r2.aaa, (0, 1, 2), tmp65, (1, 3), (2, 0, 3)) * -4 - del tmp65 - tmp68 = einsum(ints.tmp44, (0, 1, 2, 3), tmp67, (0,), (1, 2, 3)) * 2 - tmp57 = einsum(tmp56, (0, 1, 2, 3), tmp2, (0, 1, 4), (2, 4, 3)) * 2 - tmp63 = einsum(v.baa.xov, (0, 1, 2), tmp62, (0, 3), (1, 2, 3)) * 2 - del tmp62 - tmp55 = einsum(ints.tmp24, (0, 1, 2, 3), tmp2, (4, 0, 2), (4, 1, 3)) - tmp26 = einsum(t1.aa, (0, 1), r2.aba, (1, 2, 3), (3, 0, 2)) - tmp31 = einsum(t1.bb, (0, 1), tmp22, (2, 3, 1), (2, 3, 0)) * -1 - tmp105 = np.copy(tmp95) - del tmp95 - tmp105 += tmp96 - del tmp96 - tmp105 += tmp98 * -2 - del tmp98 - tmp105 += tmp100 * 2 - del tmp100 - tmp105 += tmp104 * -2 - del tmp104 - tmp94 = einsum(r2.bbb, (0, 1, 2), t2.bbbb, (3, 4, 0, 1), (2, 3, 4)) - tmp93 = np.copy(f.bb.oo) - tmp93 += ints.tmp151 * 2 - del ints.tmp151 - tmp93 += ints.tmp154 - del ints.tmp154 - tmp93 += ints.tmp179 - del ints.tmp179 - tmp93 += ints.tmp184 - del ints.tmp184 - tmp93 += ints.tmp215 - del ints.tmp215 - tmp93 += ints.tmp220 - del ints.tmp220 - tmp93 += np.transpose(ints.tmp22, (1, 0)) - del ints.tmp22 - tmp93 += ints.tmp177 * -1 - del ints.tmp177 - tmp93 += ints.tmp213 * -1 - del ints.tmp213 - tmp118 = np.copy(tmp106) - del tmp106 - tmp118 += tmp107 * 2 - del tmp107 - tmp118 += tmp108 - del tmp108 - tmp118 += tmp112 - del tmp112 - tmp118 += tmp115 * -1 - del tmp115 - tmp118 += tmp117 - del tmp117 - tmp4 = einsum(r2.bab, (0, 1, 2), t1.aa, (3, 1), (3, 2, 0)) * -1 - tmp85 = np.copy(ints.tmp170) - tmp85 += np.transpose(ints.tmp205, (0, 1, 3, 2)) * -1 - tmp85 += np.transpose(ints.tmp52, (0, 1, 3, 2)) * -1 - tmp85 += einsum(tmp84, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) - del tmp84 - tmp91 = np.copy(np.transpose(ints.tmp31, (1, 0))) - tmp91 += ints.tmp58 * 2 - tmp91 += ints.tmp61 - tmp91 += f.aa.vv * -1 - tmp91 += np.transpose(ints.tmp29, (1, 0)) * -1 - tmp91 += np.transpose(ints.tmp33, (1, 0)) * -1 - tmp91 += tmp80 - tmp89 = einsum(r2.bab, (0, 1, 2), tmp88, (3, 4, 1, 0), (3, 2, 4)) * -1 - del tmp88 - tmp90 = einsum(r2.aaa, (0, 1, 2), tmp76, (3, 2, 1), (3, 0)) * 2 - tmp90 += einsum(r2.bab, (0, 1, 2), tmp78, (3, 2, 0), (3, 1)) * -1 - tmp87 = np.copy(ints.tmp246) - tmp87 += ints.tmp313 * 2 - tmp87 += ints.tmp330 - tmp87 += einsum(t1.bb, (0, 1), tmp86, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp86 - tmp92 = np.copy(np.transpose(ints.tmp239, (1, 0))) * 0.5 - tmp92 += ints.tmp255 - tmp92 += ints.tmp257 * 0.5 - tmp92 += f.bb.vv * -0.5 - tmp92 += ints.tmp194 * -0.5 - tmp92 += ints.tmp197 * -0.5 - tmp92 += einsum(tmp38, (0, 1), t1.bb, (0, 2), (2, 1)) * 0.5 - tmp83 = np.copy(tmp34) * 0.5 - tmp83 += tmp35 * -0.5 - tmp83 += tmp36 - tmp82 = np.copy(np.transpose(ints.tmp239, (1, 0))) - tmp82 += ints.tmp255 * 2 - tmp82 += ints.tmp257 - tmp82 += f.bb.vv * -1 - tmp82 += np.transpose(ints.tmp194, (1, 0)) * -1 - tmp82 += np.transpose(ints.tmp197, (1, 0)) * -1 - tmp82 += einsum(tmp38, (0, 1), t1.bb, (0, 2), (2, 1)) - tmp70 = np.copy(f.aa.oo) - tmp70 += ints.tmp148 * 2 - del ints.tmp148 - tmp70 += ints.tmp157 - del ints.tmp157 - tmp70 += ints.tmp174 - del ints.tmp174 - tmp70 += ints.tmp181 - del ints.tmp181 - tmp70 += np.transpose(ints.tmp19, (1, 0)) - del ints.tmp19 - tmp70 += ints.tmp210 - del ints.tmp210 - tmp70 += ints.tmp217 - del ints.tmp217 - tmp70 += ints.tmp171 * -1 - del ints.tmp171 - tmp70 += ints.tmp207 * -1 - del ints.tmp207 - tmp72 = np.copy(np.transpose(ints.tmp319, (0, 1, 3, 2))) - tmp72 += ints.tmp250 * -1 - tmp72 += ints.tmp334 * -1 - tmp72 += einsum(tmp30, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) - tmp79 = einsum(tmp76, (0, 1, 2), r2.aba, (2, 3, 1), (0, 3)) * -1 - del tmp76 - tmp79 += einsum(r2.bbb, (0, 1, 2), tmp78, (3, 2, 1), (3, 0)) * 2 - del tmp78 - tmp81 = np.copy(np.transpose(ints.tmp31, (1, 0))) - tmp81 += ints.tmp58 * 2 - tmp81 += ints.tmp61 - tmp81 += f.aa.vv * -1 - tmp81 += ints.tmp29 * -1 - tmp81 += ints.tmp33 * -1 - tmp81 += tmp80 - del tmp80 - tmp74 = einsum(tmp73, (0, 1, 2, 3), r2.aba, (2, 3, 4), (4, 0, 1)) - del tmp73 - tmp71 = np.copy(ints.tmp163) * 2 - tmp71 += ints.tmp201 - tmp71 += ints.tmp47 - tmp71 += einsum(tmp56, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - del tmp56 - tmp24 = einsum(r2.aba, (0, 1, 2), t1.bb, (3, 1), (2, 3, 0)) - tmp54 = np.copy(tmp40) - del tmp40 - tmp54 += tmp41 - del tmp41 - tmp54 += np.transpose(tmp43, (0, 2, 1)) * -2 - del tmp43 - tmp54 += np.transpose(tmp49, (0, 2, 1)) - del tmp49 - tmp54 += np.transpose(tmp53, (0, 2, 1)) * -2 - del tmp53 - tmp69 = np.copy(tmp55) * 2 - del tmp55 - tmp69 += np.transpose(tmp57, (0, 2, 1)) - del tmp57 - tmp69 += np.transpose(tmp63, (0, 2, 1)) - del tmp63 - tmp69 += np.transpose(tmp66, (0, 2, 1)) * -1 - del tmp66 - tmp69 += tmp68 - del tmp68 - tmp39 = einsum(t2.aaaa, (0, 1, 2, 3), r2.aaa, (2, 3, 4), (4, 0, 1)) - tmp12 = einsum(tmp2, (0, 1, 2), t1.aa, (3, 2), (0, 1, 3)) * -1 - tmp29 = einsum(tmp26, (0, 1, 2), t1.bb, (3, 2), (0, 1, 3)) - tmp23 = np.copy(ints.tmp243) - tmp23 += ints.tmp310 * 2 - del ints.tmp310 - tmp23 += ints.tmp317 - del ints.tmp317 - tmp23 += np.transpose(ints.tmp332, (0, 1, 3, 2)) - del ints.tmp332 - tmp23 += np.transpose(ints.tmp246, (0, 1, 3, 2)) * -1 - del ints.tmp246 - tmp23 += ints.tmp313 * -2 - del ints.tmp313 - tmp23 += np.transpose(ints.tmp330, (0, 1, 3, 2)) * -1 - del ints.tmp330 - tmp20 = np.copy(ints.tmp253) - del ints.tmp253 - tmp20 += np.transpose(ints.tmp265, (0, 1, 3, 2)) - del ints.tmp265 - tmp20 += np.transpose(ints.tmp271, (0, 1, 3, 2)) - del ints.tmp271 - tmp20 += np.transpose(ints.tmp277, (0, 1, 3, 2)) * 2 - del ints.tmp277 - tmp20 += np.transpose(ints.tmp303, (0, 1, 3, 2)) - del ints.tmp303 - tmp20 += ints.tmp99 - tmp20 += ints.tmp274 * -1 - del ints.tmp274 - tmp20 += np.transpose(ints.tmp281, (0, 1, 3, 2)) * -1 - del ints.tmp281 - tmp8 = np.copy(ints.tmp105) - del ints.tmp105 - tmp8 += ints.tmp113 * 2 - del ints.tmp113 - tmp8 += ints.tmp136 * 2 - del ints.tmp136 - tmp8 += ints.tmp142 - del ints.tmp142 - tmp8 += ints.tmp152 * 2 - del ints.tmp152 - tmp8 += ints.tmp155 - del ints.tmp155 - tmp8 += ints.tmp180 - del ints.tmp180 - tmp8 += ints.tmp185 - del ints.tmp185 - tmp8 += ints.tmp196 - del ints.tmp196 - tmp8 += ints.tmp216 - del ints.tmp216 - tmp8 += ints.tmp221 - del ints.tmp221 - tmp8 += ints.tmp23 - del ints.tmp23 - tmp8 += ints.tmp40 - del ints.tmp40 - tmp8 += ints.tmp4 - del ints.tmp4 - tmp8 += ints.tmp67 * 2 - del ints.tmp67 - tmp8 += ints.tmp70 - del ints.tmp70 - tmp8 += ints.tmp82 * 2 - del ints.tmp82 - tmp8 += f.bb.ov * -1 - tmp8 += ints.tmp108 * -1 - del ints.tmp108 - tmp8 += ints.tmp10 * -1 - del ints.tmp10 - tmp8 += ints.tmp117 * -2 - del ints.tmp117 - tmp8 += ints.tmp121 * -1 - del ints.tmp121 - tmp8 += ints.tmp124 * -2 - del ints.tmp124 - tmp8 += ints.tmp13 * -2 - del ints.tmp13 - tmp8 += ints.tmp178 * -1 - del ints.tmp178 - tmp8 += ints.tmp195 * -1 - del ints.tmp195 - tmp8 += ints.tmp198 * -1 - del ints.tmp198 - tmp8 += ints.tmp214 * -1 - del ints.tmp214 - tmp8 += ints.tmp38 * -1 - del ints.tmp38 - tmp8 += ints.tmp41 * -1 - del ints.tmp41 - tmp8 += ints.tmp7 * -1 - del ints.tmp7 - tmp8 += ints.tmp85 * -1 - del ints.tmp85 - tmp32 = np.copy(ints.tmp135) - del ints.tmp135 - tmp32 += ints.tmp66 * -1 - del ints.tmp66 - tmp21 = np.copy(ints.tmp236) * 0.5 - del ints.tmp236 - tmp21 += ints.tmp251 * 0.5 - del ints.tmp251 - tmp21 += np.transpose(ints.tmp275, (0, 2, 1, 3)) - del ints.tmp275 - tmp21 += np.transpose(ints.tmp301, (0, 3, 1, 2)) * 0.5 - del ints.tmp301 - tmp21 += np.transpose(ints.tmp263, (0, 3, 1, 2)) * -0.5 - del ints.tmp263 - tmp21 += np.transpose(ints.tmp272, (0, 3, 1, 2)) * -1 - del ints.tmp272 - tmp21 += np.transpose(ints.tmp279, (0, 3, 1, 2)) * -0.5 - del ints.tmp279 - tmp25 = np.copy(ints.tmp309) - del ints.tmp309 - tmp25 += ints.tmp315 * 2 - del ints.tmp315 - tmp25 += ints.tmp335 - del ints.tmp335 - tmp25 += ints.tmp49 - tmp25 += ints.tmp312 * -1 - tmp27 = np.copy(ints.tmp250) - del ints.tmp250 - tmp27 += ints.tmp334 - del ints.tmp334 - tmp27 += np.transpose(ints.tmp319, (0, 1, 3, 2)) * -1 - del ints.tmp319 - tmp28 = np.copy(ints.tmp103) - tmp28 += ints.tmp111 * 0.5 - tmp28 += ints.tmp133 - tmp28 += ints.tmp139 * 0.5 - tmp28 += ints.tmp149 - tmp28 += ints.tmp158 * 0.5 - tmp28 += ints.tmp175 * 0.5 - tmp28 += ints.tmp182 * 0.5 - tmp28 += ints.tmp192 * 0.5 - tmp28 += ints.tmp20 * 0.5 - tmp28 += ints.tmp211 * 0.5 - tmp28 += ints.tmp218 * 0.5 - tmp28 += ints.tmp2 * 0.5 - tmp28 += ints.tmp36 * 0.5 - tmp28 += ints.tmp64 - tmp28 += ints.tmp73 * 0.5 - tmp28 += ints.tmp79 - tmp28 += f.aa.ov * -0.5 - tmp28 += ints.tmp106 * -1 - tmp28 += ints.tmp115 * -0.5 - tmp28 += ints.tmp119 * -1 - tmp28 += ints.tmp11 * -0.5 - tmp28 += ints.tmp122 * -0.5 - tmp28 += ints.tmp172 * -0.5 - tmp28 += ints.tmp190 * -0.5 - tmp28 += ints.tmp199 * -0.5 - tmp28 += ints.tmp208 * -0.5 - tmp28 += ints.tmp34 * -0.5 - tmp28 += ints.tmp42 * -0.5 - tmp28 += ints.tmp5 * -0.5 - tmp28 += ints.tmp87 * -0.5 - tmp28 += ints.tmp8 * -1 - tmp33 = np.copy(np.transpose(ints.tmp239, (1, 0))) - del ints.tmp239 - tmp33 += ints.tmp255 * 2 - del ints.tmp255 - tmp33 += ints.tmp257 - del ints.tmp257 - tmp33 += f.bb.vv * -1 - tmp33 += np.transpose(ints.tmp194, (1, 0)) * -1 - del ints.tmp194 - tmp33 += np.transpose(ints.tmp197, (1, 0)) * -1 - del ints.tmp197 - tmp37 = np.copy(tmp34) - del tmp34 - tmp37 += tmp35 * -1 - del tmp35 - tmp37 += tmp36 * 2 - del tmp36 - tmp3 = np.copy(ints.tmp160) * 2 - del ints.tmp160 - tmp3 += ints.tmp166 - del ints.tmp166 - tmp3 += np.transpose(ints.tmp203, (0, 1, 3, 2)) - del ints.tmp203 - tmp3 += ints.tmp44 - tmp3 += ints.tmp163 * -2 - del ints.tmp163 - tmp3 += np.transpose(ints.tmp201, (0, 1, 3, 2)) * -1 - del ints.tmp201 - tmp3 += np.transpose(ints.tmp47, (0, 1, 3, 2)) * -1 - del ints.tmp47 - tmp14 = np.copy(np.transpose(ints.tmp31, (1, 0))) - del ints.tmp31 - tmp14 += ints.tmp58 * 2 - del ints.tmp58 - tmp14 += ints.tmp61 - del ints.tmp61 - tmp14 += f.aa.vv * -1 - tmp14 += np.transpose(ints.tmp29, (1, 0)) * -1 - del ints.tmp29 - tmp14 += np.transpose(ints.tmp33, (1, 0)) * -1 - del ints.tmp33 - tmp13 = np.copy(ints.tmp132) - del ints.tmp132 - tmp13 += ints.tmp63 * -1 - del ints.tmp63 - tmp10 = einsum(tmp6, (0, 1, 2), t1.aa, (3, 2), (3, 0, 1)) - tmp0 = np.copy(ints.tmp146) - del ints.tmp146 - tmp0 += np.transpose(ints.tmp26, (0, 2, 1, 3)) - tmp0 += np.transpose(ints.tmp55, (0, 2, 1, 3)) - del ints.tmp55 - tmp0 += ints.tmp77 - del ints.tmp77 - tmp0 += ints.tmp91 - del ints.tmp91 - tmp0 += ints.tmp97 * 2 - del ints.tmp97 - tmp0 += ints.tmp100 * -1 - del ints.tmp100 - tmp0 += np.transpose(ints.tmp94, (0, 2, 1, 3)) * -1 - del ints.tmp94 - tmp7 = np.copy(np.transpose(ints.tmp205, (0, 1, 3, 2))) - del ints.tmp205 - tmp7 += np.transpose(ints.tmp52, (0, 1, 3, 2)) - del ints.tmp52 - tmp7 += ints.tmp170 * -1 - del ints.tmp170 - tmp1 = np.copy(ints.tmp144) * 0.5 - del ints.tmp144 - tmp1 += np.transpose(ints.tmp24, (0, 2, 3, 1)) * 0.5 - del ints.tmp24 - tmp1 += np.transpose(ints.tmp53, (0, 2, 3, 1)) * 0.5 - del ints.tmp53 - tmp1 += np.transpose(ints.tmp92, (0, 1, 3, 2)) - del ints.tmp92 - tmp1 += ints.tmp75 * -0.5 - del ints.tmp75 - tmp1 += ints.tmp89 * -1 - del ints.tmp89 - tmp1 += ints.tmp95 * -0.5 - del ints.tmp95 - tmp5 = np.copy(ints.tmp162) - del ints.tmp162 - tmp5 += ints.tmp168 * 2 - del ints.tmp168 - tmp5 += ints.tmp206 - del ints.tmp206 - tmp5 += ints.tmp49 - tmp5 += ints.tmp165 * -1 - tmp11 = np.copy(ints.tmp141) - del ints.tmp141 - tmp11 += ints.tmp69 - del ints.tmp69 - tmp9 = np.copy(ints.tmp103) * 2 - del ints.tmp103 - tmp9 += ints.tmp111 - del ints.tmp111 - tmp9 += ints.tmp133 * 2 - del ints.tmp133 - tmp9 += ints.tmp139 - del ints.tmp139 - tmp9 += ints.tmp149 * 2 - del ints.tmp149 - tmp9 += ints.tmp158 - del ints.tmp158 - tmp9 += ints.tmp175 - del ints.tmp175 - tmp9 += ints.tmp182 - del ints.tmp182 - tmp9 += ints.tmp192 - del ints.tmp192 - tmp9 += ints.tmp20 - del ints.tmp20 - tmp9 += ints.tmp211 - del ints.tmp211 - tmp9 += ints.tmp218 - del ints.tmp218 - tmp9 += ints.tmp2 - del ints.tmp2 - tmp9 += ints.tmp36 - del ints.tmp36 - tmp9 += ints.tmp64 * 2 - del ints.tmp64 - tmp9 += ints.tmp73 - del ints.tmp73 - tmp9 += ints.tmp79 * 2 - del ints.tmp79 - tmp9 += f.aa.ov * -1 - tmp9 += ints.tmp106 * -2 - del ints.tmp106 - tmp9 += ints.tmp115 * -1 - del ints.tmp115 - tmp9 += ints.tmp119 * -2 - del ints.tmp119 - tmp9 += ints.tmp11 * -1 - del ints.tmp11 - tmp9 += ints.tmp122 * -1 - del ints.tmp122 - tmp9 += ints.tmp172 * -1 - del ints.tmp172 - tmp9 += ints.tmp190 * -1 - del ints.tmp190 - tmp9 += ints.tmp199 * -1 - del ints.tmp199 - tmp9 += ints.tmp208 * -1 - del ints.tmp208 - tmp9 += ints.tmp34 * -1 - del ints.tmp34 - tmp9 += ints.tmp42 * -1 - del ints.tmp42 - tmp9 += ints.tmp5 * -1 - del ints.tmp5 - tmp9 += ints.tmp87 * -1 - del ints.tmp87 - tmp9 += ints.tmp8 * -2 - del ints.tmp8 - tmp18 = np.copy(tmp15) - del tmp15 - tmp18 += tmp16 * 2 - del tmp16 - tmp18 += tmp17 - del tmp17 - r2new.bbb = einsum(r2.bbb, (0, 1, 2), ints.tmp490, (3, 4, 0, 1), (4, 3, 2)) * 2 - del ints.tmp490 - r2new.bbb += einsum(ints.tmp243, (0, 1, 2, 3), tmp94, (4, 0, 1), (3, 2, 4)) * -2 - del tmp94 - r2new.bbb += einsum(tmp31, (0, 1, 2), ints.tmp243, (2, 1, 3, 4), (4, 3, 0)) * 2 - del ints.tmp243 - r2new.bbb += np.transpose(tmp105, (1, 2, 0)) - r2new.bbb += np.transpose(tmp105, (2, 1, 0)) * -1 - del tmp105 - r2new.bbb += np.transpose(tmp118, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp118, (2, 1, 0)) - del tmp118 - r2new.bbb += einsum(tmp93, (0, 1), r2.bbb, (2, 3, 0), (2, 3, 1)) * -2 - r2new.bbb += einsum(tmp38, (0, 1), r1.b, (2,), (2, 1, 0)) - r2new.bbb += einsum(tmp38, (0, 1), r1.b, (2,), (1, 2, 0)) * -1 - r2new.bab = einsum(ints.tmp426, (0, 1, 2, 3), r2.bab, (2, 1, 4), (3, 0, 4)) - r2new.bab += einsum(ints.tmp99, (0, 1, 2, 3), tmp4, (0, 4, 2), (3, 1, 4)) - r2new.bab += einsum(ints.tmp26, (0, 1, 2, 3), tmp6, (4, 0, 2), (3, 1, 4)) - r2new.bab += einsum(ints.tmp26, (0, 1, 2, 3), r1.a, (2,), (3, 1, 0)) * -1 - r2new.bab += einsum(r2.aaa, (0, 1, 2), ints.tmp312, (2, 3, 1, 4), (4, 0, 3)) * 2 - del ints.tmp312 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp85, (2, 3, 1, 4), (0, 4, 3)) - del tmp85 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp87, (2, 3, 0, 4), (4, 1, 3)) * -1 - del tmp87 - r2new.bab += einsum(tmp89, (0, 1, 2), ints.tmp49, (0, 2, 3, 4), (4, 3, 1)) * -1 - del tmp89 - r2new.bab += einsum(v.bbb.xov, (0, 1, 2), tmp90, (0, 3), (2, 3, 1)) * -1 - del tmp90 - r2new.bab += einsum(tmp91, (0, 1), r2.bab, (2, 0, 3), (2, 1, 3)) * -1 - del tmp91 - r2new.bab += einsum(r2.bab, (0, 1, 2), tmp92, (0, 3), (3, 1, 2)) * -2 - del tmp92 - r2new.bab += einsum(tmp93, (0, 1), r2.bab, (2, 3, 0), (2, 3, 1)) * -1 - del tmp93 - r2new.bab += einsum(tmp67, (0,), ints.tmp49, (0, 1, 2, 3), (3, 2, 1)) * 2 - del tmp67 - r2new.bab += einsum(tmp38, (0, 1), r1.a, (2,), (1, 2, 0)) * -1 - r2new.aba = einsum(ints.tmp426, (0, 1, 2, 3), r2.aba, (0, 3, 4), (1, 2, 4)) - del ints.tmp426 - r2new.aba += einsum(ints.tmp26, (0, 1, 2, 3), tmp24, (4, 0, 1), (2, 3, 4)) * -1 - del ints.tmp26 - r2new.aba += einsum(tmp26, (0, 1, 2), ints.tmp99, (1, 3, 4, 2), (3, 4, 0)) * -1 - r2new.aba += einsum(ints.tmp99, (0, 1, 2, 3), r1.b, (3,), (1, 2, 0)) * -1 - del ints.tmp99 - r2new.aba += einsum(ints.tmp165, (0, 1, 2, 3), r2.bbb, (4, 3, 1), (2, 4, 0)) * 2 - del ints.tmp165 - r2new.aba += einsum(tmp71, (0, 1, 2, 3), r2.aba, (2, 4, 0), (3, 4, 1)) * -1 - del tmp71 - r2new.aba += einsum(tmp72, (0, 1, 2, 3), r2.aba, (4, 3, 0), (4, 2, 1)) - del tmp72 - r2new.aba += einsum(tmp74, (0, 1, 2), ints.tmp49, (1, 2, 3, 4), (3, 4, 0)) - del tmp74 - r2new.aba += einsum(tmp79, (0, 1), v.baa.xov, (0, 2, 3), (3, 1, 2)) * -1 - del tmp79 - r2new.aba += einsum(r2.aba, (0, 1, 2), tmp81, (0, 3), (3, 1, 2)) * -1 - del tmp81 - r2new.aba += einsum(tmp82, (0, 1), r2.aba, (2, 0, 3), (2, 1, 3)) * -1 - del tmp82 - r2new.aba += einsum(tmp70, (0, 1), r2.aba, (2, 3, 0), (2, 3, 1)) * -1 - r2new.aba += einsum(tmp83, (0,), ints.tmp49, (1, 0, 2, 3), (2, 3, 1)) * 2 - del ints.tmp49, tmp83 - r2new.aba += einsum(tmp19, (0, 1), r1.b, (2,), (1, 2, 0)) * -1 - r2new.aaa = einsum(r2.aaa, (0, 1, 2), ints.tmp387, (3, 4, 1, 0), (4, 3, 2)) * -2 - del ints.tmp387 - r2new.aaa += einsum(ints.tmp44, (0, 1, 2, 3), tmp39, (4, 0, 1), (3, 2, 4)) * -2 - del tmp39 - r2new.aaa += einsum(ints.tmp44, (0, 1, 2, 3), tmp12, (4, 1, 0), (3, 2, 4)) * 2 - del ints.tmp44 - r2new.aaa += np.transpose(tmp54, (1, 2, 0)) - r2new.aaa += np.transpose(tmp54, (2, 1, 0)) * -1 - del tmp54 - r2new.aaa += np.transpose(tmp69, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp69, (2, 1, 0)) - del tmp69 - r2new.aaa += einsum(tmp70, (0, 1), r2.aaa, (2, 3, 0), (2, 3, 1)) * -2 - del tmp70 - r2new.aaa += einsum(r1.a, (0,), tmp19, (1, 2), (0, 2, 1)) - r2new.aaa += einsum(tmp19, (0, 1), r1.a, (2,), (1, 2, 0)) * -1 - r1new.b = einsum(r2.aba, (0, 1, 2), tmp20, (2, 0, 3, 1), (3,)) * -1 - del tmp20 - r1new.b += einsum(tmp21, (0, 1, 2, 3), r2.bbb, (2, 3, 0), (1,)) * 4 - del tmp21 - r1new.b += einsum(tmp23, (0, 1, 2, 3), tmp22, (0, 1, 2), (3,)) * 2 - del tmp22, tmp23 - r1new.b += einsum(tmp25, (0, 1, 2, 3), tmp24, (0, 1, 2), (3,)) - del tmp24, tmp25 - r1new.b += einsum(tmp26, (0, 1, 2), tmp27, (0, 1, 3, 2), (3,)) - del tmp26, tmp27 - r1new.b += einsum(tmp28, (0, 1), r2.aba, (1, 2, 0), (2,)) * 2 - del tmp28 - r1new.b += einsum(tmp8, (0, 1), r2.bbb, (2, 1, 0), (2,)) * -2 - r1new.b += einsum(tmp30, (0, 1, 2, 3), tmp29, (0, 1, 2), (3,)) * -1 - del tmp30, tmp29 - r1new.b += einsum(tmp31, (0, 1, 2), tmp32, (0, 2, 1, 3), (3,)) * -2 - del tmp31, tmp32 - r1new.b += einsum(r1.b, (0,), tmp33, (0, 1), (1,)) * -1 - del tmp33 - r1new.b += einsum(tmp38, (0, 1), tmp37, (0,), (1,)) * -1 - del tmp38, tmp37 - r1new.a = einsum(tmp0, (0, 1, 2, 3), r2.bab, (3, 1, 0), (2,)) * -1 - del tmp0 - r1new.a += einsum(tmp1, (0, 1, 2, 3), r2.aaa, (1, 2, 0), (3,)) * 4 - del tmp1 - r1new.a += einsum(tmp3, (0, 1, 2, 3), tmp2, (0, 1, 2), (3,)) * 2 - del tmp2, tmp3 - r1new.a += einsum(tmp5, (0, 1, 2, 3), tmp4, (0, 1, 3), (2,)) * -1 - del tmp4, tmp5 - r1new.a += einsum(tmp6, (0, 1, 2), tmp7, (0, 1, 2, 3), (3,)) * -1 - del tmp6, tmp7 - r1new.a += einsum(tmp8, (0, 1), r2.bab, (1, 2, 0), (2,)) - del tmp8 - r1new.a += einsum(tmp9, (0, 1), r2.aaa, (2, 1, 0), (2,)) * -2 - del tmp9 - r1new.a += einsum(tmp11, (0, 1, 2, 3), tmp10, (0, 1, 2), (3,)) - del tmp11, tmp10 - r1new.a += einsum(tmp13, (0, 1, 2, 3), tmp12, (0, 2, 1), (3,)) * -2 - del tmp12, tmp13 - r1new.a += einsum(r1.a, (0,), tmp14, (0, 1), (1,)) * -1 - del tmp14 - r1new.a += einsum(tmp19, (0, 1), tmp18, (0,), (1,)) * -1 - del tmp19, tmp18 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/UDFDCD.py b/ebcc/codegen/UDFDCD.py deleted file mode 100644 index 3fc45a7c..00000000 --- a/ebcc/codegen/UDFDCD.py +++ /dev/null @@ -1,270 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:07:28.615411 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:07:29.335246. - - Parameters - ---------- - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp1 = einsum(t2.aaaa, (0, 1, 2, 3), v.baa.xov, (4, 1, 3), (4, 0, 2)) - tmp1 += einsum(v.bbb.xov, (0, 1, 2), t2.abab, (3, 1, 4, 2), (0, 3, 4)) - tmp0 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - e_cc = einsum(v.bbb.xov, (0, 1, 2), tmp0, (0, 1, 2), ()) - del tmp0 - e_cc += einsum(tmp1, (0, 1, 2), v.baa.xov, (0, 1, 2), ()) - del tmp1 - - return e_cc - -def update_amps(f=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:07:47.224275. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - tmp22 = einsum(t2.abab, (0, 1, 2, 3), v.baa.xov, (4, 0, 2), (4, 1, 3)) - tmp23 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp1 = einsum(v.bbb.xov, (0, 1, 2), t2.abab, (3, 1, 4, 2), (0, 3, 4)) - tmp0 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp38 = np.copy(tmp22) * 0.5 - tmp38 += tmp23 - tmp2 = np.copy(tmp0) * 2 - tmp2 += tmp1 - tmp39 = einsum(v.bbb.xov, (0, 1, 2), tmp38, (0, 3, 2), (3, 1)) - tmp3 = einsum(tmp2, (0, 1, 2), v.baa.xov, (0, 3, 2), (3, 1)) * 0.5 - tmp56 = np.copy(v.bbb.xov) * 2 - tmp56 += tmp22 - tmp40 = np.copy(f.bb.oo) - tmp40 += tmp39 - del tmp39 - tmp52 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp50 = np.copy(v.bbb.xov) - tmp50 += tmp22 - tmp50 += tmp23 * 2 - tmp36 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp42 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp54 = np.copy(v.bbb.xov) - tmp54 += tmp23 - tmp27 = np.copy(tmp0) - tmp27 += tmp1 * 0.5 - tmp24 = np.copy(tmp22) - tmp24 += tmp23 * 2 - tmp33 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp6 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp8 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp4 = np.copy(f.aa.oo) - tmp4 += np.transpose(tmp3, (1, 0)) - del tmp3 - tmp20 = np.copy(v.baa.xov) - tmp20 += tmp0 - tmp18 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp15 = np.copy(v.baa.xov) * 2 - tmp15 += tmp1 - tmp48 = einsum(tmp22, (0, 1, 2), tmp22, (0, 3, 4), (1, 3, 2, 4)) - tmp57 = einsum(tmp22, (0, 1, 2), tmp56, (0, 3, 4), (1, 3, 2, 4)) * 0.5 - del tmp56 - tmp41 = einsum(t2.bbbb, (0, 1, 2, 3), tmp40, (4, 1), (0, 4, 2, 3)) * -1 - del tmp40 - tmp46 = np.copy(f.bb.vv) * -1 - tmp46 += einsum(tmp38, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp49 = einsum(tmp22, (0, 1, 2), tmp23, (0, 3, 4), (1, 3, 2, 4)) - tmp45 = np.copy(f.bb.vv) * -2 - tmp45 += einsum(tmp38, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) * 2 - del tmp38 - tmp53 = einsum(t2.bbbb, (0, 1, 2, 3), tmp52, (4, 2, 5, 3), (0, 1, 5, 4)) - del tmp52 - tmp51 = einsum(v.bbb.xov, (0, 1, 2), tmp50, (0, 3, 4), (3, 1, 4, 2)) - del tmp50 - tmp44 = einsum(t2.bbbb, (0, 1, 2, 3), tmp36, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp43 = einsum(t2.bbbb, (0, 1, 2, 3), tmp42, (4, 0, 5, 1), (5, 4, 2, 3)) - del tmp42 - tmp55 = einsum(tmp23, (0, 1, 2), tmp54, (0, 3, 4), (1, 3, 2, 4)) * 2 - del tmp54 - tmp47 = einsum(tmp23, (0, 1, 2), tmp23, (0, 3, 4), (1, 3, 2, 4)) - tmp26 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 2, 3, 4)) - tmp29 = np.copy(f.aa.vv) * -1 - tmp29 += einsum(tmp27, (0, 1, 2), v.baa.xov, (0, 1, 3), (3, 2)) - tmp28 = np.copy(f.aa.oo) - tmp28 += einsum(tmp27, (0, 1, 2), v.baa.xov, (0, 3, 2), (3, 1)) - tmp31 = np.copy(f.bb.vv) * -1 - tmp31 += einsum(v.bbb.xov, (0, 1, 2), tmp24, (0, 1, 3), (2, 3)) * 0.5 - tmp34 = einsum(t2.abab, (0, 1, 2, 3), tmp33, (4, 2, 5, 3), (0, 1, 4, 5)) - del tmp33 - tmp35 = np.copy(v.bbb.xov) * 2 - tmp35 += tmp22 - del tmp22 - tmp35 += tmp23 * 2 - del tmp23 - tmp25 = np.copy(f.bb.oo) - tmp25 += einsum(tmp24, (0, 1, 2), v.bbb.xov, (0, 3, 2), (3, 1)) * 0.5 - tmp37 = einsum(v.baa.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp32 = np.copy(v.baa.xov) * 2 - tmp32 += tmp0 * 2 - tmp32 += tmp1 - tmp30 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp14 = np.copy(v.baa.xov) - tmp14 += tmp0 * 2 - tmp14 += tmp1 - tmp13 = einsum(tmp0, (0, 1, 2), tmp1, (0, 3, 4), (1, 3, 2, 4)) - tmp17 = np.copy(v.baa.xov) - tmp17 += tmp0 * 2 - tmp7 = einsum(tmp6, (0, 1, 2, 3), t2.aaaa, (1, 3, 4, 5), (2, 0, 4, 5)) - del tmp6 - tmp12 = einsum(tmp0, (0, 1, 2), tmp0, (0, 3, 4), (1, 3, 2, 4)) - tmp9 = einsum(t2.aaaa, (0, 1, 2, 3), tmp8, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp11 = np.copy(f.aa.vv) * -1 - tmp11 += einsum(v.baa.xov, (0, 1, 2), tmp2, (0, 1, 3), (3, 2)) * 0.5 - tmp5 = einsum(tmp4, (0, 1), t2.aaaa, (2, 1, 3, 4), (2, 0, 3, 4)) * -1 - del tmp4 - tmp10 = np.copy(f.aa.vv) * -2 - tmp10 += einsum(v.baa.xov, (0, 1, 2), tmp2, (0, 1, 3), (3, 2)) - del tmp2 - tmp21 = einsum(tmp20, (0, 1, 2), tmp0, (0, 3, 4), (1, 3, 2, 4)) * 2 - del tmp0, tmp20 - tmp19 = einsum(tmp18, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (4, 5, 2, 0)) - del tmp18 - tmp16 = einsum(tmp15, (0, 1, 2), tmp1, (0, 3, 4), (1, 3, 2, 4)) * 0.5 - del tmp15 - t2new.bbbb = np.copy(np.transpose(tmp41, (0, 1, 3, 2))) * -2 - t2new.bbbb += np.transpose(tmp43, (0, 1, 3, 2)) * -2 - del tmp43 - t2new.bbbb += np.transpose(tmp41, (1, 0, 3, 2)) * 2 - del tmp41 - t2new.bbbb += np.transpose(tmp44, (1, 0, 3, 2)) * -2 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp45, (4, 3), (0, 1, 4, 2)) - del tmp45 - t2new.bbbb += np.transpose(tmp44, (1, 0, 2, 3)) * 2 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp46, (4, 3), (0, 1, 2, 4)) * -2 - del tmp46 - t2new.bbbb += tmp47 * 2 - t2new.bbbb += tmp48 * 0.5 - t2new.bbbb += tmp49 * 2 - t2new.bbbb += np.transpose(tmp49, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp51, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp47, (0, 1, 3, 2)) * -2 - del tmp47 - t2new.bbbb += np.transpose(tmp48, (1, 0, 2, 3)) * -0.5 - del tmp48 - t2new.bbbb += np.transpose(tmp49, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp49, (1, 0, 2, 3)) * -2 - del tmp49 - t2new.bbbb += np.transpose(tmp51, (1, 0, 2, 3)) * -1 - del tmp51 - t2new.bbbb += np.transpose(tmp53, (0, 1, 3, 2)) * -2 - del tmp53 - t2new.bbbb += tmp55 - t2new.bbbb += tmp57 - t2new.bbbb += tmp44 * -2 - t2new.bbbb += np.transpose(tmp57, (0, 1, 3, 2)) * -1 - del tmp57 - t2new.bbbb += np.transpose(tmp55, (0, 1, 3, 2)) * -1 - del tmp55 - t2new.bbbb += np.transpose(tmp44, (0, 1, 3, 2)) * 2 - del tmp44 - t2new.abab = einsum(tmp25, (0, 1), t2.abab, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - del tmp25 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp26, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp26 - t2new.abab += einsum(tmp28, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -1 - del tmp28 - t2new.abab += einsum(tmp8, (0, 1, 2, 3), t2.abab, (1, 4, 3, 5), (0, 4, 2, 5)) * -1 - del tmp8 - t2new.abab += einsum(tmp29, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1 - del tmp29 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp30, (4, 0, 5, 3), (4, 1, 2, 5)) * -1 - del tmp30 - t2new.abab += einsum(tmp31, (0, 1), t2.abab, (2, 3, 4, 0), (2, 3, 4, 1)) * -1 - del tmp31 - t2new.abab += einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - t2new.abab += einsum(tmp32, (0, 1, 2), tmp24, (0, 3, 4), (1, 3, 2, 4)) * 0.5 - del tmp24, tmp32 - t2new.abab += tmp34 - del tmp34 - t2new.abab += einsum(tmp35, (0, 1, 2), tmp27, (0, 3, 4), (3, 1, 4, 2)) - del tmp27, tmp35 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp36, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - del tmp36 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp37, (4, 1, 5, 2), (0, 4, 5, 3)) * -1 - del tmp37 - t2new.aaaa = np.copy(np.transpose(tmp5, (0, 1, 3, 2))) * -2 - t2new.aaaa += np.transpose(tmp7, (0, 1, 3, 2)) * -2 - del tmp7 - t2new.aaaa += np.transpose(tmp5, (1, 0, 3, 2)) * 2 - del tmp5 - t2new.aaaa += np.transpose(tmp9, (1, 0, 3, 2)) * -2 - t2new.aaaa += einsum(tmp10, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) - del tmp10 - t2new.aaaa += np.transpose(tmp9, (1, 0, 2, 3)) * 2 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp11, (4, 3), (0, 1, 2, 4)) * -2 - del tmp11 - t2new.aaaa += tmp12 * 2 - t2new.aaaa += einsum(tmp1, (0, 1, 2), tmp1, (0, 3, 4), (1, 3, 2, 4)) * 0.5 - del tmp1 - t2new.aaaa += tmp13 * 2 - t2new.aaaa += np.transpose(tmp13, (1, 0, 3, 2)) * 2 - t2new.aaaa += einsum(tmp14, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - del tmp14 - t2new.aaaa += np.transpose(tmp12, (0, 1, 3, 2)) * -2 - del tmp12 - t2new.aaaa += np.transpose(tmp13, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp13, (1, 0, 2, 3)) * -2 - del tmp13 - t2new.aaaa += np.transpose(tmp16, (0, 1, 3, 2)) * -1 - t2new.aaaa += einsum(v.baa.xov, (0, 1, 2), tmp17, (0, 3, 4), (1, 3, 4, 2)) * -1 - del tmp17 - t2new.aaaa += np.transpose(tmp19, (0, 1, 3, 2)) * -2 - del tmp19 - t2new.aaaa += np.transpose(tmp21, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp16, (1, 0, 3, 2)) - t2new.aaaa += tmp9 * -2 - t2new.aaaa += np.transpose(tmp16, (1, 0, 2, 3)) * -1 - del tmp16 - t2new.aaaa += np.transpose(tmp21, (1, 0, 2, 3)) * -1 - del tmp21 - t2new.aaaa += np.transpose(tmp9, (0, 1, 3, 2)) * 2 - del tmp9 - - return {f"t2new": t2new} - diff --git a/ebcc/codegen/UDFDCSD.py b/ebcc/codegen/UDFDCSD.py deleted file mode 100644 index d1e88287..00000000 --- a/ebcc/codegen/UDFDCSD.py +++ /dev/null @@ -1,782 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T17:09:50.861759 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:09:52.671447. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp0 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp5 = einsum(t1.aa, (0, 1), v.baa.xov, (2, 3, 1), (2, 0, 3)) - tmp1 = np.copy(tmp0) * 2 - tmp1 += einsum(v.bbb.xov, (0, 1, 2), t1.bb, (1, 2), (0,)) - tmp3 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp7 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp7 += einsum(tmp0, (0,), t1.aa, (1, 2), (0, 1, 2)) * 0.5 - del tmp0 - tmp6 = np.copy(f.aa.ov) - tmp6 += einsum(v.baa.xov, (0, 1, 2), tmp5, (0, 1, 3), (3, 2)) * -0.5 - del tmp5 - tmp2 = einsum(v.baa.xov, (0, 1, 2), t2.abab, (1, 3, 2, 4), (0, 3, 4)) - tmp2 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp2 += einsum(tmp1, (0,), t1.bb, (1, 2), (0, 1, 2)) * 0.5 - del tmp1 - tmp4 = np.copy(f.bb.ov) - tmp4 += einsum(tmp3, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) * -0.5 - del tmp3 - e_cc = einsum(tmp2, (0, 1, 2), v.bbb.xov, (0, 1, 2), ()) - del tmp2 - e_cc += einsum(t1.bb, (0, 1), tmp4, (0, 1), ()) - del tmp4 - e_cc += einsum(tmp6, (0, 1), t1.aa, (0, 1), ()) - del tmp6 - e_cc += einsum(v.baa.xov, (0, 1, 2), tmp7, (0, 1, 2), ()) - del tmp7 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T17:11:17.045708. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t1new : Namespace of arrays - Updated T1 residuals. - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - tmp5 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp6 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (1, 2), (0,)) - tmp19 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp0 = einsum(t1.aa, (0, 1), v.baa.xov, (2, 3, 1), (2, 0, 3)) - tmp107 = einsum(t1.bb, (0, 1), v.bbb.xoo, (2, 3, 0), (2, 3, 1)) - tmp33 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp29 = einsum(v.baa.xov, (0, 1, 2), t2.abab, (1, 3, 2, 4), (0, 3, 4)) - tmp9 = np.copy(tmp5) - tmp9 += tmp6 - tmp130 = einsum(t1.bb, (0, 1), v.bbb.xov, (2, 0, 3), (2, 1, 3)) - tmp38 = einsum(v.bbb.xvv, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp126 = einsum(t1.bb, (0, 1), tmp19, (2, 3, 0), (2, 3, 1)) - tmp20 = einsum(tmp19, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp7 = np.copy(tmp5) - del tmp5 - tmp7 += tmp6 - del tmp6 - tmp3 = einsum(v.bbb.xov, (0, 1, 2), t2.abab, (3, 1, 4, 2), (0, 3, 4)) - tmp18 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp11 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp13 = einsum(v.baa.xov, (0, 1, 2), tmp0, (0, 1, 3), (3, 2)) - tmp71 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 3), (0, 3, 2)) - tmp69 = einsum(tmp0, (0, 1, 2), t1.aa, (2, 3), (0, 1, 3)) - tmp42 = einsum(t1.aa, (0, 1), v.baa.xoo, (2, 3, 0), (2, 3, 1)) - tmp108 = np.copy(tmp107) * -1 - tmp108 += tmp29 * 0.5 - tmp108 += tmp33 - tmp32 = einsum(v.bbb.xov, (0, 1, 2), tmp9, (0,), (1, 2)) - tmp168 = np.copy(v.bbb.xvv) - tmp168 += np.transpose(tmp130, (0, 2, 1)) * -1 - tmp180 = np.copy(tmp107) - tmp180 += tmp33 * -1 - tmp173 = np.copy(v.bbb.xvv) - tmp173 += np.transpose(tmp130, (0, 2, 1)) * -1 - tmp143 = np.copy(tmp38) - tmp143 += tmp126 * -1 - tmp35 = np.copy(f.bb.ov) - tmp35 += tmp20 * -1 - tmp114 = np.copy(tmp38) - tmp114 += tmp29 * 0.5 - tmp114 += tmp33 - tmp114 += einsum(tmp7, (0,), t1.bb, (1, 2), (0, 1, 2)) - tmp51 = np.copy(tmp18) - tmp51 += tmp11 - tmp51 += tmp3 * 0.5 - tmp51 += einsum(tmp7, (0,), t1.aa, (1, 2), (0, 1, 2)) - tmp14 = np.copy(f.aa.ov) - tmp14 += tmp13 * -1 - tmp10 = einsum(v.baa.xov, (0, 1, 2), tmp9, (0,), (1, 2)) - del tmp9 - tmp80 = np.copy(v.baa.xvv) - tmp80 += np.transpose(tmp71, (0, 2, 1)) * -1 - tmp78 = np.copy(tmp18) - tmp78 += tmp69 * -1 - tmp72 = np.copy(v.baa.xvv) - tmp72 += np.transpose(tmp71, (0, 2, 1)) * -1 - tmp87 = np.copy(tmp42) - tmp87 += tmp11 * -1 - tmp43 = np.copy(tmp42) * -1 - tmp43 += tmp11 - tmp43 += tmp3 * 0.5 - tmp109 = einsum(v.bbb.xov, (0, 1, 2), tmp108, (0, 3, 2), (1, 3)) - tmp40 = einsum(tmp7, (0,), v.bbb.xoo, (0, 1, 2), (1, 2)) - tmp164 = np.copy(f.bb.ov) - tmp164 += tmp20 * -1 - tmp164 += tmp32 - tmp182 = einsum(tmp168, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp181 = einsum(tmp180, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - del tmp180 - tmp174 = einsum(tmp173, (0, 1, 2), tmp19, (0, 3, 4), (3, 4, 1, 2)) - del tmp173 - tmp144 = einsum(v.bbb.xov, (0, 1, 2), tmp143, (0, 3, 4), (1, 3, 2, 4)) - tmp189 = einsum(tmp19, (0, 1, 2), tmp19, (0, 3, 4), (1, 3, 2, 4)) - tmp160 = einsum(tmp19, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp116 = einsum(v.bbb.xvv, (0, 1, 2), tmp7, (0,), (1, 2)) - tmp117 = einsum(t1.bb, (0, 1), tmp35, (0, 2), (1, 2)) - tmp115 = einsum(v.bbb.xov, (0, 1, 2), tmp114, (0, 1, 3), (2, 3)) - del tmp114 - tmp21 = einsum(v.bbb.xov, (0, 1, 2), tmp7, (0,), (1, 2)) - tmp139 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp23 = einsum(tmp7, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - tmp53 = einsum(v.baa.xvv, (0, 1, 2), tmp7, (0,), (1, 2)) - tmp52 = einsum(v.baa.xov, (0, 1, 2), tmp51, (0, 1, 3), (2, 3)) - del tmp51 - tmp54 = einsum(tmp14, (0, 1), t1.aa, (0, 2), (2, 1)) - tmp95 = einsum(tmp0, (0, 1, 2), tmp0, (0, 3, 4), (1, 3, 2, 4)) - tmp66 = np.copy(f.aa.ov) - tmp66 += tmp13 * -1 - tmp66 += tmp10 - tmp61 = einsum(v.baa.xoo, (0, 1, 2), tmp0, (0, 3, 4), (3, 1, 2, 4)) - tmp81 = einsum(tmp0, (0, 1, 2), tmp80, (0, 3, 4), (1, 2, 3, 4)) - del tmp80 - tmp79 = einsum(v.baa.xov, (0, 1, 2), tmp78, (0, 3, 4), (1, 3, 2, 4)) - tmp89 = einsum(tmp72, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp88 = einsum(v.baa.xov, (0, 1, 2), tmp87, (0, 3, 4), (1, 3, 2, 4)) - del tmp87 - tmp44 = einsum(v.baa.xov, (0, 1, 2), tmp43, (0, 3, 2), (1, 3)) - tmp25 = einsum(tmp7, (0,), v.baa.xoo, (0, 1, 2), (1, 2)) - tmp110 = np.copy(f.bb.oo) - tmp110 += tmp109 - del tmp109 - tmp110 += np.transpose(tmp40, (1, 0)) - tmp113 = np.copy(tmp29) - tmp113 += tmp33 * 2 - tmp195 = einsum(tmp19, (0, 1, 2), tmp38, (0, 3, 4), (1, 3, 2, 4)) - tmp185 = np.copy(tmp107) * 2 - tmp185 += tmp29 * -1 - tmp152 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp171 = np.copy(tmp38) * -1 - tmp171 += tmp126 - tmp167 = np.copy(tmp38) - tmp167 += tmp126 * -1 - tmp165 = einsum(t1.bb, (0, 1), tmp164, (2, 1), (2, 0)) - del tmp164 - tmp183 = np.copy(tmp181) * -1 - del tmp181 - tmp183 += np.transpose(tmp182, (1, 0, 3, 2)) * -1 - del tmp182 - tmp175 = np.copy(np.transpose(tmp144, (1, 0, 3, 2))) * -1 - tmp175 += np.transpose(tmp174, (0, 1, 3, 2)) - del tmp174 - tmp197 = einsum(tmp168, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 2, 1, 4)) - tmp192 = einsum(t1.bb, (0, 1), tmp189, (2, 3, 0, 4), (3, 2, 4, 1)) - tmp187 = np.copy(tmp107) - del tmp107 - tmp187 += tmp29 * -0.5 - tmp162 = einsum(t1.bb, (0, 1), tmp160, (2, 3, 4, 0), (2, 3, 4, 1)) - tmp127 = np.copy(v.bbb.xov) - tmp127 += tmp38 - tmp127 += tmp126 * -1 - tmp118 = np.copy(f.bb.vv) * -1 - tmp118 += tmp115 - del tmp115 - tmp118 += np.transpose(tmp116, (1, 0)) * -1 - del tmp116 - tmp118 += np.transpose(tmp117, (1, 0)) - del tmp117 - tmp200 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp22 = np.copy(f.bb.ov) - tmp22 += tmp20 * -1 - del tmp20 - tmp22 += tmp21 - del tmp21 - tmp28 = einsum(tmp19, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp39 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp158 = einsum(tmp38, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp131 = np.copy(v.bbb.xvv) - tmp131 += tmp130 * -1 - tmp124 = np.copy(v.baa.xvv) - tmp124 += tmp71 * -1 - tmp128 = np.copy(v.baa.xvv) - tmp128 += tmp71 * -1 - del tmp71 - tmp140 = einsum(t1.bb, (0, 1), tmp139, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp139 - tmp137 = np.copy(v.bbb.xvv) - tmp137 += tmp130 * -1 - del tmp130 - tmp147 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 4, 1, 2)) - tmp76 = np.copy(tmp18) * -1 - tmp76 += tmp69 - tmp1 = einsum(tmp0, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp92 = np.copy(tmp42) * 2 - tmp92 += tmp3 * -1 - tmp24 = np.copy(f.aa.ov) - tmp24 += tmp13 * -1 - del tmp13 - tmp24 += tmp23 - del tmp23 - tmp55 = np.copy(f.aa.vv) * -1 - tmp55 += tmp52 - del tmp52 - tmp55 += np.transpose(tmp53, (1, 0)) * -1 - del tmp53 - tmp55 += np.transpose(tmp54, (1, 0)) - del tmp54 - tmp97 = einsum(tmp95, (0, 1, 2, 3), t1.aa, (2, 4), (1, 0, 3, 4)) - tmp67 = einsum(tmp66, (0, 1), t1.aa, (2, 1), (2, 0)) - del tmp66 - tmp70 = np.copy(tmp18) - tmp70 += tmp69 * -1 - tmp16 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp105 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xov, (0, 3, 4), (3, 1, 2, 4)) - tmp63 = einsum(tmp61, (0, 1, 2, 3), t1.aa, (3, 4), (0, 1, 2, 4)) - tmp82 = np.copy(np.transpose(tmp79, (1, 0, 3, 2))) * -1 - tmp82 += np.transpose(tmp81, (0, 1, 3, 2)) - del tmp81 - tmp100 = einsum(tmp0, (0, 1, 2), tmp18, (0, 3, 4), (1, 3, 2, 4)) - tmp74 = np.copy(v.baa.xov) - tmp74 += tmp18 - tmp74 += tmp69 * -1 - del tmp69 - tmp47 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp59 = einsum(v.baa.xoo, (0, 1, 2), tmp18, (0, 3, 4), (3, 1, 2, 4)) - tmp90 = np.copy(np.transpose(tmp88, (1, 0, 3, 2))) * -1 - del tmp88 - tmp90 += np.transpose(tmp89, (1, 0, 3, 2)) * -1 - del tmp89 - tmp45 = np.copy(f.aa.oo) - tmp45 += tmp44 - del tmp44 - tmp45 += np.transpose(tmp25, (1, 0)) - tmp102 = einsum(v.baa.xov, (0, 1, 2), tmp72, (0, 3, 4), (1, 4, 3, 2)) - tmp57 = np.copy(tmp11) * 2 - tmp57 += tmp3 - tmp30 = np.copy(t2.bbbb) - tmp30 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * -0.5 - tmp34 = np.copy(tmp29) - tmp34 += tmp33 * 2 - tmp34 += einsum(tmp7, (0,), t1.bb, (1, 2), (0, 1, 2)) - tmp4 = np.copy(t2.aaaa) - tmp4 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * -0.5 - tmp12 = np.copy(tmp11) - tmp12 += tmp3 * 0.5 - tmp12 += einsum(tmp7, (0,), t1.aa, (1, 2), (0, 1, 2)) * 0.5 - tmp151 = einsum(tmp110, (0, 1), t2.bbbb, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - tmp157 = einsum(v.bbb.xov, (0, 1, 2), tmp113, (0, 3, 4), (1, 3, 2, 4)) - tmp196 = einsum(tmp195, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - del tmp195 - tmp186 = einsum(tmp29, (0, 1, 2), tmp185, (0, 3, 4), (3, 1, 4, 2)) * 0.5 - del tmp185 - tmp154 = einsum(tmp152, (0, 1, 2, 3), t2.bbbb, (1, 3, 4, 5), (2, 0, 4, 5)) - tmp172 = einsum(tmp29, (0, 1, 2), tmp171, (0, 3, 4), (3, 1, 4, 2)) - del tmp171 - tmp169 = einsum(tmp167, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) * -1 - del tmp167 - tmp169 += einsum(tmp168, (0, 1, 2), tmp19, (0, 3, 4), (3, 4, 2, 1)) - del tmp168 - tmp161 = einsum(t2.bbbb, (0, 1, 2, 3), tmp160, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp160 - tmp166 = einsum(t2.bbbb, (0, 1, 2, 3), tmp165, (1, 4), (4, 0, 2, 3)) * -1 - del tmp165 - tmp184 = einsum(tmp183, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp183 - tmp194 = einsum(tmp38, (0, 1, 2), tmp38, (0, 3, 4), (1, 3, 2, 4)) - tmp176 = einsum(t2.bbbb, (0, 1, 2, 3), tmp175, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp175 - tmp190 = einsum(t2.bbbb, (0, 1, 2, 3), tmp189, (4, 5, 1, 0), (5, 4, 2, 3)) - del tmp189 - tmp198 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp198 += einsum(t1.bb, (0, 1), tmp197, (0, 2, 3, 4), (4, 3, 1, 2)) - del tmp197 - tmp193 = einsum(tmp192, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) - del tmp192 - tmp155 = einsum(t1.bb, (0, 1), t1.bb, (2, 3), (0, 2, 3, 1)) * 2 - tmp155 += t2.bbbb * -1 - tmp188 = einsum(tmp29, (0, 1, 2), tmp187, (0, 3, 4), (3, 1, 4, 2)) - del tmp187 - tmp191 = einsum(v.bbb.xov, (0, 1, 2), tmp38, (0, 3, 4), (3, 1, 2, 4)) - tmp163 = einsum(tmp162, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 4, 3)) - del tmp162 - tmp170 = einsum(v.bbb.xov, (0, 1, 2), tmp127, (0, 3, 4), (1, 3, 2, 4)) - tmp156 = einsum(tmp118, (0, 1), t2.bbbb, (2, 3, 4, 0), (2, 3, 4, 1)) * -2 - tmp201 = einsum(tmp200, (0, 1, 2, 3), t2.bbbb, (4, 5, 2, 3), (4, 5, 0, 1)) * -1 - del tmp200 - tmp119 = einsum(t1.bb, (0, 1), tmp22, (2, 1), (0, 2)) - tmp153 = np.copy(t2.bbbb) - tmp153 += einsum(t1.bb, (0, 1), t1.bb, (2, 3), (2, 0, 3, 1)) * 2 - tmp179 = einsum(tmp33, (0, 1, 2), tmp29, (0, 3, 4), (3, 1, 4, 2)) - tmp177 = einsum(tmp29, (0, 1, 2), tmp143, (0, 3, 4), (1, 3, 2, 4)) - tmp199 = einsum(t1.bb, (0, 1), tmp28, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp178 = einsum(tmp39, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 4, 3)) - tmp159 = einsum(tmp158, (0, 1, 2, 3), t1.bb, (1, 4), (0, 2, 4, 3)) - del tmp158 - tmp37 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp134 = einsum(tmp0, (0, 1, 2), tmp19, (0, 3, 4), (1, 2, 3, 4)) - tmp17 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp150 = einsum(tmp0, (0, 1, 2), tmp38, (0, 3, 4), (1, 2, 3, 4)) - tmp146 = einsum(tmp0, (0, 1, 2), tmp131, (0, 3, 4), (1, 2, 4, 3)) - tmp145 = np.copy(np.transpose(tmp144, (1, 0, 2, 3))) * -1 - del tmp144 - tmp145 += einsum(tmp131, (0, 1, 2), tmp19, (0, 3, 4), (3, 4, 2, 1)) - tmp136 = np.copy(tmp42) * -2 - del tmp42 - tmp136 += tmp11 * 2 - tmp136 += tmp3 - tmp149 = einsum(tmp38, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp133 = np.copy(v.bbb.xov) - tmp133 += tmp38 - tmp133 += tmp126 * -1 - del tmp126 - tmp125 = einsum(tmp124, (0, 1, 2), tmp19, (0, 3, 4), (3, 4, 2, 1)) - tmp111 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp2 = einsum(tmp0, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp112 = np.copy(t2.abab) - tmp112 += einsum(t1.bb, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) * 2 - tmp120 = einsum(v.baa.xoo, (0, 1, 2), tmp19, (0, 3, 4), (1, 2, 3, 4)) - tmp142 = np.copy(np.transpose(tmp79, (1, 0, 2, 3))) * -1 - del tmp79 - tmp142 += einsum(tmp0, (0, 1, 2), tmp128, (0, 3, 4), (1, 2, 4, 3)) - tmp141 = einsum(tmp140, (0, 1, 2, 3), t1.aa, (0, 4), (1, 4, 3, 2)) - del tmp140 - tmp141 += einsum(tmp137, (0, 1, 2), v.baa.xvv, (0, 3, 4), (3, 4, 2, 1)) - tmp132 = einsum(tmp131, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 2, 1)) - del tmp131 - tmp148 = einsum(t2.abab, (0, 1, 2, 3), tmp147, (4, 2, 5, 3), (0, 4, 1, 5)) - del tmp147 - tmp122 = einsum(v.bbb.xoo, (0, 1, 2), tmp18, (0, 3, 4), (3, 1, 2, 4)) - tmp121 = np.copy(t2.abab) - tmp121 += einsum(t1.bb, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) - tmp129 = einsum(v.bbb.xoo, (0, 1, 2), tmp128, (0, 3, 4), (1, 2, 4, 3)) - del tmp128 - tmp123 = einsum(tmp0, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 2, 3, 4)) - tmp138 = einsum(v.bbb.xov, (0, 1, 2), tmp108, (0, 3, 4), (1, 3, 2, 4)) - tmp138 += einsum(v.bbb.xoo, (0, 1, 2), tmp137, (0, 3, 4), (1, 2, 4, 3)) * -1 - del tmp137 - tmp135 = einsum(v.baa.xov, (0, 1, 2), tmp43, (0, 3, 4), (1, 3, 2, 4)) - del tmp43 - tmp135 += einsum(tmp124, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 2, 1)) * -1 - del tmp124 - tmp77 = einsum(tmp76, (0, 1, 2), tmp3, (0, 3, 4), (3, 1, 4, 2)) - del tmp76 - tmp104 = einsum(t1.aa, (0, 1), tmp1, (2, 3, 0, 4), (2, 3, 1, 4)) - tmp93 = einsum(tmp3, (0, 1, 2), tmp92, (0, 3, 4), (1, 3, 2, 4)) * 0.5 - del tmp92 - tmp84 = einsum(tmp78, (0, 1, 2), tmp3, (0, 3, 4), (3, 1, 4, 2)) - tmp50 = einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 1, 3)) * 2 - tmp50 += t2.aaaa * -1 - tmp86 = einsum(tmp11, (0, 1, 2), tmp3, (0, 3, 4), (1, 3, 2, 4)) - tmp99 = einsum(tmp18, (0, 1, 2), tmp18, (0, 3, 4), (3, 1, 4, 2)) - tmp96 = einsum(tmp95, (0, 1, 2, 3), t2.aaaa, (3, 2, 4, 5), (1, 0, 4, 5)) - del tmp95 - tmp62 = einsum(t2.aaaa, (0, 1, 2, 3), tmp61, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp61 - tmp65 = einsum(tmp24, (0, 1), t1.aa, (2, 1), (2, 0)) - tmp56 = einsum(tmp55, (0, 1), t2.aaaa, (2, 3, 4, 0), (2, 3, 4, 1)) * -2 - tmp48 = np.copy(t2.aaaa) - tmp48 += einsum(t1.aa, (0, 1), t1.aa, (2, 3), (2, 0, 3, 1)) * 2 - tmp98 = einsum(t1.aa, (0, 1), tmp97, (2, 3, 0, 4), (2, 3, 1, 4)) - del tmp97 - tmp94 = einsum(tmp18, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 4, 2)) - tmp68 = einsum(tmp67, (0, 1), t2.aaaa, (2, 1, 3, 4), (2, 0, 3, 4)) * -1 - tmp73 = einsum(v.baa.xov, (0, 1, 2), tmp70, (0, 3, 4), (3, 1, 4, 2)) * -1 - del tmp70 - tmp73 += einsum(tmp0, (0, 1, 2), tmp72, (0, 3, 4), (1, 2, 4, 3)) - del tmp72 - tmp85 = einsum(t1.aa, (0, 1), tmp16, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp106 = einsum(tmp105, (0, 1, 2, 3), t2.aaaa, (4, 5, 2, 3), (4, 5, 0, 1)) * -1 - del tmp105 - tmp64 = einsum(t1.aa, (0, 1), tmp63, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp63 - tmp83 = einsum(tmp82, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp82 - tmp101 = einsum(tmp100, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) - del tmp100 - tmp75 = einsum(v.baa.xov, (0, 1, 2), tmp74, (0, 3, 4), (1, 3, 2, 4)) - del tmp74 - tmp49 = einsum(t2.aaaa, (0, 1, 2, 3), tmp47, (4, 0, 5, 1), (5, 4, 2, 3)) - tmp60 = einsum(t1.aa, (0, 1), tmp59, (2, 0, 3, 4), (2, 3, 1, 4)) - del tmp59 - tmp91 = einsum(t2.aaaa, (0, 1, 2, 3), tmp90, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp90 - tmp46 = einsum(t2.aaaa, (0, 1, 2, 3), tmp45, (1, 4), (0, 4, 2, 3)) * -1 - tmp103 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (3, 1, 2, 4)) - tmp103 += einsum(t1.aa, (0, 1), tmp102, (0, 2, 3, 4), (4, 3, 1, 2)) - del tmp102 - tmp58 = einsum(v.baa.xov, (0, 1, 2), tmp57, (0, 3, 4), (1, 3, 2, 4)) - tmp31 = np.copy(tmp29) - del tmp29 - tmp31 += einsum(tmp30, (0, 1, 2, 3), v.bbb.xov, (4, 0, 2), (4, 1, 3)) * 2 - del tmp30 - tmp31 += einsum(tmp7, (0,), t1.bb, (1, 2), (0, 1, 2)) - tmp36 = einsum(v.bbb.xov, (0, 1, 2), tmp34, (0, 3, 2), (1, 3)) - del tmp34 - tmp36 += einsum(t1.bb, (0, 1), tmp35, (2, 1), (2, 0)) - del tmp35 - tmp27 = einsum(v.baa.xov, (0, 1, 2), tmp19, (0, 3, 4), (1, 3, 4, 2)) - tmp41 = np.copy(f.bb.oo) - tmp41 += einsum(tmp19, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (2, 3)) * -1 - del tmp19 - tmp41 += np.transpose(tmp40, (1, 0)) - del tmp40 - tmp8 = np.copy(tmp3) - del tmp3 - tmp8 += einsum(v.baa.xov, (0, 1, 2), tmp4, (1, 3, 2, 4), (0, 3, 4)) * 2 - del tmp4 - tmp8 += einsum(tmp7, (0,), t1.aa, (1, 2), (0, 1, 2)) - del tmp7 - tmp26 = np.copy(f.aa.oo) - tmp26 += einsum(v.baa.xoo, (0, 1, 2), tmp0, (0, 2, 3), (3, 1)) * -1 - del tmp0 - tmp26 += np.transpose(tmp25, (1, 0)) - del tmp25 - tmp15 = einsum(v.baa.xov, (0, 1, 2), tmp12, (0, 3, 2), (1, 3)) * 2 - del tmp12 - tmp15 += einsum(t1.aa, (0, 1), tmp14, (2, 1), (2, 0)) - del tmp14 - t2new.bbbb = np.copy(np.transpose(tmp151, (0, 1, 3, 2))) * -2 - t2new.bbbb += einsum(tmp153, (0, 1, 2, 3), tmp152, (0, 4, 1, 5), (4, 5, 3, 2)) * 0.5 - del tmp153 - t2new.bbbb += np.transpose(tmp154, (0, 1, 3, 2)) * -1 - del tmp154 - t2new.bbbb += np.transpose(tmp151, (1, 0, 3, 2)) * 2 - del tmp151 - t2new.bbbb += einsum(tmp155, (0, 1, 2, 3), tmp152, (0, 4, 1, 5), (4, 5, 3, 2)) * -0.5 - del tmp152, tmp155 - t2new.bbbb += np.transpose(tmp156, (1, 0, 3, 2)) - t2new.bbbb += tmp157 - t2new.bbbb += np.transpose(tmp156, (1, 0, 2, 3)) * -1 - del tmp156 - t2new.bbbb += np.transpose(tmp157, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp159, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp161, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp163, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp163, (1, 0, 3, 2)) * -1 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp119, (4, 1), (0, 4, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp159, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp166, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp159, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp161, (0, 1, 3, 2)) * 2 - del tmp161 - t2new.bbbb += tmp163 * -1 - t2new.bbbb += np.transpose(tmp163, (0, 1, 3, 2)) - del tmp163 - t2new.bbbb += np.transpose(tmp166, (0, 1, 3, 2)) * 2 - del tmp166 - t2new.bbbb += tmp159 - del tmp159 - t2new.bbbb += einsum(tmp169, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (4, 0, 2, 5)) * 2 - del tmp169 - t2new.bbbb += tmp170 - t2new.bbbb += np.transpose(tmp172, (1, 0, 2, 3)) - t2new.bbbb += tmp176 * -2 - t2new.bbbb += np.transpose(tmp170, (1, 0, 2, 3)) * -1 - del tmp170 - t2new.bbbb += np.transpose(tmp177, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp178, (0, 1, 3, 2)) - t2new.bbbb += tmp179 * 2 - t2new.bbbb += np.transpose(tmp179, (1, 0, 3, 2)) * 2 - t2new.bbbb += tmp184 - t2new.bbbb += tmp186 * -1 - t2new.bbbb += np.transpose(tmp178, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp179, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp179, (1, 0, 2, 3)) * -2 - del tmp179 - t2new.bbbb += np.transpose(tmp184, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp186, (1, 0, 2, 3)) - del tmp186 - t2new.bbbb += tmp178 * -1 - t2new.bbbb += np.transpose(tmp184, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp188, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp178, (1, 0, 2, 3)) - del tmp178 - t2new.bbbb += np.transpose(tmp184, (1, 0, 3, 2)) - del tmp184 - t2new.bbbb += np.transpose(tmp188, (1, 0, 3, 2)) * -1 - del tmp188 - t2new.bbbb += np.transpose(tmp190, (0, 1, 3, 2)) * -2 - del tmp190 - t2new.bbbb += np.transpose(tmp191, (0, 1, 3, 2)) - t2new.bbbb += tmp193 - t2new.bbbb += np.transpose(tmp193, (0, 1, 3, 2)) * -1 - del tmp193 - t2new.bbbb += tmp194 - t2new.bbbb += np.transpose(tmp194, (0, 1, 3, 2)) * -1 - del tmp194 - t2new.bbbb += np.transpose(tmp196, (0, 1, 3, 2)) - t2new.bbbb += np.transpose(tmp196, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp191, (1, 0, 3, 2)) * -1 - del tmp191 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp198, (2, 3, 4, 5), (0, 1, 5, 4)) * 2 - del tmp198 - t2new.bbbb += np.transpose(tmp157, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp157, (1, 0, 3, 2)) - del tmp157 - t2new.bbbb += np.transpose(tmp199, (1, 0, 2, 3)) - t2new.bbbb += np.transpose(tmp176, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp172, (1, 0, 3, 2)) * -1 - del tmp172 - t2new.bbbb += tmp199 * -1 - del tmp199 - t2new.bbbb += np.transpose(tmp176, (0, 1, 3, 2)) * 2 - del tmp176 - t2new.bbbb += np.transpose(tmp177, (1, 0, 2, 3)) * -1 - del tmp177 - t2new.bbbb += einsum(tmp201, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 4, 3)) * -2 - del tmp201 - t2new.bbbb += tmp196 * -1 - t2new.bbbb += np.transpose(tmp196, (1, 0, 2, 3)) - del tmp196 - t2new.abab = einsum(t2.abab, (0, 1, 2, 3), tmp110, (1, 4), (0, 4, 2, 3)) * -1 - del tmp110 - t2new.abab += einsum(tmp112, (0, 1, 2, 3), tmp111, (0, 4, 1, 5), (4, 5, 2, 3)) * 0.5 - del tmp112 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp111, (4, 0, 5, 1), (4, 5, 2, 3)) * 0.5 - del tmp111 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp45, (0, 4), (4, 1, 2, 3)) * -1 - del tmp45 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp55, (2, 4), (0, 1, 4, 3)) * -1 - del tmp55 - t2new.abab += einsum(v.baa.xov, (0, 1, 2), tmp113, (0, 3, 4), (1, 3, 2, 4)) - del tmp113 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp118, (3, 4), (0, 1, 2, 4)) * -1 - del tmp118 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp119, (4, 1), (0, 4, 2, 3)) * -1 - del tmp119 - t2new.abab += einsum(tmp121, (0, 1, 2, 3), tmp120, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp120 - t2new.abab += einsum(t1.bb, (0, 1), tmp122, (2, 0, 3, 4), (2, 3, 4, 1)) * -1 - del tmp122 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp67, (4, 0), (4, 1, 2, 3)) * -1 - del tmp67 - t2new.abab += einsum(tmp123, (0, 1, 2, 3), tmp121, (1, 2, 4, 5), (0, 3, 4, 5)) - del tmp123 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp125, (4, 1, 2, 5), (0, 4, 5, 3)) * -1 - del tmp125 - t2new.abab += einsum(v.baa.xov, (0, 1, 2), tmp127, (0, 3, 4), (1, 3, 2, 4)) - del tmp127 - t2new.abab += einsum(tmp37, (0, 1, 2, 3), t1.bb, (2, 4), (0, 1, 3, 4)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp129, (1, 4, 2, 5), (0, 4, 5, 3)) * -1 - del tmp129 - t2new.abab += einsum(t1.aa, (0, 1), tmp17, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp132, (0, 4, 3, 5), (4, 1, 2, 5)) * -1 - del tmp132 - t2new.abab += einsum(tmp133, (0, 1, 2), tmp18, (0, 3, 4), (3, 1, 4, 2)) - del tmp133 - t2new.abab += einsum(tmp134, (0, 1, 2, 3), tmp121, (1, 3, 4, 5), (0, 2, 4, 5)) - del tmp121, tmp134 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp135, (0, 4, 2, 5), (4, 1, 5, 3)) - del tmp135 - t2new.abab += einsum(tmp136, (0, 1, 2), tmp33, (0, 3, 4), (1, 3, 2, 4)) - del tmp136 - t2new.abab += einsum(v.bbb.xov, (0, 1, 2), tmp57, (0, 3, 4), (3, 1, 4, 2)) - del tmp57 - t2new.abab += einsum(tmp138, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) - del tmp138 - t2new.abab += einsum(tmp108, (0, 1, 2), tmp11, (0, 3, 4), (3, 1, 4, 2)) * 2 - del tmp108 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp141, (2, 4, 3, 5), (0, 1, 4, 5)) - del tmp141 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp142, (4, 0, 2, 5), (4, 1, 5, 3)) * -1 - del tmp142 - t2new.abab += einsum(tmp33, (0, 1, 2), tmp78, (0, 3, 4), (3, 1, 4, 2)) * 2 - del tmp33, tmp78 - t2new.abab += einsum(tmp145, (0, 1, 2, 3), t2.abab, (4, 1, 5, 2), (4, 0, 5, 3)) * -1 - del tmp145 - t2new.abab += einsum(tmp11, (0, 1, 2), tmp143, (0, 3, 4), (1, 3, 2, 4)) * 2 - del tmp11, tmp143 - t2new.abab += einsum(tmp2, (0, 1, 2, 3), t1.aa, (1, 4), (0, 2, 4, 3)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp146, (4, 0, 3, 5), (4, 1, 2, 5)) * -1 - del tmp146 - t2new.abab += einsum(t1.aa, (0, 1), tmp148, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp148 - t2new.abab += einsum(tmp149, (0, 1, 2, 3), t1.aa, (0, 4), (1, 2, 4, 3)) * -1 - del tmp149 - t2new.abab += einsum(t1.aa, (0, 1), tmp150, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - del tmp150 - t2new.aaaa = np.copy(np.transpose(tmp46, (0, 1, 3, 2))) * -2 - t2new.aaaa += einsum(tmp47, (0, 1, 2, 3), tmp48, (0, 2, 4, 5), (1, 3, 5, 4)) * 0.5 - del tmp48 - t2new.aaaa += np.transpose(tmp49, (0, 1, 3, 2)) * -1 - del tmp49 - t2new.aaaa += np.transpose(tmp46, (1, 0, 3, 2)) * 2 - del tmp46 - t2new.aaaa += einsum(tmp50, (0, 1, 2, 3), tmp47, (0, 4, 1, 5), (4, 5, 3, 2)) * -0.5 - del tmp47, tmp50 - t2new.aaaa += np.transpose(tmp56, (1, 0, 3, 2)) - t2new.aaaa += tmp58 - t2new.aaaa += np.transpose(tmp56, (1, 0, 2, 3)) * -1 - del tmp56 - t2new.aaaa += np.transpose(tmp58, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp60, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp62, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp64, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(tmp64, (1, 0, 3, 2)) * -1 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp65, (4, 1), (0, 4, 2, 3)) * -1 - del tmp65 - t2new.aaaa += np.transpose(tmp60, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp68, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp60, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp62, (0, 1, 3, 2)) * 2 - del tmp62 - t2new.aaaa += tmp64 * -1 - t2new.aaaa += np.transpose(tmp64, (0, 1, 3, 2)) - del tmp64 - t2new.aaaa += np.transpose(tmp68, (1, 0, 3, 2)) * 2 - del tmp68 - t2new.aaaa += tmp60 - del tmp60 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp73, (4, 1, 5, 3), (0, 4, 5, 2)) * 2 - del tmp73 - t2new.aaaa += tmp75 - t2new.aaaa += np.transpose(tmp77, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp83, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp75, (1, 0, 2, 3)) * -1 - del tmp75 - t2new.aaaa += np.transpose(tmp84, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp85, (0, 1, 3, 2)) - t2new.aaaa += tmp86 * 2 - t2new.aaaa += np.transpose(tmp86, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp91, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp93, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp85, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp86, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp86, (1, 0, 2, 3)) * -2 - del tmp86 - t2new.aaaa += np.transpose(tmp91, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp93, (0, 1, 3, 2)) - t2new.aaaa += tmp85 * -1 - t2new.aaaa += np.transpose(tmp91, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp93, (1, 0, 2, 3)) - t2new.aaaa += np.transpose(tmp85, (1, 0, 2, 3)) - del tmp85 - t2new.aaaa += tmp91 - del tmp91 - t2new.aaaa += tmp93 * -1 - del tmp93 - t2new.aaaa += np.transpose(tmp94, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp96, (0, 1, 3, 2)) * -2 - del tmp96 - t2new.aaaa += tmp98 - t2new.aaaa += np.transpose(tmp98, (0, 1, 3, 2)) * -1 - del tmp98 - t2new.aaaa += tmp99 - t2new.aaaa += np.transpose(tmp99, (0, 1, 3, 2)) * -1 - del tmp99 - t2new.aaaa += np.transpose(tmp101, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp101, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp94, (1, 0, 3, 2)) * -1 - del tmp94 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp103, (2, 3, 4, 5), (0, 1, 5, 4)) * 2 - del tmp103 - t2new.aaaa += np.transpose(tmp58, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp58, (1, 0, 3, 2)) - del tmp58 - t2new.aaaa += np.transpose(tmp104, (1, 0, 2, 3)) - t2new.aaaa += tmp83 * -2 - t2new.aaaa += tmp77 * -1 - del tmp77 - t2new.aaaa += tmp104 * -1 - del tmp104 - t2new.aaaa += np.transpose(tmp83, (1, 0, 2, 3)) * 2 - del tmp83 - t2new.aaaa += np.transpose(tmp84, (1, 0, 2, 3)) * -1 - del tmp84 - t2new.aaaa += einsum(tmp106, (0, 1, 2, 3), t1.aa, (2, 4), (0, 1, 4, 3)) * -2 - del tmp106 - t2new.aaaa += tmp101 * -1 - t2new.aaaa += np.transpose(tmp101, (1, 0, 2, 3)) - del tmp101 - t1new.bb = einsum(tmp27, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) * -1 - del tmp27 - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp28, (4, 1, 0, 3), (4, 2)) * -2 - del tmp28 - t1new.bb += f.bb.ov - t1new.bb += einsum(t1.bb, (0, 1), f.bb.vv, (2, 1), (0, 2)) - t1new.bb += einsum(tmp31, (0, 1, 2), v.bbb.xvv, (0, 3, 2), (1, 3)) - del tmp31 - t1new.bb += tmp32 - del tmp32 - t1new.bb += einsum(t1.bb, (0, 1), tmp36, (0, 2), (2, 1)) * -1 - del tmp36 - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), tmp37, (0, 4, 1, 2), (4, 3)) * -1 - del tmp37 - t1new.bb += einsum(v.bbb.xoo, (0, 1, 2), tmp38, (0, 2, 3), (1, 3)) * -1 - del tmp38 - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp39, (4, 0, 1, 3), (4, 2)) * -2 - del tmp39 - t1new.bb += einsum(tmp24, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - t1new.bb += einsum(tmp22, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) * 2 - t1new.bb += einsum(tmp41, (0, 1), t1.bb, (0, 2), (1, 2)) * -1 - del tmp41 - t1new.aa = einsum(f.aa.vv, (0, 1), t1.aa, (2, 1), (2, 0)) - t1new.aa += f.aa.ov - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), tmp1, (4, 1, 0, 3), (4, 2)) * -2 - del tmp1 - t1new.aa += einsum(tmp2, (0, 1, 2, 3), t2.abab, (1, 2, 4, 3), (0, 4)) * -1 - del tmp2 - t1new.aa += einsum(v.baa.xvv, (0, 1, 2), tmp8, (0, 3, 2), (3, 1)) - del tmp8 - t1new.aa += tmp10 - del tmp10 - t1new.aa += einsum(t1.aa, (0, 1), tmp15, (0, 2), (2, 1)) * -1 - del tmp15 - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), tmp16, (4, 0, 1, 3), (4, 2)) * -2 - del tmp16 - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), tmp17, (4, 0, 1, 3), (4, 2)) * -1 - del tmp17 - t1new.aa += einsum(tmp18, (0, 1, 2), v.baa.xoo, (0, 3, 1), (3, 2)) * -1 - del tmp18 - t1new.aa += einsum(tmp22, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - del tmp22 - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), tmp24, (1, 3), (0, 2)) * 2 - del tmp24 - t1new.aa += einsum(t1.aa, (0, 1), tmp26, (0, 2), (2, 1)) * -1 - del tmp26 - - return {f"t1new": t1new, f"t2new": t2new} - diff --git a/ebcc/codegen/UDFQCISD.py b/ebcc/codegen/UDFQCISD.py deleted file mode 100644 index 4cf25c94..00000000 --- a/ebcc/codegen/UDFQCISD.py +++ /dev/null @@ -1,399 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T16:30:16.752075 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:30:17.460329. - - Parameters - ---------- - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - tmp1 = einsum(v.baa.xov, (0, 1, 2), t2.abab, (1, 3, 2, 4), (0, 3, 4)) - tmp1 += einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp0 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - e_cc = einsum(v.baa.xov, (0, 1, 2), tmp0, (0, 1, 2), ()) - del tmp0 - e_cc += einsum(v.bbb.xov, (0, 1, 2), tmp1, (0, 1, 2), ()) - del tmp1 - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:30:44.112471. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t1new : Namespace of arrays - Updated T1 residuals. - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - tmp42 = einsum(v.bbb.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp37 = einsum(v.baa.xov, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp78 = np.copy(np.transpose(tmp42, (1, 0, 2, 3))) - tmp78 += np.transpose(tmp42, (1, 0, 3, 2)) * -1 - tmp27 = einsum(v.baa.xov, (0, 1, 2), t2.abab, (1, 3, 2, 4), (0, 3, 4)) - tmp28 = einsum(v.bbb.xov, (0, 1, 2), t2.bbbb, (3, 1, 4, 2), (0, 3, 4)) - tmp17 = einsum(t2.abab, (0, 1, 2, 3), v.bbb.xov, (4, 1, 3), (4, 0, 2)) - tmp16 = einsum(v.baa.xov, (0, 1, 2), t2.aaaa, (3, 1, 4, 2), (0, 3, 4)) - tmp38 = np.copy(np.transpose(tmp37, (1, 0, 2, 3))) * -1 - tmp38 += np.transpose(tmp37, (1, 0, 3, 2)) - tmp5 = einsum(v.baa.xov, (0, 1, 2), t1.aa, (1, 2), (0,)) - tmp6 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (1, 2), (0,)) - tmp71 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp79 = einsum(t2.bbbb, (0, 1, 2, 3), tmp78, (1, 4, 5, 3), (0, 4, 2, 5)) - del tmp78 - tmp22 = einsum(t1.bb, (0, 1), v.bbb.xvv, (2, 3, 1), (2, 0, 3)) - tmp30 = np.copy(tmp27) * 0.5 - tmp30 += tmp28 - tmp55 = np.copy(tmp16) * 2 - tmp55 += tmp17 - tmp1 = einsum(v.baa.xvv, (0, 1, 2), t1.aa, (3, 2), (0, 3, 1)) - tmp39 = einsum(tmp38, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (4, 1, 5, 3)) - tmp36 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp43 = np.copy(np.transpose(tmp42, (1, 0, 2, 3))) * -1 - tmp43 += np.transpose(tmp42, (1, 0, 3, 2)) - tmp20 = np.copy(tmp16) * 2 - tmp20 += tmp17 - tmp7 = np.copy(tmp5) - tmp7 += tmp6 - tmp3 = einsum(v.bbb.xov, (0, 1, 2), t1.bb, (3, 2), (0, 3, 1)) - tmp10 = einsum(t1.aa, (0, 1), v.baa.xov, (2, 3, 1), (2, 0, 3)) - tmp66 = np.copy(tmp27) - tmp66 += tmp28 * 2 - tmp80 = np.copy(np.transpose(tmp71, (1, 0, 3, 2))) - tmp80 += tmp79 * -2 - del tmp79 - tmp86 = einsum(t2.bbbb, (0, 1, 2, 3), tmp42, (4, 5, 3, 2), (0, 1, 5, 4)) - tmp82 = einsum(t2.abab, (0, 1, 2, 3), tmp38, (0, 4, 2, 5), (4, 1, 5, 3)) - del tmp38 - tmp59 = np.copy(v.bbb.xov) - tmp59 += tmp22 - tmp92 = einsum(v.bbb.xov, (0, 1, 2), tmp30, (0, 1, 3), (2, 3)) - tmp90 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (3, 1, 2, 4)) - tmp23 = einsum(v.bbb.xoo, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - tmp31 = einsum(tmp30, (0, 1, 2), v.bbb.xov, (0, 3, 2), (3, 1)) * 2 - tmp56 = einsum(v.baa.xov, (0, 1, 2), tmp55, (0, 3, 4), (1, 3, 2, 4)) - tmp60 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp63 = einsum(v.baa.xoo, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 2, 3, 4)) - tmp18 = np.copy(tmp16) - tmp18 += tmp17 * 0.5 - tmp69 = einsum(v.bbb.xov, (0, 1, 2), tmp55, (0, 3, 4), (3, 1, 4, 2)) - del tmp55 - tmp52 = einsum(v.baa.xoo, (0, 1, 2), v.baa.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp32 = np.copy(v.baa.xov) - tmp32 += tmp1 - tmp49 = einsum(t2.aaaa, (0, 1, 2, 3), tmp37, (4, 5, 3, 2), (0, 1, 5, 4)) - tmp2 = einsum(v.baa.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp40 = np.copy(np.transpose(tmp36, (1, 0, 3, 2))) - tmp40 += tmp39 * -2 - del tmp39 - tmp44 = einsum(tmp43, (0, 1, 2, 3), t2.abab, (4, 0, 5, 3), (4, 1, 5, 2)) - del tmp43 - tmp21 = einsum(tmp20, (0, 1, 2), v.baa.xov, (0, 3, 2), (3, 1)) * 0.5 - tmp8 = einsum(tmp7, (0,), v.bbb.xov, (0, 1, 2), (1, 2)) - tmp4 = einsum(tmp3, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) - tmp11 = einsum(v.baa.xov, (0, 1, 2), tmp10, (0, 1, 3), (3, 2)) - tmp12 = einsum(tmp7, (0,), v.baa.xov, (0, 1, 2), (1, 2)) - del tmp7 - tmp93 = einsum(v.bbb.xov, (0, 1, 2), tmp66, (0, 3, 4), (1, 3, 2, 4)) - tmp81 = einsum(t2.bbbb, (0, 1, 2, 3), tmp80, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp80 - tmp77 = einsum(tmp28, (0, 1, 2), tmp27, (0, 3, 4), (3, 1, 4, 2)) - tmp89 = einsum(f.bb.oo, (0, 1), t2.bbbb, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp88 = einsum(v.bbb.xvv, (0, 1, 2), v.bbb.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp87 = einsum(tmp86, (0, 1, 2, 3), t2.bbbb, (2, 3, 4, 5), (1, 0, 4, 5)) * -1 - del tmp86 - tmp83 = einsum(tmp82, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (4, 1, 5, 3)) - del tmp82 - tmp75 = einsum(tmp59, (0, 1, 2), v.bbb.xov, (0, 3, 4), (3, 1, 4, 2)) - tmp94 = np.copy(f.bb.vv) * -0.5 - tmp94 += np.transpose(tmp92, (1, 0)) - tmp85 = einsum(tmp22, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 4, 2)) - tmp84 = einsum(t2.bbbb, (0, 1, 2, 3), tmp71, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp91 = einsum(tmp90, (0, 1, 2, 3), t2.bbbb, (1, 3, 4, 5), (2, 0, 4, 5)) - del tmp90 - tmp76 = einsum(t1.bb, (0, 1), tmp23, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp95 = einsum(tmp31, (0, 1), t2.bbbb, (2, 0, 3, 4), (2, 1, 3, 4)) * -1 - tmp73 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (3, 4, 1, 2)) - tmp68 = np.copy(np.transpose(tmp36, (1, 0, 3, 2))) - tmp68 += einsum(t2.aaaa, (0, 1, 2, 3), tmp37, (1, 4, 5, 3), (4, 0, 5, 2)) * 2 - del tmp37 - tmp68 += tmp56 * -1 - tmp72 = einsum(t2.abab, (0, 1, 2, 3), tmp60, (4, 5, 2, 3), (0, 4, 1, 5)) - tmp64 = einsum(t2.abab, (0, 1, 2, 3), tmp63, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp63 - tmp61 = einsum(v.bbb.xoo, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 2, 3, 4)) - tmp61 += einsum(t2.abab, (0, 1, 2, 3), tmp60, (0, 4, 5, 3), (4, 1, 5, 2)) * -1 - del tmp60 - tmp65 = einsum(tmp30, (0, 1, 2), v.bbb.xov, (0, 1, 3), (2, 3)) * 2 - tmp67 = np.copy(f.aa.vv) * -1 - tmp67 += einsum(v.baa.xov, (0, 1, 2), tmp18, (0, 1, 3), (2, 3)) * 2 - tmp62 = einsum(v.bbb.xvv, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp24 = einsum(v.baa.xov, (0, 1, 2), v.bbb.xoo, (0, 3, 4), (1, 3, 4, 2)) - tmp70 = einsum(tmp42, (0, 1, 2, 3), t2.abab, (4, 0, 5, 3), (4, 1, 5, 2)) * -1 - del tmp42 - tmp70 += tmp69 - tmp0 = einsum(v.bbb.xov, (0, 1, 2), v.baa.xoo, (0, 3, 4), (3, 4, 1, 2)) - tmp74 = einsum(v.bbb.xov, (0, 1, 2), tmp30, (0, 3, 2), (3, 1)) - del tmp30 - tmp53 = einsum(tmp52, (0, 1, 2, 3), t2.aaaa, (1, 3, 4, 5), (2, 0, 4, 5)) - del tmp52 - tmp54 = einsum(v.baa.xov, (0, 1, 2), tmp20, (0, 1, 3), (3, 2)) - tmp47 = einsum(tmp1, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 4, 2)) - tmp33 = einsum(v.baa.xov, (0, 1, 2), tmp32, (0, 3, 4), (1, 3, 2, 4)) - del tmp32 - tmp50 = einsum(tmp49, (0, 1, 2, 3), t2.aaaa, (2, 3, 4, 5), (1, 0, 4, 5)) * -1 - del tmp49 - tmp34 = einsum(t1.aa, (0, 1), tmp2, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp48 = einsum(v.baa.xvv, (0, 1, 2), v.baa.xvv, (0, 3, 4), (1, 3, 4, 2)) - tmp41 = einsum(t2.aaaa, (0, 1, 2, 3), tmp40, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp40 - tmp51 = einsum(f.aa.oo, (0, 1), t2.aaaa, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp46 = einsum(t2.aaaa, (0, 1, 2, 3), tmp36, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp36 - tmp35 = einsum(tmp17, (0, 1, 2), tmp16, (0, 3, 4), (3, 1, 4, 2)) - del tmp16, tmp17 - tmp45 = einsum(t2.abab, (0, 1, 2, 3), tmp44, (4, 1, 5, 3), (0, 4, 2, 5)) * -1 - del tmp44 - tmp58 = einsum(tmp21, (0, 1), t2.aaaa, (2, 0, 3, 4), (2, 1, 3, 4)) * -2 - tmp57 = np.copy(f.aa.vv) * -0.5 - tmp57 += einsum(v.baa.xov, (0, 1, 2), tmp20, (0, 1, 3), (3, 2)) * 0.5 - del tmp20 - tmp9 = np.copy(f.bb.ov) - tmp9 += tmp4 * -1 - del tmp4 - tmp9 += tmp8 - del tmp8 - tmp26 = einsum(v.baa.xov, (0, 1, 2), tmp3, (0, 3, 4), (1, 3, 4, 2)) - tmp29 = np.copy(tmp27) - del tmp27 - tmp29 += tmp28 * 2 - del tmp28 - tmp13 = np.copy(f.aa.ov) - tmp13 += tmp11 * -1 - del tmp11 - tmp13 += tmp12 - del tmp12 - tmp19 = np.copy(tmp5) - del tmp5 - tmp19 += tmp6 - del tmp6 - tmp25 = einsum(v.bbb.xov, (0, 1, 2), tmp3, (0, 3, 4), (3, 1, 4, 2)) - del tmp3 - tmp15 = einsum(tmp10, (0, 1, 2), v.baa.xov, (0, 3, 4), (1, 3, 2, 4)) - tmp14 = einsum(tmp10, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 2, 3, 4)) - del tmp10 - t2new.bbbb = np.copy(tmp75) - t2new.bbbb += np.transpose(tmp75, (1, 0, 2, 3)) * -1 - del tmp75 - t2new.bbbb += np.transpose(tmp76, (0, 1, 3, 2)) - t2new.bbbb += tmp77 * 2 - t2new.bbbb += np.transpose(tmp77, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp81, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp83, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp76, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp77, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp77, (1, 0, 2, 3)) * -2 - del tmp77 - t2new.bbbb += np.transpose(tmp81, (0, 1, 3, 2)) * 2 - del tmp81 - t2new.bbbb += np.transpose(tmp83, (1, 0, 2, 3)) * -1 - del tmp83 - t2new.bbbb += np.transpose(tmp84, (1, 0, 2, 3)) * 2 - t2new.bbbb += tmp76 * -1 - t2new.bbbb += tmp84 * -2 - del tmp84 - t2new.bbbb += np.transpose(tmp76, (1, 0, 2, 3)) - del tmp76 - t2new.bbbb += np.transpose(tmp85, (0, 1, 3, 2)) - t2new.bbbb += tmp87 * 2 - del tmp87 - t2new.bbbb += np.transpose(tmp85, (1, 0, 3, 2)) * -1 - del tmp85 - t2new.bbbb += einsum(tmp88, (0, 1, 2, 3), t2.bbbb, (4, 5, 1, 3), (4, 5, 0, 2)) * -2 - del tmp88 - t2new.bbbb += np.transpose(tmp89, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp91, (0, 1, 3, 2)) * -2 - del tmp91 - t2new.bbbb += np.transpose(tmp89, (0, 1, 3, 2)) * -2 - del tmp89 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp92, (3, 4), (0, 1, 2, 4)) * -4 - del tmp92 - t2new.bbbb += tmp93 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), tmp94, (4, 3), (0, 1, 4, 2)) * 4 - del tmp94 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), f.bb.vv, (4, 3), (0, 1, 2, 4)) * 2 - t2new.bbbb += np.transpose(tmp93, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp93, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp93, (1, 0, 3, 2)) - del tmp93 - t2new.bbbb += np.transpose(tmp95, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp95, (1, 0, 3, 2)) * 2 - del tmp95 - t2new.abab = einsum(v.baa.xov, (0, 1, 2), tmp59, (0, 3, 4), (1, 3, 2, 4)) - del tmp59 - t2new.abab += einsum(t1.bb, (0, 1), tmp24, (2, 3, 0, 4), (2, 3, 4, 1)) * -1 - t2new.abab += einsum(tmp61, (0, 1, 2, 3), t2.abab, (4, 0, 2, 5), (4, 1, 3, 5)) * -1 - del tmp61 - t2new.abab += einsum(t1.aa, (0, 1), tmp0, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - t2new.abab += einsum(tmp62, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 5, 2)) * -1 - del tmp62 - t2new.abab += einsum(tmp1, (0, 1, 2), v.bbb.xov, (0, 3, 4), (1, 3, 2, 4)) - t2new.abab += tmp64 - del tmp64 - t2new.abab += einsum(f.bb.oo, (0, 1), t2.abab, (2, 1, 3, 4), (2, 0, 3, 4)) * -1 - t2new.abab += einsum(f.aa.oo, (0, 1), t2.abab, (1, 2, 3, 4), (0, 2, 3, 4)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp65, (4, 3), (0, 1, 2, 4)) * -1 - del tmp65 - t2new.abab += einsum(v.baa.xov, (0, 1, 2), tmp66, (0, 3, 4), (1, 3, 2, 4)) - del tmp66 - t2new.abab += einsum(tmp67, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1 - del tmp67 - t2new.abab += einsum(f.bb.vv, (0, 1), t2.abab, (2, 3, 4, 1), (2, 3, 4, 0)) - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp68, (0, 4, 2, 5), (4, 1, 5, 3)) * -1 - del tmp68 - t2new.abab += einsum(tmp70, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp70 - t2new.abab += tmp69 - del tmp69 - t2new.abab += einsum(tmp71, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) * -1 - del tmp71 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp72, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp72 - t2new.abab += einsum(tmp73, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 5, 0, 2)) - del tmp73 - t2new.abab += einsum(tmp74, (0, 1), t2.abab, (2, 1, 3, 4), (2, 0, 3, 4)) * -2 - del tmp74 - t2new.abab += einsum(tmp21, (0, 1), t2.abab, (0, 2, 3, 4), (1, 2, 3, 4)) * -2 - t2new.aaaa = np.copy(tmp33) - t2new.aaaa += np.transpose(tmp33, (1, 0, 2, 3)) * -1 - del tmp33 - t2new.aaaa += np.transpose(tmp34, (0, 1, 3, 2)) - t2new.aaaa += tmp35 * 2 - t2new.aaaa += np.transpose(tmp35, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp41, (1, 0, 3, 2)) * -2 - t2new.aaaa += tmp45 - t2new.aaaa += np.transpose(tmp34, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp35, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp35, (1, 0, 2, 3)) * -2 - del tmp35 - t2new.aaaa += np.transpose(tmp41, (0, 1, 3, 2)) * 2 - del tmp41 - t2new.aaaa += np.transpose(tmp45, (1, 0, 2, 3)) * -1 - del tmp45 - t2new.aaaa += tmp34 * -1 - t2new.aaaa += np.transpose(tmp46, (1, 0, 2, 3)) * 2 - t2new.aaaa += np.transpose(tmp34, (1, 0, 2, 3)) - del tmp34 - t2new.aaaa += tmp46 * -2 - del tmp46 - t2new.aaaa += np.transpose(tmp47, (0, 1, 3, 2)) - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp48, (4, 2, 5, 3), (0, 1, 4, 5)) * -2 - del tmp48 - t2new.aaaa += tmp50 * 2 - del tmp50 - t2new.aaaa += np.transpose(tmp47, (1, 0, 3, 2)) * -1 - del tmp47 - t2new.aaaa += np.transpose(tmp51, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp53, (0, 1, 3, 2)) * -2 - del tmp53 - t2new.aaaa += np.transpose(tmp51, (0, 1, 3, 2)) * -2 - del tmp51 - t2new.aaaa += einsum(tmp54, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 4, 0)) * -2 - del tmp54 - t2new.aaaa += tmp56 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp57, (4, 3), (0, 1, 4, 2)) * 4 - del tmp57 - t2new.aaaa += einsum(f.aa.vv, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 4, 0)) * 2 - t2new.aaaa += np.transpose(tmp56, (0, 1, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp56, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp56, (1, 0, 3, 2)) - del tmp56 - t2new.aaaa += np.transpose(tmp58, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp58, (1, 0, 3, 2)) * 2 - del tmp58 - t1new.bb = einsum(tmp22, (0, 1, 2), v.bbb.xoo, (0, 3, 1), (3, 2)) * -1 - del tmp22 - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp23, (4, 0, 1, 3), (4, 2)) * -2 - del tmp23 - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), tmp24, (0, 4, 1, 2), (4, 3)) * -1 - del tmp24 - t1new.bb += einsum(f.bb.oo, (0, 1), t1.bb, (1, 2), (0, 2)) * -1 - t1new.bb += einsum(tmp9, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) * 2 - t1new.bb += einsum(tmp13, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - t1new.bb += einsum(tmp25, (0, 1, 2, 3), t2.bbbb, (2, 1, 4, 3), (0, 4)) * -2 - del tmp25 - t1new.bb += einsum(tmp26, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) * -1 - del tmp26 - t1new.bb += einsum(t1.bb, (0, 1), f.bb.vv, (2, 1), (0, 2)) - t1new.bb += einsum(v.bbb.xvv, (0, 1, 2), tmp29, (0, 3, 2), (3, 1)) - del tmp29 - t1new.bb += einsum(v.bbb.xov, (0, 1, 2), tmp19, (0,), (1, 2)) - t1new.bb += einsum(tmp31, (0, 1), t1.bb, (0, 2), (1, 2)) * -1 - del tmp31 - t1new.aa = einsum(t2.abab, (0, 1, 2, 3), tmp0, (4, 0, 1, 3), (4, 2)) * -1 - del tmp0 - t1new.aa += einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) * -1 - t1new.aa += einsum(tmp1, (0, 1, 2), v.baa.xoo, (0, 3, 1), (3, 2)) * -1 - del tmp1 - t1new.aa += einsum(tmp2, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) * -2 - del tmp2 - t1new.aa += einsum(tmp9, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - del tmp9 - t1new.aa += einsum(tmp13, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) * 2 - del tmp13 - t1new.aa += einsum(f.aa.vv, (0, 1), t1.aa, (2, 1), (2, 0)) - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), tmp14, (4, 0, 1, 3), (4, 2)) * -1 - del tmp14 - t1new.aa += einsum(t2.aaaa, (0, 1, 2, 3), tmp15, (4, 1, 0, 3), (4, 2)) * -2 - del tmp15 - t1new.aa += einsum(tmp18, (0, 1, 2), v.baa.xvv, (0, 3, 2), (1, 3)) * 2 - del tmp18 - t1new.aa += einsum(v.baa.xov, (0, 1, 2), tmp19, (0,), (1, 2)) - del tmp19 - t1new.aa += einsum(t1.aa, (0, 1), tmp21, (0, 2), (2, 1)) * -2 - del tmp21 - - return {f"t1new": t1new, f"t2new": t2new} - diff --git a/ebcc/codegen/UMP2.py b/ebcc/codegen/UMP2.py deleted file mode 100644 index 03a9b859..00000000 --- a/ebcc/codegen/UMP2.py +++ /dev/null @@ -1,398 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:16:39.974943 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:40.498457. - - Parameters - ---------- - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_mp : array - """ - - e_mp = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 3, 1), ()) * -1 - e_mp += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 1, 3), ()) - e_mp += einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 1, 3), ()) - - return e_mp - -def make_rdm1_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:41.374665. - - Parameters - ---------- - l2 : Namespace of arrays - L2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm1 : Namespace of arrays - One-particle reduced density matrix. - """ - - rdm1 = Namespace() - rdm1.aa = Namespace() - rdm1.bb = Namespace() - delta = Namespace( - aa=Namespace(oo=np.eye(t2.aaaa.shape[0]), vv=np.eye(t2.aaaa.shape[-1])), - bb=Namespace(oo=np.eye(t2.bbbb.shape[0]), vv=np.eye(t2.bbbb.shape[-1])), - ) - rdm1.bb.vv = einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 0, 4), (1, 4)) - rdm1.bb.vv += einsum(t2.bbbb, (0, 1, 2, 3), l2.bbbb, (4, 3, 0, 1), (4, 2)) * 2 - rdm1.aa.vv = einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (4, 3, 0, 1), (4, 2)) * 2 - rdm1.aa.vv += einsum(l2.abab, (0, 1, 2, 3), t2.abab, (2, 3, 4, 1), (0, 4)) - rdm1.bb.oo = einsum(l2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 3, 0, 1), (4, 2)) * -2 - rdm1.bb.oo += einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 0, 4), (1, 4)) * -1 - rdm1.bb.oo += delta.bb.oo - rdm1.aa.oo = np.copy(delta.aa.oo) - del delta - rdm1.aa.oo += einsum(t2.abab, (0, 1, 2, 3), l2.abab, (2, 3, 4, 1), (0, 4)) * -1 - rdm1.aa.oo += einsum(t2.aaaa, (0, 1, 2, 3), l2.aaaa, (2, 3, 4, 1), (0, 4)) * -2 - rdm1.aa.ov = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm1.aa.vo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm1.bb.ov = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm1.bb.vo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]]) - rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]]) - - return rdm1 - -def make_rdm2_f(l2=None, t2=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:41.505124. - - Parameters - ---------- - l2 : Namespace of arrays - L2 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - - Returns - ------- - rdm2 : Namespace of arrays - Two-particle reduced density matrix. - """ - - rdm2 = Namespace() - rdm2.aaaa = Namespace() - rdm2.abab = Namespace() - rdm2.bbbb = Namespace() - rdm2.bbbb.vvoo = np.copy(l2.bbbb) * 2 - rdm2.abab.vvoo = np.copy(l2.abab) - rdm2.aaaa.vvoo = np.copy(l2.aaaa) * 2 - rdm2.bbbb.oovv = np.copy(t2.bbbb) * 2 - rdm2.abab.oovv = np.copy(t2.abab) - rdm2.aaaa.oovv = np.copy(t2.aaaa) * 2 - rdm2.aaaa.oooo = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[0])) - rdm2.aaaa.ooov = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm2.aaaa.oovo = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm2.aaaa.ovoo = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[0])) - rdm2.aaaa.vooo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[0])) - rdm2.aaaa.ovov = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm2.aaaa.ovvo = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm2.aaaa.voov = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm2.aaaa.vovo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm2.aaaa.ovvv = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[-1])) - rdm2.aaaa.vovv = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[-1], t2.aaaa.shape[-1])) - rdm2.aaaa.vvov = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[0], t2.aaaa.shape[-1])) - rdm2.aaaa.vvvo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[0])) - rdm2.aaaa.vvvv = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[-1], t2.aaaa.shape[-1])) - rdm2.abab.oooo = np.zeros((t2.aaaa.shape[0], t2.bbbb.shape[0], t2.aaaa.shape[0], t2.bbbb.shape[0])) - rdm2.abab.ooov = np.zeros((t2.aaaa.shape[0], t2.bbbb.shape[0], t2.aaaa.shape[0], t2.bbbb.shape[-1])) - rdm2.abab.oovo = np.zeros((t2.aaaa.shape[0], t2.bbbb.shape[0], t2.aaaa.shape[-1], t2.bbbb.shape[0])) - rdm2.abab.ovoo = np.zeros((t2.aaaa.shape[0], t2.bbbb.shape[-1], t2.aaaa.shape[0], t2.bbbb.shape[0])) - rdm2.abab.vooo = np.zeros((t2.aaaa.shape[-1], t2.bbbb.shape[0], t2.aaaa.shape[0], t2.bbbb.shape[0])) - rdm2.abab.ovov = np.zeros((t2.aaaa.shape[0], t2.bbbb.shape[-1], t2.aaaa.shape[0], t2.bbbb.shape[-1])) - rdm2.abab.ovvo = np.zeros((t2.aaaa.shape[0], t2.bbbb.shape[-1], t2.aaaa.shape[-1], t2.bbbb.shape[0])) - rdm2.abab.voov = np.zeros((t2.aaaa.shape[-1], t2.bbbb.shape[0], t2.aaaa.shape[0], t2.bbbb.shape[-1])) - rdm2.abab.vovo = np.zeros((t2.aaaa.shape[-1], t2.bbbb.shape[0], t2.aaaa.shape[-1], t2.bbbb.shape[0])) - rdm2.abab.ovvv = np.zeros((t2.aaaa.shape[0], t2.bbbb.shape[-1], t2.aaaa.shape[-1], t2.bbbb.shape[-1])) - rdm2.abab.vovv = np.zeros((t2.aaaa.shape[-1], t2.bbbb.shape[0], t2.aaaa.shape[-1], t2.bbbb.shape[-1])) - rdm2.abab.vvov = np.zeros((t2.aaaa.shape[-1], t2.bbbb.shape[-1], t2.aaaa.shape[0], t2.bbbb.shape[-1])) - rdm2.abab.vvvo = np.zeros((t2.aaaa.shape[-1], t2.bbbb.shape[-1], t2.aaaa.shape[-1], t2.bbbb.shape[0])) - rdm2.abab.vvvv = np.zeros((t2.aaaa.shape[-1], t2.bbbb.shape[-1], t2.aaaa.shape[-1], t2.bbbb.shape[-1])) - rdm2.bbbb.oooo = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[0])) - rdm2.bbbb.ooov = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm2.bbbb.oovo = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm2.bbbb.ovoo = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[0])) - rdm2.bbbb.vooo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[0])) - rdm2.bbbb.ovov = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm2.bbbb.ovvo = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm2.bbbb.voov = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm2.bbbb.vovo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm2.bbbb.ovvv = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[-1])) - rdm2.bbbb.vovv = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[-1], t2.bbbb.shape[-1])) - rdm2.bbbb.vvov = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[0], t2.bbbb.shape[-1])) - rdm2.bbbb.vvvo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[0])) - rdm2.bbbb.vvvv = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[-1], t2.bbbb.shape[-1])) - rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv) - rdm2.abab = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv) - rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv) - rdm2 = Namespace( - aaaa=np.transpose(rdm2.aaaa, (0, 2, 1, 3)), - aabb=np.transpose(rdm2.abab, (0, 2, 1, 3)), - bbbb=np.transpose(rdm2.bbbb, (0, 2, 1, 3)), - ) - rdm1 = make_rdm1_f(t2=t2, l2=l2) - delta = Namespace( - aa=np.diag(np.concatenate([np.ones(t2.aaaa.shape[0]), np.zeros(t2.aaaa.shape[-1])])), - bb=np.diag(np.concatenate([np.ones(t2.bbbb.shape[0]), np.zeros(t2.bbbb.shape[-1])])), - ) - rdm1.aa -= delta.aa - rdm1.bb -= delta.bb - rdm2.aaaa += einsum(delta.aa, (0, 1), rdm1.aa, (3, 2), (0, 1, 2, 3)) - rdm2.aaaa += einsum(rdm1.aa, (1, 0), delta.aa, (2, 3), (0, 1, 2, 3)) - rdm2.aaaa -= einsum(delta.aa, (0, 3), rdm1.aa, (2, 1), (0, 1, 2, 3)) - rdm2.aaaa -= einsum(rdm1.aa, (0, 3), delta.aa, (1, 2), (0, 1, 2, 3)) - rdm2.aaaa += einsum(delta.aa, (0, 1), delta.aa, (2, 3), (0, 1, 2, 3)) - rdm2.aaaa -= einsum(delta.aa, (0, 3), delta.aa, (1, 2), (0, 1, 2, 3)) - rdm2.bbbb += einsum(delta.bb, (0, 1), rdm1.bb, (3, 2), (0, 1, 2, 3)) - rdm2.bbbb += einsum(rdm1.bb, (1, 0), delta.bb, (2, 3), (0, 1, 2, 3)) - rdm2.bbbb -= einsum(delta.bb, (0, 3), rdm1.bb, (2, 1), (0, 1, 2, 3)) - rdm2.bbbb -= einsum(rdm1.bb, (0, 3), delta.bb, (1, 2), (0, 1, 2, 3)) - rdm2.bbbb += einsum(delta.bb, (0, 1), delta.bb, (2, 3), (0, 1, 2, 3)) - rdm2.bbbb -= einsum(delta.bb, (0, 3), delta.bb, (1, 2), (0, 1, 2, 3)) - rdm2.aabb += einsum(delta.aa, (0, 1), rdm1.bb, (3, 2), (0, 1, 2, 3)) - rdm2.aabb += einsum(rdm1.aa, (1, 0), delta.bb, (2, 3), (0, 1, 2, 3)) - rdm2.aabb += einsum(delta.aa, (0, 1), delta.bb, (2, 3), (0, 1, 2, 3)) - - return rdm2 - -def hbar_matvec_ip_intermediates(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:46.755408. - - Parameters - ---------- - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp10 : array - tmp12 : array - tmp2 : array - tmp4 : array - """ - - tmp12 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 2, 4, 3), (1, 4)) - tmp10 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 1, 3), (4, 0)) - tmp4 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp2 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 1, 3), (0, 4)) - - return {f"tmp10": tmp10, f"tmp12": tmp12, f"tmp2": tmp2, f"tmp4": tmp4} - -def hbar_matvec_ip(f=None, r1=None, r2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:46.765700. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp2 = np.copy(ints.tmp10) * 2 - del ints.tmp10 - tmp2 += ints.tmp12 - del ints.tmp12 - tmp0 = np.copy(ints.tmp2) * 2 - del ints.tmp2 - tmp0 += ints.tmp4 - del ints.tmp4 - tmp7 = einsum(r2.bbb, (0, 1, 2), f.bb.oo, (3, 1), (3, 0, 2)) - tmp6 = einsum(r1.b, (0,), v.bbbb.ooov, (1, 0, 2, 3), (1, 2, 3)) - tmp4 = einsum(v.aaaa.ooov, (0, 1, 2, 3), r1.a, (1,), (0, 2, 3)) - tmp5 = einsum(f.aa.oo, (0, 1), r2.aaa, (2, 1, 3), (0, 2, 3)) - tmp3 = np.copy(f.bb.oo) * 2 - tmp3 += tmp2 - tmp3 += np.transpose(tmp2, (1, 0)) - del tmp2 - tmp1 = np.copy(f.aa.oo) * 2 - tmp1 += tmp0 - tmp1 += np.transpose(tmp0, (1, 0)) - del tmp0 - r2new.bbb = einsum(r2.bbb, (0, 1, 2), f.bb.vv, (3, 2), (0, 1, 3)) * 2 - r2new.bbb += tmp6 * -1 - r2new.bbb += np.transpose(tmp6, (1, 0, 2)) - del tmp6 - r2new.bbb += tmp7 * 2 - r2new.bbb += np.transpose(tmp7, (1, 0, 2)) * -2 - del tmp7 - r2new.bab = einsum(f.bb.oo, (0, 1), r2.bab, (1, 2, 3), (0, 2, 3)) * -1 - r2new.bab += einsum(v.aabb.ooov, (0, 1, 2, 3), r1.a, (1,), (2, 0, 3)) - r2new.bab += einsum(f.aa.oo, (0, 1), r2.bab, (2, 1, 3), (2, 0, 3)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), f.bb.vv, (3, 2), (0, 1, 3)) - r2new.aba = einsum(r2.aba, (0, 1, 2), f.aa.vv, (3, 2), (0, 1, 3)) - r2new.aba += einsum(v.aabb.ovoo, (0, 1, 2, 3), r1.b, (3,), (0, 2, 1)) - r2new.aba += einsum(f.bb.oo, (0, 1), r2.aba, (2, 1, 3), (2, 0, 3)) * -1 - r2new.aba += einsum(f.aa.oo, (0, 1), r2.aba, (1, 2, 3), (0, 2, 3)) * -1 - r2new.aaa = einsum(r2.aaa, (0, 1, 2), f.aa.vv, (3, 2), (0, 1, 3)) * 2 - r2new.aaa += tmp4 * -1 - r2new.aaa += np.transpose(tmp4, (1, 0, 2)) - del tmp4 - r2new.aaa += tmp5 * 2 - r2new.aaa += np.transpose(tmp5, (1, 0, 2)) * -2 - del tmp5 - r1new.b = einsum(r2.bbb, (0, 1, 2), v.bbbb.ooov, (3, 1, 0, 2), (3,)) * 2 - r1new.b += einsum(r2.aba, (0, 1, 2), v.aabb.ovoo, (0, 2, 3, 1), (3,)) - r1new.b += einsum(tmp3, (0, 1), r1.b, (0,), (1,)) * -0.5 - del tmp3 - r1new.a = einsum(r2.bab, (0, 1, 2), v.aabb.ooov, (3, 1, 0, 2), (3,)) - r1new.a += einsum(r2.aaa, (0, 1, 2), v.aaaa.ooov, (3, 0, 1, 2), (3,)) * -2 - r1new.a += einsum(r1.a, (0,), tmp1, (0, 1), (1,)) * -0.5 - del tmp1 - - return {f"r1new": r1new, f"r2new": r2new} - -def hbar_matvec_ea_intermediates(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:52.010907. - - Parameters - ---------- - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - tmp10 : array - tmp12 : array - tmp2 : array - tmp4 : array - """ - - tmp12 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp10 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 4, 3), (4, 1)) - tmp4 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 4, 3), (4, 1)) - tmp2 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 3, 1, 4), (2, 4)) * -1 - - return {f"tmp10": tmp10, f"tmp12": tmp12, f"tmp2": tmp2, f"tmp4": tmp4} - -def hbar_matvec_ea(f=None, r1=None, r2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:16:52.021286. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - r1 : Namespace of arrays - R1 amplitudes. - r2 : Namespace of arrays - R2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - r1new : Namespace of arrays - Updated R1 residuals. - r2new : Namespace of arrays - Updated R2 residuals. - """ - - ints = kwargs["ints"] - r1new = Namespace() - r2new = Namespace() - tmp7 = einsum(f.bb.vv, (0, 1), r2.bbb, (2, 1, 3), (3, 0, 2)) - tmp8 = einsum(r1.b, (0,), v.bbbb.ovvv, (1, 2, 3, 0), (1, 2, 3)) - tmp4 = einsum(r2.aaa, (0, 1, 2), f.aa.vv, (3, 1), (2, 3, 0)) - tmp5 = einsum(r1.a, (0,), v.aaaa.ovvv, (1, 2, 3, 0), (1, 2, 3)) - tmp2 = np.copy(ints.tmp10) - del ints.tmp10 - tmp2 += ints.tmp12 * 0.5 - del ints.tmp12 - tmp0 = np.copy(ints.tmp2) - del ints.tmp2 - tmp0 += ints.tmp4 * 0.5 - del ints.tmp4 - tmp9 = np.copy(tmp7) * 2 - del tmp7 - tmp9 += tmp8 - del tmp8 - tmp6 = np.copy(tmp4) * 2 - del tmp4 - tmp6 += tmp5 - del tmp5 - tmp3 = np.copy(f.bb.vv) * -1 - tmp3 += tmp2 - tmp3 += np.transpose(tmp2, (1, 0)) - del tmp2 - tmp1 = np.copy(f.aa.vv) * -1 - tmp1 += tmp0 - tmp1 += np.transpose(tmp0, (1, 0)) - del tmp0 - r2new.bbb = einsum(f.bb.oo, (0, 1), r2.bbb, (2, 3, 1), (2, 3, 0)) * -2 - r2new.bbb += np.transpose(tmp9, (1, 2, 0)) * -1 - r2new.bbb += np.transpose(tmp9, (2, 1, 0)) - del tmp9 - r2new.bab = einsum(f.aa.vv, (0, 1), r2.bab, (2, 1, 3), (2, 0, 3)) - r2new.bab += einsum(r1.a, (0,), v.aabb.vvov, (1, 0, 2, 3), (3, 1, 2)) * -1 - r2new.bab += einsum(f.bb.oo, (0, 1), r2.bab, (2, 3, 1), (2, 3, 0)) * -1 - r2new.bab += einsum(r2.bab, (0, 1, 2), f.bb.vv, (3, 0), (3, 1, 2)) - r2new.aba = einsum(f.aa.vv, (0, 1), r2.aba, (1, 2, 3), (0, 2, 3)) - r2new.aba += einsum(f.aa.oo, (0, 1), r2.aba, (2, 3, 1), (2, 3, 0)) * -1 - r2new.aba += einsum(r2.aba, (0, 1, 2), f.bb.vv, (3, 1), (0, 3, 2)) - r2new.aba += einsum(r1.b, (0,), v.aabb.ovvv, (1, 2, 3, 0), (2, 3, 1)) * -1 - r2new.aaa = einsum(f.aa.oo, (0, 1), r2.aaa, (2, 3, 1), (2, 3, 0)) * -2 - r2new.aaa += np.transpose(tmp6, (1, 2, 0)) * -1 - r2new.aaa += np.transpose(tmp6, (2, 1, 0)) - del tmp6 - r1new.b = einsum(r2.aba, (0, 1, 2), v.aabb.ovvv, (2, 0, 3, 1), (3,)) * -1 - r1new.b += einsum(v.bbbb.ovvv, (0, 1, 2, 3), r2.bbb, (1, 3, 0), (2,)) * -2 - r1new.b += einsum(r1.b, (0,), tmp3, (0, 1), (1,)) * -1 - del tmp3 - r1new.a = einsum(v.aabb.vvov, (0, 1, 2, 3), r2.bab, (3, 1, 2), (0,)) * -1 - r1new.a += einsum(v.aaaa.ovvv, (0, 1, 2, 3), r2.aaa, (1, 3, 0), (2,)) * -2 - r1new.a += einsum(tmp1, (0, 1), r1.a, (0,), (1,)) * -1 - del tmp1 - - return {f"r1new": r1new, f"r2new": r2new} - diff --git a/ebcc/codegen/UMP3.py b/ebcc/codegen/UMP3.py deleted file mode 100644 index 27e5536b..00000000 --- a/ebcc/codegen/UMP3.py +++ /dev/null @@ -1,72 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T15:17:04.416375 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T15:17:10.817872. - - Parameters - ---------- - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_mp : array - """ - - tmp3 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) - tmp3 += v.aaaa.oovv * -1 - tmp4 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 1, 3))) - tmp4 += v.bbbb.oovv * -1 - tmp0 = einsum(t2.bbbb, (0, 1, 2, 3), t2.bbbb, (4, 5, 2, 3), (4, 0, 1, 5)) - tmp6 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 1, 3))) - tmp6 += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.vvvv, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp6 += einsum(tmp3, (0, 1, 2, 3), t2.aaaa, (4, 0, 5, 2), (1, 4, 3, 5)) * 4 - tmp1 = einsum(t2.aaaa, (0, 1, 2, 3), t2.aaaa, (4, 5, 2, 3), (0, 4, 5, 1)) - tmp2 = einsum(t2.abab, (0, 1, 2, 3), t2.abab, (4, 5, 2, 3), (0, 4, 1, 5)) - tmp5 = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - tmp5 += einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) * 4 - tmp5 += einsum(v.aabb.oovv, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 5, 2)) * -1 - tmp5 += einsum(v.aabb.vvoo, (0, 1, 2, 3), t2.abab, (4, 3, 1, 5), (4, 2, 0, 5)) * -1 - tmp5 += einsum(t2.bbbb, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (4, 0, 5, 2)) * 4 - tmp5 += einsum(v.aabb.vvvv, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp5 += einsum(tmp3, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp3 - tmp5 += einsum(tmp4, (0, 1, 2, 3), t2.abab, (4, 0, 5, 2), (4, 1, 5, 3)) - tmp7 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 1, 3))) - tmp7 += einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.vvvv, (4, 2, 5, 3), (0, 1, 4, 5)) - tmp7 += einsum(tmp4, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 2), (1, 4, 3, 5)) * 4 - del tmp4 - e_mp = einsum(v.bbbb.oooo, (0, 1, 2, 3), tmp0, (1, 0, 2, 3), ()) - del tmp0 - e_mp += einsum(tmp1, (0, 1, 2, 3), v.aaaa.oooo, (1, 0, 2, 3), ()) - del tmp1 - e_mp += einsum(tmp2, (0, 1, 2, 3), v.aabb.oooo, (1, 0, 3, 2), ()) - del tmp2 - e_mp += einsum(tmp5, (0, 1, 2, 3), t2.abab, (0, 1, 2, 3), ()) - del tmp5 - e_mp += einsum(t2.aaaa, (0, 1, 2, 3), tmp6, (0, 1, 2, 3), ()) - del tmp6 - e_mp += einsum(t2.bbbb, (0, 1, 2, 3), tmp7, (0, 1, 2, 3), ()) - del tmp7 - - return e_mp - diff --git a/ebcc/codegen/UQCISD.py b/ebcc/codegen/UQCISD.py deleted file mode 100644 index dcbd03f5..00000000 --- a/ebcc/codegen/UQCISD.py +++ /dev/null @@ -1,369 +0,0 @@ -""" -Code generated by `albert`: -https://github.com/obackhouse/albert - - * date: 2024-09-29T16:29:41.188806 - * python version: 3.10.15 (main, Sep 9 2024, 03:02:45) [GCC 11.4.0] - * albert version: 0.0.0 - * caller: /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/albert/codegen/einsum.py - * node: fv-az1788-690 - * system: Linux - * processor: x86_64 - * release: 6.8.0-1014-azure -""" - -from ebcc import numpy as np -from ebcc.util import pack_2e, einsum, dirsum, Namespace - - -def energy(t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:29:41.714102. - - Parameters - ---------- - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - e_cc : float - Coupled cluster energy. - """ - - e_cc = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 3), ()) - e_cc += einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (0, 2, 1, 3), ()) - e_cc += einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (0, 2, 1, 3), ()) - - return e_cc - -def update_amps(f=None, t1=None, t2=None, v=None, **kwargs): - """ - Code generated by `albert` 0.0.0 on 2024-09-29T16:30:00.249875. - - Parameters - ---------- - f : Namespace of arrays - Fock matrix. - t1 : Namespace of arrays - T1 amplitudes. - t2 : Namespace of arrays - T2 amplitudes. - v : Namespace of arrays - Electron repulsion integrals. - - Returns - ------- - t1new : Namespace of arrays - Updated T1 residuals. - t2new : Namespace of arrays - Updated T2 residuals. - """ - - t1new = Namespace() - t2new = Namespace() - tmp26 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) * -1 - tmp26 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp22 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) * -1 - tmp22 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - tmp56 = einsum(tmp26, (0, 1, 2, 3), t2.bbbb, (4, 0, 5, 2), (4, 1, 5, 3)) - tmp16 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 1, 3), (4, 0)) - tmp15 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - tmp23 = einsum(t2.aaaa, (0, 1, 2, 3), tmp22, (1, 4, 3, 5), (0, 4, 2, 5)) - tmp10 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 2, 1, 3), (0, 4)) - tmp11 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 2, 1, 3), (0, 4)) - tmp1 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp1 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp5 = np.copy(np.transpose(v.bbbb.ovov, (0, 2, 3, 1))) * -1 - tmp5 += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - tmp59 = einsum(t2.abab, (0, 1, 2, 3), tmp22, (0, 4, 2, 5), (4, 1, 5, 3)) - del tmp22 - tmp44 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (0, 3, 1, 4), (2, 4)) * -1 - tmp43 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 2, 1, 4), (4, 3)) - tmp46 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (0, 4, 1, 5)) - tmp57 = np.copy(v.bbbb.oovv) - tmp57 += tmp56 * -2 - del tmp56 - tmp70 = np.copy(tmp15) - tmp70 += tmp16 * 2 - tmp62 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.ovov, (4, 3, 5, 2), (0, 1, 4, 5)) * -1 - tmp34 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (0, 4, 1, 3), (2, 4)) - tmp35 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (0, 4, 1, 3), (2, 4)) - tmp50 = einsum(t2.aaaa, (0, 1, 2, 3), v.aabb.ovov, (1, 3, 4, 5), (0, 4, 2, 5)) - tmp27 = einsum(t2.abab, (0, 1, 2, 3), tmp26, (1, 4, 5, 3), (0, 4, 2, 5)) - del tmp26 - tmp48 = np.copy(np.transpose(v.aaaa.ovov, (0, 2, 3, 1))) - tmp48 += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) * -1 - tmp20 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp24 = np.copy(v.aaaa.oovv) - tmp24 += tmp23 * -2 - del tmp23 - tmp39 = np.copy(tmp10) * 2 - tmp39 += tmp11 - tmp30 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t2.aaaa, (4, 5, 1, 3), (4, 5, 0, 2)) - tmp2 = einsum(t1.aa, (0, 1), tmp1, (0, 2, 1, 3), (2, 3)) - del tmp1 - tmp0 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - tmp6 = einsum(tmp5, (0, 1, 2, 3), t1.bb, (0, 3), (1, 2)) - del tmp5 - tmp4 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.aa, (0, 1), (2, 3)) - tmp60 = einsum(t2.abab, (0, 1, 2, 3), tmp59, (0, 4, 2, 5), (1, 4, 3, 5)) - del tmp59 - tmp69 = np.copy(f.bb.vv) * -1 - tmp69 += tmp43 - tmp69 += tmp44 * 2 - tmp68 = einsum(v.bbbb.ovov, (0, 1, 2, 3), t2.bbbb, (4, 2, 5, 3), (4, 0, 5, 1)) - tmp55 = einsum(tmp46, (0, 1, 2, 3), t2.abab, (0, 4, 2, 5), (4, 1, 5, 3)) - tmp67 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 1, 5), (4, 2, 5, 3)) - tmp58 = einsum(t2.bbbb, (0, 1, 2, 3), tmp57, (4, 1, 5, 3), (0, 4, 2, 5)) - del tmp57 - tmp65 = einsum(t2.bbbb, (0, 1, 2, 3), f.bb.oo, (4, 1), (4, 0, 2, 3)) - tmp61 = einsum(v.bbbb.oovv, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (4, 0, 5, 2)) - tmp53 = einsum(v.bbbb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (4, 0, 1, 2)) - tmp66 = np.copy(tmp43) * 0.5 - tmp66 += tmp44 - tmp71 = einsum(tmp70, (0, 1), t2.bbbb, (2, 1, 3, 4), (2, 0, 3, 4)) * -1 - del tmp70 - tmp64 = einsum(t2.bbbb, (0, 1, 2, 3), v.bbbb.oooo, (4, 1, 5, 0), (4, 5, 2, 3)) * -1 - tmp54 = einsum(t1.bb, (0, 1), v.bbbb.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp63 = einsum(tmp62, (0, 1, 2, 3), t2.bbbb, (3, 2, 4, 5), (1, 0, 4, 5)) - del tmp62 - tmp45 = np.copy(tmp43) - del tmp43 - tmp45 += tmp44 * 2 - del tmp44 - tmp41 = np.copy(np.transpose(v.aabb.vvoo, (2, 3, 0, 1))) - tmp41 += einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (0, 4, 5, 3), (2, 4, 1, 5)) * -1 - tmp47 = np.copy(f.aa.vv) * -1 - tmp47 += np.transpose(tmp34, (1, 0)) * 2 - tmp47 += np.transpose(tmp35, (1, 0)) - tmp51 = np.copy(tmp50) * 2 - tmp51 += tmp27 * -1 - tmp42 = einsum(t2.abab, (0, 1, 2, 3), v.aabb.oooo, (4, 0, 5, 1), (4, 5, 2, 3)) - tmp49 = np.copy(v.aaaa.oovv) - tmp49 += np.transpose(tmp20, (1, 0, 3, 2)) * -1 - tmp49 += einsum(t2.aaaa, (0, 1, 2, 3), tmp48, (1, 4, 3, 5), (4, 0, 5, 2)) * 2 - del tmp48 - tmp17 = np.copy(tmp15) * 0.5 - del tmp15 - tmp17 += tmp16 - del tmp16 - tmp52 = einsum(v.aabb.ovov, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 0, 5, 2)) - tmp33 = einsum(f.aa.oo, (0, 1), t2.aaaa, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp21 = einsum(t2.aaaa, (0, 1, 2, 3), tmp20, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp38 = np.copy(f.aa.vv) * -1 - tmp38 += tmp34 * 2 - tmp38 += tmp35 - tmp29 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.oovv, (4, 1, 5, 3), (0, 4, 2, 5)) - tmp18 = einsum(t1.aa, (0, 1), v.aaaa.ovvv, (2, 3, 4, 1), (0, 2, 3, 4)) - tmp25 = einsum(tmp24, (0, 1, 2, 3), t2.aaaa, (4, 1, 5, 3), (4, 0, 5, 2)) - del tmp24 - tmp36 = np.copy(tmp34) - del tmp34 - tmp36 += tmp35 * 0.5 - del tmp35 - tmp40 = einsum(t2.aaaa, (0, 1, 2, 3), tmp39, (4, 1), (0, 4, 2, 3)) * -1 - tmp19 = einsum(t1.aa, (0, 1), v.aaaa.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) - tmp37 = einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - tmp28 = einsum(tmp27, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) * -1 - del tmp27 - tmp32 = einsum(v.aaaa.oooo, (0, 1, 2, 3), t2.aaaa, (3, 1, 4, 5), (0, 2, 4, 5)) * -1 - tmp31 = einsum(tmp30, (0, 1, 2, 3), t2.aaaa, (3, 2, 4, 5), (1, 0, 4, 5)) - del tmp30 - tmp3 = np.copy(f.aa.ov) - tmp3 += tmp0 - tmp3 += tmp2 * -1 - del tmp2 - tmp7 = np.copy(f.bb.ov) - tmp7 += tmp4 - tmp7 += tmp6 * -1 - del tmp6 - tmp14 = einsum(t1.bb, (0, 1), v.bbbb.ovov, (2, 3, 4, 1), (0, 2, 4, 3)) - tmp13 = einsum(v.aabb.ovov, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 2, 1)) - tmp9 = einsum(v.aaaa.ovov, (0, 1, 2, 3), t1.aa, (4, 3), (4, 0, 2, 1)) - tmp8 = einsum(t1.aa, (0, 1), v.aabb.ovov, (2, 1, 3, 4), (0, 2, 3, 4)) - tmp12 = np.copy(tmp10) - del tmp10 - tmp12 += tmp11 * 0.5 - del tmp11 - t2new.bbbb = np.copy(np.transpose(tmp53, (1, 0, 2, 3))) - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 1, 3)) - t2new.bbbb += tmp53 * -1 - t2new.bbbb += np.transpose(v.bbbb.ovov, (0, 2, 3, 1)) * -1 - t2new.bbbb += np.transpose(tmp54, (0, 1, 3, 2)) - t2new.bbbb += tmp55 * 2 - t2new.bbbb += np.transpose(tmp55, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp58, (1, 0, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp60, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp54, (1, 0, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp55, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp55, (1, 0, 2, 3)) * -2 - del tmp55 - t2new.bbbb += np.transpose(tmp58, (0, 1, 3, 2)) * 2 - del tmp58 - t2new.bbbb += np.transpose(tmp60, (0, 1, 3, 2)) * -1 - del tmp60 - t2new.bbbb += tmp54 * -1 - t2new.bbbb += np.transpose(tmp61, (1, 0, 2, 3)) * 2 - t2new.bbbb += np.transpose(tmp54, (1, 0, 2, 3)) - del tmp54 - t2new.bbbb += tmp61 * -2 - del tmp61 - t2new.bbbb += np.transpose(tmp53, (0, 1, 3, 2)) - t2new.bbbb += einsum(v.bbbb.vvvv, (0, 1, 2, 3), t2.bbbb, (4, 5, 3, 1), (4, 5, 0, 2)) * -2 - t2new.bbbb += np.transpose(tmp53, (1, 0, 3, 2)) * -1 - del tmp53 - t2new.bbbb += np.transpose(tmp63, (0, 1, 3, 2)) * -2 - del tmp63 - t2new.bbbb += np.transpose(tmp64, (1, 0, 3, 2)) * 2 - del tmp64 - t2new.bbbb += np.transpose(tmp65, (1, 0, 3, 2)) * 2 - t2new.bbbb += np.transpose(tmp65, (0, 1, 3, 2)) * -2 - del tmp65 - t2new.bbbb += einsum(tmp66, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 4, 0)) * -4 - del tmp66 - t2new.bbbb += np.transpose(tmp67, (1, 0, 3, 2)) - t2new.bbbb += np.transpose(tmp68, (1, 0, 3, 2)) * 2 - t2new.bbbb += einsum(tmp69, (0, 1), t2.bbbb, (2, 3, 4, 1), (2, 3, 0, 4)) * 2 - del tmp69 - t2new.bbbb += einsum(t2.bbbb, (0, 1, 2, 3), f.bb.vv, (4, 3), (0, 1, 2, 4)) * 2 - t2new.bbbb += np.transpose(tmp67, (1, 0, 2, 3)) * -1 - t2new.bbbb += np.transpose(tmp68, (1, 0, 2, 3)) * -2 - t2new.bbbb += np.transpose(tmp67, (0, 1, 3, 2)) * -1 - t2new.bbbb += np.transpose(tmp68, (0, 1, 3, 2)) * -2 - t2new.bbbb += tmp67 - del tmp67 - t2new.bbbb += tmp68 * 2 - del tmp68 - t2new.bbbb += np.transpose(tmp71, (0, 1, 3, 2)) * -2 - t2new.bbbb += np.transpose(tmp71, (1, 0, 3, 2)) * 2 - del tmp71 - t2new.abab = np.copy(np.transpose(v.aabb.ovov, (0, 2, 1, 3))) - t2new.abab += einsum(v.aabb.ovvv, (0, 1, 2, 3), t1.bb, (4, 3), (0, 4, 1, 2)) - t2new.abab += einsum(t1.bb, (0, 1), v.aabb.ovoo, (2, 3, 4, 0), (2, 4, 3, 1)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp41, (1, 4, 2, 5), (0, 4, 5, 3)) * -1 - del tmp41 - t2new.abab += einsum(v.aabb.oovv, (0, 1, 2, 3), t2.abab, (1, 4, 5, 3), (0, 4, 5, 2)) * -1 - t2new.abab += einsum(t1.aa, (0, 1), v.aabb.ooov, (2, 0, 3, 4), (2, 3, 1, 4)) * -1 - t2new.abab += einsum(t1.aa, (0, 1), v.aabb.vvov, (2, 1, 3, 4), (0, 3, 2, 4)) - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), f.bb.oo, (4, 1), (0, 4, 2, 3)) * -1 - t2new.abab += tmp42 - del tmp42 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), f.aa.oo, (4, 0), (4, 1, 2, 3)) * -1 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp45, (4, 3), (0, 1, 2, 4)) * -1 - del tmp45 - t2new.abab += tmp46 * 2 - del tmp46 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), v.aaaa.ovov, (4, 5, 0, 2), (4, 1, 5, 3)) - t2new.abab += einsum(tmp47, (0, 1), t2.abab, (2, 3, 0, 4), (2, 3, 1, 4)) * -1 - del tmp47 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), f.bb.vv, (4, 3), (0, 1, 2, 4)) - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp49, (0, 4, 2, 5), (4, 1, 5, 3)) * -1 - del tmp49 - t2new.abab += einsum(tmp51, (0, 1, 2, 3), t2.bbbb, (4, 1, 5, 3), (0, 4, 2, 5)) * 2 - del tmp51 - t2new.abab += tmp50 * 2 - del tmp50 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), v.bbbb.ovov, (4, 5, 1, 3), (0, 4, 2, 5)) - t2new.abab += einsum(v.bbbb.oovv, (0, 1, 2, 3), t2.abab, (4, 1, 5, 3), (4, 0, 5, 2)) * -1 - t2new.abab += einsum(v.aabb.vvvv, (0, 1, 2, 3), t2.abab, (4, 5, 1, 3), (4, 5, 0, 2)) - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp52, (4, 0, 5, 1), (4, 5, 2, 3)) - del tmp52 - t2new.abab += einsum(tmp17, (0, 1), t2.abab, (2, 1, 3, 4), (2, 0, 3, 4)) * -2 - t2new.abab += einsum(t2.abab, (0, 1, 2, 3), tmp39, (4, 0), (4, 1, 2, 3)) * -1 - del tmp39 - t2new.aaaa = np.copy(np.transpose(tmp18, (1, 0, 2, 3))) - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 1, 3)) - t2new.aaaa += tmp18 * -1 - t2new.aaaa += np.transpose(v.aaaa.ovov, (0, 2, 3, 1)) * -1 - t2new.aaaa += np.transpose(tmp19, (0, 1, 3, 2)) - t2new.aaaa += tmp21 * 2 - t2new.aaaa += np.transpose(tmp21, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp25, (1, 0, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp28, (1, 0, 3, 2)) - t2new.aaaa += np.transpose(tmp19, (1, 0, 3, 2)) * -1 - t2new.aaaa += np.transpose(tmp21, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp21, (1, 0, 2, 3)) * -2 - del tmp21 - t2new.aaaa += np.transpose(tmp25, (0, 1, 3, 2)) * 2 - del tmp25 - t2new.aaaa += np.transpose(tmp28, (1, 0, 2, 3)) * -1 - del tmp28 - t2new.aaaa += np.transpose(tmp29, (1, 0, 2, 3)) * 2 - t2new.aaaa += tmp19 * -1 - t2new.aaaa += tmp29 * -2 - del tmp29 - t2new.aaaa += np.transpose(tmp19, (1, 0, 2, 3)) - del tmp19 - t2new.aaaa += np.transpose(tmp18, (0, 1, 3, 2)) - t2new.aaaa += np.transpose(tmp31, (0, 1, 3, 2)) * -2 - del tmp31 - t2new.aaaa += np.transpose(tmp18, (1, 0, 3, 2)) * -1 - del tmp18 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), v.aaaa.vvvv, (4, 3, 5, 2), (0, 1, 4, 5)) * -2 - t2new.aaaa += np.transpose(tmp32, (1, 0, 3, 2)) * 2 - del tmp32 - t2new.aaaa += np.transpose(tmp33, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp33, (0, 1, 3, 2)) * -2 - del tmp33 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), tmp36, (4, 3), (0, 1, 2, 4)) * -4 - del tmp36 - t2new.aaaa += np.transpose(tmp37, (1, 0, 3, 2)) * 2 - t2new.aaaa += np.transpose(tmp20, (1, 0, 3, 2)) - t2new.aaaa += einsum(tmp38, (0, 1), t2.aaaa, (2, 3, 4, 1), (2, 3, 0, 4)) * 2 - del tmp38 - t2new.aaaa += np.transpose(tmp37, (1, 0, 2, 3)) * -2 - t2new.aaaa += einsum(t2.aaaa, (0, 1, 2, 3), f.aa.vv, (4, 3), (0, 1, 2, 4)) * 2 - t2new.aaaa += np.transpose(tmp20, (1, 0, 2, 3)) * -1 - t2new.aaaa += np.transpose(tmp37, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp20, (0, 1, 3, 2)) * -1 - t2new.aaaa += tmp37 * 2 - del tmp37 - t2new.aaaa += tmp20 - del tmp20 - t2new.aaaa += np.transpose(tmp40, (0, 1, 3, 2)) * -2 - t2new.aaaa += np.transpose(tmp40, (1, 0, 3, 2)) * 2 - del tmp40 - t1new.bb = einsum(v.bbbb.ooov, (0, 1, 2, 3), t2.bbbb, (2, 1, 4, 3), (0, 4)) * 2 - t1new.bb += einsum(v.bbbb.oovv, (0, 1, 2, 3), t1.bb, (1, 3), (0, 2)) * -1 - t1new.bb += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ovoo, (0, 2, 4, 1), (4, 3)) * -1 - t1new.bb += einsum(t1.bb, (0, 1), f.bb.oo, (2, 0), (2, 1)) * -1 - t1new.bb += einsum(tmp3, (0, 1), t2.abab, (0, 2, 1, 3), (2, 3)) - t1new.bb += einsum(tmp7, (0, 1), t2.bbbb, (2, 0, 3, 1), (2, 3)) * 2 - t1new.bb += einsum(tmp13, (0, 1, 2, 3), t2.abab, (0, 2, 3, 4), (1, 4)) * -1 - del tmp13 - t1new.bb += einsum(v.bbbb.ovov, (0, 1, 2, 3), t1.bb, (2, 3), (0, 1)) - t1new.bb += tmp4 - del tmp4 - t1new.bb += einsum(v.bbbb.ovvv, (0, 1, 2, 3), t2.bbbb, (4, 0, 1, 3), (4, 2)) * -2 - t1new.bb += einsum(v.aabb.ovvv, (0, 1, 2, 3), t2.abab, (0, 4, 1, 3), (4, 2)) - t1new.bb += einsum(t1.bb, (0, 1), f.bb.vv, (2, 1), (0, 2)) - t1new.bb += einsum(t2.bbbb, (0, 1, 2, 3), tmp14, (4, 0, 1, 3), (4, 2)) * 2 - del tmp14 - t1new.bb += einsum(tmp17, (0, 1), t1.bb, (1, 2), (0, 2)) * -2 - del tmp17 - t1new.aa = einsum(f.aa.oo, (0, 1), t1.aa, (1, 2), (0, 2)) * -1 - t1new.aa += einsum(t1.aa, (0, 1), v.aaaa.oovv, (2, 0, 3, 1), (2, 3)) * -1 - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), v.aabb.ooov, (4, 0, 1, 3), (4, 2)) * -1 - t1new.aa += einsum(v.aaaa.ooov, (0, 1, 2, 3), t2.aaaa, (1, 2, 4, 3), (0, 4)) * -2 - t1new.aa += einsum(tmp3, (0, 1), t2.aaaa, (2, 0, 3, 1), (2, 3)) * 2 - del tmp3 - t1new.aa += einsum(tmp7, (0, 1), t2.abab, (2, 0, 3, 1), (2, 3)) - del tmp7 - t1new.aa += einsum(t1.aa, (0, 1), v.aaaa.ovov, (2, 3, 0, 1), (2, 3)) - t1new.aa += einsum(f.aa.vv, (0, 1), t1.aa, (2, 1), (2, 0)) - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), tmp8, (4, 0, 1, 3), (4, 2)) * -1 - del tmp8 - t1new.aa += tmp0 - del tmp0 - t1new.aa += einsum(tmp9, (0, 1, 2, 3), t2.aaaa, (2, 1, 4, 3), (0, 4)) * -2 - del tmp9 - t1new.aa += einsum(v.aaaa.ovvv, (0, 1, 2, 3), t2.aaaa, (4, 0, 1, 3), (4, 2)) * -2 - t1new.aa += einsum(t2.abab, (0, 1, 2, 3), v.aabb.vvov, (4, 2, 1, 3), (0, 4)) - t1new.aa += einsum(t1.aa, (0, 1), tmp12, (2, 0), (2, 1)) * -2 - del tmp12 - - return {f"t1new": t1new, f"t2new": t2new} - diff --git a/ebcc/codegen/bootstrap_CC2.py b/ebcc/codegen/bootstrap_CC2.py new file mode 100644 index 00000000..ec3d8807 --- /dev/null +++ b/ebcc/codegen/bootstrap_CC2.py @@ -0,0 +1,549 @@ +""" +Generate the CC2 code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}CC2.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("L amplitudes"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e1(a,i)"], ["t1", "t2"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e1(a,i)", "f"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e1(a,i)", "v"], ["t1", "t2"]) + pq.simplify() + terms_l1 = pq.strings() + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t1"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t1"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "f"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "v"], ["t1"]) + pq.simplify() + terms_l2 = pq.strings() + + # Get the L amplitudes in albert format + output_expr, returns = get_amplitudes([terms_l1, terms_l2], spin, strategy="opt" if spin == "uhf" else "exhaust", which="l") + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_lams", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("1RDM"): + # Get the 1RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator(1.0, [f"e1({','.join(indices)})"], ["t1", "t2"]) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 1RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm1(terms, spin) + + # Generate the 1RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing + if spin != "uhf": + codegen.write("rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]])") + else: + codegen.write("rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]])") + codegen.write("rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]])") + + codegen( + "make_rdm1_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("2RDM"): + # Get the 2RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator( + 1.0, [f"e2({indices[0]},{indices[1]},{indices[3]},{indices[2]})"], ["t1", "t2"] + ) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 2RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm2(terms, spin, strategy="trav" if spin == "uhf" else "exhaust") + + # Generate the 2RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing, handle transpose + if spin != "uhf": + codegen.write("rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv).transpose((0, 2, 1, 3))") + else: + codegen.write("rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.aabb = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv).transpose((0, 2, 1, 3))") + codegen.write("del rdm2.abab") + + codegen( + "make_rdm2_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("IP-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)", "a*(j)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("EA-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a*(i)", "a(b)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("EE-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e1(i,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_matvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +with Stopwatch("L-IP-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a(i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_right_operators([["a*(a)", "a(j)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("L-EA-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a*(a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_right_operators([["a*(a)", "a*(b)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("L-EE-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e1(a,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e2(a,b,j,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_lmatvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_CC3.py b/ebcc/codegen/bootstrap_CC3.py new file mode 100644 index 00000000..f394d484 --- /dev/null +++ b/ebcc/codegen/bootstrap_CC3.py @@ -0,0 +1,102 @@ +""" +Generate the CC3 code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}CC3.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T3 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e3(i,j,k,c,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.add_triple_commutator(0.5, ["v"], ["t1"], ["t1"], ["t2"]) + pq.add_quadruple_commutator(1/6, ["v"], ["t1"], ["t1"], ["t1"], ["t2"]) + pq.simplify() + terms_t3 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2, terms_t3], spin) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_CCD.py b/ebcc/codegen/bootstrap_CCD.py new file mode 100644 index 00000000..f5035d7a --- /dev/null +++ b/ebcc/codegen/bootstrap_CCD.py @@ -0,0 +1,543 @@ +""" +Generate the CCD code. +""" + +import itertools +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}CCD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, orders=[2]) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("L amplitudes"): + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t2"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t2"]) + pq.set_left_operators([["l2"]]) + pq.add_st_operator( 1.0, ["f", "e2(a,b,j,i)"], ["t2"]) + pq.add_st_operator( 1.0, ["v", "e2(a,b,j,i)"], ["t2"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "f"], ["t2"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "v"], ["t2"]) + pq.simplify() + terms = pq.strings() + + # Get the L amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, strategy="opt" if spin == "uhf" else "exhaust", which="l", orders=[2]) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_lams", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("1RDM"): + # Get the 1RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + pq.clear() + pq.set_left_operators([["1"], ["l2"]]) + pq.add_st_operator(1.0, [f"e1({','.join(indices)})"], ["t2"]) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 1RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm1(terms, spin) + + # Generate the 1RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing + if spin != "uhf": + codegen.write("rdm1.ov = np.zeros((t2.shape[0], t2.shape[-1]))") + codegen.write("rdm1.vo = np.zeros((t2.shape[-1], t2.shape[0]))") + codegen.write("rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]])") + else: + codegen.write("rdm1.aa.ov = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1]))") + codegen.write("rdm1.aa.vo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0]))") + codegen.write("rdm1.bb.ov = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1]))") + codegen.write("rdm1.bb.vo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0]))") + codegen.write("rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]])") + codegen.write("rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]])") + + codegen( + "make_rdm1_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("2RDM"): + # Get the 2RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + pq.clear() + pq.set_left_operators([["1"], ["l2"]]) + pq.add_st_operator( + 1.0, [f"e2({indices[0]},{indices[1]},{indices[3]},{indices[2]})"], ["t2"] + ) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 2RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm2(terms, spin, strategy="trav" if spin == "uhf" else "exhaust") + + # Generate the 2RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing, handle transpose + if spin != "uhf": + for spaces in itertools.product("ov", repeat=4): + if not any(o.name == "rdm2" and all(s == i.space for s, i in zip(spaces, o.external_indices)) for o, _ in output_expr): + shape = [f"t2.shape[{0 if s == 'o' else -1}]" for s in spaces] + codegen.write(f"rdm2.{''.join(spaces)} = np.zeros(({', '.join(shape)}))") + codegen.write("rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv).transpose((0, 2, 1, 3))") + else: + for spins in ("aaaa", "abab", "bbbb"): + for spaces in itertools.product("ov", repeat=4): + if not any(o.name == "rdm2" and all(s == i.space and t == i.spin for s, t, i in zip(spaces, spins, o.external_indices)) for o, _ in output_expr): + shape = [f"t2.{t * 4}.shape[{0 if s == 'o' else -1}]" for s, t in zip(spaces, spins)] + codegen.write(f"rdm2.{spins}.{''.join(spaces)} = np.zeros(({', '.join(shape)}))") + codegen.write("rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.aabb = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv).transpose((0, 2, 1, 3))") + codegen.write("del rdm2.abab") + + codegen( + "make_rdm2_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("IP-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)", "a*(j)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("EA-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a*(i)", "a(b)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("EE-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e1(i,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_matvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +with Stopwatch("L-IP-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a(i)"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_right_operators([["a*(a)", "a(j)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("L-EA-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a*(a)"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_right_operators([["a*(a)", "a*(b)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("L-EE-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e1(a,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e2(a,b,j,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_lmatvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_CCSD.py b/ebcc/codegen/bootstrap_CCSD.py new file mode 100644 index 00000000..588fb7ea --- /dev/null +++ b/ebcc/codegen/bootstrap_CCSD.py @@ -0,0 +1,549 @@ +""" +Generate the CCSD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}CCSD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("L amplitudes"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e1(a,i)"], ["t1", "t2"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e1(a,i)", "f"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e1(a,i)", "v"], ["t1", "t2"]) + pq.simplify() + terms_l1 = pq.strings() + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "f"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "v"], ["t1", "t2"]) + pq.simplify() + terms_l2 = pq.strings() + + # Get the L amplitudes in albert format + output_expr, returns = get_amplitudes([terms_l1, terms_l2], spin, strategy="opt" if spin == "uhf" else "exhaust", which="l") + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_lams", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("1RDM"): + # Get the 1RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator(1.0, [f"e1({','.join(indices)})"], ["t1", "t2"]) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 1RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm1(terms, spin) + + # Generate the 1RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing + if spin != "uhf": + codegen.write("rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]])") + else: + codegen.write("rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]])") + codegen.write("rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]])") + + codegen( + "make_rdm1_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("2RDM"): + # Get the 2RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator( + 1.0, [f"e2({indices[0]},{indices[1]},{indices[3]},{indices[2]})"], ["t1", "t2"] + ) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 2RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm2(terms, spin, strategy="trav" if spin == "uhf" else "exhaust") + + # Generate the 2RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing, handle transpose + if spin != "uhf": + codegen.write("rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv).transpose((0, 2, 1, 3))") + else: + codegen.write("rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.aabb = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv).transpose((0, 2, 1, 3))") + codegen.write("del rdm2.abab") + + codegen( + "make_rdm2_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("IP-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)", "a*(j)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("EA-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a*(i)", "a(b)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("EE-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e1(i,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_matvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +with Stopwatch("L-IP-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a(i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_right_operators([["a*(a)", "a(j)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("L-EA-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a*(a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_right_operators([["a*(a)", "a*(b)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("L-EE-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e1(a,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e2(a,b,j,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_lmatvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_CCSDT.py b/ebcc/codegen/bootstrap_CCSDT.py new file mode 100644 index 00000000..5fbecc51 --- /dev/null +++ b/ebcc/codegen/bootstrap_CCSDT.py @@ -0,0 +1,452 @@ +""" +Generate the CCSDT code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}CCSDT.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T3 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e3(i,j,k,c,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t3 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2, terms_t3], spin, strategy="greedy") + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("L amplitudes"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e1(a,i)"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v", "e1(a,i)"], ["t1", "t2", "t3"]) + pq.set_left_operators([["l1"], ["l2"], ["l3"]]) + pq.add_st_operator(1.0, ["f", "e1(a,i)"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v", "e1(a,i)"], ["t1", "t2", "t3"]) + pq.add_st_operator(-1.0, ["e1(a,i)", "f"], ["t1", "t2", "t3"]) + pq.add_st_operator(-1.0, ["e1(a,i)", "v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_l1 = pq.strings() + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t1", "t2", "t3"]) + pq.set_left_operators([["l1"], ["l2"], ["l3"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t1", "t2", "t3"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "f"], ["t1", "t2", "t3"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_l2 = pq.strings() + + # Get the L3 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e3(a,b,c,k,j,i)"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v", "e3(a,b,c,k,j,i)"], ["t1", "t2", "t3"]) + pq.set_left_operators([["l1"], ["l2"], ["l3"]]) + pq.add_st_operator(1.0, ["f", "e3(a,b,c,k,j,i)"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v", "e3(a,b,c,k,j,i)"], ["t1", "t2", "t3"]) + pq.add_st_operator(-1.0, ["e3(a,b,c,k,j,i)", "f"], ["t1", "t2", "t3"]) + pq.add_st_operator(-1.0, ["e3(a,b,c,k,j,i)", "v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_l3 = pq.strings() + + # Get the L amplitudes in albert format + output_expr, returns = get_amplitudes([terms_l1, terms_l2, terms_l3], spin, strategy="greedy", which="l") + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_lams", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("1RDM"): + # Get the 1RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"], ["l3"]]) + pq.add_st_operator(1.0, [f"e1({','.join(indices)})"], ["t1", "t2", "t3"]) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 1RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm1(terms, spin) + + # Generate the 1RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing + if spin != "uhf": + codegen.write("rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]])") + else: + codegen.write("rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]])") + codegen.write("rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]])") + + codegen( + "make_rdm1_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("2RDM"): + # Get the 2RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"], ["l3"]]) + pq.add_st_operator( + 1.0, [f"e2({indices[0]},{indices[1]},{indices[3]},{indices[2]})"], ["t1", "t2", "t3"] + ) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 2RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm2(terms, spin, strategy="trav" if spin == "uhf" else "exhaust") + + # Generate the 2RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing, handle transpose + if spin != "uhf": + codegen.write("rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv).transpose((0, 2, 1, 3))") + else: + codegen.write("rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.aabb = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv).transpose((0, 2, 1, 3))") + codegen.write("del rdm2.abab") + + codegen( + "make_rdm2_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("IP-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)"]]) + pq.set_right_operators([["r1"], ["r2"], ["r3"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)", "a*(j)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"], ["r3"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R3 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)", "a*(j)", "a*(k)", "a(b)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"], ["r3"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_r3 = pq.strings() + terms_r3 = remove_reference_energy_eom(terms_r3) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2, terms_r3], spin, strategy="greedy", which="ip") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("EA-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a(a)"]]) + pq.set_right_operators([["r1"], ["r2"], ["r3"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a*(i)", "a(b)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"], ["r3"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R3 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a*(i)", "a*(j)", "a(c)", "a(b)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"], ["r3"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_r3 = pq.strings() + terms_r3 = remove_reference_energy_eom(terms_r3) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2, terms_r3], spin, strategy="greedy", which="ea") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("EE-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e1(i,a)"]]) + pq.set_right_operators([["r1"], ["r2"], ["r3"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.set_right_operators([["r1"], ["r2"], ["r3"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R3 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e3(i,j,k,c,b,a)"]]) + pq.set_right_operators([["r1"], ["r2"], ["r3"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_r3 = pq.strings() + terms_r3 = remove_reference_energy_eom(terms_r3) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2, terms_r3], spin, strategy="greedy", which="ee") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_matvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_CCSDTQ.py b/ebcc/codegen/bootstrap_CCSDTQ.py new file mode 100644 index 00000000..b69febd2 --- /dev/null +++ b/ebcc/codegen/bootstrap_CCSDTQ.py @@ -0,0 +1,105 @@ +""" +Generate the CCSDTQ code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}CCSDTQ.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T3 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e3(i,j,k,c,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t3 = pq.strings() + + # Get the T3 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e4(i,j,k,l,d,c,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3", "t4"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3", "t4"]) + pq.simplify() + terms_t4 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2, terms_t3, terms_t4], spin, strategy="greedy") + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_CCSD_S_1_1.py b/ebcc/codegen/bootstrap_CCSD_S_1_1.py new file mode 100644 index 00000000..1a9fd840 --- /dev/null +++ b/ebcc/codegen/bootstrap_CCSD_S_1_1.py @@ -0,0 +1,611 @@ +""" +Generate the CCSD-S-1-1 code. +""" + +import sys + +from qwick.index import Idx +from qwick.operator import Tensor as WTensor +from qwick.expression import AExpression +from qwick.convenience import PE1 +from albert.qc._wick import * +from albert.qc.index import Index +from albert.tensor import Tensor +from albert.canon import canonicalise_indices + +from ebcc.codegen.bootstrap_common import * + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EinsumCodeGen( + stdout=open(f"{spin[0].upper()}CCSD_S_1_1.py", "w"), + name_generator=name_generators[spin], + spin=spin, + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up wick +rank = ("SD", "S", "S") +occs = [Idx(n, "occ") for n in range(6)] +virs = [Idx(n, "vir") for n in range(6)] +nms = [Idx(n, "nm", fermion=False) for n in range(6)] +index_dict = { + **{k: o for k, o in zip(default_indices["o"][:len(occs)], occs)}, + **{k: v for k, v in zip(default_indices["v"][:len(virs)], virs)}, + **{k: n for k, n in zip(default_indices["b"][:len(nms)], nms)}, +} + +# Set up common wick objects +with Stopwatch("Common"): + bra1e, bra2e, bra1b, bra1b1e = get_bra_spaces(rank=rank, occs=occs, virs=virs, nms=nms) + ket1e, ket2e, ket1b, ket1b1e = get_ket_spaces(rank=rank, occs=occs, virs=virs, nms=nms) + wick_h = get_hamiltonian(rank=rank) + wick_t = get_excitation_ansatz(rank=rank, occs=occs, virs=virs, nms=nms) + wick_l = get_deexcitation_ansatz(rank=rank, occs=occs, virs=virs, nms=nms) + wick_hbars = construct_hbar(wick_h, wick_t, max_commutator=4) + wick_hbar = wick_hbars[-1] + +with Stopwatch("Energy"): + # Get the energy contractions in wick format + out = apply_wick(wick_hbar) + out.resolve() + expr = AExpression(Ex=out, simplify=True) + + # Get the energy in albert format + expr = import_from_wick(expr) + expr = spin_integrate(expr, spin) + output = tuple(Tensor(name="e_cc") for _ in range(len(expr))) + output, expr = optimise(output, expr, spin, strategy="exhaust") + returns = (Tensor(name="e_cc"),) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output, + expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in wick format + out = bra1e * wick_hbar + out = apply_wick(out) + out.resolve() + expr_t1 = AExpression(Ex=out, simplify=True) + + # Get the T2 contractions in wick format + out = bra2e * wick_hbar + out = apply_wick(out) + out.resolve() + expr_t2 = AExpression(Ex=out, simplify=True) + + # Get the S1 contractions in wick format + out = bra1b * wick_hbar + out = apply_wick(out) + out.resolve() + expr_s1 = AExpression(Ex=out, simplify=True) + + # Get the U11 contractions in wick format + out = bra1b1e * wick_hbar + out = apply_wick(out) + out.resolve() + expr_u11 = AExpression(Ex=out, simplify=True) + + # Get the T amplitudes in albert format + expr = [] + output = [] + returns = [] + terms = (expr_t1, expr_t2) + for n in range(2): + for index_spins in get_amplitude_spins(n + 1, spin): + indices = default_indices["o"][: n + 1] + default_indices["v"][: n + 1] + expr_n = import_from_wick(terms[n], index_spins=index_spins) + expr_n = spin_integrate(expr_n, spin) + output_n = get_t_amplitude_outputs(expr_n, f"t{n+1}new") + returns_n = (Tensor(*indices, name=f"t{n+1}new"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + + # Get the S amplitudes in albert format + terms = (expr_s1,) + for n in range(1): + indices = default_indices["b"][: n + 1] + expr_n = import_from_wick(terms[n]) + expr_n = spin_integrate(expr_n, spin) + output_n = get_t_amplitude_outputs(expr_n, f"s{n+1}new") + returns_n = (Tensor(*indices, name=f"s{n+1}new"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + + # Get the U amplitudes in albert format + terms = ((expr_u11,),) + for nb in range(1): + for nf in range(1): + for index_spins in get_amplitude_spins(nf + 1, spin): + indices = default_indices["b"][: nb + 1] + default_indices["o"][: nf + 1] + default_indices["v"][: nf + 1] + expr_n = import_from_wick(terms[nb][nf], index_spins=index_spins) + expr_n = spin_integrate(expr_n, spin) + output_n = get_t_amplitude_outputs(expr_n, f"u{nf+1}{nb+1}new") + returns_n = (Tensor(*indices, name=f"u{nf+1}{nb+1}new"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + + # Generate the T amplitude code + output, expr = optimise(output, expr, spin, strategy="trav") + for name, codegen in code_generators.items(): + if name == "einsum": + preamble = get_boson_einsum_preamble(spin) + if spin == "uhf": + preamble += "t1new = Namespace()\n" + preamble += "t2new = Namespace()\n" + preamble += "u11new = Namespace()" + kwargs = { + "preamble": preamble, + "as_dict": True, + } + else: + kwargs = {} + codegen( + "update_amps", + returns, + output, + expr, + **kwargs, + ) + +with Stopwatch("L amplitudes"): + # Get the L1 contractions in wick format: ⟨0|H̄|1e⟩ + out = wick_hbars[1] * ket1e + out = apply_wick(out) + out.resolve() + expr1 = AExpression(Ex=out) + expr1 = expr1.get_connected() + expr1.sort_tensors() + + # Get the L1 contractions in wick format: ⟨0|[L, H̄]|1e⟩ + out = wick_l * wick_hbars[3] * ket1e + out = apply_wick(out) + out.resolve() + expr2 = AExpression(Ex=out) + expr2 = expr2.get_connected() + expr2.sort_tensors() + expr_l1 = expr1 + expr2 + + # Get the L2 contractions in wick format: ⟨0|H̄|2e⟩ + out = wick_hbars[0] * ket2e + out = apply_wick(out) + out.resolve() + expr1 = AExpression(Ex=out) + expr1 = expr1.get_connected() + expr1.sort_tensors() + + # Get the L2 contractions in wick format: ⟨0|L H̄|2e⟩ + out = wick_l * wick_hbars[2] * ket2e + out = apply_wick(out) + out.resolve() + expr2 = AExpression(Ex=out) + expr2 = expr2.get_connected() + expr2.sort_tensors() + + # Get the L2 contractions in wick format: disconnected parts + p1 = PE1("occ", "vir") + out = wick_hbars[1] * p1 * wick_l * ket2e + out = apply_wick(out) + out.resolve() + expr3 = AExpression(Ex=out) + expr3.sort_tensors() + expr_l2 = expr1 + expr2 + expr3 + + # Get the LS1 contractions in wick format: ⟨0|H̄|1b⟩: + out = wick_hbars[1] * ket1b + out = apply_wick(out) + out.resolve() + expr1 = AExpression(Ex=out) + expr1 = expr1.get_connected() + expr1.sort_tensors() + + # Get the LS1 contractions in wick format: ⟨0|L H̄|1b⟩: + out = wick_l * wick_hbars[3] * ket1b + out = apply_wick(out) + out.resolve() + expr2 = AExpression(Ex=out) + expr2 = expr2.get_connected() + expr2.sort_tensors() + expr_ls1 = expr1 + expr2 + + # Get the LU11 contractions in wick format: ⟨0|H̄|1b1e⟩: + out = wick_hbars[0] * ket1b1e + out = apply_wick(out) + out.resolve() + expr1 = AExpression(Ex=out) + expr1 = expr1.get_connected() + expr1.sort_tensors() + + # Get the LU11 contractions in wick format: ⟨0|L H̄|1b1e⟩: + out = wick_l * wick_hbars[2] * ket1b1e + out = apply_wick(out) + out.resolve() + expr2 = AExpression(Ex=out) + expr2 = expr2.get_connected() + expr2.sort_tensors() + + # Get the LU11 contractions in wick format: disconnected parts, fermion projection + p1 = PE1("occ", "vir") + out = wick_hbars[1] * p1 * wick_l * ket1b1e + out = apply_wick(out) + out.resolve() + expr3 = AExpression(Ex=out) + expr3.sort_tensors() + + # Get the LU11 contractions in wick format: disconnected parts, boson projection + p1b = PB1("nm") + out = wick_hbars[1] * p1b * wick_l * ket1b1e + out = apply_wick(out) + out.resolve() + expr4 = AExpression(Ex=out) + expr4.sort_tensors() + expr_lu11 = expr1 + expr2 + expr3 + expr4 + + # Get the L amplitudes in albert format + expr = [] + output = [] + returns = [] + terms = (expr_l1, expr_l2) + for n in range(2): + for index_spins in get_amplitude_spins(n + 1, spin): + indices = default_indices["v"][: n + 1] + default_indices["o"][: n + 1] + expr_n = import_from_wick(terms[n], index_spins=index_spins) + expr_n = spin_integrate(expr_n, spin) + output_n = get_l_amplitude_outputs(expr_n, f"l{n+1}new") + returns_n = (Tensor(*indices, name=f"l{n+1}new"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + + # Get the LS amplitudes in albert format + terms = (expr_ls1,) + for n in range(1): + indices = default_indices["b"][: n + 1] + expr_n = import_from_wick(terms[n]) + expr_n = spin_integrate(expr_n, spin) + output_n = get_l_amplitude_outputs(expr_n, f"ls{n+1}new") + returns_n = (Tensor(*indices, name=f"ls{n+1}new"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + + # Get the LU amplitudes in albert format + terms = ((expr_lu11,),) + for nb in range(1): + for nf in range(1): + for index_spins in get_amplitude_spins(nf + 1, spin): + indices = default_indices["b"][: nb + 1] + default_indices["v"][: nf + 1] + default_indices["o"][: nf + 1] + expr_n = import_from_wick(terms[nb][nf], index_spins=index_spins) + expr_n = spin_integrate(expr_n, spin) + output_n = get_l_amplitude_outputs(expr_n, f"lu{nf+1}{nb+1}new") + returns_n = (Tensor(*indices, name=f"lu{nf+1}{nb+1}new"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + + # Generate the L amplitude code + output, expr = optimise(output, expr, spin, strategy="trav") + for name, codegen in code_generators.items(): + if name == "einsum": + preamble = get_boson_einsum_preamble(spin) + if spin == "uhf": + preamble += "l1new = Namespace()\n" + preamble += "l2new = Namespace()\n" + preamble += "ls1new = Namespace()\n" + preamble += "lu11new = Namespace()" + kwargs = { + "preamble": preamble, + "as_dict": True, + } + else: + kwargs = {} + codegen( + "update_lams", + returns, + output, + expr, + **kwargs, + ) + +with Stopwatch("1RDM"): + # Get the 1RDM contractions in wick format + terms = {} + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + i = index_dict[indices[0]] + j = index_dict[indices[1]] + ops = [FOperator(j, True), FOperator(i, False)] + p = Expression([Term(1, [], [WTensor([i, j], "")], ops, [])]) + out = bch(p, wick_t, max_commutator=2)[-1] + out = out + wick_l * out + out = apply_wick(out) + out.resolve() + expr = AExpression(Ex=out, simplify=True) + terms[sectors, indices] = expr + + # Get the 1RDM in albert format + expr = [] + output = [] + returns = [] + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + for index_spins in get_density_spins(1, spin, indices): + # wick canonicalisation is buggy: + expr_n = [import_from_wick(t) for t in str(terms[sectors, indices]).split("\n")] + expr_n = [canonicalise_indices(e, "ijklmn", "abcdef", ["x", "y", "z", "b0", "b1", "b2"]) for e in expr_n] + if index_spins: + expr_n = [e.map_indices({Index(i, space=o): Index(i, space=o, spin=index_spins[i]) for i, o in zip(indices, sectors)}) for e in expr_n] + expr_n = sum([spin_integrate(e, spin) for e in expr_n], tuple()) + if spin == "uhf": + expr_n = tuple(e * 0.5 for e in expr_n) + expr_n = tuple(e for e in expr_n if not (isinstance(e, (int, float)) and e == 0)) + output_n = get_density_outputs(expr_n, f"d", indices) + if index_spins: + returns_n = (Tensor(*[Index(i, space=o, spin=index_spins[i]) for i, o in zip(indices, sectors)], name=f"d"),) + else: + returns_n = (Tensor(*[Index(i, space=o) for i, o in zip(indices, sectors)], name=f"d"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + output, expr = optimise(output, expr, spin, strategy="exhaust") + + # Generate the 1RDM code + for name, codegen in code_generators.items(): + if name == "einsum": + kwargs = { + "preamble": get_density_einsum_preamble(1, spin), + "postamble": get_density_einsum_postamble(1, spin), + } + else: + kwargs = {} + codegen( + "make_rdm1_f", + returns, + output, + expr, + **kwargs, + ) + +with Stopwatch("2RDM"): + # Get the 2RDM contractions in wick format + terms = {} + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + i = index_dict[indices[0]] + j = index_dict[indices[1]] + k = index_dict[indices[2]] + l = index_dict[indices[3]] + ops = [FOperator(l, True), FOperator(k, True), FOperator(i, False), FOperator(j, False)] + p = Expression([Term(1, [], [WTensor([i, j, k, l], "")], ops, [])]) + out = bch(p, wick_t, max_commutator=4)[-1] + out = out + wick_l * out + out = apply_wick(out) + out.resolve() + expr = AExpression(Ex=out, simplify=True) + terms[sectors, indices] = expr + + # Get the 2RDM in albert format + expr = [] + output = [] + returns = [] + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + for index_spins in get_density_spins(2, spin, indices): + # wick canonicalisation is buggy: + expr_n = [import_from_wick(t) for t in str(terms[sectors, indices]).split("\n")] + expr_n = [canonicalise_indices(e, "ijklmn", "abcdef", ["x", "y", "z", "b0", "b1", "b2"]) for e in expr_n] + if index_spins: + expr_n = [e.map_indices({Index(i, space=o): Index(i, space=o, spin=index_spins[i]) for i, o in zip(indices, sectors)}) for e in expr_n] + expr_n = sum([spin_integrate(e, spin) for e in expr_n], tuple()) + expr_n = tuple(e for e in expr_n if not (isinstance(e, (int, float)) and e == 0)) + output_n = get_density_outputs(expr_n, f"Γ", indices) + if index_spins: + returns_n = (Tensor(*[Index(i, space=o, spin=index_spins[i]) for i, o in zip(indices, sectors)], name=f"d"),) + else: + returns_n = (Tensor(*[Index(i, space=o) for i, o in zip(indices, sectors)], name=f"d"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + output, expr = optimise(output, expr, spin, strategy="trav") + + # Generate the 2RDM code + for name, codegen in code_generators.items(): + if name == "einsum": + kwargs = { + "preamble": get_density_einsum_preamble(2, spin), + "postamble": get_density_einsum_postamble(2, spin), + } + else: + kwargs = {} + codegen( + "make_rdm2_f", + returns, + output, + expr, + **kwargs, + ) + +with Stopwatch("BDM"): + # Get the BDM contractions in wick format + terms = {} + for cre, index in [(True, "x"), (False, "x")]: + x = index_dict[index] + ops = [BOperator(x, cre)] + p = Expression([Term(1, [], [WTensor([x], "")], ops, [])]) + out = bch(p, wick_t, max_commutator=3)[-1] + out = out + wick_l * out + out = apply_wick(out) + out.resolve() + expr = AExpression(Ex=out, simplify=True) + terms[cre, index] = expr + + # Get the BDM in albert format + expr = [] + output = [] + returns = [] + for cre, index in [(True, "x"), (False, "x")]: + expr_n = import_from_wick(terms[cre, index]) + expr_n = spin_integrate(expr_n, spin) + output_n = get_density_outputs(expr_n, f"dm_{'cre' if cre else 'des'}", (index,)) + returns_n = (Tensor(Index(index, space="b"), name=f"dm_{'cre' if cre else 'des'}"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + output, expr = optimise(output, expr, spin, strategy="exhaust") + + # Generate the BDM code + for name, codegen in code_generators.items(): + kwargs = {} + codegen( + "make_sing_b_dm", + returns, + output, + expr, + **kwargs, + ) + +with Stopwatch("B1RDM"): + # Get the B1RDM contractions in wick format + x = index_dict["x"] + y = index_dict["y"] + ops = [BOperator(x, True), BOperator(y, False)] + p = Expression([Term(1, [], [WTensor([x, y], "")], ops, [])]) + out = bch(p, wick_t, max_commutator=3)[-1] + out = out + wick_l * out + out = apply_wick(out) + out.resolve() + term = AExpression(Ex=out, simplify=True) + + # Get the B1RDM in albert format + expr = [] + output = [] + returns = [] + expr_n = import_from_wick(term) + expr_n = spin_integrate(expr_n, spin) + output_n = get_density_outputs(expr_n, f"rdm1_b", ("x", "y")) + returns_n = (Tensor(Index("x", space="b"), Index("y", space="b"), name=f"rdm1_b"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + output, expr = optimise(output, expr, spin, strategy="exhaust") + + # Generate the B1RDM code + for name, codegen in code_generators.items(): + kwargs = {} + codegen( + "make_rdm1_b", + returns, + output, + expr, + **kwargs, + ) + +with Stopwatch("EBRDM"): + # Get the EBRDM contractions in wick format + terms = {} + x = index_dict["x"] + for sectors, indices in [("boo", "xij"), ("bov", "xia"), ("bvo", "xai"), ("bvv", "xab")]: + for cre in (False, True): + i = index_dict[indices[1]] + j = index_dict[indices[2]] + ops = [BOperator(x, cre), FOperator(j, True), FOperator(i, False)] + p = Expression([Term(1, [], [WTensor([x, i, j], "")], ops, [])]) + out = bch(p, wick_t, max_commutator=2)[-1] + out = out + wick_l * out + out = apply_wick(out) + out.resolve() + expr = AExpression(Ex=out, simplify=True) + terms[sectors, indices, cre] = expr + + # Get the EBRDM in albert format + expr = [] + output = [] + returns = [] + for sectors, indices in [("boo", "xij"), ("bov", "xia"), ("bvo", "xai"), ("bvv", "xab")]: + for cre in (False, True): + for index_spins in get_density_spins(1, spin, indices): + # wick canonicalisation is buggy: + expr_n = [import_from_wick(t) for t in str(terms[sectors, indices, cre]).split("\n")] + expr_n = [canonicalise_indices(e, "ijklmn", "abcdef", "xyz") for e in expr_n] + if index_spins: + expr_n = [e.map_indices({Index(i, space=o): Index(i, space=o, spin=index_spins.get(i)) for i, o in zip(indices, sectors)}) for e in expr_n] + expr_n = sum([spin_integrate(e, spin) for e in expr_n], tuple()) + if spin == "uhf": + expr_n = tuple(e * 0.5 for e in expr_n) + expr_n = tuple(e for e in expr_n if not (isinstance(e, (int, float)) and e == 0)) + output_n = get_density_outputs(expr_n, f"rdm_eb_{'cre' if cre else 'des'}", indices) + if index_spins: + returns_n = (Tensor(*[Index(i, space=o, spin=index_spins.get(i)) for i, o in zip(indices, sectors)], name=f"d"),) + else: + returns_n = (Tensor(*[Index(i, space=o) for i, o in zip(indices, sectors)], name=f"d"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + output, expr = optimise(output, expr, spin, strategy="exhaust") + + # Generate the EBRDM code + for name, codegen in code_generators.items(): + if name == "einsum": + preamble = get_density_einsum_preamble(1, spin) + preamble = preamble.replace("rdm1 = Namespace()", "rdm_eb_cre = Namespace()\nrdm_eb_des = Namespace()") + postamble = get_density_einsum_postamble(1, spin, spaces=["boo", "bov", "bvo", "bvv"]) + postamble = "\n".join([postamble.replace("rdm1", f"rdm_eb_{'cre' if cre else 'des'}") for cre in (True, False)]) + kwargs = { + "preamble": preamble, + "postamble": postamble, + } + else: + kwargs = {} + codegen( + "make_eb_coup_rdm", + returns, + output, + expr, + **kwargs, + ) diff --git a/ebcc/codegen/bootstrap_CCSDwtw.py b/ebcc/codegen/bootstrap_CCSDwtw.py new file mode 100644 index 00000000..41c4365a --- /dev/null +++ b/ebcc/codegen/bootstrap_CCSDwtw.py @@ -0,0 +1,270 @@ +""" +Generate the CCSDt code. +""" + +import sys +sys.setrecursionlimit(100000) + +import pdaggerq +from albert.qc._pdaggerq import import_from_pdaggerq +from albert.base import Base +from albert.tensor import Tensor +from albert.algebra import Mul, Add + +from ebcc.codegen.bootstrap_common import * + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +def name_generator(tensor, add_spaces=True): + name = name_generators[spin](tensor, add_spaces=add_spaces) + if isinstance(tensor, Tensor) and tensor.name.startswith("t") and not tensor.name.startswith("tmp"): + spaces = tuple(i.space for i in tensor.indices) + if not any(s is None for s in spaces): # Otherwise, it's a "return" tensor + if spaces not in (("o", "v"), ("o", "o", "v", "v"), ("O", "o", "o", "v", "v", "V")): + name = name.replace(".", "_") + name = f"{name}_{''.join(spaces)}" + return name + +class _EinsumCodeGen(EinsumCodeGen): + def ignore_argument(self, arg): + if "_" in name_generator(arg): + return True + return super().ignore_argument(arg) + + def tensor_cleanup(self, *args): + args = tuple(self.get_name(arg) if isinstance(arg, Tensor) else arg for arg in args) + args = tuple(arg for arg in args if "_" not in arg) + return super().tensor_cleanup(*args) + + def preamble(self, imports=None): + if imports is None: + imports = "from ebcc import numpy as np\n" + imports += "from ebcc.util import pack_2e, einsum, dirsum, Namespace\n" + imports += "from ebcc.backend import _inflate" + super().preamble(imports=imports) + +code_generators = { + "einsum": _EinsumCodeGen( + stdout=open(f"{spin[0].upper()}CCSDwtw.py", "w"), + name_generator=name_generator, + spin=spin, + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_hf_energy(terms) + + # Get the energy in albert format + expr = import_from_pdaggerq(terms) + expr = spin_integrate(expr, spin) + output = tuple(Tensor(name="e_cc") for _ in range(len(expr))) + output, expr = optimise(output, expr, spin, strategy="exhaust") + returns = (Tensor(name="e_cc"),) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output, + expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T3 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e3(i,j,k,c,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t3 = pq.strings() + + # Get the T amplitudes in albert format + terms = [terms_t1, terms_t2, terms_t3] + expr = [] + output = [] + returns = [] + for n in range(3): + for index_spins in get_amplitude_spins(n + 1, spin): + indices = default_indices["o"][: n + 1] + default_indices["v"][: n + 1] + expr_n = import_from_pdaggerq(terms[n], index_spins=index_spins) + expr_n = spin_integrate(expr_n, spin) + output_n = get_t_amplitude_outputs(expr_n, f"t{n+1}new", indices=indices) + returns_n = (Tensor(*tuple(Index(i) for i in indices), name=f"t{n+1}new"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + + # Make the T3 indices active + new_expr = [] + new_output = [] + for i, (o, e) in enumerate(zip(output, expr)): + # Get the indices + indices = set() + if o.name.startswith("t3"): + indices = indices.union({o.indices[0], o.indices[5]}) + for a in e.nested_view(): + indices_a = indices.copy() + for t in a: + if isinstance(t, Tensor) and t.name.startswith("t3"): + indices_a = indices_a.union({t.indices[0], t.indices[5]}) + + # Substitute the indices + subs = {i: Index(i.name.upper(), spin=i.spin, space=i.space.upper()) for i in indices_a} + new_args = [] + for t in a: + if isinstance(t, Tensor): + new_args.append(t.map_indices(subs)) + else: + new_args.append(t) + new_output.append(o.map_indices(subs)) + new_expr.append(Mul(*new_args)) + output = new_output + expr = new_expr + + ## Spin integrate + #new_output = [] + #new_expr = [] + #for o, e in zip(output, expr): + # new_expr_spin = spin_integrate(e, spin) + # for ee in new_expr_spin: + # if isinstance(ee, Base) and len(ee.without_coefficient().args): + # new_expr.append(ee) + # new_output.append(get_t_amplitude_outputs((ee,), o.name, indices=[i.name for i in sorted(ee.external_indices)])[0]) + #expr = new_expr + #output = new_output + + # Optimise + #output, expr = optimise(output, expr, spin, strategy="exhaust" if spin != "uhf" else "greedy") + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + ignore_arguments = [] + if name == "einsum": + preamble = "space = kwargs[\"space\"]" + preamble += "\nt1new = Namespace()" + preamble += "\nt2new = Namespace()" + preamble += "\nt3new = Namespace()" + if spin == "uhf": + preamble += "\nsoa = np.ones((t1.aa.shape[0],), dtype=bool)" + preamble += "\nsva = np.ones((t1.aa.shape[1],), dtype=bool)" + preamble += "\nsob = np.ones((t1.bb.shape[0],), dtype=bool)" + preamble += "\nsvb = np.ones((t1.bb.shape[1],), dtype=bool)" + preamble += "\nsOa = space[0].active[space[0].correlated][space[0].occupied[space[0].correlated]]" + preamble += "\nsVa = space[0].active[space[0].correlated][space[0].virtual[space[0].correlated]]" + preamble += "\nsOb = space[1].active[space[1].correlated][space[1].occupied[space[1].correlated]]" + preamble += "\nsVb = space[1].active[space[1].correlated][space[1].virtual[space[1].correlated]]" + preamble += "\n" + postamble = "" + inp_keys = {"aa": set(), "bb": set(), "aaaa": set(), "abab": set(), "bbbb": set()} + out_keys = {"aa": set(), "bb": set(), "aaaa": set(), "abab": set(), "bbbb": set()} + for o, e in zip(output, expr): + if o.name.startswith("t") and not (o.name.startswith("tmp") or o.name.startswith("t3")): + spaces = "".join(tuple(i.space for i in o.indices)) + spins = "".join(tuple({"α": "a", "β": "b"}[i.spin] for i in o.indices)) + if set(spaces) != {"o", "v"}: + inp_keys[spins].add(spaces) + for a in e.nested_view(): + for t in a: + if isinstance(t, Tensor) and t.name.startswith("t") and not (t.name.startswith("tmp") or t.name.startswith("t3")): + spaces = "".join(tuple(i.space for i in t.indices)) + spins = "".join(tuple({"α": "a", "β": "b"}[i.spin] for i in t.indices)) + inp_keys[spins].add(spaces) + for spins, inp_keys in inp_keys.items(): + for key in inp_keys: + slices = ", ".join(f"s{c}{s}" for c, s in zip(key, spins)) + preamble += f"\nt{len(key)//2}_{spins}_{key} = np.copy(t{len(key)//2}.{spins}[np.ix_({slices})])" + ignore_arguments.append(f"t{len(key)//2}_{spins}_{key}") + for spins, out_keys in out_keys.items(): + for key in out_keys: + slices = ", ".join(f"s{c}{s}" for c, s in zip(key, spins)) + postamble += f"\nt{len(key)//2}new.{spins} += _inflate(t{len(key)//2}new.{spins}.shape, np.ix_({slices}), t{len(key)//2}new_{spins}_{key})" + else: + preamble += "\nso = np.ones((t1.shape[0],), dtype=bool)" + preamble += "\nsv = np.ones((t1.shape[1],), dtype=bool)" + preamble += "\nsi = np.ones((t3.shape[0],), dtype=bool)" + preamble += "\nsa = np.ones((t3.shape[5],), dtype=bool)" + preamble += "\nsO = space.active[space.correlated][space.occupied[space.correlated]]" + preamble += "\nsV = space.active[space.correlated][space.virtual[space.correlated]]" + postamble = "" + inp_keys = set() + out_keys = set() + for o, e in zip(output, expr): + if o.name.startswith("t") and not o.name.startswith("tmp"): + spaces = "".join(tuple(i.space for i in o.indices)) + if set(spaces) != {"o", "v"} and spaces != "OoovvV": + out_keys.add(spaces) + for a in e.nested_view(): + for t in a: + if isinstance(t, Tensor) and t.name.startswith("t") and not t.name.startswith("tmp"): + spaces = "".join(tuple(i.space for i in t.indices)) + if set(spaces) != {"o", "v"} and spaces != "OoovvV": + inp_keys.add(spaces) + for key in sorted(inp_keys, key=lambda x: (len(x), x)): + if len(key) == 6: + #slices = ", ".join(f"s{c}" for c in key[:2]) + ", si, " + ", ".join(f"s{c}" for c in key[3:5]) + ", sa" + slices = "si, " + ", ".join(f"s{c}" for c in key[1:5]) + ", sa" + else: + slices = ", ".join(f"s{c}" for c in key) + preamble += f"\nt{len(key)//2}_{key} = np.copy(t{len(key)//2}[np.ix_({slices})])" + ignore_arguments.append(f"t{len(key)//2}_{key}") + for key in sorted(out_keys, key=lambda x: (len(x), x)): + if len(key) == 6: + #slices = ", ".join(f"s{c}" for c in key[:2]) + ", si, " + ", ".join(f"s{c}" for c in key[3:5]) + ", sa" + slices = "si, " + ", ".join(f"s{c}" for c in key[1:5]) + ", sa" + else: + slices = ", ".join(f"s{c}" for c in key) + postamble += f"\nt{len(key)//2}new += _inflate(t{len(key)//2}new.shape, np.ix_({slices}), t{len(key)//2}new_{key})" + preamble += "\n" + kwargs = { + "preamble": preamble, + "postamble": postamble, + "as_dict": True, + "ignore_arguments": ignore_arguments, + } + else: + kwargs = {} + codegen( + "update_amps", + returns, + output, + expr, + **kwargs, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_CCSDwtwp.py b/ebcc/codegen/bootstrap_CCSDwtwp.py new file mode 100644 index 00000000..8c302e24 --- /dev/null +++ b/ebcc/codegen/bootstrap_CCSDwtwp.py @@ -0,0 +1,225 @@ +""" +Generate the CCSDt' code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info +from albert.opt import optimise +from albert.algebra import Mul +from albert.misc import ExclusionSet + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +class CodeGenerator(EBCCCodeGenerator): + _add_spaces = ExclusionSet() + + def get_name(self, tensor, add_spins=None, add_spaces=None, spin_delimiter=".", space_delimiter="."): + if isinstance(tensor, Tensor) and tensor.name.startswith("t") and not tensor.name.startswith("tmp"): + spaces = tuple(i.space for i in tensor.indices) + if spaces not in (("o", "v"), ("o", "o", "v", "v"), ("O", "O", "O", "V", "V", "V")): + space_delimiter = "_" + else: + add_spaces = False + return super().get_name(tensor, add_spins=add_spins, add_spaces=add_spaces, spin_delimiter=spin_delimiter, space_delimiter=space_delimiter) + + def module_imports(self): + super().module_imports() + self.write("from ebcc.backend import _inflate") + + def ignore_argument(self, tensor): + if "_" in self.get_name(tensor): + return True + return super().ignore_argument(tensor) + + def tensor_cleanup(self, *args): + names = tuple(self.get_name(arg) for arg in args) + args = tuple(arg for arg, name in zip(args, names) if "_" not in name) + super().tensor_cleanup(*args) + +code_generators = { + "einsum": CodeGenerator( + stdout=open(f"{spin[0].upper()}CCSDwtwp.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T3 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e3(i,j,k,c,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3"]) + pq.simplify() + terms_t3 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2, terms_t3], spin, strategy=None) + + # Make the T3 indices active + new_expr = [] + new_output = [] + for i, (o, e) in enumerate(output_expr): + # Get the indices + indices = set() + if o.name.startswith("t3"): + indices = indices.union(set(o.external_indices)) + + for add in e.expand()._children: + indices_a = indices.copy() + def _get_indices(tensor): + global indices_a + if tensor.name.startswith("t3"): + indices_a = indices_a.union(set(tensor.external_indices)) + return tensor + + add = add.apply(_get_indices, Tensor) + + # Substitute the indices + subs = {i: Index(i.name.upper(), spin=i.spin, space=i.space.upper()) for i in indices_a} + def _substitute(tensor): + return tensor.map_indices(subs) + + new_output.append(o.map_indices(subs)) + new_expr.append(add.apply(_substitute, Tensor)) + + # Optimise + output_expr = optimise(new_output, new_expr, strategy="exhaust" if spin != "uhf" else "greedy") + output_expr = [(o, e.apply(lambda tensor: tensor.canonicalise(), Tensor)) for o, e in output_expr] + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing + ignore_arguments = [] + preamble = "space = kwargs[\"space\"]" + preamble += "\nt1new = Namespace()" + preamble += "\nt2new = Namespace()" + preamble += "\nt3new = Namespace()" + if spin == "uhf": + preamble += "\nsoa = np.ones((t1.aa.shape[0],), dtype=bool)" + preamble += "\nsva = np.ones((t1.aa.shape[1],), dtype=bool)" + preamble += "\nsob = np.ones((t1.bb.shape[0],), dtype=bool)" + preamble += "\nsvb = np.ones((t1.bb.shape[1],), dtype=bool)" + preamble += "\nsOa = space[0].active[space[0].correlated][space[0].occupied[space[0].correlated]]" + preamble += "\nsVa = space[0].active[space[0].correlated][space[0].virtual[space[0].correlated]]" + preamble += "\nsOb = space[1].active[space[1].correlated][space[1].occupied[space[1].correlated]]" + preamble += "\nsVb = space[1].active[space[1].correlated][space[1].virtual[space[1].correlated]]" + preamble += "\n" + postamble = "" + inp_keys = {"aa": set(), "bb": set(), "aaaa": set(), "abab": set(), "bbbb": set()} + out_keys = {"aa": set(), "bb": set(), "aaaa": set(), "abab": set(), "bbbb": set()} + for o, e in output_expr: + if o.name.startswith("t") and not (o.name.startswith("tmp") or o.name.startswith("t3")): + spaces = "".join(tuple(i.space for i in o.indices)) + spins = "".join(tuple(i.spin for i in o.indices)) + if set(spaces) != {"o", "v"}: + inp_keys[spins].add(spaces) + for t in e.search_leaves(Tensor): + if isinstance(t, Tensor) and t.name.startswith("t") and not (t.name.startswith("tmp") or t.name.startswith("t3")): + spaces = "".join(tuple(i.space for i in t.indices)) + spins = "".join(tuple(i.spin for i in t.indices)) + inp_keys[spins].add(spaces) + for spins, inp_keys in inp_keys.items(): + for key in inp_keys: + slices = ", ".join(f"s{c}{s}" for c, s in zip(key, spins)) + preamble += f"\nt{len(key)//2}_{spins}_{key} = np.copy(t{len(key)//2}.{spins}[np.ix_({slices})])" + ignore_arguments.append(f"t{len(key)//2}_{spins}_{key}") + for spins, out_keys in out_keys.items(): + for key in out_keys: + slices = ", ".join(f"s{c}{s}" for c, s in zip(key, spins)) + postamble += f"\nt{len(key)//2}new.{spins} += _inflate(t{len(key)//2}new.{spins}.shape, np.ix_({slices}), t{len(key)//2}new_{spins}_{key})" + else: + preamble += "\nso = np.ones((t1.shape[0],), dtype=bool)" + preamble += "\nsv = np.ones((t1.shape[1],), dtype=bool)" + preamble += "\nsO = space.active[space.correlated][space.occupied[space.correlated]]" + preamble += "\nsV = space.active[space.correlated][space.virtual[space.correlated]]" + postamble = "" + inp_keys = set() + out_keys = set() + for o, e in output_expr: + if o.name.startswith("t") and not (o.name.startswith("tmp") or o.name.startswith("t3")): + spaces = "".join(tuple(i.space for i in o.indices)) + if set(spaces) != {"o", "v"}: + out_keys.add(spaces) + for t in e.search_leaves(Tensor): + if isinstance(t, Tensor) and t.name.startswith("t") and not (t.name.startswith("tmp") or t.name.startswith("t3")): + spaces = "".join(tuple(i.space for i in t.indices)) + if set(spaces) != {"o", "v"}: + inp_keys.add(spaces) + for key in sorted(inp_keys): + slices = ", ".join(f"s{c}" for c in key) + preamble += f"\nt{len(key)//2}_{key} = np.copy(t{len(key)//2}[np.ix_({slices})])" + ignore_arguments.append(f"t{len(key)//2}_{key}") + for key in sorted(out_keys): + slices = ", ".join(f"s{c}" for c in key) + postamble += f"\nt{len(key)//2}new += _inflate(t{len(key)//2}new.shape, np.ix_({slices}), t{len(key)//2}new_{key})" + preamble += "\n" + codegen( + "update_amps", + returns, + output_expr, + preamble = lambda: codegen.write(preamble), + postamble = lambda: codegen.write(postamble), + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_DCD.py b/ebcc/codegen/bootstrap_DCD.py new file mode 100644 index 00000000..dd16cad9 --- /dev/null +++ b/ebcc/codegen/bootstrap_DCD.py @@ -0,0 +1,87 @@ +""" +Generate the DCD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DCD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T2 contractions in pdaggerq format + # 10.1063/1.4944087 + terms = [ + ["-1.00", "P(i,j)", "f(k,j)", "t2(a,b,i,k)"], + ["+1.00", "P(a,b)", "f(a,c)", "t2(c,b,i,j)"], + ["+1.00", ""], + ["+0.50", "", "t2(a,b,k,l)"], + ["+0.50", "", "t2(c,d,i,j)"], + ["+1.00", "P(i,j)", "P(a,b)", "", "t2(a,c,i,k)"], + ["-0.25", "P(i,j)", "", "t2(d,c,i,k)", "t2(a,b,l,j)"], + ["-0.25", "P(a,b)", "", "t2(a,c,l,k)", "t2(d,b,i,j)"], + ["+0.50", "P(i,j)", "P(a,b)", "", "t2(a,c,i,k)", "t2(b,d,j,l)"], + ] + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, orders=[2]) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_DCSD.py b/ebcc/codegen/bootstrap_DCSD.py new file mode 100644 index 00000000..0d6af88b --- /dev/null +++ b/ebcc/codegen/bootstrap_DCSD.py @@ -0,0 +1,98 @@ +""" +Generate the DCSD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DCSD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # T1 residuals: + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t1 = pq.strings() + + # T2 residuals: + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t2 = pq.strings() + + # DCD: 10.1063/1.4944087 + terms_t2 = [term for term in terms_t2 if sum(t.startswith("t2") for t in term) < 2] + terms_t2 += [ + ["-0.25", "P(i,j)", "", "t2(d,c,i,k)", "t2(a,b,l,j)"], + ["-0.25", "P(a,b)", "", "t2(a,c,l,k)", "t2(d,b,i,j)"], + ["+0.50", "P(i,j)", "P(a,b)", "", "t2(a,c,i,k)", "t2(b,d,j,l)"], + ] + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() + diff --git a/ebcc/codegen/bootstrap_DFCC2.py b/ebcc/codegen/bootstrap_DFCC2.py new file mode 100644 index 00000000..4dd5d4a9 --- /dev/null +++ b/ebcc/codegen/bootstrap_DFCC2.py @@ -0,0 +1,549 @@ +""" +Generate the DF-CC2 code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DFCC2.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin, density_fit=True) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin, density_fit=True) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("L amplitudes"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e1(a,i)"], ["t1", "t2"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e1(a,i)", "f"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e1(a,i)", "v"], ["t1", "t2"]) + pq.simplify() + terms_l1 = pq.strings() + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t1"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t1"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "f"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "v"], ["t1"]) + pq.simplify() + terms_l2 = pq.strings() + + # Get the L amplitudes in albert format + output_expr, returns = get_amplitudes([terms_l1, terms_l2], spin, strategy="opt" if spin == "uhf" else "exhaust", which="l", density_fit=True) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_lams", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("1RDM"): + # Get the 1RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator(1.0, [f"e1({','.join(indices)})"], ["t1", "t2"]) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 1RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm1(terms, spin, density_fit=True) + + # Generate the 1RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing + if spin != "uhf": + codegen.write("rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]])") + else: + codegen.write("rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]])") + codegen.write("rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]])") + + codegen( + "make_rdm1_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("2RDM"): + # Get the 2RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator( + 1.0, [f"e2({indices[0]},{indices[1]},{indices[3]},{indices[2]})"], ["t1", "t2"] + ) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 2RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm2(terms, spin, strategy="trav" if spin == "uhf" else "exhaust", density_fit=True) + + # Generate the 2RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing, handle transpose + if spin != "uhf": + codegen.write("rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv).transpose((0, 2, 1, 3))") + else: + codegen.write("rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.aabb = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv).transpose((0, 2, 1, 3))") + codegen.write("del rdm2.abab") + + codegen( + "make_rdm2_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("IP-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)", "a*(j)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("EA-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a*(i)", "a(b)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("EE-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e1(i,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_matvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +with Stopwatch("L-IP-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a(i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_right_operators([["a*(a)", "a(j)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("L-EA-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a*(a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_right_operators([["a*(a)", "a*(b)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("L-EE-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e1(a,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e2(a,b,j,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_lmatvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_DFCCD.py b/ebcc/codegen/bootstrap_DFCCD.py new file mode 100644 index 00000000..5a99e7d5 --- /dev/null +++ b/ebcc/codegen/bootstrap_DFCCD.py @@ -0,0 +1,527 @@ +""" +Generate the DF-CCD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DFCCD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin, density_fit=True) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, orders=[2], density_fit=True) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("L amplitudes"): + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t2"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t2"]) + pq.set_left_operators([["l2"]]) + pq.add_st_operator( 1.0, ["f", "e2(a,b,j,i)"], ["t2"]) + pq.add_st_operator( 1.0, ["v", "e2(a,b,j,i)"], ["t2"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "f"], ["t2"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "v"], ["t2"]) + pq.simplify() + terms = pq.strings() + + # Get the L amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, strategy="opt" if spin == "uhf" else "exhaust", which="l", orders=[2], density_fit=True) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_lams", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("1RDM"): + # Get the 1RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + pq.clear() + pq.set_left_operators([["1"], ["l2"]]) + pq.add_st_operator(1.0, [f"e1({','.join(indices)})"], ["t2"]) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 1RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm1(terms, spin, density_fit=True) + + # Generate the 1RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing + if spin != "uhf": + codegen.write("rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]])") + else: + codegen.write("rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]])") + codegen.write("rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]])") + + codegen( + "make_rdm1_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("2RDM"): + # Get the 2RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + pq.clear() + pq.set_left_operators([["1"], ["l2"]]) + pq.add_st_operator( + 1.0, [f"e2({indices[0]},{indices[1]},{indices[3]},{indices[2]})"], ["t2"] + ) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 2RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm2(terms, spin, strategy="trav" if spin == "uhf" else "exhaust", density_fit=True) + + # Generate the 2RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing, handle transpose + if spin != "uhf": + codegen.write("rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv).transpose((0, 2, 1, 3))") + else: + codegen.write("rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.aabb = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv).transpose((0, 2, 1, 3))") + codegen.write("del rdm2.abab") + + codegen( + "make_rdm2_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("IP-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)", "a*(j)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("EA-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a*(i)", "a(b)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("EE-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e1(i,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_matvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +with Stopwatch("L-IP-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a(i)"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_right_operators([["a*(a)", "a(j)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("L-EA-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a*(a)"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_right_operators([["a*(a)", "a*(b)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("L-EE-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e1(a,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e2(a,b,j,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_lmatvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_DFCCSD.py b/ebcc/codegen/bootstrap_DFCCSD.py new file mode 100644 index 00000000..94a82d64 --- /dev/null +++ b/ebcc/codegen/bootstrap_DFCCSD.py @@ -0,0 +1,549 @@ +""" +Generate the DF-CCSD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DFCCSD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin, density_fit=True) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin, density_fit=True) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("L amplitudes"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e1(a,i)"], ["t1", "t2"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e1(a,i)"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e1(a,i)", "f"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e1(a,i)", "v"], ["t1", "t2"]) + pq.simplify() + terms_l1 = pq.strings() + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v", "e2(a,b,j,i)"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "f"], ["t1", "t2"]) + pq.add_st_operator(-1.0, ["e2(a,b,j,i)", "v"], ["t1", "t2"]) + pq.simplify() + terms_l2 = pq.strings() + + # Get the L amplitudes in albert format + output_expr, returns = get_amplitudes([terms_l1, terms_l2], spin, strategy="opt" if spin == "uhf" else "exhaust", which="l", density_fit=True) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_lams", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("1RDM"): + # Get the 1RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator(1.0, [f"e1({','.join(indices)})"], ["t1", "t2"]) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 1RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm1(terms, spin, density_fit=True) + + # Generate the 1RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing + if spin != "uhf": + codegen.write("rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]])") + else: + codegen.write("rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]])") + codegen.write("rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]])") + + codegen( + "make_rdm1_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("2RDM"): + # Get the 2RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator( + 1.0, [f"e2({indices[0]},{indices[1]},{indices[3]},{indices[2]})"], ["t1", "t2"] + ) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 2RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm2(terms, spin, strategy="trav" if spin == "uhf" else "exhaust", density_fit=True) + + # Generate the 2RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing, handle transpose + if spin != "uhf": + codegen.write("rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv).transpose((0, 2, 1, 3))") + else: + codegen.write("rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.aabb = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv).transpose((0, 2, 1, 3))") + codegen.write("del rdm2.abab") + + codegen( + "make_rdm2_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("IP-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)", "a*(j)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("EA-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a*(i)", "a(b)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("EE-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e1(i,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_matvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +with Stopwatch("L-IP-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a(i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_right_operators([["a*(a)", "a(j)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("L-EA-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a*(a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_right_operators([["a*(a)", "a*(b)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("L-EE-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e1(a,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e2(a,b,j,i)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_lmatvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_DFDCD.py b/ebcc/codegen/bootstrap_DFDCD.py new file mode 100644 index 00000000..a3c51720 --- /dev/null +++ b/ebcc/codegen/bootstrap_DFDCD.py @@ -0,0 +1,87 @@ +""" +Generate the DF-DCD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DFDCD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin, density_fit=True) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T2 contractions in pdaggerq format + # 10.1063/1.4944087 + terms = [ + ["-1.00", "P(i,j)", "f(k,j)", "t2(a,b,i,k)"], + ["+1.00", "P(a,b)", "f(a,c)", "t2(c,b,i,j)"], + ["+1.00", ""], + ["+0.50", "", "t2(a,b,k,l)"], + ["+0.50", "", "t2(c,d,i,j)"], + ["+1.00", "P(i,j)", "P(a,b)", "", "t2(a,c,i,k)"], + ["-0.25", "P(i,j)", "", "t2(d,c,i,k)", "t2(a,b,l,j)"], + ["-0.25", "P(a,b)", "", "t2(a,c,l,k)", "t2(d,b,i,j)"], + ["+0.50", "P(i,j)", "P(a,b)", "", "t2(a,c,i,k)", "t2(b,d,j,l)"], + ] + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, orders=[2], density_fit=True) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_DFDCSD.py b/ebcc/codegen/bootstrap_DFDCSD.py new file mode 100644 index 00000000..2d7eee11 --- /dev/null +++ b/ebcc/codegen/bootstrap_DFDCSD.py @@ -0,0 +1,98 @@ +""" +Generate the DF-DCSD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DFDCSD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin, density_fit=True) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # T1 residuals: + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t1 = pq.strings() + + # T2 residuals: + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t2 = pq.strings() + + # DCD: 10.1063/1.4944087 + terms_t2 = [term for term in terms_t2 if sum(t.startswith("t2") for t in term) < 2] + terms_t2 += [ + ["-0.25", "P(i,j)", "", "t2(d,c,i,k)", "t2(a,b,l,j)"], + ["-0.25", "P(a,b)", "", "t2(a,c,l,k)", "t2(d,b,i,j)"], + ["+0.50", "P(i,j)", "P(a,b)", "", "t2(a,c,i,k)", "t2(b,d,j,l)"], + ] + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin, density_fit=True) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() + diff --git a/ebcc/codegen/bootstrap_DFLCCD.py b/ebcc/codegen/bootstrap_DFLCCD.py new file mode 100644 index 00000000..fa30dc2b --- /dev/null +++ b/ebcc/codegen/bootstrap_DFLCCD.py @@ -0,0 +1,86 @@ +""" +Generate the DFLCCD code. +""" + +import itertools +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DFLCCD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +def add_st_operator(factor, left_operators, right_operators): + pq.add_operator_product(factor, left_operators) + pq.add_commutator(factor, left_operators, right_operators) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + add_st_operator(1.0, ["f"], ["t2"]) + add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin, density_fit=True) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + add_st_operator(1.0, ["f"], ["t2"]) + add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, orders=[2], density_fit=True) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_DFLCCSD.py b/ebcc/codegen/bootstrap_DFLCCSD.py new file mode 100644 index 00000000..6bacbf71 --- /dev/null +++ b/ebcc/codegen/bootstrap_DFLCCSD.py @@ -0,0 +1,94 @@ +""" +Generate the DFLCCSD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DFLCCSD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +def add_st_operator(factor, left_operators, right_operators): + pq.add_operator_product(factor, left_operators) + for right_operator in right_operators: + pq.add_commutator(factor, left_operators, [right_operator]) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + add_st_operator(1.0, ["f"], ["t1", "t2"]) + add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin, density_fit=True) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + add_st_operator(1.0, ["f"], ["t1", "t2"]) + add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + add_st_operator(1.0, ["f"], ["t1", "t2"]) + add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin, density_fit=True) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_DFQCISD.py b/ebcc/codegen/bootstrap_DFQCISD.py new file mode 100644 index 00000000..efbe6384 --- /dev/null +++ b/ebcc/codegen/bootstrap_DFQCISD.py @@ -0,0 +1,647 @@ +""" +Generate the DF-QCISD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DFQCISD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin, density_fit=True) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin, density_fit=True) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("L amplitudes"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_commutator(1.0, ["f", "e1(a,i)"], ["t1"]) + pq.add_commutator(1.0, ["v", "e1(a,i)"], ["t1"]) + pq.add_commutator(1.0, ["f", "e1(a,i)"], ["t2"]) + pq.add_commutator(1.0, ["v", "e1(a,i)"], ["t2"]) + pq.add_double_commutator(1.0, ["f", "e1(a,i)"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v", "e1(a,i)"], ["t1"], ["t2"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_commutator(1.0, ["f", "e1(a,i)"], ["t1"]) + pq.add_commutator(1.0, ["v", "e1(a,i)"], ["t1"]) + pq.add_commutator(1.0, ["f", "e1(a,i)"], ["t2"]) + pq.add_commutator(1.0, ["v", "e1(a,i)"], ["t2"]) + pq.add_double_commutator(1.0, ["f", "e1(a,i)"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v", "e1(a,i)"], ["t1"], ["t2"]) + pq.add_commutator(-1.0, ["e1(a,i)", "f"], ["t1"]) + pq.add_commutator(-1.0, ["e1(a,i)", "v"], ["t1"]) + pq.add_commutator(-1.0, ["e1(a,i)", "f"], ["t2"]) + pq.add_commutator(-1.0, ["e1(a,i)", "v"], ["t2"]) + pq.add_double_commutator(-1.0, ["e1(a,i)", "f"], ["t1"], ["t2"]) + pq.add_double_commutator(-1.0, ["e1(a,i)", "v"], ["t1"], ["t2"]) + pq.simplify() + terms_l1 = pq.strings() + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t1"]) + pq.add_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t1"]) + pq.add_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t2"]) + pq.add_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t2"]) + pq.add_double_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t1"], ["t2"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t1"]) + pq.add_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t1"]) + pq.add_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t2"]) + pq.add_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t2"]) + pq.add_double_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t1"], ["t2"]) + pq.add_commutator(-1.0, ["e2(a,b,j,i)", "f"], ["t1"]) + pq.add_commutator(-1.0, ["e2(a,b,j,i)", "v"], ["t1"]) + pq.add_commutator(-1.0, ["e2(a,b,j,i)", "f"], ["t2"]) + pq.add_commutator(-1.0, ["e2(a,b,j,i)", "v"], ["t2"]) + pq.add_double_commutator(-1.0, ["e2(a,b,j,i)", "f"], ["t1"], ["t2"]) + pq.add_double_commutator(-1.0, ["e2(a,b,j,i)", "v"], ["t1"], ["t2"]) + pq.simplify() + terms_l2 = pq.strings() + + # Get the L amplitudes in albert format + output_expr, returns = get_amplitudes([terms_l1, terms_l2], spin, strategy="opt" if spin == "uhf" else "exhaust", which="l", density_fit=True) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_lams", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("1RDM"): + # Get the 1RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator(1.0, [f"e1({','.join(indices)})"], ["t1", "t2"]) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 1RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm1(terms, spin, density_fit=True) + + # Generate the 1RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing + if spin != "uhf": + codegen.write("rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]])") + else: + codegen.write("rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]])") + codegen.write("rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]])") + + codegen( + "make_rdm1_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("2RDM"): + # Get the 2RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator( + 1.0, [f"e2({indices[0]},{indices[1]},{indices[3]},{indices[2]})"], ["t1", "t2"] + ) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 2RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm2(terms, spin, strategy="trav" if spin == "uhf" else "exhaust", density_fit=True) + + # Generate the 2RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing, handle transpose + if spin != "uhf": + codegen.write("rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv).transpose((0, 2, 1, 3))") + else: + codegen.write("rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.aabb = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv).transpose((0, 2, 1, 3))") + codegen.write("del rdm2.abab") + + codegen( + "make_rdm2_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("IP-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)", "a*(j)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("EA-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a*(i)", "a(b)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("EE-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e1(i,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee", density_fit=True) + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_matvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +with Stopwatch("L-IP-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a(i)"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_right_operators([["a*(a)", "a(j)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("L-EA-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a*(a)"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_right_operators([["a*(a)", "a*(b)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("L-EE-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e1(a,i)"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e2(a,b,j,i)"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee", density_fit=True) + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_lmatvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_DFwdwwrwCCD.py b/ebcc/codegen/bootstrap_DFwdwwrwCCD.py new file mode 100644 index 00000000..e00a6e49 --- /dev/null +++ b/ebcc/codegen/bootstrap_DFwdwwrwCCD.py @@ -0,0 +1,84 @@ +""" +Generate the DF-drCCD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DFwdwwrwCCD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin, density_fit=True) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T2 contractions in pdaggerq format + # arXiv:1804.01037 + terms = [ + ["-1.00", "P(i,j)", "f(k,j)", "t2(a,b,i,k)"], + ["+1.00", "P(a,b)", "f(a,c)", "t2(c,b,i,j)"], + ["+1.00", ""], + ["+1.00", "t2(a,c,i,k)", ""], + ["+1.00", "t2(c,b,k,j)", ""], + ["+1.00", "t2(a,c,i,k)", "t2(d,b,l,j)", ""], + ] + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, orders=[2], density_fit=True) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_DFwrwCCD.py b/ebcc/codegen/bootstrap_DFwrwCCD.py new file mode 100644 index 00000000..3ee13534 --- /dev/null +++ b/ebcc/codegen/bootstrap_DFwrwCCD.py @@ -0,0 +1,84 @@ +""" +Generate the DF-rCCD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}DFwrwCCD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin, density_fit=True) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T2 contractions in pdaggerq format + # arXiv:1804.01037 + terms = [ + ["-1.00", "P(i,j)", "f(k,j)", "t2(a,b,i,k)"], + ["+1.00", "P(a,b)", "f(a,c)", "t2(c,b,i,j)"], + ["+1.00", ""], + ["+1.00", "t2(a,c,i,k)", ""], + ["+1.00", "t2(c,b,k,j)", ""], + ["+1.00", "t2(a,c,i,k)", "t2(d,b,l,j)", ""], + ] + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, orders=[2], density_fit=True) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_LCCD.py b/ebcc/codegen/bootstrap_LCCD.py new file mode 100644 index 00000000..a49ab7cc --- /dev/null +++ b/ebcc/codegen/bootstrap_LCCD.py @@ -0,0 +1,86 @@ +""" +Generate the LCCD code. +""" + +import itertools +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}LCCD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +def add_st_operator(factor, left_operators, right_operators): + pq.add_operator_product(factor, left_operators) + pq.add_commutator(factor, left_operators, right_operators) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + add_st_operator(1.0, ["f"], ["t2"]) + add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + add_st_operator(1.0, ["f"], ["t2"]) + add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, orders=[2]) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_LCCSD.py b/ebcc/codegen/bootstrap_LCCSD.py new file mode 100644 index 00000000..8a83646b --- /dev/null +++ b/ebcc/codegen/bootstrap_LCCSD.py @@ -0,0 +1,94 @@ +""" +Generate the LCCSD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}LCCSD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +def add_st_operator(factor, left_operators, right_operators): + pq.add_operator_product(factor, left_operators) + for right_operator in right_operators: + pq.add_commutator(factor, left_operators, [right_operator]) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + add_st_operator(1.0, ["f"], ["t1", "t2"]) + add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + add_st_operator(1.0, ["f"], ["t1", "t2"]) + add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + add_st_operator(1.0, ["f"], ["t1", "t2"]) + add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_MPn.py b/ebcc/codegen/bootstrap_MPn.py new file mode 100644 index 00000000..45f7925b --- /dev/null +++ b/ebcc/codegen/bootstrap_MPn.py @@ -0,0 +1,345 @@ +""" +Generate the MPn code. +""" + +import itertools +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom +from ebcc.codegen import bootstrap_hugenholtz as hugenholtz + +# Get the spin case +spin = sys.argv[1] +order = int(sys.argv[2]) + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}MP{order}.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + terms = sum([ + [hugenholtz.get_pdaggerq(graph) for graph in hugenholtz.get_hugenholtz_diagrams(n)] + for n in range(2, order+1) + ], []) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +if order == 2: + pq = pdaggerq.pq_helper("fermi") + pq.set_print_level(0) + + with Stopwatch("1RDM"): + # Get the 1RDM contractions in pdaggerq format + terms = { + ("oo", "ij"): [["+1.0", "d(i,j)"], ["-0.5", "t2(b,a,k,i)", "l2(k,j,b,a)"]], + ("vv", "ab"): [["+0.5", "t2(b,c,i,j)", "l2(i,j,a,c)"]] + } + + # Get the 1RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm1(terms, spin) + + # Generate the 1RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing + if spin != "uhf": + codegen.write("rdm1.ov = np.zeros((t2.shape[0], t2.shape[-1]))") + codegen.write("rdm1.vo = np.zeros((t2.shape[-1], t2.shape[0]))") + codegen.write("rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]])") + else: + codegen.write("rdm1.aa.ov = np.zeros((t2.aaaa.shape[0], t2.aaaa.shape[-1]))") + codegen.write("rdm1.aa.vo = np.zeros((t2.aaaa.shape[-1], t2.aaaa.shape[0]))") + codegen.write("rdm1.bb.ov = np.zeros((t2.bbbb.shape[0], t2.bbbb.shape[-1]))") + codegen.write("rdm1.bb.vo = np.zeros((t2.bbbb.shape[-1], t2.bbbb.shape[0]))") + codegen.write("rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]])") + codegen.write("rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]])") + + codegen( + "make_rdm1_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + + with Stopwatch("2RDM"): + # Get the 2RDM contractions in pdaggerq format + terms = { + ("oovv", "ijab"): [["t2(a,b,i,j)"]], + ("vvoo", "abij"): [["l2(i,j,a,b)"]], + } + + # Get the 2RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm2(terms, spin, strategy="trav" if spin == "uhf" else "exhaust") + + # Generate the 2RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing, handle transpose + if spin != "uhf": + for key in itertools.product("ov", repeat=4): + if tuple(key) in {("o", "o", "v", "v") , ("v", "v", "o", "o")}: + continue + i, j, k, l = [0 if k == "o" else -1 for k in key] + codegen.write(f"rdm2.{''.join(key)} = np.zeros((t2.shape[{i}], t2.shape[{j}], t2.shape[{k}], t2.shape[{l}]))") + codegen.write("rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv).transpose((0, 2, 1, 3))") + else: + for s in ("aaaa", "abab", "bbbb"): + for key in itertools.product("ov", repeat=4): + if tuple(key) in {("o", "o", "v", "v") , ("v", "v", "o", "o")}: + continue + i, j, k, l = [0 if k == "o" else -1 for k in key] + si, sj, sk, sl = s + codegen.write(f"rdm2.{si+sj+sk+sl}.{''.join(key)} = np.zeros((t2.{si * 4}.shape[{i}], t2.{sj * 4}.shape[{j}], t2.{sk * 4}.shape[{k}], t2.{sl * 4}.shape[{l}]))") + codegen.write("rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.aabb = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv).transpose((0, 2, 1, 3))") + codegen.write("del rdm2.abab") + codegen.write("rdm1 = make_rdm1_f(t2=t2, l2=l2)") + if spin == "uhf": + codegen.write("delta = Namespace(") + codegen.write(" aa=np.diag(np.concatenate([np.ones(t2.aaaa.shape[0]), np.zeros(t2.aaaa.shape[-1])])),") + codegen.write(" bb=np.diag(np.concatenate([np.ones(t2.bbbb.shape[0]), np.zeros(t2.bbbb.shape[-1])])),") + codegen.write(")") + codegen.write("rdm1.aa -= delta.aa") + codegen.write("rdm1.bb -= delta.bb") + codegen.write("rdm2.aaaa += einsum(delta.aa, (0, 1), rdm1.aa, (3, 2), (0, 1, 2, 3))") + codegen.write("rdm2.aaaa += einsum(rdm1.aa, (1, 0), delta.aa, (2, 3), (0, 1, 2, 3))") + codegen.write("rdm2.aaaa -= einsum(delta.aa, (0, 3), rdm1.aa, (2, 1), (0, 1, 2, 3))") + codegen.write("rdm2.aaaa -= einsum(rdm1.aa, (0, 3), delta.aa, (1, 2), (0, 1, 2, 3))") + codegen.write("rdm2.aaaa += einsum(delta.aa, (0, 1), delta.aa, (2, 3), (0, 1, 2, 3))") + codegen.write("rdm2.aaaa -= einsum(delta.aa, (0, 3), delta.aa, (1, 2), (0, 1, 2, 3))") + codegen.write("rdm2.bbbb += einsum(delta.bb, (0, 1), rdm1.bb, (3, 2), (0, 1, 2, 3))") + codegen.write("rdm2.bbbb += einsum(rdm1.bb, (1, 0), delta.bb, (2, 3), (0, 1, 2, 3))") + codegen.write("rdm2.bbbb -= einsum(delta.bb, (0, 3), rdm1.bb, (2, 1), (0, 1, 2, 3))") + codegen.write("rdm2.bbbb -= einsum(rdm1.bb, (0, 3), delta.bb, (1, 2), (0, 1, 2, 3))") + codegen.write("rdm2.bbbb += einsum(delta.bb, (0, 1), delta.bb, (2, 3), (0, 1, 2, 3))") + codegen.write("rdm2.bbbb -= einsum(delta.bb, (0, 3), delta.bb, (1, 2), (0, 1, 2, 3))") + codegen.write("rdm2.aabb += einsum(delta.aa, (0, 1), rdm1.bb, (3, 2), (0, 1, 2, 3))") + codegen.write("rdm2.aabb += einsum(rdm1.aa, (1, 0), delta.bb, (2, 3), (0, 1, 2, 3))") + codegen.write("rdm2.aabb += einsum(delta.aa, (0, 1), delta.bb, (2, 3), (0, 1, 2, 3))") + elif spin == "ghf": + codegen.write("delta = np.diag(np.concatenate([np.ones(t2.shape[0]), np.zeros(t2.shape[-1])]))") + codegen.write("rdm1 -= delta") + codegen.write("rdm2 += einsum(delta, (0, 1), rdm1, (3, 2), (0, 1, 2, 3))") + codegen.write("rdm2 += einsum(rdm1, (1, 0), delta, (2, 3), (0, 1, 2, 3))") + codegen.write("rdm2 -= einsum(delta, (0, 3), rdm1, (2, 1), (0, 1, 2, 3))") + codegen.write("rdm2 -= einsum(rdm1, (0, 3), delta, (1, 2), (0, 1, 2, 3))") + codegen.write("rdm2 += einsum(delta, (0, 1), delta, (2, 3), (0, 1, 2, 3))") + codegen.write("rdm2 -= einsum(delta, (0, 3), delta, (1, 2), (0, 1, 2, 3))") + elif spin == "rhf": + codegen.write("delta = np.diag(np.concatenate([np.ones(t2.shape[0]), np.zeros(t2.shape[-1])]))") + codegen.write("rdm1 -= delta * 2") + codegen.write("rdm2 += einsum(delta, (0, 1), rdm1, (3, 2), (0, 1, 2, 3)) * 2") + codegen.write("rdm2 += einsum(rdm1, (1, 0), delta, (2, 3), (0, 1, 2, 3)) * 2") + codegen.write("rdm2 -= einsum(delta, (0, 3), rdm1, (2, 1), (0, 1, 2, 3))") + codegen.write("rdm2 -= einsum(rdm1, (0, 3), delta, (1, 2), (0, 1, 2, 3))") + codegen.write("rdm2 += einsum(delta, (0, 1), delta, (2, 3), (0, 1, 2, 3)) * 4") + codegen.write("rdm2 -= einsum(delta, (0, 3), delta, (1, 2), (0, 1, 2, 3)) * 2") + + codegen( + "make_rdm2_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + + with Stopwatch("IP-EOM"): + # Get the R1 contractions in pdaggerq format + terms_r1 = [ + ["-1.0", "f(j,i)", "r1(j)"], + ["+0.5", "", "r2(a,k,j)"], + ["-0.25", "", "t2(a,b,i,j)", "r1(k)"], + ["-0.25", "", "t2(a,b,k,j)", "r1(k)"], + ] + + # Get the R2 contractions in pdaggerq format + terms_r2 = [ + ["-1.0", "", "r1(k)"], + ["+1.0", "f(a,b)", "r2(b,i,j)"], + ["-1.0", "P(i,j)", "f(k,j)", "r2(a,i,k)"], + ] + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + + with Stopwatch("EA-EOM"): + # Get the R1 contractions in pdaggerq format + terms_r1 = [ + ["+1.0", "f(a,b)", "r1(b)"], + ["-0.5", "", "r2(b,c,i)"], + ["-0.25", "", "t2(b,a,j,i)", "r1(c)"], + ["-0.25", "", "t2(b,c,j,i)", "r1(c)"], + ] + + # Get the R2 contractions in pdaggerq format + terms_r2 = [ + ["-1.0", "f(j,i)", "r2(a,b,j)"], + ["+1.0", "P(a,b)", "f(a,c)", "r2(c,b,i)"], + ["+1.0", "", "r1(c)"], + ] + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + + if spin == "ghf": # FIXME + with Stopwatch("EE-EOM"): + # Get the R1 contractions in pdaggerq format + terms_r1 = [ + ["-1.0", "f(j,i)", "r1(a,j)"], + ["+1.0", "f(a,b)", "r1(b,i)"], + ["+1.0", "", "r1(b,j)"], + ["-0.5", "", "r2(b,a,k,j)"], + ["-0.5", "", "r2(b,c,i,j)"], + ["-0.5", "", "r1(a,k)", "t2(b,c,i,j)"], + ["-0.5", "", "r1(c,i)", "t2(b,a,k,j)"], + ["+1.0", "", "r1(c,k)", "t2(b,a,i,j)"], + ] + + # Get the R2 contractions in pdaggerq format + terms_r2 = [ + ["-1.0", "P(i,j)", "f(k,j)", "r2(a,b,i,k)"], + ["+1.0", "P(a,b)", "f(a,c)", "r2(c,b,i,j)"], + ["+1.0", "P(a,b)", "", "r1(b,k)"], + ["+1.0", "P(i,j)", "", "r1(c,i)"], + ] + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_matvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_QCISD.py b/ebcc/codegen/bootstrap_QCISD.py new file mode 100644 index 00000000..126cb959 --- /dev/null +++ b/ebcc/codegen/bootstrap_QCISD.py @@ -0,0 +1,647 @@ +""" +Generate the QCISD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}QCISD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("L amplitudes"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_commutator(1.0, ["f", "e1(a,i)"], ["t1"]) + pq.add_commutator(1.0, ["v", "e1(a,i)"], ["t1"]) + pq.add_commutator(1.0, ["f", "e1(a,i)"], ["t2"]) + pq.add_commutator(1.0, ["v", "e1(a,i)"], ["t2"]) + pq.add_double_commutator(1.0, ["f", "e1(a,i)"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v", "e1(a,i)"], ["t1"], ["t2"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_commutator(1.0, ["f", "e1(a,i)"], ["t1"]) + pq.add_commutator(1.0, ["v", "e1(a,i)"], ["t1"]) + pq.add_commutator(1.0, ["f", "e1(a,i)"], ["t2"]) + pq.add_commutator(1.0, ["v", "e1(a,i)"], ["t2"]) + pq.add_double_commutator(1.0, ["f", "e1(a,i)"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v", "e1(a,i)"], ["t1"], ["t2"]) + pq.add_commutator(-1.0, ["e1(a,i)", "f"], ["t1"]) + pq.add_commutator(-1.0, ["e1(a,i)", "v"], ["t1"]) + pq.add_commutator(-1.0, ["e1(a,i)", "f"], ["t2"]) + pq.add_commutator(-1.0, ["e1(a,i)", "v"], ["t2"]) + pq.add_double_commutator(-1.0, ["e1(a,i)", "f"], ["t1"], ["t2"]) + pq.add_double_commutator(-1.0, ["e1(a,i)", "v"], ["t1"], ["t2"]) + pq.simplify() + terms_l1 = pq.strings() + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.set_right_operators([["1"]]) + pq.add_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t1"]) + pq.add_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t1"]) + pq.add_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t2"]) + pq.add_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t2"]) + pq.add_double_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t1"], ["t2"]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t1"]) + pq.add_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t1"]) + pq.add_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t2"]) + pq.add_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t2"]) + pq.add_double_commutator(1.0, ["f", "e2(a,b,j,i)"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v", "e2(a,b,j,i)"], ["t1"], ["t2"]) + pq.add_commutator(-1.0, ["e2(a,b,j,i)", "f"], ["t1"]) + pq.add_commutator(-1.0, ["e2(a,b,j,i)", "v"], ["t1"]) + pq.add_commutator(-1.0, ["e2(a,b,j,i)", "f"], ["t2"]) + pq.add_commutator(-1.0, ["e2(a,b,j,i)", "v"], ["t2"]) + pq.add_double_commutator(-1.0, ["e2(a,b,j,i)", "f"], ["t1"], ["t2"]) + pq.add_double_commutator(-1.0, ["e2(a,b,j,i)", "v"], ["t1"], ["t2"]) + pq.simplify() + terms_l2 = pq.strings() + + # Get the L amplitudes in albert format + output_expr, returns = get_amplitudes([terms_l1, terms_l2], spin, strategy="opt" if spin == "uhf" else "exhaust", which="l") + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_lams", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("1RDM"): + # Get the 1RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator(1.0, [f"e1({','.join(indices)})"], ["t1", "t2"]) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 1RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm1(terms, spin) + + # Generate the 1RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing + if spin != "uhf": + codegen.write("rdm1 = np.block([[rdm1.oo, rdm1.ov], [rdm1.vo, rdm1.vv]])") + else: + codegen.write("rdm1.aa = np.block([[rdm1.aa.oo, rdm1.aa.ov], [rdm1.aa.vo, rdm1.aa.vv]])") + codegen.write("rdm1.bb = np.block([[rdm1.bb.oo, rdm1.bb.ov], [rdm1.bb.vo, rdm1.bb.vv]])") + + codegen( + "make_rdm1_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("2RDM"): + # Get the 2RDM contractions in pdaggerq format + terms = {} + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + pq.clear() + pq.set_left_operators([["1"], ["l1"], ["l2"]]) + pq.add_st_operator( + 1.0, [f"e2({indices[0]},{indices[1]},{indices[3]},{indices[2]})"], ["t1", "t2"] + ) + pq.simplify() + terms[sectors, indices] = pq.strings() + + # Get the 2RDM in albert format + output_expr, returns, deltas, deltas_sources = get_rdm2(terms, spin, strategy="trav" if spin == "uhf" else "exhaust") + + # Generate the 2RDM code + for name, codegen in code_generators.items(): + def preamble(): + done = set() + for delta, delta_source in zip(deltas, deltas_sources): + if delta in done: + continue + shape_source_index = 0 if delta.external_indices[0].space == "o" else -1 + codegen.tensor_declaration( + delta, + is_identity=True, + shape_source=delta_source, + shape_source_index=shape_source_index, + ) + codegen._tensor_declared.add(_tensor_info(delta)) + done.add(delta) + + def postamble(): + if name != "einsum": + raise NotImplementedError # FIXME remove packing, handle transpose + if spin != "uhf": + codegen.write("rdm2 = pack_2e(rdm2.oooo, rdm2.ooov, rdm2.oovo, rdm2.ovoo, rdm2.vooo, rdm2.oovv, rdm2.ovov, rdm2.ovvo, rdm2.voov, rdm2.vovo, rdm2.vvoo, rdm2.ovvv, rdm2.vovv, rdm2.vvov, rdm2.vvvo, rdm2.vvvv).transpose((0, 2, 1, 3))") + else: + codegen.write("rdm2.aaaa = pack_2e(rdm2.aaaa.oooo, rdm2.aaaa.ooov, rdm2.aaaa.oovo, rdm2.aaaa.ovoo, rdm2.aaaa.vooo, rdm2.aaaa.oovv, rdm2.aaaa.ovov, rdm2.aaaa.ovvo, rdm2.aaaa.voov, rdm2.aaaa.vovo, rdm2.aaaa.vvoo, rdm2.aaaa.ovvv, rdm2.aaaa.vovv, rdm2.aaaa.vvov, rdm2.aaaa.vvvo, rdm2.aaaa.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.aabb = pack_2e(rdm2.abab.oooo, rdm2.abab.ooov, rdm2.abab.oovo, rdm2.abab.ovoo, rdm2.abab.vooo, rdm2.abab.oovv, rdm2.abab.ovov, rdm2.abab.ovvo, rdm2.abab.voov, rdm2.abab.vovo, rdm2.abab.vvoo, rdm2.abab.ovvv, rdm2.abab.vovv, rdm2.abab.vvov, rdm2.abab.vvvo, rdm2.abab.vvvv).transpose((0, 2, 1, 3))") + codegen.write("rdm2.bbbb = pack_2e(rdm2.bbbb.oooo, rdm2.bbbb.ooov, rdm2.bbbb.oovo, rdm2.bbbb.ovoo, rdm2.bbbb.vooo, rdm2.bbbb.oovv, rdm2.bbbb.ovov, rdm2.bbbb.ovvo, rdm2.bbbb.voov, rdm2.bbbb.vovo, rdm2.bbbb.vvoo, rdm2.bbbb.ovvv, rdm2.bbbb.vovv, rdm2.bbbb.vvov, rdm2.bbbb.vvvo, rdm2.bbbb.vvvv).transpose((0, 2, 1, 3))") + codegen.write("del rdm2.abab") + + codegen( + "make_rdm2_f", + returns, + output_expr, + preamble=preamble, + postamble=postamble, + ) + +with Stopwatch("IP-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("IP") + pq.set_left_operators([["a*(i)", "a*(j)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("EA-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EA") + pq.set_left_operators([["a*(i)", "a(b)", "a(a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("EE-EOM"): + # Get the R1 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e1(i,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the R2 contractions in pdaggerq format + pq.clear() + pq.set_right_operators_type("EE") + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.set_right_operators([["r1"], ["r2"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the R amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee") + + # Generate the R amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_matvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the R amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_matvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +with Stopwatch("L-IP-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a(i)"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("IP") + pq.set_right_operators([["a*(a)", "a(j)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ip") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ip", + returns_r, + output_expr_r, + as_dict=True, + ) + +with Stopwatch("L-EA-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["a*(a)"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EA") + pq.set_right_operators([["a*(a)", "a*(b)", "a(i)"]]) + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="exhaust", which="ea") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ea", + returns_r, + output_expr_r, + as_dict=True, + ) + +if spin == "ghf": # FIXME + with Stopwatch("L-EE-EOM"): + # Get the L1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e1(a,i)"]]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(1.0, ["f"], ["t1"], ["t2"]) + pq.add_double_commutator(1.0, ["v"], ["t1"], ["t2"]) + pq.simplify() + terms_r1 = pq.strings() + terms_r1 = remove_reference_energy_eom(terms_r1) + + # Get the L2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators_type("EE") + pq.set_left_operators([["l1"], ["l2"]]) + pq.set_right_operators([["e2(a,b,j,i)"]]) + pq.add_operator_product(1.0, ["f"]) + pq.add_operator_product(1.0, ["v"]) + pq.add_commutator(1.0, ["f"], ["t1"]) + pq.add_commutator(1.0, ["v"], ["t1"]) + pq.add_commutator(1.0, ["f"], ["t2"]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.add_double_commutator(0.5, ["f"], ["t2"], ["t2"]) + pq.add_double_commutator(0.5, ["v"], ["t2"], ["t2"]) + pq.simplify() + terms_r2 = pq.strings() + terms_r2 = remove_reference_energy_eom(terms_r2) + + # Get the L amplitudes in albert format + output_expr_nr, returns_nr, output_expr_r, returns_r = get_eom([terms_r1, terms_r2], spin, strategy="trav", which="ee") + + # Generate the L amplitude intermediates code + for name, codegen in code_generators.items(): + codegen( + "hbar_lmatvec_ee_intermediates", + returns_nr, + output_expr_nr, + as_dict=True, + ) + + # Generate the L amplitude code + for name, codegen in code_generators.items(): + def postamble(): + if spin == "uhf": + r2_abab = Tensor( + Index("i", space="o", spin="a"), + Index("j", space="v", spin="b"), + Index("a", space="o", spin="a"), + Index("b", space="v", spin="b"), + name="r2new", + ) + r2_baba = Tensor( + Index("i", space="o", spin="b"), + Index("j", space="v", spin="a"), + Index("a", space="o", spin="b"), + Index("b", space="v", spin="a"), + name="r2new", + ) + codegen.tensor_expression(r2_baba, r2_abab, is_return=True) + + codegen( + "hbar_lmatvec_ee", + returns_r, + output_expr_r, + postamble=postamble, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_common.py b/ebcc/codegen/bootstrap_common.py new file mode 100644 index 00000000..c62005cf --- /dev/null +++ b/ebcc/codegen/bootstrap_common.py @@ -0,0 +1,202 @@ +"""Common functionality for the bootstrap scripts for `ebcc`. +""" + +from albert.qc._pdaggerq import import_from_pdaggerq +from albert.qc.spin import ghf_to_rhf, ghf_to_uhf, get_amplitude_spins, get_density_spins +from albert.qc.decomp import density_fit as _density_fit +from albert.opt import optimise +from albert.opt.tools import optimise_eom +from albert.tensor import Tensor + + +def spin_integrate(expr, spin): + """Perform the spin integration on the given expressions.""" + if spin == "ghf": + return (expr,) + elif spin == "uhf": + return ghf_to_uhf(expr) + else: + return (ghf_to_rhf(expr),) + + +def get_energy(terms, spin, strategy="exhaust", density_fit=False): + """Get the energy expressions from `pdaggerq` terms.""" + expr = import_from_pdaggerq(terms) + expr = spin_integrate(expr, spin) + if density_fit: + expr = tuple(_density_fit(e) for e in expr) + output = tuple(Tensor(name="e_cc") for _ in range(len(expr))) + output_expr = optimise(output, expr, strategy=strategy) + returns = (Tensor(name="e_cc"),) + return output_expr, returns + + +def get_amplitudes(terms_grouped, spin, strategy="exhaust", which="t", orders=None, density_fit=False, optimise_kwargs={}): + """Get the amplitude expressions from `pdaggerq` terms.""" + expr = [] + output = [] + returns = [] + if orders is None: + orders = range(1, len(terms_grouped) + 1) + for order, terms in zip(orders, terms_grouped): + n = order - 1 + if which == "t": + indices = "ijkl"[: n + 1] + "abcd"[: n + 1] + else: + indices = "abcd"[: n + 1] + "ijkl"[: n + 1] + for index_spins in get_amplitude_spins(indices[: n + 1], indices[n + 1 :], spin): + expr_n = import_from_pdaggerq(terms, index_spins=index_spins) + expr_n = spin_integrate(expr_n, spin) + if density_fit: + expr_n = tuple(_density_fit(e) for e in expr_n) + output_n = [Tensor(*tuple(sorted(e.external_indices, key=lambda i: indices.index(i.name))), name=f"{which}{order}new") for e in expr_n] + returns_n = (output_n[0],) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + if strategy is not None: + output_expr = optimise(output, expr, strategy="exhaust", **optimise_kwargs) + else: + output_expr = list(zip(output, expr)) + output_expr = [(o, e.apply(lambda tensor: tensor.canonicalise(), Tensor)) for o, e in output_expr] + return output_expr, returns + + +def get_rdm1(terms_sectors, spin, strategy="exhaust", density_fit=False): + """Get the one-body reduced density matrix expressions from `pdaggerq` terms.""" + if spin == "ghf": + from albert.qc.ghf import Delta, T1, T2 + elif spin == "uhf": + from albert.qc.uhf import Delta, T1, T2 + else: + from albert.qc.rhf import Delta, T1, T2 + expr = [] + output = [] + returns = [] + deltas = [] + deltas_sources = [] + for sectors, indices in [("oo", "ij"), ("ov", "ia"), ("vo", "ai"), ("vv", "ab")]: + if not terms_sectors.get((sectors, indices)): + continue + for index_spins in get_density_spins(indices, spin): + expr_n = import_from_pdaggerq(terms_sectors[sectors, indices], index_spins=index_spins) + expr_n = spin_integrate(expr_n, spin) + if spin == "rhf": + expr_n = tuple(e * 2 for e in expr_n) + if density_fit: + expr_n = tuple(_density_fit(e) for e in expr_n) + output_n = [Tensor(*tuple(sorted(e.external_indices, key=lambda i: indices.index(i.name))), name=f"rdm1") for e in expr_n] + returns_n = (output_n[0],) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + if len(set(sectors)) == 1: + delta = Delta(*tuple(sorted(expr_n[0].external_indices, key=lambda i: indices.index(i.name)))) + deltas.append(delta) + # FIXME improve: + for tensor in expr_n[0].search_leaves(T1): + if spin != "uhf" or len(set(i.spin for i in tensor.external_indices)) == 1: + deltas_sources.append(tensor) + break + else: + for tensor in expr_n[0].search_leaves(T2): + if spin != "uhf" or len(set(i.spin for i in tensor.external_indices)) == 1: + deltas_sources.append(tensor) + break + output_expr = optimise(output, expr, strategy=strategy) + output_expr = [(o, e.apply(lambda tensor: tensor.canonicalise(), Tensor)) for o, e in output_expr] + return output_expr, returns, deltas, deltas_sources + + +def get_rdm2(terms_sectors, spin, strategy="exhaust", density_fit=False): + """Get the two-body reduced density matrix expressions from `pdaggerq` terms.""" + if spin == "ghf": + from albert.qc.ghf import Delta, T1, T2 + elif spin == "uhf": + from albert.qc.uhf import Delta, T1, T2 + else: + from albert.qc.rhf import Delta, T1, T2 + expr = [] + output = [] + returns = [] + deltas = [] + deltas_sources = [] + for sectors, indices in [ + ("oooo", "ijkl"), + ("ooov", "ijka"), + ("oovo", "ijak"), + ("ovoo", "iajk"), + ("vooo", "aijk"), + ("oovv", "ijab"), + ("ovov", "iajb"), + ("ovvo", "iabj"), + ("voov", "aijb"), + ("vovo", "aibj"), + ("vvoo", "abij"), + ("ovvv", "iabc"), + ("vovv", "aibc"), + ("vvov", "abic"), + ("vvvo", "abci"), + ("vvvv", "abcd"), + ]: + if not terms_sectors.get((sectors, indices)): + continue + for index_spins in get_density_spins(indices, spin): + expr_n = import_from_pdaggerq(terms_sectors[sectors, indices], index_spins=index_spins) + expr_n = spin_integrate(expr_n, spin) + if density_fit: + expr_n = tuple(_density_fit(e) for e in expr_n) + output_n = [Tensor(*tuple(sorted(e.external_indices, key=lambda i: indices.index(i.name))), name=f"rdm2") for e in expr_n] + returns_n = (output_n[0],) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + if len(set(sectors)) == 1: + delta = Delta(*tuple(sorted(expr_n[0].external_indices, key=lambda i: indices.index(i.name))[:2])) + deltas.append(delta) + # FIXME improve: + for tensor in expr_n[0].search_leaves(T1): + if spin != "uhf" or len(set(i.spin for i in tensor.external_indices)) == 1: + deltas_sources.append(tensor) + break + else: + for tensor in expr_n[0].search_leaves(T2): + if spin != "uhf" or len(set(i.spin for i in tensor.external_indices)) == 1: + deltas_sources.append(tensor) + break + output_expr = optimise(output, expr, strategy=strategy) + output_expr = [(o, e.apply(lambda tensor: tensor.canonicalise(), Tensor)) for o, e in output_expr] + return output_expr, returns, deltas, deltas_sources + + +def get_eom(terms_grouped, spin, strategy="exhaust", which="ip", orders=None, density_fit=False, optimise_kwargs={}): + """Get the EOM expressions from `pdaggerq` terms.""" + expr = [] + output = [] + returns = [] + if orders is None: + orders = range(1, len(terms_grouped) + 1) + for order, terms in zip(orders, terms_grouped): + n = order - 1 + if which == "ip": + indices = "ijkl"[: n + 1] + "abcd"[: n] + elif which == "ea": + indices = "abcd"[: n + 1] + "ijkl"[: n] + else: + indices = "ijkl"[: n + 1] + "abcd"[: n + 1] + for index_spins in get_amplitude_spins(indices[: n + 1], indices[n + 1 :], spin): + expr_n = import_from_pdaggerq(terms, index_spins=index_spins, l_is_lambda=False) + expr_n = spin_integrate(expr_n, spin) + if density_fit: + expr_n = tuple(_density_fit(e) for e in expr_n) + output_n = [Tensor(*sorted(e.external_indices, key=lambda i: indices.index(i.name)), name=f"r{order}new") for e in expr_n] + returns_n = (output_n[0],) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + (returns_nr, output_expr_nr), (returns_r, output_expr_r) = optimise_eom(returns, output, expr, strategy=strategy, **optimise_kwargs) + if spin == "uhf": + # R amplitudes may get wrong spins + output_expr_nr = [(output, expr.canonicalise()) for output, expr in output_expr_nr] + output_expr_r = [(output, expr.canonicalise()) for output, expr in output_expr_r] + return output_expr_nr, returns_nr, output_expr_r, returns_r diff --git a/ebcc/codegen/bootstrap_ecCC.py b/ebcc/codegen/bootstrap_ecCC.py new file mode 100644 index 00000000..94963f6c --- /dev/null +++ b/ebcc/codegen/bootstrap_ecCC.py @@ -0,0 +1,255 @@ +""" +Generate the ecCC code. +""" + +import itertools +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom, import_from_pdaggerq +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf, get_amplitude_spins +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index, from_list +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info, combine_expressions +from albert.opt import optimise +from albert.scalar import Scalar +from albert.misc import ExclusionSet + +from ebcc.util import factorial +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom, spin_integrate + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +class CodeGenerator(EBCCCodeGenerator): + _add_spaces = EBCCCodeGenerator._add_spaces + _add_spaces.add("t1new") + _add_spaces.add("t2new") + +code_generators = { + "einsum": CodeGenerator( + stdout=open(f"{spin[0].upper()}ecCC.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3", "t4"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3", "t4"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2", "t3", "t4"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2", "t3", "t4"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms_t1, terms_t2], spin, strategy=None) + + # Make the T3 and T4 indices active + new_expr = [] + new_output = [] + for i, (o, e) in enumerate(output_expr): + # Get the indices + indices = set() + for add in e.expand()._children: + indices_a = indices.copy() + def _get_indices(tensor): + global indices_a + if tensor.name in {"t3", "t4", "t4a"}: + indices_a = indices_a.union(set(tensor.external_indices)) + return tensor + + add = add.apply(_get_indices, Tensor) + subs = {i: Index(i.name.upper(), spin=i.spin, space=i.space.upper()) for i in indices_a} + + def _substitute(tensor): + return tensor.map_indices(subs) + + new_output.append(o.map_indices(subs)) + new_expr.append(add.apply(_substitute, Tensor)) + + output_expr = list(zip(new_output, new_expr)) + + #if spin == "uhf": + # # Why do we have to refactor these amplitudes? Is this a deficiency in albert? + # def _refactor(tensor): + # extra_factor = 1.0 + # if type(tensor) in (uhf.T1, uhf.T2, uhf.T3, uhf.T4): + # spin = tuple(i.spin for i in tensor.external_indices[: tensor.rank // 2]) + # extra_factor /= factorial(sum(s == "a" for s in spin)) + # extra_factor /= factorial(sum(s == "b" for s in spin)) + # return tensor * Scalar(extra_factor) + # output_expr = [(o, e.apply(_refactor, Tensor)) for o, e in output_expr] + + # Separate the T3 and T4 dependnent parts + output_expr_external = [] + output_expr_mixed = [] + output_expr_internal = [] + for output, expr in output_expr: + for e in expr.expand()._children: + names = set(tensor.name for tensor in e.search_leaves(Tensor)) + if names.intersection({"t3", "t4", "t4a"}) and names.intersection({"t1", "t2"}): + output_expr_mixed.append((output, e)) + elif names.intersection({"t3", "t4", "t4a"}): + output_expr_external.append((output, e)) + else: + output_expr_internal.append((output, e)) + + # Optimise + output_expr_external = optimise([o for o, e in output_expr_external], [e for o, e in output_expr_external], strategy="exhaust") + output_expr_external = [(o, e.apply(lambda tensor: tensor.canonicalise(), Tensor)) for o, e in output_expr_external] + output_expr_external = combine_expressions(output_expr_external) + return_external = [r for r in returns if any(o.name == r.name for o, e in output_expr_external)] + output_expr_mixed = optimise([o for o, e in output_expr_mixed], [e for o, e in output_expr_mixed], strategy="exhaust") + output_expr_mixed = [(o, e.apply(lambda tensor: tensor.canonicalise(), Tensor)) for o, e in output_expr_mixed] + output_expr_mixed = combine_expressions(output_expr_mixed) + return_mixed = [r for r in returns if any(o.name == r.name for o, e in output_expr_mixed)] + + # Generate the external T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps_external", + return_external, + output_expr_external, + as_dict=True, + ) + + # Generate the mixed T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps_mixed", + return_mixed, + output_expr_mixed, + as_dict=True, + ) + +with Stopwatch("C->T conversions"): + # Get the C->T contractions in albert format + string_t1 = r"c_{i}^{a}" + string_t2 = r"c_{ij}^{ab} - t_{i}^{a} t_{j}^{b} + t_{i}^{b} t_{j}^{a}" + string_t3 = r"c_{ijk}^{abc} - t_{i}^{a} t_{jk}^{bc} + t_{i}^{b} t_{jk}^{ac} - t_{i}^{c} t_{jk}^{ab} + t_{j}^{a} t_{ik}^{bc} - t_{j}^{b} t_{ik}^{ac} + t_{j}^{c} t_{ik}^{ab} - t_{k}^{a} t_{ij}^{bc} + t_{k}^{b} t_{ij}^{ac} - t_{k}^{c} t_{ij}^{ab} - t_{i}^{a} t_{j}^{b} t_{k}^{c} + t_{i}^{a} t_{j}^{c} t_{k}^{b} + t_{i}^{b} t_{j}^{a} t_{k}^{c} - t_{i}^{b} t_{j}^{c} t_{k}^{a} - t_{i}^{c} t_{j}^{a} t_{k}^{b} + t_{i}^{c} t_{j}^{b} t_{k}^{a}" + string_t4 = r"c_{ijkl}^{abcd} - t_{i}^{a} t_{jkl}^{bcd} + t_{i}^{b} t_{jkl}^{acd} - t_{i}^{c} t_{jkl}^{abd} + t_{i}^{d} t_{jkl}^{abc} + t_{j}^{a} t_{ikl}^{bcd} - t_{j}^{b} t_{ikl}^{acd} + t_{j}^{c} t_{ikl}^{abd} - t_{j}^{d} t_{ikl}^{abc} - t_{k}^{a} t_{ijl}^{bcd} + t_{k}^{b} t_{ijl}^{acd} - t_{k}^{c} t_{ijl}^{abd} + t_{k}^{d} t_{ijl}^{abc} + t_{l}^{a} t_{ijk}^{bcd} - t_{l}^{b} t_{ijk}^{acd} + t_{l}^{c} t_{ijk}^{abd} - t_{l}^{d} t_{ijk}^{abc} - t_{ij}^{ab} t_{kl}^{cd} + t_{ij}^{ac} t_{kl}^{bd} - t_{ij}^{ad} t_{kl}^{bc} - t_{ij}^{bc} t_{kl}^{ad} + t_{ij}^{bd} t_{kl}^{ac} - t_{ij}^{cd} t_{kl}^{ab} + t_{ik}^{ab} t_{jl}^{cd} - t_{ik}^{ac} t_{jl}^{bd} + t_{ik}^{ad} t_{jl}^{bc} + t_{ik}^{bc} t_{jl}^{ad} - t_{ik}^{bd} t_{jl}^{ac} + t_{ik}^{cd} t_{jl}^{ab} - t_{il}^{ab} t_{jk}^{cd} + t_{il}^{ac} t_{jk}^{bd} - t_{il}^{ad} t_{jk}^{bc} - t_{il}^{bc} t_{jk}^{ad} + t_{il}^{bd} t_{jk}^{ac} - t_{il}^{cd} t_{jk}^{ab} - t_{i}^{a} t_{j}^{b} t_{kl}^{cd} + t_{i}^{a} t_{j}^{c} t_{kl}^{bd} - t_{i}^{a} t_{j}^{d} t_{kl}^{bc} + t_{i}^{a} t_{k}^{b} t_{jl}^{cd} - t_{i}^{a} t_{k}^{c} t_{jl}^{bd} + t_{i}^{a} t_{k}^{d} t_{jl}^{bc} - t_{i}^{a} t_{l}^{b} t_{jk}^{cd} + t_{i}^{a} t_{l}^{c} t_{jk}^{bd} - t_{i}^{a} t_{l}^{d} t_{jk}^{bc} + t_{i}^{b} t_{j}^{a} t_{kl}^{cd} - t_{i}^{b} t_{j}^{c} t_{kl}^{ad} + t_{i}^{b} t_{j}^{d} t_{kl}^{ac} - t_{i}^{b} t_{k}^{a} t_{jl}^{cd} + t_{i}^{b} t_{k}^{c} t_{jl}^{ad} - t_{i}^{b} t_{k}^{d} t_{jl}^{ac} + t_{i}^{b} t_{l}^{a} t_{jk}^{cd} - t_{i}^{b} t_{l}^{c} t_{jk}^{ad} + t_{i}^{b} t_{l}^{d} t_{jk}^{ac} - t_{i}^{c} t_{j}^{a} t_{kl}^{bd} + t_{i}^{c} t_{j}^{b} t_{kl}^{ad} - t_{i}^{c} t_{j}^{d} t_{kl}^{ab} + t_{i}^{c} t_{k}^{a} t_{jl}^{bd} - t_{i}^{c} t_{k}^{b} t_{jl}^{ad} + t_{i}^{c} t_{k}^{d} t_{jl}^{ab} - t_{i}^{c} t_{l}^{a} t_{jk}^{bd} + t_{i}^{c} t_{l}^{b} t_{jk}^{ad} - t_{i}^{c} t_{l}^{d} t_{jk}^{ab} + t_{i}^{d} t_{j}^{a} t_{kl}^{bc} - t_{i}^{d} t_{j}^{b} t_{kl}^{ac} + t_{i}^{d} t_{j}^{c} t_{kl}^{ab} - t_{i}^{d} t_{k}^{a} t_{jl}^{bc} + t_{i}^{d} t_{k}^{b} t_{jl}^{ac} - t_{i}^{d} t_{k}^{c} t_{jl}^{ab} + t_{i}^{d} t_{l}^{a} t_{jk}^{bc} - t_{i}^{d} t_{l}^{b} t_{jk}^{ac} + t_{i}^{d} t_{l}^{c} t_{jk}^{ab} - t_{j}^{a} t_{k}^{b} t_{il}^{cd} + t_{j}^{a} t_{k}^{c} t_{il}^{bd} - t_{j}^{a} t_{k}^{d} t_{il}^{bc} + t_{j}^{a} t_{l}^{b} t_{ik}^{cd} - t_{j}^{a} t_{l}^{c} t_{ik}^{bd} + t_{j}^{a} t_{l}^{d} t_{ik}^{bc} + t_{j}^{b} t_{k}^{a} t_{il}^{cd} - t_{j}^{b} t_{k}^{c} t_{il}^{ad} + t_{j}^{b} t_{k}^{d} t_{il}^{ac} - t_{j}^{b} t_{l}^{a} t_{ik}^{cd} + t_{j}^{b} t_{l}^{c} t_{ik}^{ad} - t_{j}^{b} t_{l}^{d} t_{ik}^{ac} - t_{j}^{c} t_{k}^{a} t_{il}^{bd} + t_{j}^{c} t_{k}^{b} t_{il}^{ad} - t_{j}^{c} t_{k}^{d} t_{il}^{ab} + t_{j}^{c} t_{l}^{a} t_{ik}^{bd} - t_{j}^{c} t_{l}^{b} t_{ik}^{ad} + t_{j}^{c} t_{l}^{d} t_{ik}^{ab} + t_{j}^{d} t_{k}^{a} t_{il}^{bc} - t_{j}^{d} t_{k}^{b} t_{il}^{ac} + t_{j}^{d} t_{k}^{c} t_{il}^{ab} - t_{j}^{d} t_{l}^{a} t_{ik}^{bc} + t_{j}^{d} t_{l}^{b} t_{ik}^{ac} - t_{j}^{d} t_{l}^{c} t_{ik}^{ab} - t_{k}^{a} t_{l}^{b} t_{ij}^{cd} + t_{k}^{a} t_{l}^{c} t_{ij}^{bd} - t_{k}^{a} t_{l}^{d} t_{ij}^{bc} + t_{k}^{b} t_{l}^{a} t_{ij}^{cd} - t_{k}^{b} t_{l}^{c} t_{ij}^{ad} + t_{k}^{b} t_{l}^{d} t_{ij}^{ac} - t_{k}^{c} t_{l}^{a} t_{ij}^{bd} + t_{k}^{c} t_{l}^{b} t_{ij}^{ad} - t_{k}^{c} t_{l}^{d} t_{ij}^{ab} + t_{k}^{d} t_{l}^{a} t_{ij}^{bc} - t_{k}^{d} t_{l}^{b} t_{ij}^{ac} + t_{k}^{d} t_{l}^{c} t_{ij}^{ab} - t_{i}^{a} t_{j}^{b} t_{k}^{c} t_{l}^{d} + t_{i}^{a} t_{j}^{b} t_{k}^{d} t_{l}^{c} + t_{i}^{a} t_{j}^{c} t_{k}^{b} t_{l}^{d} - t_{i}^{a} t_{j}^{c} t_{k}^{d} t_{l}^{b} - t_{i}^{a} t_{j}^{d} t_{k}^{b} t_{l}^{c} + t_{i}^{a} t_{j}^{d} t_{k}^{c} t_{l}^{b} + t_{i}^{b} t_{j}^{a} t_{k}^{c} t_{l}^{d} - t_{i}^{b} t_{j}^{a} t_{k}^{d} t_{l}^{c} - t_{i}^{b} t_{j}^{c} t_{k}^{a} t_{l}^{d} + t_{i}^{b} t_{j}^{c} t_{k}^{d} t_{l}^{a} + t_{i}^{b} t_{j}^{d} t_{k}^{a} t_{l}^{c} - t_{i}^{b} t_{j}^{d} t_{k}^{c} t_{l}^{a} - t_{i}^{c} t_{j}^{a} t_{k}^{b} t_{l}^{d} + t_{i}^{c} t_{j}^{a} t_{k}^{d} t_{l}^{b} + t_{i}^{c} t_{j}^{b} t_{k}^{a} t_{l}^{d} - t_{i}^{c} t_{j}^{b} t_{k}^{d} t_{l}^{a} - t_{i}^{c} t_{j}^{d} t_{k}^{a} t_{l}^{b} + t_{i}^{c} t_{j}^{d} t_{k}^{b} t_{l}^{a} + t_{i}^{d} t_{j}^{a} t_{k}^{b} t_{l}^{c} - t_{i}^{d} t_{j}^{a} t_{k}^{c} t_{l}^{b} - t_{i}^{d} t_{j}^{b} t_{k}^{a} t_{l}^{c} + t_{i}^{d} t_{j}^{b} t_{k}^{c} t_{l}^{a} + t_{i}^{d} t_{j}^{c} t_{k}^{a} t_{l}^{b} - t_{i}^{d} t_{j}^{c} t_{k}^{b} t_{l}^{a}" + for n, string in enumerate([string_t1, string_t2, string_t3, string_t4]): + output = [] + expr = [] + returns = [] + for index_spins in get_amplitude_spins("ijkl"[: n + 1], "abcd"[: n + 1], spin): + signs = [1] + [1 if s == "+" else -1 for s in string if s in "+-"] + terms = [s.strip() for s in string.replace("-", "+").split("+")] + expr_n = Scalar(0.0) + for sign, term in zip(signs, terms): + part = Scalar(sign) + for tensor in term.split(): + order = sum(1 for c in tensor if c in "ijkl") + name = f"{tensor[0]}{order}" + occ = [Index(i, space="o", spin=index_spins.get(i, None)) for i in tensor[tensor.index("_") + 2 : tensor.index("_") + 2 + order]] + vir = [Index(a, space="v", spin=index_spins.get(a, None)) for a in tensor[tensor.index("^") + 2 : tensor.index("^") + 2 + order]] + part *= getattr(ghf, f"T{order}")(*occ, *vir, name=name) + expr_n += part + + expr_n = spin_integrate(expr_n, spin) + if spin == "rhf" and (n + 1) == 4 and len([s for s in index_spins.values() if s == "a"]) == 6: + name = "t4a" + else: + name = f"t{n + 1}" + output_n = [Tensor(*tuple(sorted(e.external_indices, key=lambda i: "ijklabcd".index(i.name))), name=name) for e in expr_n] + returns_n = (output_n[0],) + + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + + if spin == "uhf": + # Why do we have to refactor these amplitudes? Is this a deficiency in albert? + def _refactor(tensor): + extra_factor = 1.0 + if type(tensor) in (uhf.T1, uhf.T2, uhf.T3, uhf.T4): + spin = tuple(i.spin for i in tensor.external_indices[: tensor.rank // 2]) + extra_factor /= factorial(sum(s == "a" for s in spin)) + extra_factor /= factorial(sum(s == "b" for s in spin)) + return tensor * Scalar(extra_factor) + expr = [e.apply(_refactor, Tensor) for e in expr] + + # Optimise and generate the code separately for each amplitude + output_expr = optimise(output, expr, strategy="exhaust" if n < 3 else "trav") + output_expr = [(o, e.apply(lambda tensor: tensor.canonicalise(), Tensor)) for o, e in output_expr] + + for name, codegen in code_generators.items(): + codegen( + f"convert_c{n + 1}_to_t{n + 1}", + returns, + output_expr, + as_dict=True, + ) + +with Stopwatch("T->C conversions"): + # Get the T amplitudes in albert format + eT = [[1.0, ["1"]]] + for n in range(4): + factor = 1 / factorial(n + 1) + for ts in itertools.product(["t1", "t2", "t3", "t4"], repeat=n + 1): + eT.append([factor, list(ts)]) + + for n in range(4): + # Get the T->C contractions in pdaggerq format + pq.clear() + pq.set_left_operators([[f"e{n + 1}({','.join('ijkl'[:n + 1]+''.join(reversed('abcd'[:n + 1])))})"]]) + pq.set_right_operators([["1"]]) + for term in eT: + pq.add_operator_product(term[0], term[1]) + pq.simplify() + terms = pq.strings() + + ## Get the T->C contractions in albert format + #output_expr, returns = get_amplitudes([terms], spin, strategy="exhaust" if (n, spin) != (4, "uhf") else "greedy", orders=[n + 1]) + + output = [] + expr = [] + returns = [] + for index_spins in get_amplitude_spins("ijkl"[: n + 1], "abcd"[: n + 1], spin): + expr_n = import_from_pdaggerq(terms, index_spins=index_spins) + expr_n = spin_integrate(expr_n, spin) + if spin == "rhf" and (n + 1) == 4 and len([s for s in index_spins.values() if s == "a"]) == 6: + name = "c4a" + else: + name = f"c{n + 1}" + output_n = [Tensor(*tuple(sorted(e.external_indices, key=lambda i: "ijklabcd".index(i.name))), name=name) for e in expr_n] + returns_n = (output_n[0],) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + + # Optimise and generate the code separately for each amplitude + output_expr = optimise(output, expr, strategy="exhaust" if n < 3 else "trav") + output_expr = [(o, e.apply(lambda tensor: tensor.canonicalise(), Tensor)) for o, e in output_expr] + + for name, codegen in code_generators.items(): + codegen( + f"convert_t{n + 1}_to_c{n + 1}", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_hugenholtz.py b/ebcc/codegen/bootstrap_hugenholtz.py new file mode 100644 index 00000000..fb55031e --- /dev/null +++ b/ebcc/codegen/bootstrap_hugenholtz.py @@ -0,0 +1,374 @@ +""" +Generate Hugenholtz diagrams +Scales roughly +""" +# TODO test energies + +import numpy as np +import itertools +from collections import defaultdict + +OCC_INDS = "ijklmnopIJKLMNOP" +VIR_INDS = "abcdefghABCDEFGH" + + +def index_to_ov(idx): + """Convert i.e. j->o, b->v etc.""" + + if idx in OCC_INDS: + return "o" + elif idx in VIR_INDS: + return "v" + else: + raise ValueError + + +def iter_edges(graph): + """Iterate over the edges (out, in)""" + + for i in range(len(graph)): + yield graph[i - 1], graph[i] + + +def direction(start, end): + """ + Return the direction of an edge: + + 1 : up (occupied) + -1 : down (virtual) + 0 : level (bubble) + """ + + return int(bool(end > start) - bool(start > end)) + + +def classify_graph(graph, ignore_bubble=False): + """ + Return a unique classifier for a graph allowing equality - only + unique among graphs with the same size. + """ + + edges = defaultdict(int) + step = len(graph) // 2 + + for start, end in iter_edges(graph): + if ignore_bubble: + if direction(start, end) == 0: + return False + + edge = start * step + end + edges[edge] += 1 + + return frozenset(edges.items()) + + +def equal_graphs(a, b): + """Return True if two graphs are equal""" + + return classify_graph(a) == classify_graph(b) + + +def get_connectivity(graph): + """ + Return ∑(number of edges going in) - ∑(number of edges going out) + for each node in a graph. + """ + + count = [ + 0, + ] * (len(graph) // 2) + + for start, end in iter_edges(graph): + count[start] += 1 + count[end] -= 1 + + return count + + +def permutations(n=2, ignore_bubble=False): + """ + Return permutations of [0,1,...,n,0,1,...n] + From more_itertools + """ + + perm = sorted(range(n)) * 2 + size = n * 2 + + if n < 2: + yield perm + + while True: + # Find largest i such that i < i+1 + for i in range(size - 2, -1, -1): + if perm[i] < perm[i + 1]: + break + else: + return + + # Find largest j such that i < j + for j in range(size - 1, i, -1): + if perm[i] < perm[j]: + break + + # Swap i, j and reverse from i+1 + perm[i], perm[j] = perm[j], perm[i] + perm[i + 1 :] = perm[: i - size : -1] + + # To skip bubbles at this point: + # + # 0 1 i-1 i i+1 j-1 j j+1 2n-2 2n-1 + # ------------------------------------------------------------- + # Start with: [ 0, 1, ..., a-1, a, a+1, ..., b-1, b, b+1, ..., c-2, c-1 ] + # Swap i,j: [ 0, 1, ..., a-1, b, a+1, ..., b-1, a, b+1, ..., c-2, c-1 ] + # Reverse i+1: [ 0, 1, ..., a-1, b, c-1, ..., b+1, a, b-1, ..., a+2, a+1 ] + # + # Therefore new neighbours exist at: + # + # (i-1, i), (i, i+1), (j-1, j), (j, j+1), (2n-1, 0) + # + # and the first permutation will always have no bubbles. It's probably + # possible to "jump ahead" in the algorithm to the next non-bubble but + # that would take some thinking. + if ignore_bubble: + new_neighbours = set( + [ + (i - 1, i % size), + (i, (i + 1) % size), + (j - 1, j), + (j, (j + 1) % size), + (size - 1, 0), + ] + ) + if any(perm[a] == perm[b] for a, b in new_neighbours): + continue + + yield perm + + +def get_hugenholtz_diagrams(n=2, ignore_bubble=True): + """ + Get a list of directed graphs representing Hugenholtz diagrams + for a given order of perturbation theory. + """ + + seen = set() + + for graph in permutations(n): + classification = classify_graph(graph, ignore_bubble=ignore_bubble) + + # Check if diagram is a duplicate + if classification is False or classification in seen: + continue + seen.add(classification) + + # Check the connectivity is balanced + if any([x != 0 for x in get_connectivity(graph)]): + continue + + # If we get here, it's a valid diagram + yield graph + + +def sort_energy(term): + """Sort the energy repr into a canonical order""" + + occ_part = [char for char in term if char in OCC_INDS] + vir_part = [char for char in term if char in VIR_INDS] + + term_out = "".join(occ_part) + "".join(vir_part) + + return term_out + + +def sort_integral(term): + """Sort the integral repr into a canonical order""" + + term_out = term + score_min = np.inf + sign = 1 + allowed = [ + ((0, 1, 2, 3), 1), + ((1, 0, 3, 2), 1), + ((2, 3, 0, 1), 1), + ((3, 2, 1, 0), 1), + ((0, 1, 3, 2), -1), + ((1, 0, 2, 3), -1), + ((3, 2, 0, 1), -1), + ((2, 3, 1, 0), -1), + ] + + for allow, sign_flip in allowed: + perm = [term[x] for x in allow] + string = "".join(["0" if s in OCC_INDS else "1" for s in perm]) + score = int(string, 2) + if score < score_min: + term_out = "".join(perm) + score_min = score + sign *= sign_flip + + return term_out, sign + + +def label_edges(graph): + """Return a list of index labels for each edge""" + + labels = [] + o = list(OCC_INDS) + v = list(VIR_INDS) + + for start, end in iter_edges(graph): + d = direction(start, end) + + if d == 1: + labels.append(o.pop(0)) + elif d == -1: + labels.append(v.pop(0)) + else: + labels.append(None) + + return labels + + +def direction_dicts(graph, labels): + """ + Return dictionaries with keys corresponding to each vertex and + values containing a list of labels corresponding to edges going + in and out of the vertex. + """ + + outs = defaultdict(list) + ins = defaultdict(list) + + last = graph[-1] + for n in range(len(graph)): + outs[last].append(labels[n]) + last = graph[n] + ins[last].append(labels[n]) + + ins = {k: v for k, v in ins.items()} + outs = {k: v for k, v in outs.items()} + + return ins, outs + + +def get_hugenholtz_energies(graph, labels): + """Get the energy contribution from a given Hugenholtz diagram""" + + order = len(graph) // 2 + terms = [] + + for n in range(order - 1): + x = 0.5 + n + term = "" + + for label, (start, end) in zip(labels, iter_edges(graph)): + if (start < x and end > x) or (start > x and end < x): + term = term + label + + term = sort_energy(term) + terms.append(term) + + return ",".join(terms) + + +def get_hugenholtz_integrals(graph, labels): + """Get the integral contribution from a given Hugentholtz diagram""" + + ins, outs = direction_dicts(graph, labels) + terms = [] + sign = 1 + + for point in set(graph): + term = "".join([*ins[point], *outs[point]]) + term, sf = sort_integral(term) + terms.append(term) + sign *= sf + + return ",".join(terms), sign + + +def get_hugenholtz_sign(graph, labels, integrals): + """Get the sign contribution from a given Hugenholtz diagram""" + + integrals = integrals.split(",") + rule = [x[0] + x[2] for x in integrals] + [x[1] + x[3] for x in integrals] + paths = [rule.pop(0)] + + while len(rule): + r = rule.pop(0) + for i in range(len(paths)): + if r[-1] == paths[i][0]: + paths[i] = r + paths[i] + break + elif r[0] == paths[i][-1]: + paths[i] = paths[i] + r + break + else: + paths.append(r) + + l = len(paths) + h = len([x for x in labels if x in OCC_INDS]) + sign = pow(-1, h + l) + + return sign + + +def get_hugenholtz_factor(graph): + """Get the factor contribution from a given Hugenholtz diagram""" + + count = defaultdict(int) + + for start, end in iter_edges(graph): + count[(start, end)] += 1 + + n = sum([x // 2 for x in count.values()]) + + return pow(0.5, n) + + +def get_pdaggerq( + graph, + use_t2=True, +): + labels = label_edges(graph) + integrals, sign = get_hugenholtz_integrals(graph, labels) + energies = get_hugenholtz_energies(graph, labels) + sign *= get_hugenholtz_sign(graph, labels, integrals) + factor = get_hugenholtz_factor(graph) + + if use_t2: + amplitudes = [] + energies_to_remove = [] + integrals_to_remove = [] + + for i, integral in enumerate(integrals.split(",")): + for j, energy in enumerate(energies.split(",")): + if integral == energy: + inds = tuple(index_to_ov(x) for x in integral) + if inds == ("o", "o", "v", "v"): + if i in integrals_to_remove or j in energies_to_remove: + continue + amplitudes.append(integral) + integrals_to_remove.append(i) + energies_to_remove.append(j) + + energies = [x for i, x in enumerate(energies.split(",")) if i not in energies_to_remove] + integrals = [x for i, x in enumerate(integrals.split(",")) if i not in integrals_to_remove] + + energies = ",".join(energies) + integrals = ",".join(integrals) + amplitudes = ",".join(amplitudes) + + term = [("+" if sign > 0 else "-") + str(factor)] + if integrals.strip(): + for integral in integrals.split(","): + term += ["<%s,%s||%s,%s>" % tuple(integral)] + if energies.strip(): + for energy in energies.split(","): + term += ["denom%d(%s)" % (len(energy) // 2, ",".join(energy))] + if amplitudes.strip(): + for amplitude in amplitudes.split(","): + n = len(amplitude) // 2 + term += ["t2(%s,%s)" % (",".join(amplitude[n:]), ",".join(amplitude[:n]))] + + return term diff --git a/ebcc/codegen/bootstrap_wdwwrwCCD.py b/ebcc/codegen/bootstrap_wdwwrwCCD.py new file mode 100644 index 00000000..b904cf4a --- /dev/null +++ b/ebcc/codegen/bootstrap_wdwwrwCCD.py @@ -0,0 +1,84 @@ +""" +Generate the drCCD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}wdwwrwCCD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T2 contractions in pdaggerq format + # arXiv:1804.01037 + terms = [ + ["-1.00", "P(i,j)", "f(k,j)", "t2(a,b,i,k)"], + ["+1.00", "P(a,b)", "f(a,c)", "t2(c,b,i,j)"], + ["+1.00", ""], + ["+1.00", "t2(a,c,i,k)", ""], + ["+1.00", "t2(c,b,k,j)", ""], + ["+1.00", "t2(a,c,i,k)", "t2(d,b,l,j)", ""], + ] + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, orders=[2]) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/bootstrap_wrwCCD.py b/ebcc/codegen/bootstrap_wrwCCD.py new file mode 100644 index 00000000..fd8623ee --- /dev/null +++ b/ebcc/codegen/bootstrap_wrwCCD.py @@ -0,0 +1,84 @@ +""" +Generate the rCCD code. +""" + +import sys + +import pdaggerq +from albert.qc._pdaggerq import remove_reference_energy, remove_reference_energy_eom +from albert.qc.spin import ghf_to_uhf, ghf_to_rhf +from albert.qc import ghf, uhf, rhf +from albert.tensor import Tensor +from albert.index import Index +from albert.code._ebcc import EBCCCodeGenerator +from albert.misc import Stopwatch +from albert.opt.tools import _tensor_info + +from ebcc.codegen.bootstrap_common import get_energy, get_amplitudes, get_rdm1, get_rdm2, get_eom + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EBCCCodeGenerator( + stdout=open(f"{spin[0].upper()}wrwCCD.py", "w"), + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t2"]) + pq.add_st_operator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_reference_energy(terms) + + # Get the energy in albert format + output_expr, returns = get_energy(terms, spin) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output_expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T2 contractions in pdaggerq format + # arXiv:1804.01037 + terms = [ + ["-1.00", "P(i,j)", "f(k,j)", "t2(a,b,i,k)"], + ["+1.00", "P(a,b)", "f(a,c)", "t2(c,b,i,j)"], + ["+1.00", ""], + ["+1.00", "t2(a,c,i,k)", ""], + ["+1.00", "t2(c,b,k,j)", ""], + ["+1.00", "t2(a,c,i,k)", "t2(d,b,l,j)", ""], + ] + + # Get the T amplitudes in albert format + output_expr, returns = get_amplitudes([terms], spin, orders=[2]) + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + codegen( + "update_amps", + returns, + output_expr, + as_dict=True, + ) + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/codegen/new_bootstrap_CCSDxTx.py b/ebcc/codegen/new_bootstrap_CCSDxTx.py new file mode 100644 index 00000000..7d1c4c51 --- /dev/null +++ b/ebcc/codegen/new_bootstrap_CCSDxTx.py @@ -0,0 +1,401 @@ +""" +Generate the CCSD(T) code. +""" + +from numbers import Number +import itertools +import re +import sys +import types + +import pdaggerq +from albert.qc._pdaggerq import import_from_pdaggerq +from albert.tensor import Tensor +from albert.algebra import Algebraic +from albert.codegen.einsum import _parse_indices + +from ebcc.codegen.bootstrap_common import * + +# Get the spin case +spin = sys.argv[1] + +# Set up the code generators +code_generators = { + "einsum": EinsumCodeGen( + stdout=open(f"{spin[0].upper()}CCSDxTx.py", "w"), + name_generator=name_generators[spin], + spin=spin, + ), +} + +# Write the preamble +for codegen in code_generators.values(): + codegen.preamble() + +# Set up pdaggerq +pq = pdaggerq.pq_helper("fermi") +pq.set_print_level(0) + +# Function for writing T3 slices +def algebraic_expression_t3(self, output, expr, already_declared=False): + """Write an algebraic expression.""" + + assert isinstance(output, Tensor) + assert isinstance(expr, (Tensor, Algebraic)) + + for i, mul_args in enumerate(expr.nested_view()): + # Separate the factors and tensors + factors = [arg for arg in mul_args if isinstance(arg, Number)] + tensors = [arg for arg in mul_args if isinstance(arg, Tensor)] + + # Get the indices + lhs = [arg.indices for arg in tensors] + rhs = output.indices + indices = _parse_indices(lhs, rhs) + to_slice = [i.name for i in output.indices[:3]] + + # Get the arguments + args = [] + for tensor, index in zip(tensors, indices): + name = self.get_name(tensor).lower() + inds = repr(index) + if len(tensors) == 2: + slices = [f"{i.name.lower()}0:{i.name.lower()}1" if i.space == i.space.upper() else ":" for i in tensor.indices] + name += f"[{', '.join(slices)}]" + args.append(name) + args.append(inds) + args.append(repr(indices[-1])) + + # Get the operator and LHS + output_name = self.get_name(output) + if len(tensors) == 1: + slices = [f"{i.name.lower()}0:{i.name.lower()}1" if i.space == i.space.upper() else ":" for i in output.indices] + output_name += f"[{', '.join(slices)}]" + operator = "=" if output_name not in self._declared else "+=" + self._declared.add(output_name) + + # Get the factor + factor = 1 + for f in factors: + factor *= f + if abs(factor - round(factor)) < 1e-12: + factor = int(round(factor)) + factor = f" * {factor}" if factor != 1 else "" + + # Write the expression + if len(tensors) > 1: + if self.einsum_kwargs: + kwargs = ", " + ", ".join(f"{k}={v}" for k, v in self.einsum_kwargs.items()) + else: + kwargs = "" + args = ", ".join(args) + self.write(f"{output_name} {operator} {self.einsum_func}({args}{kwargs}){factor}") + else: + transpose = tuple(indices[0].index(i) for i in indices[1]) + if transpose != tuple(range(len(transpose))): + targ = self.transpose_func.format(arg=args[0], transpose=transpose) + else: + targ = args[0] + copy = ".copy()" if i == 0 and not already_declared else "" + self.write(f"{output_name} {operator} {targ}{copy}{factor}") + +# Function for writing e_pert slices +def algebraic_expression_e(self, output, expr, already_declared=False): + """Write an algebraic expression.""" + + assert isinstance(output, Tensor) + assert isinstance(expr, (Tensor, Algebraic)) + + for i, mul_args in enumerate(expr.nested_view()): + # Separate the factors and tensors + factors = [arg for arg in mul_args if isinstance(arg, Number)] + tensors = [arg for arg in mul_args if isinstance(arg, Tensor)] + + # Get the indices + lhs = [arg.indices for arg in tensors] + rhs = output.indices + indices = _parse_indices(lhs, rhs) + + # Get the sliced indices + sliced_chars = None + sliced_inds = None + for tensor, index in zip(tensors, indices): + if tensor.name in self._slice_cache: + sliced_inds = index + sliced_chars = self._slice_cache[tensor.name] + break + + # Get the arguments + args = [] + for tensor, index in zip(tensors, indices): + inds = repr(index) + name = self.get_name(tensor) + chars = [sliced_chars[sliced_inds.index(i)] if i in sliced_inds else None for i in index] + if name != "t3": + name += f"[{', '.join(':' if c is None else f'{c}0:{c}1' for c in chars)}]" + args.append(name) + args.append(inds) + args.append(repr(indices[-1])) + + # Get the operator and LHS + output_name = self.get_name(output) + operator = "=" if output_name not in self._declared else "+=" + self._declared.add(output_name) + chars = [sliced_chars[sliced_inds.index(i)] if i in sliced_inds else None for i in indices[-1]] + self._slice_cache[self.get_name(output)] = chars + + # Get the factor + factor = 1 + for f in factors: + factor *= f + if abs(factor - round(factor)) < 1e-12: + factor = int(round(factor)) + factor = f" * {factor}" if factor != 1 else "" + + # Write the expression + if len(tensors) > 1: + if self.einsum_kwargs: + kwargs = ", " + ", ".join(f"{k}={v}" for k, v in self.einsum_kwargs.items()) + else: + kwargs = "" + args = ", ".join(args) + self.write(f"{output_name} {operator} {self.einsum_func}({args}{kwargs}){factor}") + else: + transpose = tuple(indices[0].index(i) for i in indices[1]) + if transpose != tuple(range(len(transpose))): + targ = self.transpose_func.format(arg=args[0], transpose=transpose) + else: + targ = args[0] + copy = ".copy()" if i == 0 and not already_declared else "" + self.write(f"{output_name} {operator} {targ}{copy}{factor}") + +with Stopwatch("Energy"): + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["1"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms = pq.strings() + terms = remove_hf_energy(terms) + + # Get the energy in albert format + expr = import_from_pdaggerq(terms) + expr = spin_integrate(expr, spin) + output = tuple(Tensor(name="e_cc") for _ in range(len(expr))) + output, expr = optimise(output, expr, spin, strategy="exhaust") + returns = (Tensor(name="e_cc"),) + + # Generate the energy code + for codegen in code_generators.values(): + codegen( + "energy", + returns, + output, + expr, + ) + +with Stopwatch("T amplitudes"): + # Get the T1 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e1(i,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t1 = pq.strings() + + # Get the T2 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e2(i,j,b,a)"]]) + pq.add_st_operator(1.0, ["f"], ["t1", "t2"]) + pq.add_st_operator(1.0, ["v"], ["t1", "t2"]) + pq.simplify() + terms_t2 = pq.strings() + + # Get the T amplitudes in albert format + terms = [terms_t1, terms_t2] + expr = [] + output = [] + returns = [] + for n in range(2): + for index_spins in get_amplitude_spins(n + 1, spin): + indices = default_indices["o"][: n + 1] + default_indices["v"][: n + 1] + expr_n = import_from_pdaggerq(terms[n], index_spins=index_spins) + expr_n = spin_integrate(expr_n, spin) + output_n = get_t_amplitude_outputs(expr_n, f"t{n+1}new") + returns_n = (Tensor(*indices, name=f"t{n+1}new"),) + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + output, expr = optimise(output, expr, spin, strategy="exhaust") + + # Generate the T amplitude code + for name, codegen in code_generators.items(): + if name == "einsum": + kwargs = { + "preamble": "t1new = Namespace()\nt2new = Namespace()" if spin == "uhf" else None, + "as_dict": True, + } + else: + kwargs = {} + codegen( + "update_amps", + returns, + output, + expr, + **kwargs, + ) + +with Stopwatch("Perturbative triples"): + # Get the T3 contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["e3(i,j,k,c,b,a)"]]) + pq.add_commutator(1.0, ["v"], ["t2"]) + pq.simplify() + terms = pq.strings() + + # Get the T3 amplitudes in albert format + expr = [] + output = [] + returns = [] + for index_spins in get_amplitude_spins(3, spin): + index_spaces = {c: "O" for c in "IJK"} # Hacky, use the active space indices for the slices + index_spaces.update({c: "v" for c in "abc"}) + indices = [x.upper() for x in default_indices["o"][:3]] + default_indices["v"][:3] + expr_n = import_from_pdaggerq(terms, index_spins=index_spins, index_spaces=index_spaces) + expr_n = expr_n.map_indices({i: Index(i.name.upper(), space="O", spin=i.spin) for i in expr_n.external_indices if i.name in "ijk"}) + expr_n = spin_integrate(expr_n, spin) + output_n = get_t_amplitude_outputs(expr_n, f"t3", indices=indices) + output_n = [o.map_indices({i: i.to_space(index_spaces.get(i.name, None)) for i in o.indices}) for o in output_n] + returns_n = (Tensor(*indices, name=f"t3"),) + output_n, expr_n = optimise(output_n, expr_n, spin, strategy="exhaust") + expr.extend(expr_n) + output.extend(output_n) + returns.extend(returns_n) + output, expr = optimise(output, expr, spin, strategy="exhaust") + + # Generate the T3 amplitude code + for name, codegen in code_generators.items(): + preamble = "" + if name == "einsum": + _algebraic_expression = codegen.algebraic_expression + codegen.algebraic_expression = types.MethodType(algebraic_expression_t3, codegen) + if spin in ("rhf", "ghf"): + preamble += "t3 = Namespace()\n" + preamble += "i0 = kwargs[\"i0\"]\n" + preamble += "j0 = kwargs[\"j0\"]\n" + preamble += "k0 = kwargs[\"k0\"]\n" + preamble += "i1 = kwargs[\"i1\"]\n" + preamble += "j1 = kwargs[\"j1\"]\n" + preamble += "k1 = kwargs[\"k1\"]\n" + else: + 1/0 + codegen._declared = set() + codegen( + "_get_t3", + returns, + output, + expr, + preamble=preamble, + ) + if name == "einsum": + codegen.algebraic_expression = _algebraic_expression + del codegen._declared + + # Get the energy contractions in pdaggerq format + pq.clear() + pq.set_left_operators([["l1"], ["l2"]]) + pq.add_commutator(1.0, ["v"], ["t3"]) + pq.simplify() + terms = pq.strings() + + # Get the energy in albert format + expr = import_from_pdaggerq(terms) + expr = spin_integrate(expr, spin) + output = tuple(Tensor(name="e_pert") for _ in range(len(expr))) + output, expr = optimise(output, expr, spin, strategy="exhaust") + returns = (Tensor(name="e_pert"),) + + # Insert the slices + new_output = [] + new_expr = [] + + # Generate the energy code + for codegen in code_generators.values(): + if name == "einsum": + _algebraic_expression = codegen.algebraic_expression + codegen._slice_cache = {"t3": ["i", "j", "k", None, None, None]} + codegen.algebraic_expression = types.MethodType(algebraic_expression_e, codegen) + preamble = "" + if spin in ("rhf", "ghf"): + preamble += "i0 = kwargs[\"i0\"]\n" + preamble += "j0 = kwargs[\"j0\"]\n" + preamble += "k0 = kwargs[\"k0\"]\n" + preamble += "i1 = kwargs[\"i1\"]\n" + preamble += "j1 = kwargs[\"j1\"]\n" + preamble += "k1 = kwargs[\"k1\"]\n" + else: + 1/0 + codegen._declared = set() + codegen( + "_et_block", + returns, + output, + expr, + preamble=preamble, + ) + if name == "einsum": + codegen.algebraic_expression = _algebraic_expression + del codegen._slice_cache + del codegen._declared + + for codegen in code_generators.values(): + if name == "einsum": + # Generate the energy function + codegen.function_declaration("energy_perturbative", ["f", "l1", "l2", "t2", "v"]) + codegen.indent() + + # Write the function docstring + metadata = codegen.get_metadata() + docstring = f"Code generated by `albert` {metadata['albert_version']} on {metadata['date']}.\n" + docstring += "\n" + docstring += "Parameters\n----------\n" + docstring += "f : array\n" + docstring += "l1 : array\n" + docstring += "l2 : array\n" + docstring += "l2 : array\n" + docstring += "v : array\n" + docstring += "\n" + docstring += "Returns\n-------\n" + docstring += "e_pert : float" + codegen.function_docstring(docstring) + codegen.blank() + code = "" + code += "ei = f.oo.diagonal()\n" + code += "ea = f.vv.diagonal()\n" + code += "eabc = direct_sum(\"a,b,c->abc\", -ea, -ea, -ea)\n" + code += "block_size = kwargs.get(\"block_size\", 32)\n" + code += "\n" + code += "e_pert = 0.0\n" + code += "for i0 in range(l1.shape[1]):\n" + code += " for j0 in range(l1.shape[1]):\n" + code += " for k0 in range(0, l1.shape[1], block_size):\n" + code += " i1 = i0 + 1\n" + code += " j1 = j0 + 1\n" + code += " k1 = min(k0 + block_size, l1.shape[1])\n" + code += " t3 = _get_t3(l1=l1, l2=l2, t2=t2, v=v, i0=i0, j0=j0, k0=k0, i1=i1, j1=j1, k1=k1)\n" + for i, j, k in itertools.permutations("ijk"): + code += f" if hasattr(t3, \"{i}{j}{k}\"):\n" + code += f" t3_block = t3.{i}{j}{k}\n" + code += f" t3_block /= direct_sum(\"i,j,k,abc->ijkabc\", ei[{i}0:{i}1], ei[{j}0:{j}1], ei[{k}0:{k}1], eabc)\n" + code += f" e_pert += _et_block(l1=l1, l2=l2, t2=t2, t3=t3_block, v=v, i0={i}0, j0={j}0, k0={k}0, i1={i}1, j1={j}1, k1={k}1)\n" + code += f" del t3_block\n" + codegen.write(code) + codegen.function_return(["e_pert"]) + codegen.dedent() + codegen.blank() + + +for codegen in code_generators.values(): + codegen.postamble() + codegen.stdout.close() diff --git a/ebcc/util/einsumfunc.py b/ebcc/util/einsumfunc.py index 6c71f205..ceb1439b 100644 --- a/ebcc/util/einsumfunc.py +++ b/ebcc/util/einsumfunc.py @@ -513,7 +513,14 @@ def einsum( path_kwargs = dict(optimize=optimize, einsum_call=True) contractions = np.einsum_path(subscript, *args, **path_kwargs)[1] for contraction in contractions: - inds, idx_rm, einsum_str, remain = list(contraction[:4]) + + if len(contraction) == 3: + # numpy>=2.4.0 + inds, einsum_str = list(contraction[:2]) + else: + # numpy<2.4.0 + inds, idx_rm, einsum_str, remain = list(contraction[:4]) + contraction_args = [args.pop(x) for x in inds] # type: ignore if alpha != 1.0 or beta != 0.0: raise NotImplementedError("Scaling factors not supported for >2 arguments")