Skip to content

Fix grover_oracle() #3316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/tutorials/grovers-algorithm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@
" ]\n",
" # Add a multi-controlled Z-gate with pre- and post-applied X-gates (open-controls)\n",
" # where the target bit-string has a '0' entry\n",
" qc.x(zero_inds)\n",
" if zero_inds:\n",
" qc.x(zero_inds)\n",
" qc.compose(MCMTGate(ZGate(), num_qubits - 1, 1), inplace=True)\n",
" qc.x(zero_inds)\n",
" if zero_inds:\n",
" qc.x(zero_inds)\n",
" return qc"
]
},
Expand Down
Loading