tensor_out_inp_shape_from_signature#
View source on GitHub
|
Returns a tuple for tensor data corresponding to signature.
qualtran.simulation.tensor.tensor_out_inp_shape_from_signature(
signature: qualtran.Signature
) -> Tuple[Tuple[int, ...], Tuple[int, ...]]
Tensor data for a bloq with a given signature can be expressed as a ndarray of
shape out_indices_shape + inp_indices_shape where
out_indices_shape - A tuple of values
2 ** soq.reg.bitsizefor every soquetsoqcorresponding to the RIGHT registers in signature.inp_indices_shape - A tuple of values
2 ** soq.reg.bitsizefor every soquetsoqcorresponding to the LEFT registers in signature.
This method returns a tuple of (out_indices_shape, inp_indices_shape).
View source on GitHub