Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Nov 28, 2024
1 parent 062ab25 commit 06dd1bb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/source/tutorial/qc-hamiltonians.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@
"Time elapsed = 3.045 | E = -106.9391328597 | DE = 0.00e+00 | DW = 2.47e-20\n",
"\n",
"DMRG energy = -106.939132859666600\n",
"Norm = 1.000000000000000\n",
"Norm^2 = 1.000000000000000\n",
"Energy expectation = -106.939132859666586\n",
"<S^2> expectation = 2.000000000000001\n"
]
Expand Down Expand Up @@ -1304,16 +1304,16 @@
"\n",
"impo = driver.get_identity_mpo()\n",
"\n",
"norm = driver.expectation(ket, impo, ket)\n",
"normsq = driver.expectation(ket, impo, ket)\n",
"ener = driver.expectation(ket, mpo, ket)\n",
"\n",
"print('Norm = %20.15f' % norm)\n",
"print('Energy expectation = %20.15f' % (ener / norm))\n",
"print('Norm^2 = %20.15f' % normsq)\n",
"print('Energy expectation = %20.15f' % (ener / normsq))\n",
"\n",
"# <S^2> [ in spin-adapted mode this is always S(S+1) ]\n",
"ssq_mpo = driver.get_spin_square_mpo(iprint=0)\n",
"ssq = driver.expectation(ket, ssq_mpo, ket)\n",
"print('<S^2> expectation = %20.15f' % (ssq / norm))"
"print('<S^2> expectation = %20.15f' % (ssq / normsq))"
]
},
{
Expand Down Expand Up @@ -1355,7 +1355,7 @@
"n_mpo = driver.get_mpo(b.finalize(), iprint=0)\n",
"\n",
"n_0 = driver.expectation(ket, n_mpo, ket)\n",
"print('N0 expectation = %20.15f' % (n_0 / norm))"
"print('N0 expectation = %20.15f' % (n_0 / normsq))"
]
},
{
Expand Down

0 comments on commit 06dd1bb

Please sign in to comment.