Git Product home page Git Product logo

Comments (9)

abrassel avatar abrassel commented on June 17, 2024 1

Oh! This helped immensely @Manvi-Agrawal . I would definitely have benefited from having this in the work book (or at least a link to the solutions).

from quantumkatas.

tcNickolas avatar tcNickolas commented on June 17, 2024 1

Yes, if this helps, we definitely can add this to the workbook! (And I didn't know you could use LaTeX on GitHub either! :-) )

from quantumkatas.

Manvi-Agrawal avatar Manvi-Agrawal commented on June 17, 2024

Hi @abrassel, I did not get your question fully, so I am taking liberty to explain the whole solution.

  • First, we start by preparing the described state with the qubits reversed. This is important as it allows to prepare the state inplace.
  • We are doing this by leveraging BinaryFractionQuantumInPlace from Task 1.5. This function changes the state of the register from $|j_1\rangle \otimes |j_2 ... j_n\rangle$ to $\frac{1}{\sqrt{2}} \big(|0\rangle + e^{2\pi i \cdot 0.j_1 j_2 ... j_n} |1\rangle \big) \otimes |j_2 ... j_n\rangle$.
  • In short, BinaryFractionQuantumInPlace if applied on register $|j_1 ... j_n\rangle$, only transforms $|j_1\rangle$.
  • We can use above operation to transform $|j_1\rangle \otimes |j_2> \otimes |j_3 ... j_n\rangle$ to $|j_1\rangle \otimes \frac{1}{\sqrt{2}} \big(|0\rangle + e^{2\pi i \cdot 0.j_2 ... j_n}) \otimes |j_3 ... j_n\rangle$ by applying operation BinaryFractionQuantumInPlace to register $|j_2 ... j_n\rangle$, and so on...
  • Finally, we use ReverseRegister from task 1.6 to get the desired state.

from quantumkatas.

abrassel avatar abrassel commented on June 17, 2024

Hi @Manvi-Agrawal , thanks for explaining your solution! I didn't realize that you could use latex in markdown comments, so I can actually go into a bit more depth about the nature of my question. My specific understanding gap is in the math, not the gates we are using to implement it.

In Task 1.7, there is a two-step sequence of algebraic transformations. From $\frac{1}{\sqrt{2^n}}\sum{e^{2\pi i \cdot \frac{jk}{2^n}}} |k\rangle$, and taking any given qubit (i.e. $|0101\rangle$), and factoring it across tensor products. When you distribute the tensor products, you wind up with terms such as $e^{2\pi i \cdot (0.j_{2}j_{3} + 0.j_{1} j_{2}j_{3})}|011\rangle$. It's unclear to me how that is equivalent to the step prior to the transformation.

from quantumkatas.

Manvi-Agrawal avatar Manvi-Agrawal commented on June 17, 2024

Hi @abrassel, the math of transformation from $\frac{1}{\sqrt{2^{n}}} \sum_{}{} e^{2\pi i \cdot \frac{jk}{2^{n}}} |k\rangle$ to factoring it across various tensor products is a bit intensive and lengthy.

Here is the github link that you can visit to see the math. You will find the math below solution for Task 1.7 under the heading "Math to get qubit transformation from summation"

from quantumkatas.

Manvi-Agrawal avatar Manvi-Agrawal commented on June 17, 2024

@tcNickolas, do you think we should add this math in workbook or would it get too intensive? Because I think its not very obvious to understand the transformation from summation to tensor products expression listed in workbook for task 1.7.

from quantumkatas.

Manvi-Agrawal avatar Manvi-Agrawal commented on June 17, 2024

I am glad @abrassel , that I was able to help you

from quantumkatas.

Manvi-Agrawal avatar Manvi-Agrawal commented on June 17, 2024

Hmm, this is interesting. This was my first time using LaTex on Github. My idea behind using LaTex in comment was that Github supports markdown in comments. And we use Latex in markdown cells in Jupyter notebook. That being said, Github markdown supports only some LaTex or with a slightly different syntax.

I initially planned to send the math explaination in Github comment by copying from jupyter notebook. But it did not render well. So, I just commited my changes in jupyter and shared Github llink to save time.

from quantumkatas.

Manvi-Agrawal avatar Manvi-Agrawal commented on June 17, 2024

I think it might be a good idea to introduce a separate task for Two qubit QFT so that math for N bit QFT does not sound a bit lengthy to the learners.

Also, I think that maybe we should give the info about transformation of summation to tensor products in a hint, rather than giving it right away so that learners can spend some time in figuring out math. Also, I have given an option to skip math as well, so that if someone is finding math difficult they can just try to implement the expression instead of leaving the kata unsolved :-(.

Here is my link to my branch containing the changes. I have 3 commits. Kindly note that first commit contains most of the meaningful changes. Second commit is for cleaning up things, fixing typos and adding some stuff that I thought might be useful. Third commit just changes the task numbering.

Would love to know if this refactoring makes sense? Or do we just want to add math explaination from the github link that I shared earlier?

from quantumkatas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.