French
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

Gradient

class Gradient(grad_method='param_shift', **kwargs)[source]

Bases : GradientBase

Convert an operator expression to the first-order gradient.

Paramètres
  • grad_method (Union[str, CircuitGradient]) – The method used to compute the state/probability gradient. Can be either 'param_shift' or 'lin_comb' or 'fin_diff'. Ignored for gradients w.r.t observable parameters.

  • kwargs (dict) – Optional parameters for a CircuitGradient

Lève

ValueError – If method != fin_diff and epsilon is not None.

Methods Defined Here

convert

type operator

OperatorBase

get_gradient

Get the gradient for the given operator w.r.t.

Attributes

grad_method

Returns CircuitGradient.

Type renvoyé

CircuitGradient

Renvoie

CircuitGradient.