jet.Gate

class Gate(name: str, num_wires: int, dim: int, params: Optional[List[float]] = None)[source]

Bases: abc.ABC

Gate represents a quantum gate.

Parameters
  • name (str) – Name of the gate.

  • num_wires (int) – Number of wires the gate is applied to.

  • dim (int) – Dimension of the gate. This should match the dimension of the qudits the gate can be applied to.

  • params (List[float] or None) – Parameters of the gate.

Raises

ValueError – If the dimension is invalid.

dimension

Returns the dimension of this gate.

indices

Returns the indices of this gate.

num_wires

Returns the number of wires this gate acts on.

params

Returns the parameters of this gate.

dimension

Returns the dimension of this gate.

indices

Returns the indices of this gate. An index is a label associated with an axis of the tensor representation of a gate; the indices of a tensor determine its connectivity in the context of a tensor network.

num_wires

Returns the number of wires this gate acts on.

params

Returns the parameters of this gate.

tensor([dtype])

Returns the tensor representation of this gate.

tensor(dtype: numpy.dtype = <class 'numpy.complex128'>)Union[jet.bindings.TensorC64, jet.bindings.TensorC128][source]

Returns the tensor representation of this gate.

Parameters

dtype (np.dtype) – Data type of the tensor.