VariationalPrinciple#
- class qiskit.algorithms.time_evolvers.variational.VariationalPrinciple(qgt, gradient)[source]#
Bases :
ABC
A Variational Principle class. It determines the time propagation of parameters in a quantum state provided as a parametrized quantum circuit (ansatz).
- gradient#
Instance of a class used to compute the state gradient.
- Type:
- Paramètres:
qgt (BaseQGT) – Instance of a class used to compute the GQT.
gradient (BaseEstimatorGradient) – Instance of a class used to compute the state gradient.
Methods
- abstract evolution_gradient(hamiltonian, ansatz, param_values, gradient_params=None)[source]#
Calculates an evolution gradient according to the rules of this variational principle.
- Paramètres:
hamiltonian (BaseOperator) – Operator used for Variational Quantum Time Evolution.
ansatz (QuantumCircuit) – Quantum state in the form of a parametrized quantum circuit.
param_values (Sequence[float]) – Values of parameters to be bound.
gradient_params (Sequence[Parameter] | None) – List of parameters with respect to which gradients should be computed. If
None
given, gradients w.r.t. all parameters will be computed.
- Renvoie:
An evolution gradient.
- Type renvoyé:
np.ndarray
- metric_tensor(ansatz, param_values)[source]#
Calculates a metric tensor according to the rules of this variational principle.
- Paramètres:
ansatz (QuantumCircuit) – Quantum state in the form of a parametrized quantum circuit.
param_values (Sequence[float]) – Values of parameters to be bound.
- Renvoie:
Metric tensor.
- Lève:
AlgorithmError – If a QFI job fails.
- Type renvoyé:
Sequence[float]