-
Notifications
You must be signed in to change notification settings - Fork 55
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
TypeError when performing gauge optimization with respect to fidelity or trace distance #406
Comments
Great job catching this, @rileyjmurray! I'm not positive what the history is behind this, but I suspect this is vestigial from the time before more complicated modelmembers for operations existed when pretty much all of the operations inherited from DenseOperatorInterface or similar, and as such behaved in many contexts as if they were numpy arrays. This is clearly no longer true, and your proposed solution makes sense to me. |
I agree with Corey's assessment - we haven't tried gauge optimizing to
fidelity in a long time and the initial implementation was more
experimental research and there are likely no unit tests. So yeah,
converting operators to dense matrices first is I think what you want to do.
…On Tue, Mar 19, 2024 at 3:24 PM coreyostrove ***@***.***> wrote:
Great job catching this, @rileyjmurray <https://github.com/rileyjmurray>!
I'm not positive what the history is behind this, but I suspect this is
vestigial from the time before more complicated modelmembers for operations
existed when pretty much all of the operations inherited from
DenseOperatorInterface or similar, and as such behaved in many contexts as
if they were numpy arrays. This is clearly no longer true, and your
proposed solution makes sense to me.
—
Reply to this email directly, view it on GitHub
<#406 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACA7BCZ7WZLG34TKK2EXHRDYZCGHJAVCNFSM6AAAAABECNHCP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBXHE2TMMZXGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I think this particular bug is basically solved by Timo's PR #414. By performing the The only thing I haven't check as part of that is whether similar bugs exist for other |
Closing as Timo's PR did in fact fix the other possible |
Running gauge optimization with respect to fidelity hits the following codeblock:
pyGSTi/pygsti/algorithms/gaugeopt.py
Lines 636 to 640 in 0299e1d
The documentation of
entanglement_fidelity
says its arguments need to be numpy arrays. However, the code above passes in pyGSTi modelmember objects of one kind or another. If you take a quick look at the implementation ofentanglement_fidelity
then you'll find that this can easily result in an error. (For example, if either operation is a CompsedOp object.)This specific issue could be fixed by replacing 638 -- 640 in the gaugeopt.py snippet to the following:
That said, the issue isn't isolated to the snippet above. Similar bugs exist throughout the definition of the the objective function for non-LS gauge optimization models.
The text was updated successfully, but these errors were encountered: