![]() |
Returns an identity matrix reshaped into a tensor.
cirq.eye_tensor(
half_shape: Tuple[int, ...], *, dtype: 'DTypeLike'
) -> np.ndarray
Args | |
---|---|
half_shape
|
A tuple representing the number of quantum levels of each
qubit the returned matrix applies to. half_shape is (2, 2, 2) for
a three-qubit identity operation tensor.
|
dtype
|
The numpy dtype of the new array. |
Returns | |
---|---|
The created numpy array with shape half_shape + half_shape .
|