Skip to content

Commit

Permalink
update entanglement forging notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Nov 6, 2023
1 parent 908a2d8 commit b3b0c22
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions docs/tutorials/05-entanglement-forging.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,19 @@
"\n",
"# Define active space\n",
"active_space = [1, 2, 4, 5, 6]\n",
"norb = len(active_space)\n",
"n_electrons = int(sum(hartree_fock.mo_occ[active_space]))\n",
"n_alpha = (n_electrons + hartree_fock.mol.spin) // 2\n",
"n_beta = (n_electrons - hartree_fock.mol.spin) // 2\n",
"nelec = (n_alpha, n_beta)\n",
"\n",
"# Compute FCI energy\n",
"cas = pyscf.mcscf.CASCI(hartree_fock, ncas=len(active_space), nelecas=nelec)\n",
"mo = cas.sort_mo(active_space, base=0)\n",
"energy_fci = cas.kernel(mo)[0]\n",
"\n",
"# Get molecular data and molecular Hamiltonian (one- and two-body tensors)\n",
"mol_data = ffsim.MolecularData.from_hartree_fock(\n",
" hartree_fock, active_space=active_space\n",
")\n",
"mol_hamiltonian = mol_data.hamiltonian"
"norb = mol_data.norb\n",
"nelec = mol_data.nelec\n",
"mol_hamiltonian = mol_data.hamiltonian\n",
"\n",
"# Compute FCI energy\n",
"cas = pyscf.mcscf.CASCI(hartree_fock, ncas=mol_data.norb, nelecas=mol_data.nelec)\n",
"mo = cas.sort_mo(active_space, base=0)\n",
"energy_fci = cas.kernel(mo)[0]"
]
},
{
Expand Down

0 comments on commit b3b0c22

Please sign in to comment.