Skip to content

Commit 42fd72d

Browse files
Allowing QuantumSystem's with no drive Hamiltonians
1 parent 4b8fe5f commit 42fd72d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/qugrad/systems/_systems.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def generate_channel_couplings(number_channels: list[int]) -> np.ndarray[bool]:
2929
An entry is `True` if the channel corresponds to the drive.
3030
"""
3131
number_channels: np.ndarray[int] = np.array(number_channels)
32+
if len(number_channels) == 0:
33+
return np.empty((0, 0), dtype=bool)
3234
number_channels = number_channels.cumsum()
3335
channel_couplings: np.ndarray[bool] = np.zeros((len(number_channels),
3436
number_channels[-1]),

0 commit comments

Comments
 (0)