Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Updates to Grover's Algorithm chapter #185

Merged
merged 14 commits into from
Nov 19, 2021
Merged

Updates to Grover's Algorithm chapter #185

merged 14 commits into from
Nov 19, 2021

Conversation

vabarbosa
Copy link
Contributor

@vabarbosa vabarbosa commented Oct 25, 2021

@CLAassistant
Copy link

CLAassistant commented Oct 25, 2021

CLA assistant check
All committers have signed the CLA.

@vabarbosa
Copy link
Contributor Author

@SaraM92 thank you!! if possible, can you sign the contributor agreement? see comment above for link.

i have created a draft PR of the update. we also have a preview deployed here for (the team to review and comment):


@frankharkins any feedback is appreciated.
@JRussellHuffman would it be possible to get appropriately styled/themed images to replace the placeholder images?

thanks!

@JRussellHuffman
Copy link

Yes indeed. I'll make a design issue in the backlog, but that shouldn't be a blocker for this PR.

@vabarbosa
Copy link
Contributor Author

Yes indeed. I'll make a design issue in the backlog, but that shouldn't be a blocker for this PR.

@JRussellHuffman cool. just wanted to get it into your radar. thanks!!

Copy link
Member

@frankharkins frankharkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome thank you @SaraM92. I really like the triangle finding problem example you've added. I think it's a neat example and I like that it shows a different state preparation circuit.

The only big thing I'd change would be changing the formatting of the code examples a bit to match qiskit's style. If you want to use the linter, you can add this notebook's filepath to scripts/notebook_paths.txt. The textbook linter is a still a work-in-progress so let me know if it's giving you problems and we can change some of the rules.

Other than that, I added some other minor comments as I read through.

notebooks/ch-algorithms/grover.ipynb Outdated Show resolved Hide resolved
"\n",
"The first step of Grover's algorithm is the initial state preparation. As we just mentioned, the search space is all possible values we need to search through to find the answer we want. For the examples in this textbook, our 'database' is comprised of all the possible computational basis states our qubits can be in. For example, if we have 3 qubits, our list is the states $|000\\rangle, |001\\rangle, \\dots |111\\rangle$ (i.e the states $|0\\rangle \\rightarrow |7\\rangle$). So, in this case the size of our search space will be $N = 2^{3} = 8$.\n",
"\n",
"**Maybe add a page about the Dicke state in the composer circuit examples??**\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"**Maybe add a page about the Dicke state in the composer circuit examples??**\n",

We don't have control over the composer docs, we can request they consider this but for now we can link to wikipedia (or another resource) in the annotation

notebooks/ch-algorithms/grover.ipynb Outdated Show resolved Hide resolved
notebooks/ch-algorithms/grover.ipynb Outdated Show resolved Hide resolved
notebooks/ch-algorithms/grover.ipynb Outdated Show resolved Hide resolved
notebooks/ch-algorithms/grover.ipynb Outdated Show resolved Hide resolved
notebooks/ch-algorithms/grover.ipynb Outdated Show resolved Hide resolved
notebooks/ch-algorithms/grover.ipynb Outdated Show resolved Hide resolved
"metadata": {},
"outputs": [],
"source": [
"def cnz(qc, num_control, node, anc):\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use something from the circuit library here instead of building yourself please? The MCPhaseGate is closest I can find.

notebooks/ch-algorithms/grover.ipynb Outdated Show resolved Hide resolved
Copy link

@JRussellHuffman JRussellHuffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new graphics will need to be restyled to match the textbook aesthetic, which a new issue has been opened for that here. Otherwise, they look good to me.

@vabarbosa
Copy link
Contributor Author

@frankharkins i believe all your comments have been addressed. any final thoughts or are you good with merging this?

@vabarbosa vabarbosa marked this pull request as ready for review November 17, 2021 17:03
Copy link
Member

@frankharkins frankharkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks again!

@vabarbosa vabarbosa merged commit c85f1e9 into main Nov 19, 2021
@vabarbosa vabarbosa deleted the sara-draft branch November 19, 2021 17:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants