Skip to content

Commit

Permalink
docs: fix spin for SGF
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Sep 11, 2024
1 parent a27c8b5 commit fd21c59
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/source/tutorial/qc-hamiltonians.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
"orb_sym = [orb_sym[i // 2] for i in range(len(orb_sym) * 2)]\n",
"n_sites = ncas * 2\n",
"\n",
"driver.initialize_system(n_sites=n_sites, n_elec=n_elec, spin=spin, orb_sym=orb_sym)\n",
"driver.initialize_system(n_sites=n_sites, n_elec=n_elec, orb_sym=orb_sym)\n",
"\n",
"mpo = driver.get_qc_mpo(h1e=h1e, g2e=g2e, ecore=ecore, iprint=1)\n",
"ket = driver.get_random_mps(tag=\"GS\", bond_dim=250, nroots=1)\n",
Expand Down Expand Up @@ -660,7 +660,7 @@
" ncore=0, ncas=None, g2e_symm=8)\n",
"\n",
"driver = DMRGDriver(scratch=\"./tmp\", symm_type=SymmetryTypes.SGF, n_threads=4)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, spin=spin, orb_sym=orb_sym)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, orb_sym=orb_sym)\n",
"\n",
"mpo = driver.get_qc_mpo(h1e=h1e, g2e=g2e, ecore=ecore, iprint=1)\n",
"ket = driver.get_random_mps(tag=\"GS\", bond_dim=250, nroots=1)\n",
Expand Down Expand Up @@ -767,7 +767,7 @@
" ncore=0, ncas=None, g2e_symm=8)\n",
"\n",
"driver = DMRGDriver(scratch=\"./tmp\", symm_type=SymmetryTypes.SGB, n_threads=4)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, spin=spin, orb_sym=orb_sym, heis_twos=1)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, orb_sym=orb_sym, heis_twos=1)\n",
"\n",
"mpo = driver.get_qc_mpo(h1e=h1e, g2e=g2e, ecore=ecore, iprint=1)\n",
"ket = driver.get_random_mps(tag=\"GS\", bond_dim=250, nroots=1)\n",
Expand Down Expand Up @@ -874,7 +874,7 @@
" ncore=0, ncas=None, pg_symm=False)\n",
"\n",
"driver = DMRGDriver(scratch=\"./tmp\", symm_type=SymmetryTypes.SGFCPX, n_threads=4)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, spin=spin, orb_sym=orb_sym)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, orb_sym=orb_sym)\n",
"\n",
"mpo = driver.get_qc_mpo(h1e=h1e, g2e=g2e, ecore=ecore, iprint=1)\n",
"ket = driver.get_random_mps(tag=\"GS\", bond_dim=250, nroots=1)\n",
Expand Down Expand Up @@ -1203,7 +1203,7 @@
"print(orb_sym_z)\n",
"\n",
"driver = DMRGDriver(scratch=\"./tmp\", symm_type=SymmetryTypes.SAnySGFLZ, n_threads=4)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, spin=spin, orb_sym=orb_sym_z, pg_irrep=0)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, orb_sym=orb_sym_z, pg_irrep=0)\n",
"\n",
"mpo = driver.get_qc_mpo(h1e=h1e, g2e=g2e, ecore=ecore, iprint=1)\n",
"ket = driver.get_random_mps(tag=\"GS\", bond_dim=250, nroots=1)\n",
Expand Down Expand Up @@ -2088,7 +2088,7 @@
"occs = occs + bias * (occs < 0.5) - bias * (occs > 0.5)\n",
"\n",
"driver = DMRGDriver(scratch=\"./tmp\", symm_type=SymmetryTypes.SGF, n_threads=4)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, spin=spin, orb_sym=orb_sym)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, orb_sym=orb_sym)\n",
"\n",
"mpo = driver.get_qc_mpo(h1e=h1e, g2e=g2e, ecore=ecore, iprint=0)\n",
"ket = driver.get_random_mps(tag=\"GS\", bond_dim=250, occs=occs, nroots=1)\n",
Expand Down Expand Up @@ -2582,7 +2582,7 @@
" ncore=0, ncas=None, g2e_symm=8)\n",
"\n",
"driver = DMRGDriver(scratch=\"./tmp\", symm_type=SymmetryTypes.SGF, n_threads=4)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, spin=spin, orb_sym=orb_sym)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, orb_sym=orb_sym)\n",
"\n",
"mpo = driver.get_qc_mpo(h1e=h1e, g2e=g2e, ecore=ecore, iprint=0)\n",
"ket = driver.get_random_mps(tag=\"GS\", bond_dim=250, nroots=1)\n",
Expand Down Expand Up @@ -2813,7 +2813,7 @@
" ncore=0, ncas=None, g2e_symm=8)\n",
"\n",
"driver = DMRGDriver(scratch=\"./tmp\", symm_type=SymmetryTypes.SGF, n_threads=4)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, spin=spin, orb_sym=orb_sym)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, orb_sym=orb_sym)\n",
"\n",
"mpo = driver.get_qc_mpo(h1e=h1e, g2e=g2e, ecore=ecore, iprint=0)\n",
"ket = driver.get_random_mps(tag=\"GS\", bond_dim=250, nroots=1)\n",
Expand Down Expand Up @@ -3083,7 +3083,7 @@
" g2e = g2e_orig[idx][:, idx][:, :, idx][:, :, :, idx]\n",
" orb_sym = np.array(orb_sym_orig)[idx]\n",
"\n",
" driver.initialize_system(n_sites=ncas, n_elec=n_elec, spin=spin, orb_sym=orb_sym)\n",
" driver.initialize_system(n_sites=ncas, n_elec=n_elec, orb_sym=orb_sym)\n",
" mpo = driver.get_qc_mpo(h1e=h1e, g2e=g2e, ecore=ecore, iprint=0)\n",
" ket = driver.get_random_mps(tag=\"GS\", bond_dim=250, nroots=1)\n",
" energy = driver.dmrg(mpo, ket, n_sweeps=20, bond_dims=bond_dims, noises=noises,\n",
Expand Down Expand Up @@ -3319,7 +3319,7 @@
"g2e_orig = driver.unpack_g2e(g2e_orig, n_sites=ncas)\n",
"\n",
"# approx DMRG to get orbital_interaction_matrix\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, spin=spin, orb_sym=orb_sym_orig)\n",
"driver.initialize_system(n_sites=ncas, n_elec=n_elec, orb_sym=orb_sym_orig)\n",
"mpo = driver.get_qc_mpo(h1e=h1e_orig, g2e=g2e_orig, ecore=ecore, iprint=0)\n",
"ket = driver.get_random_mps(tag=\"GS\", bond_dim=50, nroots=1)\n",
"energy = driver.dmrg(mpo, ket, n_sweeps=10, bond_dims=[50] * 8, noises=noises,\n",
Expand Down

0 comments on commit fd21c59

Please sign in to comment.