qiskit-community / qiskit-dynamics

Tools for building and solving models of quantum systems in Qiskit
https://qiskit-community.github.io/qiskit-dynamics/
Apache License 2.0
105 stars 61 forks source link

Add warning about sampling rate when using `ShiftFrequency` and `SetFrequency` in pulse schedules #241

Closed DanPuzzuoli closed 1 year ago

DanPuzzuoli commented 1 year ago

An issue arose here when SetFrequency and ShiftFrequency were used to shift a channel frequency well away from what was specified in the channel_carrier_freqs argument to Solver.

The specified channel frequency couldn't be represented digitally with the given dt, and the simulations therefore produced strange results.

@nkanazawa1989 suggested raising a warning in the schedule interpretation step when the difference between the schedule frequency and the channel_carrier_freqs frequency is larger than the Nyquist frequency (and therefore can't be accurately represented). One minor technical issue with adding this is that this code can be compiled with JAX, so we'll need to take some technical care with handling this.