Skip to content

Commit

Permalink
fix: path with platform name for Kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacfomg committed Jan 19, 2024
1 parent d3619f4 commit 2e5eca6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/qibolab/qubits.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Not all channels are required to operate a qubit.
"""
EXCLUDED_FIELDS = CHANNEL_NAMES + ("name", "native_gates", "_flux")
EXCLUDED_FIELDS = CHANNEL_NAMES + ("name", "native_gates", "kernels", "_flux")
"""Qubit dataclass fields that are excluded by the ``characterization``
property."""

Expand Down
13 changes: 7 additions & 6 deletions src/qibolab/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,9 @@ def dump_qubits(
}

kernels = Kernels()
for q in qubits:
qubit = characterization["single_qubit"][q]
if qubit["kernel"] is not None:
kernel = qubit.pop("kernel")
kernels[q] = kernel
for qubit in qubits.values():
if qubit.kernel is not None:
kernels[qubit.name] = qubit.kernel

if couplers:
characterization["coupler"] = {
Expand Down Expand Up @@ -185,7 +183,10 @@ def dump_runcard(platform: Platform, path: Path):
if qubit.kernel is not None:
kernels[qubit.name] = qubit.kernel
qubit.kernel = None
Kernels(kernels).dump(Path(__file__).parent / "dummy" / KERNELS_FILE)
name = platform.name
if platform.name == "dummy_couplers":
name = "dummy"
Kernels(kernels).dump(Path(__file__).parent / name / KERNELS_FILE)

settings = {
"nqubits": platform.nqubits,
Expand Down

0 comments on commit 2e5eca6

Please sign in to comment.