rigetti / forest-benchmarking

A library for quantum characterization, verification, validation (QCVV), and benchmarking using pyQuil.
Apache License 2.0
53 stars 22 forks source link

Tighter condition on proj_choi_to_physical function #235

Open cho19 opened 1 year ago

cho19 commented 1 year ago

I ran tomography on qubit 0-1 frame and found that the process matrix found from the pdgb algorithm was not fully completely positive. Sometimes, it gave me a fidelity higher than 100 %.

In the code block below, when I lowered the value from 1e-4 to 1e-10 by 1e-2, I found that the fidelity converges below 1e-8 condition and now none of the gates I tested had a fidelity higher than 100 %, as expected.

This is from benchmarking.operator_tools.roject_superoperators.py, proj_choi_to_physical function.

if np.linalg.norm(CP_change_change) ** 2 + np.linalg.norm(TP_change_change) ** 2 \
                + 2 * abs(np.dot(vec(old_TP_change).conj().T, vec(state_change))) \
                + 2 * abs(np.dot(vec(old_CP_change).conj().T,
                                 vec(CP_projection - last_CP_projection))) < 1e-4:
            break