RealMcLachlanPrinciple#
- class qiskit.algorithms.time_evolvers.variational.RealMcLachlanPrinciple(qgt=None, gradient=None)[código fonte]#
Bases:
RealVariationalPrinciple
Class for a Real McLachlan’s Variational Principle. It aims to minimize the distance between both sides of the Schrödinger equation with a quantum state given as a parametrized trial state. The principle leads to a system of linear equations handled by a linear solver. The real variant means that we consider real time dynamics.
- Parâmetros:
qgt (BaseQGT | None) – Instance of a the GQT class used to compute the QFI. If
None
provided,LinCombQGT
is used.gradient (BaseEstimatorGradient | None) – Instance of a class used to compute the state gradient. If
None
provided,LinCombEstimatorGradient
is used.
- Levanta:
AlgorithmError – If the gradient instance does not contain an estimator.
Methods
- evolution_gradient(hamiltonian, ansatz, param_values, gradient_params=None)[código fonte]#
Calculates an evolution gradient according to the rules of this variational principle.
- Parâmetros:
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.
- Retorno:
An evolution gradient.
- Levanta:
AlgorithmError – If a gradient job fails.
- Tipo de retorno:
np.ndarray