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

[Feature] Conditional feed-forward operations #453

Open
arthurfaria opened this issue Jun 7, 2024 · 4 comments
Open

[Feature] Conditional feed-forward operations #453

arthurfaria opened this issue Jun 7, 2024 · 4 comments
Assignees
Labels
enhancement feature New feature or request

Comments

@arthurfaria
Copy link
Collaborator

arthurfaria commented Jun 7, 2024

For my QGNN implementations, I need conditional operations since the quantum pooling layer relies on these types of gates [1]. As in CNNs, QCNNs consist of convolution layers that finds a new state and a pooling layer that reduces the size of the system. Below is an example:

Picture1

Hence, for the quantum pooling layer, we need those conditional feed-forward operations, defined as follows [2]:

  • Principle of deferred measurement: a controlled gate followed by a measurement of the controlled qubit results in the same as first performing the measurement and then applying a classically-controlled gate as in Fig. below
Screenshot 2024-06-07 at 17 49 26

In addition, these conditional operations are a necessary ingredient for quantum error correction, such as in surface code schemes. They check for errors using measurements in ancillas and depending on the measurement results, the system either performs error correction or does not.


ref. [1]: https://arxiv.org/pdf/2009.09423
ref. [2]: https://arxiv.org/pdf/2308.13065

@arthurfaria arthurfaria changed the title Conditioan Conditional gates Jun 7, 2024
@arthurfaria arthurfaria changed the title Conditional gates Conditional feed-forward operations Jun 7, 2024
@arthurfaria arthurfaria added feature New feature or request enhancement labels Jun 7, 2024
@jpmoutinho
Copy link
Collaborator

jpmoutinho commented Jun 10, 2024

Hey @arthurfaria, thanks for opening this! How urgently do you need it?

Doing a fully integrated implementation of conditional gates would likely require a bit of re-thinking of some core features of Qadence, like adding a classical register, a different measurement operation other than "sample", and implementing the control mechanism.

However, there should be sufficient tools in Qadence to replicate the circuit you want. For example, since the measured qubits are not reused, instead of measuring you can just do a normal control gate and then post-process the data at the end and post-select on the state of the ancilla qubits. That way each pooling layer will not "reduce" size of the system, but it will have the same effect. Well this is essentially just not doing the deferred measurement like you said.

@rajaiitp
Copy link
Collaborator

rajaiitp commented Jun 10, 2024

As far as the runtime, I think its gonna be identical as you would have to run thru all possible projections of the qubits being measured (subspace scaled down by 2^k, but additional 2^k simulations). If you are interested in specific projections alone, I presume a quicker hack would be is to use projector operator once all the controlled operations are performed and reuse the subspace output of interest for further simulations

@jpmoutinho
Copy link
Collaborator

Yes indeed @rajaiitp, and projectors are also available in Qadence (see here).

@RolandMacDoland RolandMacDoland changed the title Conditional feed-forward operations [Feature] Conditional feed-forward operations Jul 22, 2024
@RolandMacDoland
Copy link
Collaborator

@jpmoutinho @arthurfaria @rajaiitp It would be good to start on this I guess.

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

No branches or pull requests

5 participants