-
Notifications
You must be signed in to change notification settings - Fork 7
Add Gaussian OpenPulse waveform generator with PyQASM module export #77
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TheGupta2012
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @robertjovanov , this is a great start! I have given some comments but the overall structure looks good to me!
It'll be good if you can add some tests as well for the functionality
…neration, overrides, and unrolling.
… as a building block for larger experiments, such as Qubit Spectroscopy
|
Hi @TheGupta2012 , thanks a lot for the feedback. I tried to implement most of it. I also included unit tests, as well as a Jupyter notebook demonstrating how to use the module on its own, and in larger experiments. |
tests/test_gaussian.py
Outdated
| assert 'defcalgrammar "openpulse";' in qasm | ||
| assert "cal {" in qasm | ||
| assert "port d0;" in qasm | ||
| assert "frame driveframe = newframe(d0, 5000000000.0, 0.0);" in qasm | ||
| assert "waveform wf = gaussian(1.0 + 2.0im, 16ns, 4ns);" in qasm | ||
| assert "defcal play_gaussian" in qasm | ||
| assert "play(driveframe, wf);" in qasm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should check for the order of these statements as well? This is because a malformed output such as -
port d0;
cal {
decalgrammar "openpulse"; would pass this test as well! Since num of tests are very less, best to compare exact strings of the expected qasm V/S generated qasm. A scalable approach is to use something called pytest.fixtures or pytest.mark.parameterize but that may be overkill at the moment.
Similar comment for test_generate_program_kwargs_override_names as well.
TheGupta2012
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @robertjovanov , thank you for incorporating the review! Changes look good to me, just one comment about the tests. Should be good to merge post that
Changes
This PR introduces a foundational OpenPulse waveform generator to qbraid-algorithms.
The contribution implements a reusable Gaussian OpenPulse waveform generator, exported as a PyQASM module, and is intended as a base for future pulse-level extensions.