Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for DMRG UnitTests - Draft #68

Closed
wants to merge 99 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
8f94610
Added default dmrg `settings.py` to `external`, modified workflow,
ShaunWeatherly Dec 13, 2024
1a1fb39
`ruff` fixes in `dmrgscf_settings`
ShaunWeatherly Dec 13, 2024
e7d5570
`ruff` fixes again.
ShaunWeatherly Dec 13, 2024
7281805
Merging and bringing up to date.
ShaunWeatherly Jan 14, 2025
cf7d9e4
Merge from Main (#87)
ShaunWeatherly Jan 14, 2025
a42c878
Merge branch 'modified_dmrg_tests' of github.com:troyvvgroup/quemb in…
ShaunWeatherly Jan 14, 2025
1ae212d
Fixes for scratch management in `solver` and `helper` modules.
ShaunWeatherly Jan 14, 2025
c15af03
Added `DMRG_ArgsUser` to `TestBE_DMRG`
ShaunWeatherly Jan 14, 2025
e2f5a1b
Fixed incorrect definition of `ebe_tot` as `rets[0]`, which is only the
ShaunWeatherly Jan 14, 2025
f444837
Make `helper.delete_multiple_files` recursive.
ShaunWeatherly Jan 14, 2025
3e3d3d1
Make `use_cumulant=True` by default in `solver_block2`.
ShaunWeatherly Jan 14, 2025
ab10c5d
Modify `molecular_DMRG_test`
ShaunWeatherly Jan 14, 2025
a168d09
Merge branch 'main' into modified_dmrg_tests
ShaunWeatherly Jan 14, 2025
65299dd
Redundant fixes for `lo` module.
ShaunWeatherly Jan 14, 2025
3514d65
Sort imports in `solver`
ShaunWeatherly Jan 14, 2025
a9be377
Remove extra blank lines.
ShaunWeatherly Jan 14, 2025
e101f4a
Explicit versioning for block2 in `yaml`
ShaunWeatherly Jan 15, 2025
bc2dda5
Add `block2` to `test_requirements`
ShaunWeatherly Jan 15, 2025
52b7456
Reset `frag_type` in `molbe_dmrg...` example script.
ShaunWeatherly Jan 15, 2025
30aeb7c
Testing `max_mem`
ShaunWeatherly Jan 15, 2025
f2133b9
Test `LD_PRELOAD`
ShaunWeatherly Jan 15, 2025
e708caa
try only one of the block2
mcocdawc Jan 15, 2025
c381f8d
cleaned up test environment
mcocdawc Jan 16, 2025
d4c1054
don't wait for analysis
mcocdawc Jan 16, 2025
1e4504b
Test `conda`
ShaunWeatherly Jan 17, 2025
5a93e27
Test `nomkl` via `pip`
ShaunWeatherly Jan 17, 2025
2899f81
Test `nomkl` via `pip`
ShaunWeatherly Jan 17, 2025
687a228
tests `nomkl`
ShaunWeatherly Jan 17, 2025
0f9fe95
Tests `nomkl`
ShaunWeatherly Jan 17, 2025
aebef45
Tests `nomkl`
ShaunWeatherly Jan 17, 2025
fa4bb62
Tests `nomkl`
ShaunWeatherly Jan 17, 2025
ccf5059
Test block2 versioning.
ShaunWeatherly Jan 17, 2025
869ac8c
Test block2 versioning.
ShaunWeatherly Jan 17, 2025
9fa2b59
Update cache keys.
ShaunWeatherly Jan 17, 2025
5f39a5d
Update cache keys.
ShaunWeatherly Jan 17, 2025
2c04933
Update cache keys
ShaunWeatherly Jan 17, 2025
de9375a
Update cache keys
ShaunWeatherly Jan 17, 2025
30ed897
Remove block2 versioning
ShaunWeatherly Jan 17, 2025
42c4f6e
Test explicit cache save/restore.
ShaunWeatherly Jan 17, 2025
6a21dc0
Fully explicit save/restore for cache
ShaunWeatherly Jan 17, 2025
17d24e8
Block2 `no-binary`
ShaunWeatherly Jan 17, 2025
b08d2bc
Test `no-binary`
ShaunWeatherly Jan 17, 2025
ccb9e9c
Typo
ShaunWeatherly Jan 17, 2025
00e29a7
Explicit block2 versioning
ShaunWeatherly Jan 17, 2025
c48cbfb
Move to `test_requirements`
ShaunWeatherly Jan 17, 2025
9eedc9b
Edit block2 versioning.
ShaunWeatherly Jan 17, 2025
2d43e28
Force latest `mkl`
ShaunWeatherly Jan 17, 2025
4778738
test latest `mkl`
ShaunWeatherly Jan 17, 2025
ef240f9
Separate caching for `block2`
ShaunWeatherly Jan 17, 2025
94ede7e
Test caching
ShaunWeatherly Jan 17, 2025
6a6ae2c
Test caching
ShaunWeatherly Jan 17, 2025
aa8554a
Fine tune caching
ShaunWeatherly Jan 17, 2025
acc6544
Further fine-tune caching
ShaunWeatherly Jan 17, 2025
66e69ee
Back to block2 versioning
ShaunWeatherly Jan 17, 2025
fb59e91
Test `mkl`
ShaunWeatherly Jan 17, 2025
00a91a7
Add `test_opt_requirements.txt`
ShaunWeatherly Jan 17, 2025
23eb215
Modify requirements
ShaunWeatherly Jan 17, 2025
9a0092e
Test hashing
ShaunWeatherly Jan 17, 2025
2cb1abf
Test no `mkl`
ShaunWeatherly Jan 17, 2025
664f96b
More tests
ShaunWeatherly Jan 17, 2025
177ab88
Tests
ShaunWeatherly Jan 17, 2025
637d4d8
Tests
ShaunWeatherly Jan 17, 2025
4ebac0e
Test preloading.
ShaunWeatherly Jan 17, 2025
26ede77
Testing
ShaunWeatherly Jan 17, 2025
ed7722e
Test preloading
ShaunWeatherly Jan 17, 2025
5adc5d4
Test preloading
ShaunWeatherly Jan 17, 2025
9c1e108
Test preloading
ShaunWeatherly Jan 17, 2025
8afb975
Test preloading
ShaunWeatherly Jan 17, 2025
3ead062
Test preloading
ShaunWeatherly Jan 17, 2025
930d14b
Test preloading
ShaunWeatherly Jan 17, 2025
33f6aee
Test preloading
ShaunWeatherly Jan 17, 2025
9b8491c
Undo preload
ShaunWeatherly Jan 17, 2025
a7c3864
Test manual binary addition
ShaunWeatherly Jan 17, 2025
2f0e4c2
Testing
ShaunWeatherly Jan 17, 2025
352e1ed
Revert
ShaunWeatherly Jan 17, 2025
bdb0bff
Test forced library
ShaunWeatherly Jan 17, 2025
ae5257a
Revert
ShaunWeatherly Jan 17, 2025
f0d5adc
Revert
ShaunWeatherly Jan 17, 2025
8c410c4
Graph theoretic fragmentation via `graphgen`. (#86)
ShaunWeatherly Jan 17, 2025
26e5158
Merge branch 'modified_dmrg_tests' into main
ShaunWeatherly Jan 17, 2025
b7c78a2
Testing
ShaunWeatherly Jan 17, 2025
f17c59b
Testing conda
ShaunWeatherly Jan 19, 2025
6e25eea
Testing conda
ShaunWeatherly Jan 19, 2025
31e2aa1
Testing conda
ShaunWeatherly Jan 19, 2025
67ba833
Testing conda
ShaunWeatherly Jan 19, 2025
0a1c213
Testing conda
ShaunWeatherly Jan 19, 2025
e367c36
Testing `setup`
ShaunWeatherly Jan 19, 2025
4ec52e3
Testing directories
ShaunWeatherly Jan 19, 2025
d2c7697
Test directories
ShaunWeatherly Jan 19, 2025
4488314
Testing directories
ShaunWeatherly Jan 19, 2025
5d32294
Test setup
ShaunWeatherly Jan 19, 2025
f3aeac8
Final edits.
ShaunWeatherly Jan 22, 2025
65cd540
Formatting and `ompnum` passing.
ShaunWeatherly Jan 22, 2025
6f7c3a1
Install quemb in workflows.
ShaunWeatherly Jan 22, 2025
d01acfc
resolve `molecular_DMRG_test` scratch
ShaunWeatherly Jan 22, 2025
ab6e870
Update example script
ShaunWeatherly Jan 22, 2025
9543b29
Update .gitignore
ShaunWeatherly Jan 22, 2025
df55040
update .gitignore
ShaunWeatherly Jan 22, 2025
11885f7
Enable all unittests
ShaunWeatherly Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 57 additions & 16 deletions .github/workflows/quemb_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}
key: ${{ env.pythonLocation }}-${{ runner.OS }}-pip-cache-${{ hashFiles('setup.py') }}}}}}


