Skip to content

Commit

Permalink
fix: Make calibration converter compatible with qblox
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Dec 2, 2024
1 parent 352842d commit d459a7e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ def channel(qubit: str, type_: str, gate: Optional[str] = None) -> str:
else (
"acquisition"
if type_ == "ro"
else "drive12" if gate == "RX12" else "drive"
else "drive12"
if gate == "RX12"
else "drive"
)
)
)
Expand Down Expand Up @@ -182,7 +184,9 @@ def pulse_like(o: dict, rescale: float) -> dict:
return (
acquisition(o, rescale)
if o["type"] == "ro"
else virtualz(o) if o["type"] == "virtual_z" else pulse(o, rescale)
else virtualz(o)
if o["type"] == "virtual_z"
else pulse(o, rescale)
)


Expand Down Expand Up @@ -260,7 +264,7 @@ def single_qubits_cal(o: dict) -> dict:
"t1": [k["T1"], None],
"t2": [k["T2"], None],
"t2_spin_echo": [k["T2_spin_echo"], None],
"rb_fidelity": [k["gate_fidelity"], None],
"rb_fidelity": [k["gate_fidelity"], None] if "gate_fidelity" in k else None,
}
for q, k in o.items()
}
Expand All @@ -279,7 +283,9 @@ def two_qubits_cal(o: dict) -> dict:
def upgrade_cal(o: dict) -> dict:
return {
"single_qubits": single_qubits_cal(o["characterization"]["single_qubit"]),
"two_qubits": two_qubits_cal(o["characterization"]["two_qubit"]),
"two_qubits": two_qubits_cal(o["characterization"]["two_qubit"])
if "two_qubit" in o["characterization"]
else {},
}


Expand Down

0 comments on commit d459a7e

Please sign in to comment.