Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

qiskit.algorithms.time_evolvers.variational


Variational Quantum Time Evolutions

qiskit.algorithms.time_evolvers.variational

Algorithms for performing Variational Quantum Time Evolution of quantum states, which can be tailored to near-term devices. VarQTE base class exposes an interface, compliant with the Quantum Time Evolution Framework in Qiskit Terra, that is implemented by VarQRTE and VarQITE classes for real and imaginary time evolution respectively. The variational approach is taken according to a variational principle chosen by a user.

Example

import numpy as np
 
from qiskit.algorithms import TimeEvolutionProblem, VarQITE
from qiskit.algorithms.time_evolvers.variational import ImaginaryMcLachlanPrinciple
from qiskit.circuit.library import EfficientSU2
from qiskit.quantum_info import SparsePauliOp
 
observable = SparsePauliOp.from_list(
    [
        ("II", 0.2252),
        ("ZZ", 0.5716),
        ("IZ", 0.3435),
        ("ZI", -0.4347),
        ("YY", 0.091),
        ("XX", 0.091),
    ]
)
 
ansatz = EfficientSU2(observable.num_qubits, reps=1)
init_param_values = np.zeros(len(ansatz.parameters))
for i in range(len(ansatz.parameters)):
    init_param_values[i] = np.pi / 2
var_principle = ImaginaryMcLachlanPrinciple()
time = 1
evolution_problem = TimeEvolutionProblem(observable, time)
var_qite = VarQITE(ansatz, var_principle, init_param_values)
evolution_result = var_qite.evolve(evolution_problem)

Variational Principles

With variational principles we can project time evolution of a quantum state onto the parameters of a model, in our case a variational quantum circuit.

They can be divided into two categories: Variational Quantum _Real_ Time Evolution, which evolves the variational ansatz under the standard Schroediger equation and Variational Quantum _Imaginary_ Time Evolution, which evolves under the normalized Wick-rotated Schroedinger equation.

VariationalPrinciple(qgt, gradient)A Variational Principle class.
RealVariationalPrinciple(qgt, gradient)Class for a Real Variational Principle.
ImaginaryVariationalPrinciple(qgt, gradient)Abstract class for an Imaginary Variational Principle.
RealMcLachlanPrinciple([qgt, gradient])Class for a Real McLachlan's Variational Principle.
ImaginaryMcLachlanPrinciple([qgt, gradient])Class for an Imaginary McLachlan's Variational Principle.

ODE solvers

ODE solvers that implement the SciPy ODE Solver interface. The Forward Euler Solver is a preferred choice in the presence of noise. One might also use solvers provided by SciPy directly, e.g. RK45.

ForwardEulerSolver(function, t0, y0, t_bound)Forward Euler ODE solver.
Was this page helpful?
Report a bug or request content on GitHub.