# CircuitGradient

`qiskit.opflow.gradients.CircuitGradient`

Bases: `ConverterBase`

Deprecated: Circuit to gradient operator converter.

Converter for changing parameterized circuits into operators whose evaluation yields the gradient with respect to the circuit parameters.

This is distinct from DerivativeBase converters which take gradients of composite operators and handle things like differentiating combo_fn’s and enforcing product rules when operator coefficients are parameterized.

CircuitGradient - uses quantum techniques to get derivatives of circuits DerivativeBase - uses classical techniques to differentiate operator flow data structures

The class `qiskit.opflow.gradients.circuit_gradients.circuit_gradient.CircuitGradient`

is deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. For code migration guidelines, visit https://qisk.it/opflow_migration (opens in a new tab).

## Methods

### convert

`abstract convert(operator, params=None)`

**Parameters**

**operator**(*OperatorBase*) – The operator we are taking the gradient of**params**(*ParameterExpression**|**ParameterVector**|**List*(opens in a new tab)*[**ParameterExpression**] |**Tuple*(opens in a new tab)*[**ParameterExpression**,**ParameterExpression**] |**List*(opens in a new tab)*[**Tuple*(opens in a new tab)*[**ParameterExpression**,**ParameterExpression**]] | None*) – The parameters we are taking the gradient wrt: ω If a ParameterExpression, ParameterVector or List[ParameterExpression] is given, then the 1st order derivative of the operator is calculated. If a Tuple[ParameterExpression, ParameterExpression] or List[Tuple[ParameterExpression, ParameterExpression]] is given, then the 2nd order derivative of the operator is calculated.

**Returns**

An operator whose evaluation yields the Gradient.

**Raises**

**ValueError** (opens in a new tab) – If `params`

contains a parameter not present in `operator`

.

**Return type**