Skip to main content
IBM Quantum Platform
Esta página pertenece a una versión antigua de Qiskit SDK y no existe en la versión más reciente. Te recomendamos que actualices a la última versión. Consulta las notas de la versión para obtener más información.

VariationalPrinciple

class qiskit.algorithms.time_evolvers.variational.VariationalPrinciple(qgt, gradient)

GitHub

Bases: ABC

A Variational Principle class. It determines the time propagation of parameters in a quantum state provided as a parametrized quantum circuit (ansatz).

qgt

Instance of a class used to compute the GQT.

Type

BaseQGT

gradient

Instance of a class used to compute the state gradient.

Type

BaseEstimatorGradient

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

evolution_gradient

abstract evolution_gradient(hamiltonian, ansatz, param_values, gradient_params=None)

Calculates an evolution gradient according to the rules of this variational principle.

Parameters

  • 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.

Returns

An evolution gradient.

Return type

np.ndarray

metric_tensor

metric_tensor(ansatz, param_values)

Calculates a metric tensor according to the rules of this variational principle.

Parameters

  • ansatz (QuantumCircuit) – Quantum state in the form of a parametrized quantum circuit.
  • param_values (Sequence[float]) – Values of parameters to be bound.

Returns

Metric tensor.

Raises

AlgorithmError – If a QFI job fails.

Return type

Sequence[float]

¿Le ha resultado útil esta página?
Informe de un error, de una errata o solicite contenido en GitHub.