-
Notifications
You must be signed in to change notification settings - Fork 21
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
Comments
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. |
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 @arthurfaria @rajaiitp It would be good to start on this I guess. |
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:
Hence, for the quantum pooling layer, we need those conditional feed-forward operations, defined as follows [2]:
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
The text was updated successfully, but these errors were encountered: