unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
363 stars 160 forks source link

Support pyQuil #255

Closed willzeng closed 4 years ago

willzeng commented 4 years ago

@karalekas and @rmlarose I'll let you fill in details of the approach to this here.

rmlarose commented 4 years ago

Thanks Will. Copying links from the engineering meeting schedule here:

Also link to the pyQuil ANTLR parser. @karalekas is this what you were referring to?

I was going to ping to partially support QUIL Cirq issue but I think maybe we should just give it a go first. With the ANTLR parser (QUIL string --> List[AbstractInstruction]) I think we just need to translate from pyquil instructions to Cirq operations.

rmlarose commented 4 years ago

Since this will be a PR to Cirq I'm not sure logistically the best way to organize. @karalekas maybe if you fork Cirq we can both contribute there and communicate here or by email?

karalekas commented 4 years ago

Sounds good, I'll fork Cirq, and we can communicate here or in a PR in that forked repo

willzeng commented 4 years ago

Looks good. Let's have issue communication here (PR reviews etc can happen on the fork) to keep things easily visible to the team

On Mon, Jul 20, 2020 at 3:22 PM Peter Karalekas notifications@github.com wrote:

Sounds good, I'll fork Cirq, and we can communicate here or in a PR in that forked repo

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/unitaryfund/mitiq/issues/255#issuecomment-661285553, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHZDASVPRZA3OTCG75J2D3R4SKPZANCNFSM4O7A7QEA .

-- https://unitary.fund/ Creating a quantum technology ecosystem that benefits the most people.

karalekas commented 4 years ago

Draft PR for Quil to Cirq conversion: https://github.com/karalekas/Cirq/pull/1

willzeng commented 4 years ago

@karalekas What is left to be done to close this issue? I copied these from your comment on #278

Are these still open? Are there any others that should be on this list?

karalekas commented 4 years ago

@willzeng those are still open yes, they require a PR to Cirq which I’m working on. The only other thing to do after is to update mitiq to use those changes to Cirq once they are in, and this issue is done

karalekas commented 4 years ago

Merging https://github.com/unitaryfund/mitiq/pull/291 will address the third point in the bulleted list above.

karalekas commented 4 years ago

As for the second point, I can make the change in Cirq, but it's looking like @andreamari's PR #283 will also address it.

karalekas commented 4 years ago

I have a PR to address the first point which is ready for internal review before I submit it publicly to Cirq: https://github.com/karalekas/Cirq/pull/1 @rmlarose @andreamari @willzeng

rmlarose commented 4 years ago

As for the second point, I can make the change in Cirq, but it's looking like @andreamari's PR #283 will also address it.

Indeed #283 fixes the weird inverse issue for self-inverse gates in Qiskit. Ultimately it would be good to upstream this to Cirq if possible, though. I believe @karalekas' conversions of self-inverse pyQuil gates doesn't have this issue.

karalekas commented 4 years ago

@rmlarose I think we can try to get it into Cirq eventually, but it feels weird to me to change it in Quil export and not QASM export, and I'd like for our PR to Cirq to get merged ASAP and not give them any reason to hold it up.

rmlarose commented 4 years ago

@rmlarose I think we can try to get it into Cirq eventually, but it feels weird to me to change it in Quil export and not QASM export, and I'd like for our PR to Cirq to get merged ASAP and not give them any reason to hold it up.

Ah gotcha, yeah I agree with this.

willzeng commented 4 years ago

@rmlarose I think we can try to get it into Cirq eventually, but it feels weird to me to change it in Quil export and not QASM export, and I'd like for our PR to Cirq to get merged ASAP and not give them any reason to hold it up.

+1