About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
VariationalPrinciple
class VariationalPrinciple(qgt, gradient)
Bases: abc.ABC
A Variational Principle class. It determines the time propagation of parameters in a quantum state provided as a parametrized quantum circuit (ansatz).
qgt
gradient
Parameters
- qgt (
BaseQGT
) – Instance of a class used to compute the GQT. - gradient (
BaseEstimatorGradient
) – Instance of a class used to compute the state gradient.
Methods Defined Here
evolution_gradient
abstract VariationalPrinciple.evolution_gradient(hamiltonian, ansatz, param_values, gradient_params=None)
Calculates an evolution gradient according to the rules of this variational principle.
Parameters
- hamiltonian – Operator used for Variational Quantum Time Evolution.
- ansatz – Quantum state in the form of a parametrized quantum circuit.
- param_values – Values of parameters to be bound.
- gradient_params – List of parameters with respect to which gradients should be computed. If
None
given, gradients w.r.t. all parameters will be computed.
Returns
An evolution gradient.
metric_tensor
VariationalPrinciple.metric_tensor(ansatz, param_values)
Calculates a metric tensor according to the rules of this variational principle.
Parameters
- ansatz – Quantum state in the form of a parametrized quantum circuit.
- param_values – Values of parameters to be bound.
Returns
Metric tensor.
Raises
AlgorithmError – If a QFI job fails.
Was this page helpful?
Report a bug or request content on GitHub.