1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/// An iterator that yields all Clifford [`crate::Tableau`] values of a given
/// qubit count.
///
/// Created by [`crate::Tableau::iter_all`], this iterator lazily enumerates
/// every stabilizer tableau (i.e. every Clifford operation) over the specified
/// number of qubits. The number of tableaux grows extremely fast with qubit
/// count: there are 24 single-qubit Cliffords, 11,520 two-qubit Cliffords,
/// and so on.
///
/// The iterator can be configured to produce only unsigned tableaux (those
/// with all-positive stabilizer signs), which reduces the count by a factor
/// of 2^(2n) for `n` qubits.
///
/// The iterator can be cloned to create an independent copy that resumes from
/// the same position.
///
/// # Examples
///
/// ```
/// // Count all single-qubit Clifford operations.
/// let count = stim::Tableau::iter_all(1, false).count();
/// assert_eq!(count, 24);
///
/// // Unsigned single-qubit Cliffords (ignoring sign): 24 / 2^(2*1) = 6.
/// let unsigned_count = stim::Tableau::iter_all(1, true).count();
/// assert_eq!(unsigned_count, 6);
/// ```