We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9975ef commit 7012125Copy full SHA for 7012125
qualtran/_infra/composite_bloq.py
@@ -59,6 +59,20 @@
59
60
61
class SoquetT(Protocol):
62
+ """Either a Soquet or an array thereof.
63
+
64
+ To narrow objects of this type, use `BloqBuilder.is_single(soq)` and/or
65
+ `BloqBuilder.is_ndarray(soqs)`.
66
67
+ Example:
68
+ >>> soq_or_soqs: SoquetT
69
+ ... if BloqBuilder.is_ndarray(soq_or_soqs):
70
+ ... first_soq = soq_or_soqs.reshape(-1).item(0)
71
+ ... else:
72
+ ... # Note: `.item()` raises if not a single item.
73
+ ... first_soq = soq_or_soqs.item()
74
75
+ """
76
@property
77
def shape(self) -> Tuple[int, ...]: ...
78
0 commit comments