- name: Install dependencies
Expand Down Expand Up @@ -79,10 +79,9 @@ jobs:

testsuite:
runs-on: ubuntu-latest
needs: analysis
strategy:
matrix:
python-version: ["3.10", "3.13"]
python-version: ["3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand All @@ -92,33 +91,75 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Prepare pip
run: |
python -m pip install --upgrade pip


- uses: actions/cache@v4
- name: Restore pip Cache
id: restore-pip-cache
uses: actions/cache/restore@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}
key: ${{ env.pythonLocation }}-${{ runner.OS }}-pip-cache-${{ hashFiles('setup.py') }}}}

- name: Install pip
if: steps.restore-pip-cache.outputs.cache-hit != 'true'
run: python -m pip install --upgrade pip

- name: Save pip Cache
if: steps.restore-pip-cache.outputs.cache-hit != 'true'
id: save-pip-cache
uses: actions/cache/save@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ steps.restore-pip-cache.outputs.cache-primary-key }}

- name: Restore quemb Cache
id: restore-quemb-cache
uses: actions/cache/restore@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ runner.OS }}-quemb-cache-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}-${{ hashFiles('tests/test_requirements.txt') }}}}

- name: Install dependencies
- name: Install quemb
if: steps.restore-quemb-cache.outputs.cache-hit != 'true'
run: |
pip install -r tests/test_requirements.txt
pip install git+https://github.com/pyscf/dmrgscf
PYSCFHOME=$(pip show pyscf-dmrgscf | grep 'Location' | tr ' ' '\n' | tail -n 1)
wget https://raw.githubusercontent.com/pyscf/dmrgscf/master/pyscf/dmrgscf/settings.py.example
mv settings.py.example ${PYSCFHOME}/pyscf/dmrgscf/settings.py
pip install .

