phase_option='SU' gives IndexError instead of AttributeError

30 views
Skip to first unread message

Álvaro Mandado

unread,
Apr 27, 2026, 1:55:12 PMApr 27
to QuTiP: Quantum Toolbox in Python
While working on trying to optimize a series of controls to achieve a CNOT gate from a ZZ drift and X and Y controls, I encountered that the solution the optimize_pulse_unitary(...,phase_option='PSU',...) gives is exp(i*2*pi/3)*CNOT. When trying to fix the phase by using phase_option='SU', my code finds an issue on normalize_SU.

It basically tries to find the 0th element of tuple A (the fidelity I think), which is already a scalar. The way normalize_SU avoids (or tries to avoid) this problem is by raising an exception of AttributeError, that explicitely mentions the case A is already an scalar. However, I am getting an IndexError, saying the tuple index is out of range. I understand in practice the global phase isn't relevant, but for my Bachelor's Thesis I actually need to reach exactly CNOT. 

I would like to know whether this is my fault and how to fix this error. Thanks for hearing me out.
Reply all
Reply to author
Forward
0 new messages