microsoft / Quantum

Microsoft Quantum Development Kit Samples
https://docs.microsoft.com/quantum
MIT License
3.86k stars 920 forks source link

Add Python host programs to chemistry samples. #233

Open cgranade opened 4 years ago

cgranade commented 4 years ago

Currently, most samples only have a C# host program. It would be nice if more or even most samples demonstrated how to use Python to call into Q#.

Samples with Python Hosts

bromeg commented 4 years ago

We are working on a samples re-organization, it would be best for those interesting in helping with this issue to work on it after #235 has been merged.

cgranade commented 4 years ago

As per @bromeg's comment above, I think we're in a better place to add host programs now that #235 is in. ♥

deadmau6 commented 4 years ago

Hello, are you still looking for help with this issue? Also this is my first time contributing to Open Source but this seems like a simple issue.

cgranade commented 4 years ago

@deadmau6: Thanks for your patience, we'd definitely appreciate help with this one! We recently added several Python host programs to the samples in the getting-started folder, but there's a number of samples that still only have C# host programs. A good place to start might be with the bit-flip-code sample, as adding a Python host to that would require fairly minimal changes. Please let me know if there's anything I can do to help, in the meantime we really appreciate the contribution! 💕

deadmau6 commented 4 years ago

Update: Just giving a quick update here, so I finished the bit-flip-code and almost all of the samples in algorithms/. I did have an issue with order-finding in which the solution is maybe not the best and I can go into more detail either here or in a PR. Anyways I should be able to get a lot more done over the weekend because I don't have to work.

Questions: I do have a quick question, should I submit all of the samples in one PR? Also is there some sort of issues and sub-issues list in github?

I'm just thinking it would be easier to provide updates if there was a task list I could check off like algorithms -> done. Thanks!

cgranade commented 4 years ago

Thanks, @deadmau6! For order-finding, if it would be helpful I'm happy to take a look in a PR and offer what suggestions I can. As for PR style, I don't think there's a huge advantage either way for having one big PR or several small ones in this case; whatever works best for you.

Thanks for the suggestion of a sub-issues list, probably the easiest way to do that is for me to edit the original issue with - [ ] lists, as GitHub then renders that as a kind of sub-issue. I'll go on and do that now, then. Thanks!

deadmau6 commented 4 years ago

@cgranade, quick update, sorry it has taken me so long. I am nearly complete with all of the samples, but I hit a wall with most of the chemistry samples. I feel like I am missing something like a library, but I have everything done except for GetGateCount, CreateHubbardHamiltonian, SimulateHubbardHamiltonian, RunSimultation, and MolecularHydrogen. Anyways can I submit a PR for what I have and then could you maybe help me out with the chemistry stuff?

cgranade commented 4 years ago

My apologies for the delay, @deadmau6, just getting spun back up after a vacation. In any case, the chemistry host programs are definitely the hardest to adapt, as there's a lot of pre- and post-processing that happens in the classical hosts to load problem descriptions. Especially given planned simplifications such as #203, I agree with making a PR for the other host programs for now, that sounds like a great idea. Thank you again for all your help!

deadmau6 commented 4 years ago

Awesome! And no worries I actually made some progress since I last spoke, not enough to add to this PR but if there is a better place I'd love to share what I got. Anyways I'll submit the PR once I get home tonight.

cgranade commented 4 years ago

Thanks again for your contribution, @deadmau6! I think that brings us down to just missing Python hosts for the chemistry samples, so I'll go on and update the title/description accordingly.

cgranade commented 4 years ago

It was great to talk to you today, @sdf94! I've updated the checklist above, as it looks like only AnalyzeHamiltonian was incorrectly listed as not having a Python host. Thanks for volunteering to take a look at this enhancement, we really appreciate it! 💕

superkirill commented 4 years ago

@cgranade, is SimulateHubbardHamiltonian still open for contributions?

ShaunJW360 commented 4 years ago

@cgranade Would it be possible to contribute?

cgranade commented 4 years ago

@cgranade, is SimulateHubbardHamiltonian still open for contributions?

Yep! If you're interested in contributing, the relevant folder is at https://github.com/microsoft/Quantum/tree/master/samples/chemistry/SimulateHubbardHamiltonian. That sample currently only has a C# host, but it should be adaptable to a Python host since it doesn't rely on project references. Thanks for the help, @superkirill!

@cgranade Would it be possible to contribute?

Absolutely, thank you for the help @ShaunJW360! Please let me know if there's anything I can do to help with contributions; in the meantime, the contribution guide may be of interest. Thanks!

superkirill commented 4 years ago

Yes, I want to take a look at this then. Thanks, @cgranade!