- name: Save quemb Cache
if: steps.restore-quemb-cache.outputs.cache-hit != 'true'
id: save-quemb-cache
uses: actions/cache/save@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ steps.restore-quemb-cache.outputs.cache-primary-key }}

- name: Restore block2 Cache
id: restore-block2-cache
uses: actions/cache/restore@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ runner.OS }}-block2-cache-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}-${{ hashFiles('tests/test_opt_requirements.txt')}}}}

- name: Install block2
if: steps.restore-block2-cache.outputs.cache-hit != 'true'
run: |

PYSCFHOME=$(pip show pyscf-dmrgscf | grep 'Location' | tr ' ' '\n' | tail -n 1)
cp src/quemb/shared/external/dmrgscf_settings.py ${PYSCFHOME}/pyscf/dmrgscf/settings.py
chmod +x ${PYSCFHOME}/pyscf/dmrgscf/nevpt_mpi.py

- name: Save block2 Cache
if: steps.restore-block2-cache.outputs.cache-hit != 'true'
id: save-block2-cache
uses: actions/cache/save@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ steps.restore-block2-cache.outputs.cache-primary-key }}

- name: Test with pytest
run: |
pip install .
cd tests
QUEMB_SKIP_EXPENSIVE_TESTS=true pytest --doctest-modules --junitxml=junit/quemb-test-results_${{ matrix.python-version }}.xml


