supergrad.utils.gates.expand_operator

supergrad.utils.gates.expand_operator#

supergrad.utils.gates.expand_operator(oper, n, targets, dims=None, cyclic_permutation=False)[source]#

Expand an operator to one that acts on a system with desired dimensions.

SuperGrad-supported implementation of qutip_qip.operations.gates.expand_operator().

Original docstring below.

Parameters:
  • oper (qutip.Qobj) – An operator that act on the subsystem, has to be an operator and the dimension matches the tensored dims Hilbert space e.g. oper.dims = [[2, 3], [2, 3]]

  • dims (list) – A list of integer for the dimension of each composite system. E.g [2, 3, 2, 3, 4].

  • targets (int or list of int) – The indices of subspace that are acted on. Permutation can also be realized by changing the orders of the indices.

  • cyclic_permutation (boolean, optional) – Deprecated. Expand for all cyclic permutation of the targets. E.g. if N=3 and oper is a 2-qubit operator, the result will be a list of three operators, each acting on qubits 0 and 1, 1 and 2, 2 and 0.

Returns:

expanded_oper – The expanded operator acting on a system with desired dimension.

Return type:

qutip.Qobj