Skip to content

bdiv bug again #542

@John-zzh

Description

@John-zzh

#540 is resolved, but the subsequent orbital_pair_cart2sph has a following up error, probably wrong array shape.

Traceback (most recent call last):
  File "/root/jojo/ris_tests/extest42/chkfiles_def2SVP/pbe0/55_DPP1/bdiv_bug.py", line 87, in <module>
    eri3c_batch = int3c2e_opt.orbital_pair_cart2sph(eri3c_batch, inplace=True)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/jojo/software/gpu4pyscf_ris/gpu4pyscf/df/int3c2e_bdiv.py", line 506, in orbital_pair_cart2sph
    t = contract('mpqr,pj->mjqr', t, cj)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/jojo/software/gpu4pyscf_ris/gpu4pyscf/lib/cutensor.py", line 163, in contract
    return contraction(pattern, a, b, alpha, beta, out=out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/jojo/software/gpu4pyscf_ris/gpu4pyscf/lib/cutensor.py", line 91, in contraction
    desc_a = cutensor.create_tensor_descriptor(a)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "cupyx/cutensor.pyx", line 235, in cupyx.cutensor.create_tensor_descriptor
  File "cupyx/cutensor.pyx", line 255, in cupyx.cutensor.create_tensor_descriptor
  File "cupyx/cutensor.pyx", line 79, in cupyx.cutensor.TensorDescriptor.__init__
  File "cupy_backends/cuda/libs/cutensor.pyx", line 226, in cupy_backends.cuda.libs.cutensor.createTensorDescriptor
  File "cupy_backends/cuda/libs/cutensor.pyx", line 189, in cupy_backends.cuda.libs.cutensor.check_status
cupy_backends.cuda.libs.cutensor.CuTensorError: CUTENSOR_STATUS_NOT_SUPPORTED
from pyscf.df import incore
import pyscf
from gpu4pyscf.df import int3c2e_bdiv


mol = pyscf.M(
    atom='''
C     7.2664723   -0.0499943   -0.0065814 
C     7.1293317    1.3272633    0.2300085 
C     5.7902954    1.7503053    0.2723592 
C     4.8577950    0.7219655    0.0716040 
S     5.6819288   -0.7938244   -0.1722845 
H     7.9830786    1.9934581    0.3648773 
H     5.4983874    2.7886551    0.4429769 
C    -0.9120223    1.0426618   -0.0564051 
C    -1.8046659   -0.0450478   -0.0020236 
N    -1.6944313    2.1954095   -0.1378876 
C    -3.1470577    0.4382575   -0.0229097 
C    -3.1048622    1.8875924   -0.1162697 
C    -1.8495179   -1.4947275    0.0924656 
O    -0.9922691   -2.3766087    0.1408380 
N    -3.2619128   -1.8011177    0.1123776 
C    -4.0402808   -0.6478351    0.0321611 
O    -3.9645573    2.7674408   -0.1625691 
C    -1.2994101    3.5801035   -0.3457870 
H    -0.8941850    4.0362632    0.5745842 
H    -0.5592670    3.6609730   -1.1577256 
H    -2.2215514    4.1162944   -0.6188625 
C    -3.6623799   -3.1846460    0.3180075 
H    -4.0624797   -3.6394978   -0.6052655 
H    -2.7445188   -3.7243672    0.5982990 
H    -4.4092758   -3.2621573    1.1240239 
C    -8.3153036   -0.3890379   -0.0513520 
C    -7.5356331    0.7462399    0.2188833 
C    -7.7103592   -1.6258423   -0.3173492 
C    -6.1453369    0.6364155    0.2376686 
H    -8.0131390    1.7113545    0.4073224 
C    -6.3176166   -1.7292837   -0.2899240 
H    -8.3238887   -2.4998883   -0.5507637 
C    -5.5006445   -0.6069967    0.0010727 
H    -5.5454868    1.5354030    0.4104793 
H    -5.8758409   -2.6957884   -0.5290363 
C     0.5444130    1.0066291   -0.0167939 
C     1.3594225    2.1383186    0.2518919 
C     1.2033855   -0.2373239   -0.2205366 
C     2.7466528    2.0400635    0.2853088 
H     0.9120585    3.1071706    0.4678860 
C     2.5895867   -0.3264924   -0.1935757 
H     0.6115191   -1.1441206   -0.3779559 
C     3.4034596    0.8079664    0.0500586 
H     3.3311768    2.9370434    0.5069021 
H     3.0581271   -1.3025041   -0.3627858 
Br  -10.2111239   -0.2479833   -0.0751307 
C     8.4168303   -0.8906528   -0.1266851 
C     9.7525028   -0.5500912   -0.0365112 
C    10.2011789    0.7832768    0.2064403 
C    10.8248189   -1.5688820   -0.1897493 
N    10.5237407    1.8920973    0.4070390 
O    12.0162313   -1.3320076   -0.1205693 
O    10.3312507   -2.8183344   -0.4204713 
H    11.1168476   -3.3970633   -0.5033726 
H     8.2265581   -1.9524117   -0.3163640 
''',                     
    basis='def2-svp',                        
    verbose=4,
    charge=0                      
    )


auxmol = mol.copy()
auxmol.basis = {'H': [[0, [0.1999828038466018, 1.0]]], 'O': [[0, [0.2587932305664396, 1.0]]], 'C': [[0, [0.1320292535005648, 1.0]]], 'S': [[0, [0.07333458614245612, 1.0]]], 'Br': [[0, [0.06164023088322297, 1.0]]], 'N': [[0, [0.1900871004703463, 1.0]]]}

auxmol.build()


dat = int3c2e_bdiv.aux_e2(mol, auxmol)
ref = incore.aux_e2(mol, auxmol)


print('abs(dat.get()-ref).max()', abs(dat.get()-ref).max())
assert abs(dat.get()-ref).max() < 1e-10


int3c2e_opt = int3c2e_bdiv.Int3c2eOpt(mol, auxmol).build()

eri3c_batch = next(int3c2e_opt.int3c2e_bdiv_generator())
eri3c_batch = int3c2e_opt.orbital_pair_cart2sph(eri3c_batch, inplace=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions