classiq-library icon indicating copy to clipboard operation
classiq-library copied to clipboard

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

Open TomerGoldfriend opened this issue 1 year ago • 2 comments

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 avatar May 15 '24 06:05 TomerGoldfriend

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

TomerGoldfriend avatar May 15 '24 06:05 TomerGoldfriend

sure let me have a look

AbdullahKazi500 avatar May 15 '24 13:05 AbdullahKazi500

@TomerGoldfriend I have started the work on this

AbdullahKazi500 avatar Jun 05 '24 18:06 AbdullahKazi500

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

TomerGoldfriend avatar Jun 05 '24 18:06 TomerGoldfriend

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?

AbdullahKazi500 avatar Jun 23 '24 10:06 AbdullahKazi500

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.

TomerGoldfriend avatar Jun 24 '24 13:06 TomerGoldfriend

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

amir-naveh avatar Jul 18 '24 07:07 amir-naveh

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

TomerGoldfriend avatar Jul 18 '24 07:07 TomerGoldfriend

@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 avatar Jul 18 '24 11:07 AbdullahKazi500

you can keep the issue open for now

AbdullahKazi500 avatar Jul 18 '24 11:07 AbdullahKazi500

@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

AbdullahKazi500 avatar Jul 21 '24 14:07 AbdullahKazi500

OK, good @AbdullahKazi500 .

TomerGoldfriend avatar Jul 22 '24 10:07 TomerGoldfriend

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

amir-naveh avatar Aug 15 '24 06:08 amir-naveh

@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 avatar Aug 15 '24 11:08 AbdullahKazi500

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

AbdullahKazi500 avatar Aug 15 '24 20:08 AbdullahKazi500

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

TomerGoldfriend avatar Aug 16 '24 15:08 TomerGoldfriend