quark-app / quark

Quark is a user-friendly app to dive into the realm of quantum computing through simple block-based coding.
GNU General Public License v3.0
0 stars 0 forks source link

Use more efficient runtime #3

Open Lynzzyr opened 2 months ago

Lynzzyr commented 2 months ago

The leading quantum computing SDK/library is Qiskit by IBM. However it is a Python library. There are some undocumented ways to use C++ with Qiskit, but generally it is for Python. Preferably the backend runtime should be coded in a more efficient language such as the aforementioned C++ or even god forbid Rust. While Qiskit isn't available for these languages, here are some other libraries for other languages:

Qulacs - C++ (most popular for C++) Quantum++ - C++ RustQIP - Rust Quantum - Rust

bulutthecat commented 2 months ago

Currently working on this, I have decided to go with rust. I am not switching the Quantum lang yet, as that will come in the future. but I have implemented the json parsing and python output in rust. needs further testing.

logandhillon commented 2 months ago

@bulutthecat Please make sure you are not directly committing to main. I have reverted your commit on main and left your branch alone, however, we want to keep main as the working branch.

When you're done, make a PR instead.

Lynzzyr commented 2 months ago

While a compiler written in Rust may be a smidge faster, ultimately a Python compiler would be more practical as it has virtually no performance drawbacks and Rust may in fact be a hinderance in terms of the host machine and the person working on the script.

This issue is meant to actually run the quantum code in another language besides Python. I will be working on this and I may use the Rust compiler or not. Probably not though.

bulutthecat commented 2 months ago

@bulutthecat Please make sure you are not directly committing to main. I have reverted your commit on main and left your branch alone, however, we want to keep main as the working branch.

When you're done, make a PR instead.

The changes I have pushed to main, I have made sure to not interfere with the main frontend/backend. As well as rigorously tested to make sure no existing code in main was modified. Please let me know before you make a change like that.

bulutthecat commented 2 months ago

While a compiler written in Rust may be a smidge faster, ultimately a Python compiler would be more practical as it has virtually no performance drawbacks and Rust may in fact be a hinderance in terms of the host machine and the person working on the script.

This issue is meant to actually run the quantum code in another language besides Python. I will be working on this and I may use the Rust compiler or not. Probably not though.

Yes, currently Python is fine for that, our compiler needs to be well optimized for RAM usage though, as each user query will be going through it. Python has proven to use alot of RAM, something which cannot be particularly reserved at scale, for each user request, and JIT isnt fast enough for our usecase.

As for moving to Rust or C++ for our compiled code, It would be easier to use native Qiskit instead of a subsidiary/intermediary language.

Lynzzyr commented 2 months ago

Okay I will look into your suggestions however note that those mentioned libraries are not intermediary languages for Qiskit and are instead fully fledged quantum SDKs as far as my knowledge covers.

For now @bulutthecat you don't need to worry about this.

bulutthecat commented 2 months ago

Okay I will look into your suggestions however note that those mentioned libraries are not intermediary languages for Qiskit and are instead fully fledged quantum SDKs as far as my knowledge covers.

For now @bulutthecat you don't need to worry about this.

Thats fine, you focus on making an example script in one of those languages, and then we can both work on porting our qupython code compiler over. All of those are fine options, get back to me when you can finalize that, and we can both work on it. for now, I am going to keep this open until we can decide on what language to use.

logandhillon commented 1 month ago

The changes I have pushed to main, I have made sure to not interfere with the main frontend/backend. As well as rigorously tested to make sure no existing code in main was modified. Please let me know before you make a change like that.

Hi, please be aware that no one should commit directly to main, instead, make a branch and PR into main. I'm sure you're aware of this, so no worries.