Skip to content

Commit 2061f52

Browse files
authored
Projected Atomic Orbitals (#177)
Adds a virtual localizer class for calculating Projected Atomic Orbitals. THE WORK TO INTEGRATE THIS INTO THE DRIVER IS NOT COMPLETE. For this class to work, a simplified interface for the `OccupiedLocalizer` has been introduced, with a new `LocalizedSystem` being the output of the `localize` function.
1 parent d0ea107 commit 2061f52

28 files changed

+1385
-784
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,27 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.0.9]
8+
## [Unreleased]
99
Major refactor, with several breaking changes!
1010

1111
### Added
1212
- `NbedConfig` pydantic model to validate user input.
13+
- `OccupiedLocalizerTypes`, `VirtualLocalizerTypes` and `ProjectorTypes` enums added to config.
1314
- `savefile` config option used to save driver output to json file.
15+
- `PAOLocalizer` Virtual orbital localizaion with Projected Atomic Orbitals. (Implementation in driver not complete.)
16+
- `LocalizedSystem` dataclass added in `localizers/system.py`.
1417

1518
### Removed
1619
- `HamiltonianConverter` removed.
1720
- All functions relating to generating qubit hamiltonians have been removed from `HamiltonianBuilder`, this now only handles creating a second quantised hamiltonian.
1821

1922
### Changed
23+
- `OccupiedLocalizer` classes now output `LocalizedSystem` dataclass.
2024
- CLI tool now expects a path to a config `.json` file which matches the `NbedConfig` model.
2125
- `NbedDriver` automatically calls `HamiltonianBuilder.build()`, adding output to results as `second_quantised`.
2226
- Removed underscore from `driver._huzinaga` and `driver._mu`.
2327
- Driver defaults to *unrestricted* for both whole molecule and environment, passing charge and spin to environment based on spin-aware localization.
28+
- Config `run_virtual_localization` removed, with new flag `virtual_localizer` allowing for "cl" or "pao", defaulting to "cl".
2429

2530
## [0.0.9]
2631
### Fixed

docs/jupyter_execute/notebooks/1. Orbital Plotting and Localization Functions.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"\n",
103103
" plotted_orbitals = []\n",
104104
" for index in index_list:\n",
105-
" File_name = f\"temp_MO_orbital_index{index}.cube\"\n",
105+
" File_name = f\"temp_mo_orbital_index{index}.cube\"\n",
106106
" cubegen.orbital(PySCF_mol_obj, File_name, C_matrix[:, index])\n",
107107
"\n",
108108
" view = py3Dmol.view(width=width, height=height)\n",

docs/jupyter_execute/notebooks/6. Long form Notes.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@
515515
"metadata": {},
516516
"outputs": [],
517517
"source": [
518-
"print(f\"active inds: {localized_system.active_MO_inds}\")\n",
519-
"print(f\"enviro inds: {localized_system.enviro_MO_inds}\")"
518+
"print(f\"active inds: {localized_system.active_mo_inds}\")\n",
519+
"print(f\"enviro inds: {localized_system.enviro_mo_inds}\")"
520520
]
521521
},
522522
{
@@ -763,7 +763,7 @@
763763
" charge=charge,\n",
764764
" spin=spin,\n",
765765
")\n",
766-
"rks_emb_mol.nelectron = 2 * len(localized_system.active_MO_inds) # <--change no e-\n",
766+
"rks_emb_mol.nelectron = 2 * len(localized_system.active_mo_inds) # <--change no e-\n",
767767
"rks_emb_mol.build()\n",
768768
"\n",
769769
"rks_emb = scf.RKS(rks_emb_mol)\n",
@@ -855,7 +855,7 @@
855855
" spin=spin,\n",
856856
")\n",
857857
"full_system_mol.nelectron = 2 * len(\n",
858-
" localized_system.active_MO_inds\n",
858+
" localized_system.active_mo_inds\n",
859859
") # <- change number of e-\n",
860860
"full_system_mol.build()\n",
861861
"\n",
@@ -1038,7 +1038,7 @@
10381038
" spin=spin,\n",
10391039
")\n",
10401040
"full_system_mol_HUZ.nelectron = 2 * len(\n",
1041-
" localized_system.active_MO_inds\n",
1041+
" localized_system.active_mo_inds\n",
10421042
") # <- change number of e-\n",
10431043
"full_system_mol_HUZ.build()\n",
10441044
"\n",
@@ -1139,7 +1139,7 @@
11391139
"\n",
11401140
"overlap_by_size = overlap.argsort()[::-1]\n",
11411141
"\n",
1142-
"n_env_mo = len(localized_system.enviro_MO_inds)\n",
1142+
"n_env_mo = len(localized_system.enviro_mo_inds)\n",
11431143
"frozen_enviro_orb_inds = overlap_by_size[:n_env_mo]\n",
11441144
"active_MOs_occ_and_virt_embedded = [\n",
11451145
" mo_i\n",
@@ -1367,8 +1367,8 @@
13671367
"# note we only take MO environment indices!\n",
13681368
"ortho_proj = np.einsum(\n",
13691369
" \"ik,jk->ij\",\n",
1370-
" c_loc_ortho[:, localized_system.enviro_MO_inds],\n",
1371-
" c_loc_ortho[:, localized_system.enviro_MO_inds],\n",
1370+
" c_loc_ortho[:, localized_system.enviro_mo_inds],\n",
1371+
" c_loc_ortho[:, localized_system.enviro_mo_inds],\n",
13721372
")"
13731373
]
13741374
},

0 commit comments

Comments
 (0)