Reset#

class torchquantum.operator.Reset(has_params: bool = False, trainable: bool = False, init_params=None, n_wires=None, wires=None, inverse=False)[source]#

Bases: Operator

Class for Reset gate.

__init__(has_params: bool = False, trainable: bool = False, init_params=None, n_wires=None, wires=None, inverse=False)#

__init__ function for Operator.

Parameters:
  • has_params (bool, optional) – Whether the operations has parameters. Defaults to False.

  • trainable (bool, optional) – Whether the parameters are trainable (if contains parameters). Defaults to False.

  • init_params (torch.Tensor, optional) – Initial parameters. Defaults to None.

  • n_wires (int, optional) – Number of qubits. Defaults to None.

  • wires (Union[int, List[int]], optional) – Which qubit the operation is applied to. Defaults to None.

Methods

static func(q_device: None, wires, inverse=False)#

Attributes

num_params = 0#
num_wires = -1#
op_name = 'reset'#
training: bool#