# This code is part of Qiskit.
#
#
# obtain a copy of this license in the LICENSE.txt file in the root directory
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""The base interface for Aqua's gradient."""

from typing import Union

"""Base class for first-order operator gradient.

Convert an operator expression to the first-order gradient.
"""

[Doku]    def __init__(self,
**kwargs):
r"""
Args:
grad_method: 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

Raises:
ValueError: If method != fin_diff and epsilon is not None.
"""

epsilon = kwargs.get('epsilon', 1e-6)

else:
raise ValueError("Unrecognized input provided for grad_method. Please provide"
" a CircuitGradient object or one of the pre-defined string"
" arguments: {'param_shift', 'fin_diff', 'lin_comb'}. ")

@property
"""Returns CircuitGradient.
CircuitGradient.