Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support setp and delay pulses #355

Open
1tnguyen opened this issue Dec 9, 2020 · 8 comments
Open

Support setp and delay pulses #355

1tnguyen opened this issue Dec 9, 2020 · 8 comments

Comments

@1tnguyen
Copy link
Contributor

1tnguyen commented Dec 9, 2020

IBM has introduced two new native pulses setp (set phase) and delay (in addition to fc and acquire).

These two instructions can be used inside pulse cmd-def JSON. We need to update IBMAccelerator::contributeInstructions to contribute these new instructions so that the pulse cmd-def Composite can be constructed.

@1tnguyen
Copy link
Contributor Author

1tnguyen commented Jan 5, 2021

To be able to run a protocol similar to the one described in https://arxiv.org/pdf/2008.04302.pdf,
we need to support a couple of advanced pulse instructions:

  • Shift freq. (shiftf)
  • Set freq. (setf)

These instructions allow changing LO freq. per pulse (rather than fixed for the whole experiment).
(pulse frequency is an optimization parameter in the protocol)

Note: we may not be able to simulate these two instructions since Aer doesn't support them (see this)

@flatslm
Copy link
Contributor

flatslm commented Jun 14, 2021

Topics about pulses are interesting to me. Is this issue still relevant?

@1tnguyen
Copy link
Contributor Author

Yea, this issue is still relevant. Please feel free to work on this if you're interested.

BTW, we can get around this issue by pre-modulating the pulse signal in the code, but it'd be nice to have these pulse instructions supported in XACC.

@flatslm
Copy link
Contributor

flatslm commented Jun 28, 2021

I started implementation (a draft pull request #464 ) and have a few questions:

  1. Do I understand correctly that it is necessary to support the processing of 4 new commands: setf / shiftf / setp / shiftp ?
  2. What is the best place for testing code? Example program or unit tests (like in xacc/quantum/gate/ir/tests /)?
  3. What backend is better for testing? Last version of Aer?

@1tnguyen
Copy link
Contributor Author

Hi @flatslm,

  1. Do I understand correctly that it is necessary to support the processing of 4 new commands: setf / shiftf / setp / shiftp ?
  • Yes.
  1. What is the best place for testing code? Example program or unit tests (like in xacc/quantum/gate/ir/tests /)?
  • I think you can place unit testing code in xacc/quantum/plugins/ibm/tests. There are a few IBM-related tests in there for your reference (including some pulse IR testing).
  1. What backend is better for testing? Last version of Aer?
  • The 'open' IBMQ provider has the armonk device which can run pulse instructions. You could test by making sure the QObj with those new pulse instructions is accepted.
  • I don't think that Aer can handle frequency instructions (setf and shiftf). Looks like it will raise an exception if seeing those frequency instructions (see Aer's digest_pulse_qobj.py).

@flatslm
Copy link
Contributor

flatslm commented Aug 1, 2021

Hi @tnguyen-ornl
I added simplest test to pull request #464 .
Check please, is this test correct?
Now I plan send some instructions to armonk ibm device.

@1tnguyen
Copy link
Contributor Author

1tnguyen commented Aug 2, 2021

Thanks, @flatslm.
This looks good. For the test that you have, you can look at the QObj generated when you execute that cr_comp.
Also, make sure it is validated by the armonk backend :)

flatslm added a commit to flatslm/xacc that referenced this issue Aug 15, 2021
@flatslm
Copy link
Contributor

flatslm commented Aug 15, 2021

Hi @tnguyen-ornl.
Some code and new test was corrected and I marked PR as "ready for review".
It seems that setf and shiftf works ok, but I did not found backend with support of setp/shiftp operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants