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

Add another implementation for the "increment" function in the discrete quantum walk tutorial #56

Closed
TomerGoldfriend opened this issue May 15, 2024 · 16 comments
Assignees
Labels
quantum intermediate Requires some basic knowledge in quantum computing

Comments

@TomerGoldfriend
Copy link
Member

The tutorial on Discrete Quantum Walks demonstrates an example of a quantum walk on a circle. The quantum_step_clockwise quantum function is implemented as a QFT-adder, however, there are other implementations available for such quantum operation, e.g., by applying a cascade of multi-controlled-X gates.

The goal of this issue is to add another implementation for the quantum_step_clockwise quantum function in the aforementioned tutorial.

Detailed guidelines:

  1. Within the section "Example: Symmetric Quantum Walk on a Circle" in the notebook do the following:
    • Add a text explaining that in this example we will construct an implementation for the "clockwise_step"/"increment" function, which is different from the QFT-based implementation presented above.
    • Add a cell defining a new quantum function with the following declaration: qfunc increment(x: QArray[QBit]).
    • Use the new function in the specific example treated in the section.
    • Modify the synthesis constraints: optimize over depth with a relevant constraint over the width.
  2. Under the "Technical Notes" section, add a short explanation about the implementation.
  3. Make sure to generate a qmod (using the write_qmod function) for the modified example.
  4. Make sure the notebook looks well, does not have any typos / mistakes, and is running properly.
  5. Follow the contribution guidelines to open a pull request.

If you have any questions or comments, you can ask them here in the issue, or in our slack community, and the Classiq team will be happy to assist.

Happy quantum coding!

@TomerGoldfriend TomerGoldfriend added the quantum intermediate Requires some basic knowledge in quantum computing label May 15, 2024
@TomerGoldfriend
Copy link
Member Author

@AbdullahKazi500 Please see the description above. Let us know if you have any questions.

@AbdullahKazi500
Copy link
Contributor

sure let me have a look

@AbdullahKazi500
Copy link
Contributor

@TomerGoldfriend I have started the work on this

@TomerGoldfriend
Copy link
Member Author

Great @AbdullahKazi500 ! let us know if you have any questions.

@AbdullahKazi500
Copy link
Contributor

Great @AbdullahKazi500 ! let us know if you have any questions.

Hi can we use auxiliary qubits (qr_aux) when implementing multi-controlled-X gates in Classiq?

@TomerGoldfriend
Copy link
Member Author

Great @AbdullahKazi500 ! let us know if you have any questions.

Hi can we use auxiliary qubits (qr_aux) when implementing multi-controlled-X gates in Classiq?

You do not need to specify auxiliary qubits explicitly. Classiq supports various implementations for the multi-controlled-X operation. The implementation, and in particular whether there is a usage of auxiliaries or not, is determined automatically by the synthesis. For example, you can synthesize the following code

qfunc main(output target: qbit) {
  qba: qnum;
  allocate<5>(qba);
  allocate<1>(target);
  control (qba==2) {
    X(target);
  }
}

with different optimization/constraints and see that different implementations are chosen.

@amir-naveh
Copy link
Member

@TomerGoldfriend - is this still in progress or should I close it? Thanks

@TomerGoldfriend
Copy link
Member Author

@AbdullahKazi500 could you please give an update? are you planning to work on this?

@AbdullahKazi500
Copy link
Contributor

@TomerGoldfriend - is this still in progress or should I close it? Thanks

Hi @amir-naveh and @TomerGoldfriend this is still in progress I am testing my code will report soon

@AbdullahKazi500
Copy link
Contributor

you can keep the issue open for now

@AbdullahKazi500
Copy link
Contributor

@AbdullahKazi500 could you please give an update? are you planning to work on this?

Hi tomer I got the implementation running the code runs fine for now and is giving the output with the increment decrement
but I have a doubt with the output /results we can discuss this next week when I make a PR

@TomerGoldfriend
Copy link
Member Author

OK, good @AbdullahKazi500 .

@amir-naveh
Copy link
Member

@TomerGoldfriend - what is the status here? Can we close this?

@AbdullahKazi500
Copy link
Contributor

@TomerGoldfriend - what is the status here? Can we close this?

there was some progress but the code is halfway done as I am busy this week and the coming week you can close it and if you want you can reopen it later on

@AbdullahKazi500
Copy link
Contributor

OK, good @AbdullahKazi500 .

Hi Tomer if you want I can upload my file but I am not sure how well is the implementation been done

@TomerGoldfriend
Copy link
Member Author

@AbdullahKazi500 no need to upload a partial code. @amir-naveh I am closing this and will reopen when @AbdullahKazi500
has something to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quantum intermediate Requires some basic knowledge in quantum computing
Projects
None yet
Development

No branches or pull requests

3 participants