Skip to main contentIBM Quantum Documentation

LearningRate

qiskit.algorithms.optimizers.optimizer_utils.LearningRate(learning_rate)

Bases: Generator (opens in a new tab)

Represents a Learning Rate. Will be an attribute of GradientDescentState. Note that GradientDescent also has a learning rate. That learning rate can be a float, a list, an array, a function returning a generator and will be used to create a generator to be used during the optimization process. This class wraps Generator so that we can also access the last yielded value.

Parameters

learning_rate (float (opens in a new tab) |list (opens in a new tab)[float (opens in a new tab)] | np.ndarray | Callable[[], Generator[float (opens in a new tab), None, None]]) – Used to create a generator to iterate on.


Attributes

current

Returns the current value of the learning rate.


Methods

close

close()

Raise GeneratorExit inside generator.

send

send(value)

Send a value into the generator. Return next yielded value or raise StopIteration.

throw

throw(typ, val=None, tb=None)

Raise an exception in the generator. Return next yielded value or raise StopIteration.

Was this page helpful?