Skip to content

Conversation

@robertjovanov
Copy link
Collaborator

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.

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Member

@TheGupta2012 TheGupta2012 left a 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

… as a building block for larger experiments, such as Qubit Spectroscopy
@robertjovanov
Copy link
Collaborator Author

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.

Comment on lines 33 to 39
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
Copy link
Member

@TheGupta2012 TheGupta2012 Jan 29, 2026

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.

Copy link
Member

@TheGupta2012 TheGupta2012 left a 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

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

Successfully merging this pull request may close these issues.

3 participants