unitaryfund / pyqrack

Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator library
MIT License
16 stars 8 forks source link

Official PyQrack Documentation #16

Closed WrathfulSpatula closed 2 years ago

WrathfulSpatula commented 2 years ago

PyQrack has no documentation, beyond its README. The reason this can be, despite some hundred thousand downloads worth of utilization by others, is that PyQrack exposes a quantum gate API that is well-known colloquialism; what "T" means as a gate name in any quantum computing API is what it means in PyQrack, and so on for most-to-all gates in qrack_simulator.py, basically. This isn't entirely welcoming to new users, though. Many would benefit from a repository of readable API definition, at least.

Work toward formal documentation of PyQrack API can constitute unitaryHACK contribution. I can start a vm6502q organization repository for this, before or during unitaryHACK.

Zshan0 commented 2 years ago

Hello, I have been looking into pyqrack and followed it on the unitary fund discord server for a few days now and wanted to further understand the codebase to learn more about it, do you think this would be the right issue to learn more about qrack? If so I would love to communicate with the community and get this issue done!

Thanks

WrathfulSpatula commented 2 years ago

@Zshan0 Thanks for your interest! Yes, drafting a simple API reference for the gates in qrack_simulator.py could be a great way to familiarize yourself with the PyQrack module, and I'd be happy to help you throughout the process!

This was meant to be a bountied issue for unitaryhack.dev, by the way, worth $100. The hackathon hasn't started, quite yet, but, as a member of the Unitary Fund team myself, I could definitely talk to the hackathon organizers about getting you started on this ASAP, rather than blocking on the start of the hackathon simply for the sake of it.

Tonight, after my daily work on https://metriq.info for the Unitary Fund, I'll start a repository for the documentation you'll produce. I suspect that, based on the simple colloquial meanings of the gate method names, you'll be able to find satisfactory definitions from other sources, (like by Googling "quantum t gate," for example, and that will probably be specific enough). I'll be here to help, too!

I'll let you know here in this issue, when I've created the new documentation repository. Thanks again! :+1:

Zshan0 commented 2 years ago

Hey, thanks for the quick response! While you are setting that up, do you recommend I go through some codebase or material beforehand? I installed pyqrack and qrack on my system as of now, could let me know what kind of familiarity would I need of the codebase and functionality of qrack itself for working on pyqrack? and where would you recommend I start reading the pyqrack code, not very sure how to experiment with it yet.

Thanks :D

WrathfulSpatula commented 2 years ago

While I'm working out the logistics, a decent place to start experimenting with the PyQrack package is at https://github.com/vm6502q/pyqrack-jupyter. There are a very limited number of example Jupyter notebooks, so far, but they're working examples, at least.

As per the reason for this issue ticket in the first place, PyQrack currently relies on the hope that the QrackSimulator definition file is sufficiently self-documented, just by using common and obvious gate names, at https://github.com/vm6502q/pyqrack/blob/main/pyqrack/qrack_simulator.py. The names aren't exactly the same, but the similarity to the underlying vm6502q/qrack (C++11) library API is hopefully somewhat obvious, and Qrack's documentation lives here:

https://qrack.readthedocs.io/en/latest/

Qrack's API reference, specifically, comprises the bottom two headings on the left menu, "API" and "Doxygen."

Let me know if you need any more help!

WrathfulSpatula commented 2 years ago

@Zshan0 I'm still coordinating with Unitary Fund about the bounty, but here's the documentation repository skeleton!

https://github.com/vm6502q/pyqrack.github.io

More will follow when I get further details, but you're free to start working an on API reference! Based on foreseeable conditions, you might need to wait until the official hackathon event to receive the bounty, but we'll get it to you, if you start writing the API reference now or before the end of the event.

Also, any questions you have at all, feel free to ask me here or on the Unitary Fund Discord server, either in the #qrack channel, or you can message me directly. Thank you again!