Skip to content

Commit

Permalink
regen notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
anurudhp committed Nov 6, 2024
1 parent e6b365d commit 9cb2e5e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
21 changes: 18 additions & 3 deletions qualtran/bloqs/phase_estimation/qubitization_qpe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"\n",
"#### Parameters\n",
" - `walk`: Bloq representing the Qubitization walk operator to run the phase estimation protocol on.\n",
" - `m_bits`: Bitsize of the phase register to be used during phase estimation.\n",
" - `ctrl_state_prep`: Bloq to prepare the control state on the phase register. Defaults to `OnEach(self.m_bits, Hadamard())`.\n",
" - `qft_inv`: Bloq to apply inverse QFT on the phase register. Defaults to `QFTTextBook(self.m_bits).adjoint()` \n",
"\n",
Expand Down Expand Up @@ -193,6 +192,22 @@
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "49743657",
"metadata": {
"cq.autogen": "QubitizationQPE.qubitization_qpe_ising"
},
"outputs": [],
"source": [
"from qualtran.bloqs.chemistry.ising.walk_operator import get_walk_operator_for_1d_ising_model\n",
"from qualtran.bloqs.phase_estimation import RectangularWindowState\n",
"\n",
"walk, _ = get_walk_operator_for_1d_ising_model(4, 0.1)\n",
"qubitization_qpe_ising = QubitizationQPE(walk, RectangularWindowState(4))"
]
},
{
"cell_type": "markdown",
"id": "b19f9365",
Expand All @@ -213,8 +228,8 @@
"outputs": [],
"source": [
"from qualtran.drawing import show_bloqs\n",
"show_bloqs([qubitization_qpe_hubbard_model_small, qubitization_qpe_sparse_chem, qubitization_qpe_chem_thc],\n",
" ['`qubitization_qpe_hubbard_model_small`', '`qubitization_qpe_sparse_chem`', '`qubitization_qpe_chem_thc`'])"
"show_bloqs([qubitization_qpe_hubbard_model_small, qubitization_qpe_sparse_chem, qubitization_qpe_chem_thc, qubitization_qpe_ising],\n",
" ['`qubitization_qpe_hubbard_model_small`', '`qubitization_qpe_sparse_chem`', '`qubitization_qpe_chem_thc`', '`qubitization_qpe_ising`'])"
]
},
{
Expand Down
1 change: 0 additions & 1 deletion qualtran/bloqs/phase_estimation/qubitization_qpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class QubitizationQPE(GateWithRegisters):
Args:
walk: Bloq representing the Qubitization walk operator to run the phase estimation protocol
on.
m_bits: Bitsize of the phase register to be used during phase estimation.
ctrl_state_prep: Bloq to prepare the control state on the phase register. Defaults to
`OnEach(self.m_bits, Hadamard())`.
qft_inv: Bloq to apply inverse QFT on the phase register. Defaults to
Expand Down
5 changes: 5 additions & 0 deletions qualtran/bloqs/phase_estimation/qubitization_qpe_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,8 @@ def test_qubitization_phase_estimation_of_walk(num_terms: int, use_resource_stat
@pytest.mark.notebook
def test_phase_estimation_of_qubitized_hubbard_model():
execute_notebook('phase_estimation_of_quantum_walk')


@pytest.mark.notebook
def test_notebook():
execute_notebook('qubitization_qpe')

0 comments on commit 9cb2e5e

Please sign in to comment.