Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Add Python host programs to chemistry samples. #233

Open
20 of 34 tasks
cgranade opened this issue Oct 3, 2019 · 15 comments
Open
20 of 34 tasks

Add Python host programs to chemistry samples. #233

cgranade opened this issue Oct 3, 2019 · 15 comments

Comments

@cgranade
Copy link
Contributor

cgranade commented Oct 3, 2019

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

  • algorithms
    • chsh-game
    • database-search
    • integer-factorization
    • oracle-synthesis
    • order-finding
    • reversible-logic-synthesis
    • simple-grover
  • arithmetic
    • adder-example (n/a: no host program for this sample)
  • characterization
    • phase-estimation
  • chemistry
    • AnalyzeHamiltonian
    • CreateHubbardHamiltonian
    • GetGateCount
    • IntegralData (n/a: static sample data)
    • LithiumHydrideGUI (n/a: demonstrates C# ↔ Electron interaction)
    • MolecularHydrogen
    • MolecularHydrogenGUI (n/a: demonstrates C# ↔ Electron interaction)
    • PythonIntegration
    • RunSimulation
    • SimulateHubbardHamiltonian
  • diagnostics
    • unit-testing (n/a: demonstrates xunit integration)
  • error-correction
    • bit-flip-code
  • getting-started
    • intro-to-iqsharp (n/a: specific to IQ#)
    • measurement
    • simple-algorithms
    • teleportation
  • interoperability
    • fsharp (n/a)
    • python
  • numerics
  • CustomModAdd
  • EvaluatingFunctions
  • ResourceCounting
  • runtime
    • oracle-emulation (n/a: specific to extending runtime with C#)
    • state-visualizer (n/a: demonstrates using Q# with ASP.NET Core)
  • simulation
    • h2
      • command-line
      • gui (n/a: demonstrates C# ↔ Electron interaction)
    • hubbard
@bromeg
Copy link
Contributor

bromeg commented Oct 10, 2019

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
Copy link
Contributor Author

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

@deadmau6
Copy link
Contributor

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
Copy link
Contributor Author

@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
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor

@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
Copy link
Contributor Author

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
Copy link
Contributor

deadmau6 commented Oct 31, 2019

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
Copy link
Contributor Author

cgranade commented Dec 9, 2019

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 cgranade changed the title Add Python host programs to more samples. Add Python host programs to chemistry samples. Dec 9, 2019
jwittner pushed a commit to jwittner/Quantum that referenced this issue Dec 16, 2019
@cgranade
Copy link
Contributor Author

cgranade commented Apr 2, 2020

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
Copy link

@cgranade, is SimulateHubbardHamiltonian still open for contributions?

@ShaunJW360
Copy link

@cgranade Would it be possible to contribute?

@cgranade
Copy link
Contributor Author

@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
Copy link

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

@guenp guenp self-assigned this Nov 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants