Skip to content

Commit

Permalink
feat: Log qblox modules input
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Dec 10, 2024
1 parent ce8a2ad commit 75841ed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/qibolab/_core/instruments/qblox/cluster.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import defaultdict
from functools import cached_property
from pathlib import Path
from typing import Optional

import qblox_instruments as qblox
Expand Down Expand Up @@ -122,6 +123,8 @@ def play(
results = {}
for ps in sequences:
sequences_ = _prepare(ps, sweepers, options, self.sampling_rate)
if "log" in configs:
_dump_sequences(configs["log"].path, sequences_)
sequencers = self._upload(sequences_)
results |= self._execute(sequencers)
return results
Expand Down Expand Up @@ -177,3 +180,8 @@ def ch_pulses(channel: ChannelId):
)
for channel in sequence.channels
}


def _dump_sequences(log: Path, sequences: dict[ChannelId, Sequence]):
for ch, seq in sequences.items():
(log / f"{ch}.json".replace("/", "-")).write_text(seq.model_dump_json())

0 comments on commit 75841ed

Please sign in to comment.