kron

Graph.kron(x, y, *, name=None)

Calculate the Kronecker product between np.ndarrays, Tensors, Pwcs, or Stfs.

If any of the inputs is a Pwc or Stf, the output is also a Pwc or Stf (mixing Pwcs and Stfs is not supported). Otherwise, the output is a Tensor.

This operation supports broadcasting between the batch dimensions of the two input objects. All the dimensions with the exception of the two innermost ones (where the Kronecker product is performed) are considered batch dimensions.

When operating a tensor-like object with an Stf or a Pwc, the time dimension of the latter is ignored.

Parameters

  • x (np.ndarray or Tensor or Pwc or Stf) – The left multiplicand. It must be a have at least two dimensions.
  • y (np.ndarray or Tensor or Pwc or Stf) – The right multiplicand. It must be a have at least two dimensions.
  • name (str or None , optional) – The name of the node. You can only provide a name if neither x nor y are Stfs.

Returns

The Kronecker product of the input objects. If any of the input objects is a Pwc or Stf, the returned objects has the same type. Otherwise, it is a Tensor.

Return type

Tensor or Pwc or Stf

SEE ALSO

Graph.embed_operators : Embed operators into a larger Hilbert space.

Graph.kronecker_product_list : Kronecker product of a list of operators.

Graph.pauli_kronecker_product : Embed Pauli matrices into a larger Hilbert space.

Was this useful?