Skip to content

WIP: leakage-aware GST #410

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

Draft
wants to merge 62 commits into
base: develop
Choose a base branch
from
Draft

WIP: leakage-aware GST #410

wants to merge 62 commits into from

Conversation

rileyjmurray
Copy link
Contributor

@rileyjmurray rileyjmurray commented Mar 19, 2024

(I said I'd close this PR due to awful commit history. But then everything fixed itself when I changed the target branch from master to develop. So I'm keeping open.)

@rileyjmurray rileyjmurray changed the title WIP: leakage-aware gauge optimization WIP: leakage-aware gauge optimization -- bad commit history Sep 24, 2024
@rileyjmurray rileyjmurray changed the base branch from master to develop September 24, 2024 21:15
@rileyjmurray rileyjmurray changed the title WIP: leakage-aware gauge optimization -- bad commit history WIP: leakage-aware gauge optimization Sep 24, 2024
…inearOperator (not just plain numpy ndarrays)
…frobenius norm computation. Bugfix in test_optools.py.
…lots of in-line comments explaining the logic.
…anch that omitted jac as a keyword argument to scipy.minimize, even if jac was None.
…nt fidelity from the calculation of that metric itself. This makes it easier to reuse the setup code in other metrics. While making this change, also make the setup more efficient by using TensorProduct bases from the beginning.
…imizers. Right now only entanglement fidelity and jtracedist have implementations that can consider leakage. (So there are no leakage-aware metrics for SPAM.)
…dded annotations to all gauage optimization objectives used in the non-LS optimizer, indicating if that particular objective has support for leakage-aware metrics.
… while. The tests only consider when no leakage is modeled. New tests wil be needed for when theres a leakage dimension
… that various gauge optimization functions don`t raise errors.
@rileyjmurray rileyjmurray changed the title WIP: leakage-aware gauge optimization WIP: leakage-aware GST Mar 25, 2025
@rileyjmurray
Copy link
Contributor Author

Text from an email Piper sent (not showing plots since they contained real data):

I was looking at the model violation tab, trying to work out why the smaller L models weren’t fitting the data as well as might be expected as quantified by Nsigma. I think this maybe be a function of how we calculate Nsigma = (2delta logl -k)/sqrt(2k). The number of non-gauge model parameters N_p is reported as 351 in the leakage-enhanced GST report (I don’t have any particular sense of whether this is correct). The number of data points N_s is 193 for L=1. This means that k (the degrees of freedom) is negative if you just calculate it as N_s-N_p. In cases like this, pyGSTi chooses k=1. k remains small until L is fairly large, which means two delta logl must be quite small for Nsigma to be small. This explains why we don’t see any red boxes in the per sequence detail for the L=1 iteration (and Nsigma is large enough that I would expect to see some or at least more dark gray squares than can be seen).

If you directly compare two delta logl between the two fits, you can see that the two delta logl is in fact smaller in the leakage-enhanced report than in the standard report.

I think the solution here is just to make sure that the first iteration of leakage-aware GST uses L=2 instead of L=1. (Or, more generally, we use the smallest L where N_s > N_p.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant