qiskit.algorithms.VQD.get_energy_evaluation¶
- VQD.get_energy_evaluation(step, operator, return_expectation=False, prev_states=None)[source]¶
Returns a function handle to evaluates the energy at given parameters for the ansatz.
This return value is the objective function to be passed to the optimizer for evaluation.
- প্যারামিটার
step (int) -- level of energy being calculated. 0 for ground, 1 for first excited state...
operator (OperatorBase) -- The operator whose energy to evaluate.
return_expectation (bool) -- If True, return the
ExpectationBase
expectation converter used in the construction of the expectation value. Useful e.g. to evaluate other operators with the same expectation value converter.prev_states (list[np.ndarray] | None) -- List of parameters from previous rounds of optimization.
- রিটার্নস
A callable that computes and returns the energy of the hamiltonian of each parameter, and, optionally, the expectation
- রেইজেস
RuntimeError -- If the circuit is not parameterized (i.e. has 0 free parameters).
AlgorithmError -- If operator was not provided.
- রিটার্ন টাইপ
Callable[[np.ndarray], float | list[float]] | tuple[Callable[[np.ndarray], float | list[float]], ExpectationBase]