zapata-engineering / orquestra-core

Core Orquestra meta-package
https://docs.orquestra.io/docs/core/index.html
Apache License 2.0
18 stars 10 forks source link

Create `subdistribution()` function for MeasurementOutcomeDistribution #13

Closed AthenaCaesura closed 2 years ago

AthenaCaesura commented 2 years ago

Our scientists often make use of more qubits than they measure at the end of their experiments (e.g. ancilla qubits). Currently, our MeasurementOutcomeDistributions (defined here) can become difficult to read if there are many other qubits that we really should just ignore.

We should solve this issue by adding a function subdistribution() which takes a list of qubit indices and returns the same MeasurementOutcomeDistribution with only the provided qubits. That is, we should sum all the counts associated with each outcome of the provided qubits.

@AthenaCaesura has written some ad-hoc code to modify a dictionary of counts to exclude qubits, but it would be nice if we incorporated this into a function which is callable from the distribution itself and returns a MeasurementOutcomeDistribution.

Deliverables:

Affected repo: orquestra-quantum

fred5825 commented 2 years ago

@AthenaCaesura Hi would like to give this a try if possible

mstechly commented 2 years ago

@fred5825 Feel free!

fred5825 commented 2 years ago

Awesome thank you @mstechly I was wondering if you would be at the unitaryhack office hours. So we could discuss more, I am new to hackathons and opensource, I don't know my way around much.

AthenaCaesura commented 2 years ago

I would love to be at the UH office hours! But I can't seem to find the schedule.... the UH FAQ says they should be on the discord, but I can't seem to find them. At the very least if you want to chat 1:1 I'm sure I can find some time. 😄

fred5825 commented 2 years ago

@AthenaCaesura Awesome thank you please let me know what time you are available to chat. Also to find the UH office hours is on the top of the discord page in events.

mstechly commented 2 years ago

@fred5825 I added some timeslots for office hours, but it seems the website didn't auto-update yet. Keep an eye on it though!

fred5825 commented 2 years ago

@mstechly Awesome thank you and just to confirm, you mean the UH website right?

mstechly commented 2 years ago

@fred5825 I mean here: https://unitary.fund/talks.html

fred5825 commented 2 years ago

Thank you I will check it out.

Renaud2002 commented 2 years ago

Hi @mstechly I was wondering if you could add this account to the issue the acount: fred5825 is my school account, I wanted to make the changes using me personal account. At the moment I can't commit my code because it says permission denied. Very sorry for the inconvenience.

mstechly commented 2 years ago

@Renaud2002 @fred5825 I can't give you write access to the repository, as you're not Zapata employee, but this is not a really problem. You can fork the repo and make a pull request from there, just follow the procedure described here :)

fred5825 commented 2 years ago

Yes of course I tried push it to my fork but this is the error that i encounter, I don't know why it says this

Screen Shot 2022-06-15 at 6 53 30 PM

fred5825 commented 2 years ago

@mstechly I think I know why the issue is happening I think I might have maybe clone the actual repository instead of my fork.

fred5825 commented 2 years ago

@mstechly That was in fact the issue I am very sorry for the inconvenience, the pull request has been created.

mstechly commented 2 years ago

@fred5825 No problem! I'll take a look tomorrow!

fred5825 commented 2 years ago

@mstechly Awesome thank you.