- name: Upload pytest junit results
uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
.tests/data/molecular_DMRG_test/*

# Translations
*.mo
Expand Down
1 change: 1 addition & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[lint]
# see the rules [here](https://docs.astral.sh/ruff/rules/)
select = ["E", "F", "I", "NPY", "PL", "ARG"]
exclude = ["tests/fragmentation_test.py"]
ignore = [
"S101",
# https://docs.astral.sh/ruff/rules/assert/
Expand Down
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"python": ("https://docs.python.org/3", None),
"pyscf": ("https://pyscf.org/", None),
"h5py": ("https://docs.h5py.org/en/stable/", None),
"networkx": ("https://networkx.org/documentation/stable/", None),
}


Expand Down
7 changes: 2 additions & 5 deletions example/molbe_dmrg_block2.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# any clear advantage to using any one scheme over another,
# the Pipek-Mezey scheme continues to be the most popular. With
# BE-DMRG, localization takes place prior to fragmentation:
fobj = fragpart(be_type="be1", mol=mol)
fobj = fragpart(be_type="be1", frag_type="autogen", mol=mol)
mybe = BE(
mf,
fobj,
Expand All @@ -55,7 +55,6 @@
solver="block2", # or 'DMRG', 'DMRGSCF', 'DMRGCI'
solver_args=DMRG_ArgsUser(
maxM=100, # Max fragment bond dimension
force_cleanup=True, # Remove all fragment DMRG tmpfiles
),
)

Expand Down Expand Up @@ -88,7 +87,7 @@
mol.charge = 0
mol.spin = 0
mol.build()
fobj = fragpart(be_type="be2", mol=mol)
fobj = fragpart(be_type="be2", frag_type="autogen", mol=mol)
mybe = BE(mf, fobj, lo_method="pipek-mezey", pop_method="lowdin")

# We automatically construct the fragment DMRG schedules based on user keywords.
Expand All @@ -109,7 +108,6 @@
max_noise=1e-3, # Max MPS noise introduced per sweep
min_tol=1e-8, # Tighest Davidson tolerance per sweep
block_extra_keyword=["fiedler"], # Specify orbital reordering algorithm
force_cleanup=True, # Remove all fragment DMRG tmpfiles
),
)

Expand All @@ -128,7 +126,6 @@
solver_args=DMRG_ArgsUser(
schedule_kwargs=schedule,
block_extra_keyword=["fiedler"],
force_cleanup=True,
),
)

Expand Down
11 changes: 8 additions & 3 deletions example/molbe_h8_chemical_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Perform BE calculations with different fragment schemes:

# Define BE1 fragments
fobj = fragpart(be_type="be1", mol=mol)
fobj = fragpart(be_type="be1", frag_type="autogen", mol=mol)
# Initialize BE
mybe = BE(mf, fobj)
# Perform chemical potential optimization
Expand All @@ -45,7 +45,12 @@
print(f"*** BE1 Correlation Energy Error (%) : {err_:>8.4f} %")

# Define BE2 fragments
fobj = fragpart(be_type="be2", mol=mol)
fobj = fragpart(be_type="be2", frag_type="autogen", mol=mol)
mybe = BE(mf, fobj)
mybe.optimize(solver="FCI", only_chem=True)

# Define BE2 fragments
fobj = fragpart(be_type="be2", frag_type="graphgen", mol=mol)
mybe = BE(mf, fobj)
mybe.optimize(solver="FCI", only_chem=True)

Expand All @@ -55,7 +60,7 @@
print(f"*** BE2 Correlation Energy Error (%) : {err_:>8.4f} %")

# Define BE3 fragments
fobj = fragpart(be_type="be3", mol=mol)
fobj = fragpart(be_type="be3", frag_type="graphgen", mol=mol)
mybe = BE(mf, fobj)
mybe.optimize(solver="FCI", only_chem=True)

Expand Down
2 changes: 1 addition & 1 deletion example/molbe_ppp.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
mf.kernel()

# Define fragments; use IAO scheme with 'sto-3g' as the minimal basis set
fobj = fragpart(be_type="be2", mol=mol, valence_basis="sto-3g", frozen_core=True)
fobj = fragpart(be_type="be2", mol=mol, iao_valence_basis="sto-3g", frozen_core=True)

# Initialize BE
mybe = BE(mf, fobj, lo_method="iao")
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
disallow_untyped_defs = False
check_untyped_defs = False

[mypy-tests.chem_dm_kBE_test,tests.chempot_molBE_test,tests.dm_molBE_test,tests.dmrg_molBE_test,tests.eri_onthefly_test,tests.hf-in-hf_BE_test,tests.kbe_polyacetylene_test,tests.molbe_h8_test,tests.molbe_io_fcidump_test,tests.molbe_octane_get_rdms_test,tests.molbe_oneshot_rbe_hcore_test,tests.molbe_oneshot_rbe_qmmm-fromchk_test,tests.ube-oneshot_test]
[mypy-tests.fragmentation_test,tests.chem_dm_kBE_test,tests.chempot_molBE_test,tests.dm_molBE_test,tests.dmrg_molBE_test,tests.eri_onthefly_test,tests.hf-in-hf_BE_test,tests.kbe_polyacetylene_test,tests.molbe_h8_test,tests.molbe_io_fcidump_test,tests.molbe_octane_get_rdms_test,tests.molbe_oneshot_rbe_hcore_test,tests.molbe_oneshot_rbe_qmmm-fromchk_test,tests.ube-oneshot_test]
disallow_untyped_defs = False
check_untyped_defs = False

Expand Down
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
"numpy>=1.22.0",
"scipy>=1.7.0",
"pyscf>=2.0.0",
"block2",
"intel-openmp==2021.4.0",
"mkl==2021.4.0",
"tbb==2021.13.1",
"pyscf-dmrgscf @ git+https://github.com/pyscf/dmrgscf.git",
"networkx",
"matplotlib",
"libdmet @ git+https://github.com/gkclab/libdmet_preview.git",
"attrs",
Expand Down
8 changes: 4 additions & 4 deletions src/quemb/kbe/autofrag.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def autogen(
nx=False,
ny=False,
nz=False,
valence_basis=None,
iao_valence_basis=None,
interlayer=False,
print_frags=True,
):
Expand Down Expand Up @@ -274,7 +274,7 @@ def autogen(
write_geom : bool, optional
Whether to write a 'fragment.xyz' file which contains all the fragments in
Cartesian coordinates. Defaults to False.
valence_basis : str, optional
iao_valence_basis : str, optional
Name of minimal basis set for IAO scheme. 'sto-3g' is sufficient for most cases.
Defaults to None.
valence_only : bool, optional
Expand Down Expand Up @@ -1922,11 +1922,11 @@ def autogen(
)
w.close()

pao = valence_basis is not None
pao = iao_valence_basis is not None

if pao:
cell2 = cell.copy()
cell2.basis = valence_basis
cell2.basis = iao_valence_basis
cell2.build()

bas2list = cell2.aoslice_by_atom()
Expand Down
8 changes: 4 additions & 4 deletions src/quemb/kbe/fragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(
ny=False,
nz=False,
kpt=None,
valence_basis=None,
iao_valence_basis=None,
be_type="be2",
mol=None,
frozen_core=False,
Expand Down Expand Up @@ -56,7 +56,7 @@ def __init__(
mol : pyscf.pbc.gto.cell.Cell
pyscf.pbc.gto.cell.Cell object. This is required for the options, 'autogen',
and 'chain' as frag_type.
valence_basis: str
iao_valence_basis: str
Name of minimal basis set for IAO scheme. 'sto-3g' suffice for most cases.
frozen_core: bool
Whether to invoke frozen core approximation. This is set to False by default
Expand Down Expand Up @@ -90,7 +90,7 @@ def __init__(
self.frozen_core = frozen_core
self.self_match = self_match
self.allcen = allcen
self.valence_basis = valence_basis
self.iao_valence_basis = iao_valence_basis
self.kpt = kpt
self.molecule = False # remove this

Expand All @@ -117,7 +117,7 @@ def __init__(
kpt,
be_type=be_type,
frozen_core=frozen_core,
valence_basis=valence_basis,
iao_valence_basis=iao_valence_basis,
unitcell=unitcell,
nx=nx,
ny=ny,
Expand Down
17 changes: 11 additions & 6 deletions src/quemb/kbe/lo.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Mixin_k_Localize:
def localize(
self,
lo_method,
valence_basis="sto-3g",
iao_valence_basis="sto-3g",
core_basis="sto-3g",
iao_wannier=True,
iao_val_core=True,
Expand All @@ -60,7 +60,7 @@ def localize(
lo_method : str
Localization method in quantum chemistry. 'lowdin', 'boys','iao',
and 'wannier' are supported.
valence_basis : str
iao_valence_basis : str
Name of valence basis set for IAO scheme. 'sto-3g' suffice for most cases.
core_basis : str
Name of core basis set for IAO scheme. 'sto-3g' suffice for most cases.
Expand Down Expand Up @@ -128,7 +128,7 @@ def localize(
elif lo_method == "iao":
if not iao_val_core or not self.frozen_core:
Co = self.C[:, :, : self.Nocc].copy()
S12, S2 = get_xovlp_k(self.cell, self.kpts, basis=valence_basis)
S12, S2 = get_xovlp_k(self.cell, self.kpts, basis=iao_valence_basis)
ciao_ = get_iao_k(Co, S12, self.S, S2=S2)

# tmp - aos are not rearrange and so below is not necessary
Expand All @@ -145,7 +145,7 @@ def localize(
# Cpao = get_pao_k(Ciao, self.S, S12, S2, self.cell)
# get_pao_native_k returns symm orthogonalized orbitals
cpao_ = get_pao_native_k(
Ciao_, self.S, self.cell, valence_basis, self.kpts
Ciao_, self.S, self.cell, iao_valence_basis, self.kpts
)

nk, nao, nlo = cpao_.shape
Expand Down Expand Up @@ -192,7 +192,7 @@ def localize(

# Begin valence
s12_val_, s2_val = get_xovlp_k(
self.cell, self.kpts, basis=valence_basis
self.cell, self.kpts, basis=iao_valence_basis
)
C_nocore = self.C[:, :, self.ncore :].copy()
C_nocore_occ_ = C_nocore[:, :, : self.Nocc].copy()
Expand Down Expand Up @@ -235,7 +235,12 @@ def localize(
)

cpao_ = get_pao_native_k(
c_core_val, self.S, self.cell, valence_basis, self.kpts, ortho=True
c_core_val,
self.S,
self.cell,
iao_valence_basis,
self.kpts,
ortho=True,
)
nk, nao, nlo = cpao_.shape
Cpao_ = zeros((nk, nao, nlo), dtype=complex128)
Expand Down
6 changes: 3 additions & 3 deletions src/quemb/kbe/lo_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def get_pao_k(Ciao, S, S12):
return asarray(Cpao)


def get_pao_native_k(Ciao, S, mol, valence_basis, ortho=True):
def get_pao_native_k(Ciao, S, mol, iao_valence_basis, ortho=True):
"""

Parameters
Expand All @@ -203,7 +203,7 @@ def get_pao_native_k(Ciao, S, mol, valence_basis, ortho=True):
ao ovlp matrix
mol :
mol object
valence_basis:
iao_valence_basis:
basis used for valence orbitals

Returns
Expand All @@ -215,7 +215,7 @@ def get_pao_native_k(Ciao, S, mol, valence_basis, ortho=True):

# Form a mol object with the valence basis for the ao_labels
mol_alt = mol.copy()
mol_alt.basis = valence_basis
mol_alt.basis = iao_valence_basis
mol_alt.build()

full_ao_labels = mol.ao_labels()
Expand Down
Loading
Loading