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

Conversation

@msoeken
Copy link
Member

@msoeken msoeken commented Jul 2, 2020

This PR implements a C# library containing a custom IQuantumProcessor-based Q# simulator to dump Q# program execution traces into qpic files. It does not support all intrinsic operations and is used as accompanying sample to the 3rd Q# blog post on custom simulators. It also contains an intrinsics project with custom Q# operations for the simulator.

There is a lot of code this time, so I created a feature branch. Two upcoming PRs will add (i) a Q# test project with sample code to create qpic pictures and (ii) README and meta data for the sample.

Copy link
Contributor

@cgranade cgranade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good to me, thanks for doing this! I left a few comments here and there that may be helpful, but otherwise I think this is going to be a great sample!

msoeken and others added 2 commits July 3, 2020 14:26
Co-authored-by: Chris Granade <chgranad@microsoft.com>
@msoeken
Copy link
Member Author

msoeken commented Jul 3, 2020

@cgranade Thanks for your helpful comments. I have incorporated them and answered to some comments.

cgranade
cgranade previously approved these changes Jul 7, 2020
Copy link
Contributor

@cgranade cgranade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks pretty good, though I'd strongly recommend adding a README first so that this sample can be onboarded to the Samples Browser. Please ping me if I can help with that. Thanks!

vadym-kl
vadym-kl previously approved these changes Jul 7, 2020
tcNickolas
tcNickolas previously approved these changes Jul 13, 2020
Copy link
Contributor

@tcNickolas tcNickolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall to me - I'm still a bit hazy on the things related to classical control, but I'm assuming it's because it will be explained in the 2nd part of the blog post :-)

I agree that this sample would benefit from a README, maybe slightly more extended than other READMEs in the Samples - I would definitely add an example of what this simulator does (a simple Q# code and a picture of the generated circuit).

For visualization of the parameterized gates, I don't recall whether the blog posts refer to them? I understand this simulator is not intended to be our primary circuit visualization tool, but rather an illustration of an approach that can be taken? If this is true and the blog posts don't rely on fractional rotations, we might want to skip implementing them altogether in the interest of keeping the sample concise.

Thank you for working on this!

Comment on lines 103 to 104
// we are using a color coding for some angles according to the visualizations in
// [arXiv:1808.02892](https://arxiv.org/abs/1808.02892)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to add this information as text? Carrying info in colors only seems so fragile, regardless of the encoding used - once my laptop switches to night mode the circuit changes.

Co-authored-by: Mariia Mykhailova <mamykhai@microsoft.com>
@msoeken
Copy link
Member Author

msoeken commented Jul 13, 2020

Thanks to everyone for your suggestions, I tried incorporating them all. Regarding a README and sample implementations, I am planning to add them in a separate PR into the same feature branch. This was just to add the library projects to support this functionality.

@msoeken msoeken requested a review from cgranade July 13, 2020 16:07
Copy link
Contributor

@tcNickolas tcNickolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't realize this is a PR to a branch!

@msoeken msoeken merged commit 3e8b7fe into feature/qpic-simulator Jul 16, 2020
@msoeken msoeken deleted the msoeken/qpic-simulator branch July 16, 2020 13:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants