Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pulser-core/pulser/sequence/_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ def __getitem__(
self, key: Union[int, slice]
) -> Union[_TimeSlot, list[_TimeSlot]]:
if key == -1 and not self.slots:
raise ValueError("The chosen channel has no target.")
raise ValueError(
f"The chosen channel ({self.channel_id!r}) has no target."
)
return self.slots[key]

def __iter__(self) -> Iterator[_TimeSlot]:
Expand Down Expand Up @@ -290,7 +292,7 @@ def get_samples(
if qubits is None:
raise ValueError(
"'qubits' must be defined when extracting the samples of a"
" DMM channel."
f" DMM channel; got None for channel {self.channel_id!r}."
)
return DMMSamples(
**init_fields, detuning_map=self.detuning_map, qubits=qubits
Expand Down Expand Up @@ -714,7 +716,7 @@ def _check_duration(
if self.max_duration is not None and t > self.max_duration:
msg = (
"The sequence's duration exceeded the maximum duration allowed"
f" by the device ({self.max_duration} ns)."
f" by the device ({self.max_duration} ns); got {t} ns."
)
if block_over_max_duration:
raise RuntimeError(msg)
Expand Down
8 changes: 7 additions & 1 deletion pulser-core/pulser/sequence/_seq_drawer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,8 +1018,14 @@ def _draw_qubit_content(
for ch, ch_obj in sampled_seq._ch_objs.items()
]
):
wrong_basis = {
ch: ch_obj.basis
for ch, ch_obj in sampled_seq._ch_objs.items()
if ch_obj.basis != "ground-rydberg"
}
raise NotImplementedError(
"Can only draw qubit contents for channels in rydberg basis."
"Can only draw qubit contents for channels in the "
f"'ground-rydberg' basis; got {wrong_basis}."
)
# Gather data per targeted qubits
total_duration = data["total_duration"]
Expand Down
Loading
Loading