|
3 | 3 |
|
4 | 4 | This module provides a high-level `QuditCircuit` API that mirrors `tensorcircuit.circuit.Circuit` |
5 | 5 | but targets qudits with dimension `3 <= d <= 36`. |
6 | | -For string-encoded samples/counts, digits use `0–9A–Z` where `A=10, …, Z=35`. |
| 6 | +For string-encoded samples/counts, digits use `0-9A-Z` where `A=10, ..., Z=35`. |
7 | 7 |
|
8 | 8 | .. note:: |
9 | 9 | For qubits (`d=2`) please use :class:`tensorcircuit.circuit.Circuit`. |
@@ -42,8 +42,8 @@ class QuditCircuit: |
42 | 42 | >>> c.sample(1024, format="count_dict_bin") |
43 | 43 |
|
44 | 44 | .. note:: |
45 | | - For `3 <= d <= 36`, string samples and count keys use base-`d` characters `0–9A–Z` |
46 | | - (`A=10, …, Z=35`). |
| 45 | + For `3 <= d <= 36`, string samples and count keys use base-`d` characters `0-9A-Z` |
| 46 | + (`A=10, ..., Z=35`). |
47 | 47 |
|
48 | 48 | :param nqudits: Number of qudits (wires) in the circuit. |
49 | 49 | :type nqudits: int |
@@ -94,7 +94,7 @@ def _set_dim(self, dim: int) -> None: |
94 | 94 | f"QuditCircuit is only for qudits (dim>=3). " |
95 | 95 | f"You passed dim={dim}. For qudits, please use `Circuit` instead." |
96 | 96 | ) |
97 | | - # Require integer d>=2; current string-encoded IO supports d<=36 (0–9A–Z digits). |
| 97 | + # Require integer d>=2; current string-encoded IO supports d<=36 (0-9A-Z digits). |
98 | 98 | if dim > 36: |
99 | 99 | raise NotImplementedError( |
100 | 100 | "The Qudit interface is only supported for dimension < 36 now." |
@@ -486,7 +486,7 @@ def amplitude(self, l: Union[str, Tensor]) -> Tensor: |
486 | 486 | >>> c.amplitude("21") |
487 | 487 | array(1.+0.j, dtype=complex64) |
488 | 488 |
|
489 | | - :param l: Bitstring in base-`d` using `0–9A–Z`. |
| 489 | + :param l: Bitstring in base-`d` using `0-9A-Z`. |
490 | 490 | :type l: Union[str, Tensor] |
491 | 491 | :return: Complex amplitude. |
492 | 492 | :rtype: Tensor |
@@ -528,7 +528,7 @@ def sample( |
528 | 528 | "count_vector": # np.array([2, 0, 0, 0]) |
529 | 529 |
|
530 | 530 | "count_dict_bin": # {"00": 2, "01": 0, "10": 0, "11": 0} |
531 | | - for cases d\in [11, 36], use 0–9A–Z digits (e.g., 'A' -> 10, …, 'Z' -> 35); |
| 531 | + for cases :math:`d\in [11, 36]`, use 0-9A-Z digits (e.g., 'A' -> 10, ..., 'Z' -> 35); |
532 | 532 |
|
533 | 533 | :type format: Optional[str] |
534 | 534 | :param random_generator: random generator, defaults to None |
@@ -593,7 +593,7 @@ def mid_measurement(self, index: int, keep: int = 0) -> Tensor: |
593 | 593 |
|
594 | 594 | :param index: Qudit index where post-selection is applied. |
595 | 595 | :type index: int |
596 | | - :param keep: Post-selected digit in `{0, …, d-1}`. |
| 596 | + :param keep: Post-selected digit in `{0, ..., d-1}`. |
597 | 597 | :type keep: int |
598 | 598 | :return: Unnormalized post-selected state. |
599 | 599 | :rtype: Tensor |
@@ -662,7 +662,7 @@ def amplitude_before(self, l: Union[str, Tensor]) -> List[Gate]: |
662 | 662 | For density-matrix simulators, |
663 | 663 | it would correspond to :math:`\operatorname{Tr}(\rho \vert l \rangle \langle l \vert)`. |
664 | 664 |
|
665 | | - :param l: Base-`d` string using `0–9A–Z` or an equivalent tensor index. |
| 665 | + :param l: Base-`d` string using `0-9A-Z` or an equivalent tensor index. |
666 | 666 | :type l: Union[str, Tensor] |
667 | 667 | :return: The tensornetwork nodes for the amplitude of the circuit. |
668 | 668 | :rtype: List[Gate] |
|
0 commit comments