Skip to content

Commit

Permalink
CNEO Quantum Computing UCC and FCI
Browse files Browse the repository at this point in the history
Contains functionality for UCC and FCI for CNEO, NEO, and electronic
calculations
  • Loading branch information
tculpitt authored and zc62 committed Mar 1, 2024
1 parent 4d42c82 commit d928ae3
Show file tree
Hide file tree
Showing 9 changed files with 1,991 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pyscf/ao2mo/incore.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,20 @@ def half_e1(eri_ao, mo_coeffs, compact=True):
nao, nmoi = mo_coeffs[0].shape
nmoj = mo_coeffs[1].shape[1]
nao_pair = nao*(nao+1)//2
if len(mo_coeffs) == 4:
nao2 = mo_coeffs[2].shape[0]
nao2_pair = nao2*(nao2+1)//2
else:
nao2_pair = nao_pair
ijmosym, nij_pair, moij, ijshape = _conc_mos(mo_coeffs[0], mo_coeffs[1], compact)
ijshape = (ijshape[0], ijshape[1]-ijshape[0],
ijshape[2], ijshape[3]-ijshape[2])

eri1 = numpy.empty((nij_pair,nao_pair))
eri1 = numpy.empty((nij_pair,nao2_pair))
if nij_pair == 0:
return eri1

if eri_ao.size == nao_pair**2: # 4-fold symmetry
if eri_ao.size == nao_pair*nao2_pair: # 4-fold symmetry
# half_e1 first transforms the indices which are contiguous in memory
# transpose the 4-fold integrals to make ij the contiguous indices
eri_ao = lib.transpose(eri_ao)
Expand All @@ -221,7 +226,7 @@ def half_e1(eri_ao, mo_coeffs, compact=True):
fdrv = getattr(_ao2mo.libao2mo, 'AO2MOnr_e1incore_drv')

buf = numpy.empty((BLOCK, nij_pair))
for p0, p1 in lib.prange(0, nao_pair, BLOCK):
for p0, p1 in lib.prange(0, nao2_pair, BLOCK):
fdrv(ftrans, fmmm,
buf.ctypes.data_as(ctypes.c_void_p),
eri_ao.ctypes.data_as(ctypes.c_void_p),
Expand Down
6 changes: 6 additions & 0 deletions pyscf/neo/basis/1s1p.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 1s1p basis

H S
25.556 1.000
H P
23.333 1.000
8 changes: 8 additions & 0 deletions pyscf/neo/basis/2s1p.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 2s1p basis

H S
21.111 1.000
H S
27.778 1.000
H P
23.333 1.000
7 changes: 7 additions & 0 deletions pyscf/neo/basis/dzsnb.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# DZSNB Basis, s-function exponents from:
# S.P. Webb, T. Iordanov, S. Hammes-Schiffer. J. Chem. Phys., 117 4106 (2002).

H S
20.17583 1.000
H S
29.29266 1.000
25 changes: 25 additions & 0 deletions pyscf/neo/qc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from pyscf import neo
from pyscf.neo.qc.qnuc import QC_FCI_NEO, QC_UCC_NEO, QC_CFCI_NEO, QC_CUCC_NEO
from pyscf.neo.qc.elec import QC_FCI_ELEC, QC_UCC_ELEC

def FCI(mf):
if isinstance(mf, neo.HF):
fcisolver = QC_FCI_NEO(mf)
else:
fcisolver = QC_FCI_ELEC(mf)
return fcisolver

def UCC(mf):
if isinstance(mf, neo.HF):
uccsolver = QC_UCC_NEO(mf)
else:
uccsolver = QC_UCC_ELEC(mf)
return uccsolver

def CFCI(mf):
fcisolver = QC_CFCI_NEO(mf)
return fcisolver

def CUCC(mf):
uccsolver = QC_CUCC_NEO(mf)
return uccsolver
Loading

0 comments on commit d928ae3

Please sign in to comment.