TeamGraphix / graphix

measurement-based quantum computing (MBQC) compiler and simulator
https://graphix.readthedocs.io
Apache License 2.0
55 stars 20 forks source link

[demo] Quantum neural network #46

Closed shinich1 closed 1 year ago

shinich1 commented 1 year ago

Do quantum neural networks (QNNs) work well with LCMBQC? Please write up a python script or jupyter notebook in the graphix/example directory, describing the QNN algorithm with basic math, its implementation (both schematically and as a code), corresponding graph state before and after the Pauli measurement preprocessing. You may need to modify graphix.transpiler.Circuit class, or write a new transpiler class, to express the QNN circuit which may have non-equal number of input and output qubits. It would also be nice to see the plot of qubit resource (# of qubits in the resource state) vs QNN size, with and without Pauli measurement preprocessing.

Please see our contribution guide before starting, and do not forget to comment on this issue to show your interest. We are always happy to answer questions, so do not hesitate to ask on this page.

Thank you for your interest, and good luck!

shinich1 commented 1 year ago

@AbdullahKazi500 Please go ahead and work on this issue, thanks for your interest! According to unitaryHack guide, assigning to issue indicates successful merging of associated PR - so it should wait until there's a PR ready to merge.

Feel free to ask any question regarding graphix or the issue on this page :)

athanzxyt commented 1 year ago

Hey @shinich1, I would like to take a stab at this problem. (I won't ask to be assigned noting your previous comment)

RamAIbot commented 1 year ago

Hi @shinich1 I would like to work on this issue. I just have few questions. Should I need to train the QNN and LCMBQC model for some dataset and evaluate the performance? How do I approach the LCMBQC model. Do you have any references apart from docs?

shinich1 commented 1 year ago

@RamAIbot Yes it would be great if some QNN training can be done, with the help of external modules where necessary, but not a strong requirement for this issue (in case there are multiple PRs, one with actual training example is likely be preferred for merging if the implementation is similar). We would just like to see whether the typical circuit structure of QNN may work well with LCMBQC, so no need to tackle large and useful problems, just a small-scale demo would work. A good reference for LCMBQC is our preprint arXiv:2212.11975 (this is going through significant rewriting but should still be quite useful). I think the easiest way to approach this is to express QNN circuit using graphix.Circuit, and do standardize, shift_signals and perform_pauli_measurements. This will give you LCMBQC pattern to inspect and run. You may need to modify Circuit class to express QNN as above

andresulea commented 1 year ago

hi @shinich1, I'm trying to understand how Graphix works, it's really not very clear, how could I carry out the derivative of the circuit, in order to carry out the parameter update?

Gopal-Dahale commented 1 year ago

@shinich1 Kindly review PR #57.