Skip to content

WIP: general leakage modeling#707

Draft
rileyjmurray wants to merge 33 commits intodevelopfrom
general-leakage
Draft

WIP: general leakage modeling#707
rileyjmurray wants to merge 33 commits intodevelopfrom
general-leakage

Conversation

@rileyjmurray
Copy link
Contributor

No description provided.

@rileyjmurray
Copy link
Contributor Author

Todo: add the following function. Maybe not strictly necessary, but I wrote it in another PR where it's distinctly less necessary.

def trace_effect(op: _np.ndarray, op_basis: BasisLike, on_space: SpaceT = 'HilbertSchmidt'):
    """
    Let `op` be the array representation of a superoperator G in `op_basis`,
    where G maps from and to the space of order-d Hermitian operators.
    
    The trace effect of G is the Heritian operator E that satifies

        trace(G(ρ)) = trace(E ρ) for all order-d Hermitian matrices ρ.

    If on_space='HilbertSchmidt', then this function returns a superket representation
    of E in `op_basis`. If on_space='Hilbert', then we return E itself.
    """
    d = int(_np.round(op.size ** 0.25))
    assert op.shape == (d**2, d**2)
    basis = op_basis if isinstance(op_basis, _Basis) else _Basis.cast(op_basis, dim=d**2)
    vecI = _bt.stdmx_to_vec(_np.eye(d), basis)
    vecE = op.T.conj() @ vecI
    if on_space == 'HilbertSchmidt':
        return vecE
    else:
        E = _bt.vec_to_stdmx(vecE, op_basis)
        return E

…:transform_composed_model. Those changes have been moved to PR #643.
@rileyjmurray
Copy link
Contributor Author

The test in test/integration/test_leakage_gst.py is failing due to numerical issues. The body of the test includes the following info in a long-form comment.

        Original results are shown below. We don't rely on the exact numbers here. What matters is
        qualitative aspects of how Gxpi2 and Gypi2 deviate from their respective targets. Since our
        data generating model only applied leakage to Gxpi2, a "good" result reports much more error
        in Gxpi2 than Gypi2. (It's not clear to me why stdgaugeopt lacks wildcard error.)

        Leakage-aware guage optimization.

            | Gate    | ent. infidelity | 1/2 trace dist | 1/2 diamond dist | Max TOP  | Unmodeled error |
            |---------|-----------------|----------------|------------------|----------|-----------------|
            | []      | 0.000009        | 0.002639   	 | 0.003724	        | 0.000014 | 0.00007         |
            | Gxpi2:0 | 0.000965        | 0.030946       | 0.040751	        | 0.001629 | 0.000764        |
            | Gypi2:0 | 0.000375        | 0.019367       | 0.025308         | 0.000531 | 0.000475        |

        
        Standard gauge optimization

            | Gate    | ent. infidelity | 1/2 trace dist | 1/2 diamond dist | Max TOP  |
            |---------|-----------------|----------------|------------------|----------|
            | []      | 0.000016        | 0.003644       | 0.005146         | 0.000026 |
            | Gxpi2:0 | 0.000620        | 0.024758       | 0.032616         | 0.001000 |
            | Gypi2:0 | 0.000611        | 0.024714       | 0.033323         | 0.001001 |

        We'll run tests with subspace entanglement infidelity.

            * For LAGO, infidelity of Gxpi2 is 2.57x larger than that of Gypi2;
              we'll test for a 2x difference.
            
            * For standard gauge optimization, Gxpi2 and Gypi2 have almost identical infidelities;
              we'll test for a factor 1.1x there.

The issue is that the factor 1.1x is, apparently, not enough to cover the change after merging in develop. I don't know exactly what changes in develop would cause the changes here, but that's the nature of integration tests. I'll probably regenerate the table and pick a new tolerance.

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