diff --git a/docs/tutorials/05-entanglement-forging.ipynb b/docs/tutorials/05-entanglement-forging.ipynb index c5adf768b..740abb417 100644 --- a/docs/tutorials/05-entanglement-forging.ipynb +++ b/docs/tutorials/05-entanglement-forging.ipynb @@ -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]" ] }, {