Skip to content
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

Added an example of quantum adder #326

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

Added an example of quantum adder #326

wants to merge 16 commits into from

Conversation

JerryZYGo
Copy link

Hi I am interested in this project, so I want to make some contribution by adding an illustrated tutorial explaining how to construct a quantum adder. I hope this can lower the learning curve for other beginners.

Copy link
Contributor

@fernandodelaiglesia fernandodelaiglesia left a comment

Choose a reason for hiding this comment

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

Thank you Jerry for the interest and the proposal.

I have some concept questions, Is this adder taking advantage of the quantum nature of the qubits? If I try the notebook (using the sample test) by setting qureg_A[0] in a superposition state, which output I will get? Is the adder a binary one? if so, which is the point to have an example that is not using the quantum nature in ProjectQ?

In addition and in order to make the notebook usable in some jupytier environment I would add at the beginning a code line with

!pip install projectq

Thank you

@JerryZYGo
Copy link
Author

JerryZYGo commented Jun 16, 2019

Thank you Jerry for the interest and the proposal.
I have some concept questions, Is this adder taking advantage of the quantum nature of the qubits? If I try the notebook (using the sample test) by setting qureg_A[0] in a superposition state, which output I will get? Is the adder a binary one? if so, which is the point to have an example that is not using the quantum nature in ProjectQ?
In addition and in order to make the notebook usable in some jupytier environment I would add at the beginning a code line with
!pip install projectq
Thank you

Thank you for paying attention, I am always glad to have someone to discuss with the topic of quantum computation.

As for your question, is this adder taking advantage of the quantum nature of the qubits? I think the answer is yes (though not explicitly). This quantum adder is based on Vedral et al., the first implementation of quantum addition as far as I can track back in history. It is one basic building block of quantum modular exponentiation, which is the most demanding part of Shor's algorithm. So if we use it as a part of Shor's algorithm, the input state will be |1>, which is a superposition of eigenstates of Multiply_Modulo_N operator. So yes, in that sense the quantum nature of parallelism is utilized.

By the way, in the build-in function of projectQ, add_constant is implemented using another approach, see Draper. However I think this one is more straightforward and easier to understand.

@fernandodelaiglesia
Copy link
Contributor

Sorry for the delay in the answer.

Thank you for the references and for the explanantion. Now I think it is clear the intention. I would suggest to add the information of the reference in the notebook. In addition, do you plan to add all the operations that are described in the paper? I think it would complete the example.

Regarding the comment on adding to the notebook a first code line

!pip install projectq

what do you think?

Finally, if I'm not wrong, in order to be able merge, some maganement should be in place (contributor agreemnt). @Takishima, can you please help on this?

@Takishima
Copy link
Collaborator

Takishima commented Jun 28, 2019

Everybody that contributes to ProjectQ is required to sign a Copyright Licence Agreement (CLA).
The easiest way of getting it is to just send an e-mail to info@projectq.ch requesting the CLA and you should then get it, read it, sign it and return it.
Everything is done electronically.

@Takishima
Copy link
Collaborator

@JerryZYGo Did you manage to get the CLA signed? If not please do so. Until this is done I will not be reviewing this PR.

@CLAassistant
Copy link

CLAassistant commented Feb 13, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants