jet.Qudit¶
-
class
Qudit
(dim: int, data: Optional[numpy.ndarray] = None)[source]¶ Bases:
jet.state.State
Qudit represents a qudit state.
- Parameters
dim (int) – Dimension of the qudit.
data (np.ndarray or None) – Optional state vector.
Attributes
Returns the indices of this state.
Returns the number of wires connected to this state.
-
indices
¶ Returns the indices of this state. An index is a label associated with an axis of the tensor representation of a state; the indices of a tensor determine its connectivity in the context of a tensor network.
-
num_wires
¶ Returns the number of wires connected to this state.
Methods
tensor
([dtype])Returns the tensor representation of this state.
-
tensor
(dtype: numpy.dtype = <class 'numpy.complex128'>) → Union[jet.bindings.TensorC64, jet.bindings.TensorC128]¶ Returns the tensor representation of this state.
- Parameters
dtype (np.dtype) – Data type of the tensor.
code/api/jet.Qudit
Download Python script
Download Notebook
View on GitHub