dq.zeros
zeros(*dims: int, layout: Layout | None = None) -> QArray
Returns the null operator.
If multiple dimensions are provided , it returns the null operator of the composite Hilbert space of dimension :
Parameters
-
*dims
–
Hilbert space dimension of each subsystem.
-
layout
–
Matrix layout (
dq.dense
,dq.dia
orNone
).
Returns
(qarray of shape (n, n)) Null operator, with n = prod(dims).
Examples
Single-mode :
>>> dq.zeros(4)
QArray: shape=(4, 4), dims=(4,), dtype=complex64, layout=dia, ndiags=0
[[ ⋅ ⋅ ⋅ ⋅ ]
[ ⋅ ⋅ ⋅ ⋅ ]
[ ⋅ ⋅ ⋅ ⋅ ]
[ ⋅ ⋅ ⋅ ⋅ ]]
Multi-mode :
>>> dq.zeros(2, 3)
QArray: shape=(6, 6), dims=(2, 3), dtype=complex64, layout=dia, ndiags=0
[[ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ]
[ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ]
[ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ]
[ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ]
[ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ]
[ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ]]
See also
dq.zeros_like()
: returns the null operator in the Hilbert space of the input.