Encodes the array x into a set of binary-encoded variables described by
the shape of a Hilbert space. The i-th element of x will be encoded in
{code}`ceil(log2(shape[i]))` bits.
Parameters:
hilbert (DiscreteHilbert) – Hilbert space of the samples that are to be encoded.