qutip-qip icon indicating copy to clipboard operation
qutip-qip copied to clipboard

Let the pulse coeff handle complex coefficients

Open Wikstahl opened this issue 2 years ago • 3 comments

This fixes issue #148

Wikstahl avatar Jun 15 '22 14:06 Wikstahl

Hi @Wikstahl, thanks a lot for the PR!

It is probably better to set the dtype of the new coefficient array to be the same as the old one, instead of always using a complex array.

Could you also add a new test for the complex coefficients?

BoxiLi avatar Jun 18 '22 12:06 BoxiLi

Sure I can fix this! :)

Wikstahl avatar Aug 03 '22 08:08 Wikstahl

I just pushed a patch with dtype=old_coeffs.dtype

This should make the test pass. However, it does not mean that the complex coefficient is fully supported. The Processor.plot_pulse will still get a warning because of the complex numbers. But this at least lets the computation run without an error.

In fact, one can always rewrite complex coefficients by real ones with two sx and sy control terms. So real coefficient also has no loss of generality.

BoxiLi avatar Mar 14 '23 22:03 BoxiLi