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

Pulse duration validation #248

Closed
sorewachigauyo opened this issue Dec 14, 2022 · 3 comments · Fixed by #660
Closed

Pulse duration validation #248

sorewachigauyo opened this issue Dec 14, 2022 · 3 comments · Fixed by #660
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@sorewachigauyo
Copy link
Collaborator

Currently the pulse duration and start parameters are in integers of nanoseconds. However, this is an issue for instruments with sampling rates that are not 1GSps.

For the IcarusQ RFSoC, we are using a bisection to retrieve the sample indices associated with the pulse.

Perhaps this parameter can be sanitized on the driver side instead?

@scarrazza scarrazza added the enhancement New feature or request label Dec 15, 2022
@scarrazza scarrazza moved this to 🆕 New in Tasks Management Dec 15, 2022
@scarrazza scarrazza added this to the Qibolab 0.1.4 milestone Oct 25, 2023
@stavros11
Copy link
Member

Is this issue still relevant? Note that the constraint for the pulse duration to be integer of nanoseconds was lifted in #623.

@sorewachigauyo
Copy link
Collaborator Author

I think this issue is still a problem, on commit f08149e39855d502f8d270d2c2c8efb30c801579

Trying this code

from qibolab.pulses import Pulse

Pulse(start=5, duration=34.33, amplitude=1, frequency=5e9, relative_phase=0, shape="Rectangular", channel="x1", qubit=0)

raises the following error

  File "c:\Users\745 G5\Documents\repos\icarusq_runcard\test.py", line 4, in <module>
    Pulse(start=5, duration=34.33, amplitude=1, frequency=5e9, relative_phase=0, shape="Rectangular", channel="x1", qubit=0)
  File "C:\qibolab\src\qibolab\pulses.py", line 704, in __init__
    self.duration = duration
    ^^^^^^^^^^^^^
  File "C:\qibolab\src\qibolab\pulses.py", line 808, in duration
    self._finish = self._start + self._duration
                   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

@stavros11
Copy link
Member

Thanks for checking @sorewachigauyo. Should be fixed in #660.

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Tasks Management Nov 15, 2023
@stavros11 stavros11 mentioned this issue Jan 12, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants