Skip to content

Commit

Permalink
Fix another expm doc error (#801)
Browse files Browse the repository at this point in the history
- Taking exponential of a sparse matrix is no longer allowed.
- Convert this to dense matrix to fix doc generation.
  • Loading branch information
dstrain115 committed Sep 22, 2022
1 parent 16fa379 commit 8b1c2b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/fqe/tutorials/fermi_hubbard.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
"sparse_hopping_matrix = of.get_sparse_operator(sum(one_body_terms))\n",
"\n",
"# Exponentiate the matrix.\n",
"unitary = expm(-1j * e_time * sparse_hopping_matrix)\n",
"unitary = expm(-1j * e_time * sparse_hopping_matrix.todense())\n",
"\n",
"# Time-evolve the initial state.\n",
"evolved_cirq_wfn = unitary @ init_cirq_wfn"
Expand Down

0 comments on commit 8b1c2b4

Please sign in to comment.