Skip to main contentIBM Quantum Documentation
This page is from the dev version of Qiskit SDK. Go to the stable version

evolved_operator_ansatz

class qiskit.circuit.library.evolved_operator_ansatz(operators, reps=1, evolution=None, insert_barriers=False, name='EvolvedOps', parameter_prefix='t', remove_identities=True, flatten=None)

GitHub

Bases:

Construct an ansatz out of operator evolutions.

For a set of operators [O1,...,OJ][O_1, ..., O_J] and RR repetitions (reps), this circuit is defined as

r=1R(j=J1eiθj,rOj)\prod_{r=1}^{R} \left( \prod_{j=J}^1 e^{-i\theta_{j, r} O_j} \right)

where the exponentials exp(iθOj)exp(-i\theta O_j) are expanded using the product formula specified by evolution.

Examples

from qiskit.circuit.library import evolved_operator_ansatz
from qiskit.quantum_info import Pauli
 
ops = [Pauli("ZZI"), Pauli("IZZ"), Pauli("IXI")]
ansatz = evolved_operator_ansatz(ops, reps=3, insert_barriers=True)
ansatz.draw("mpl")
../_images/qiskit-circuit-library-evolved_operator_ansatz-1.png

Parameters

  • operators (BaseOperator | Sequence[BaseOperator]) – The operators to evolve. Can be a single operator or a sequence thereof.
  • reps (int) – The number of times to repeat the evolved operators.
  • evolution (EvolutionSynthesis | None) – A specification of which evolution synthesis to use for the PauliEvolutionGate. Defaults to first order Trotterization. Note, that operators of type Operator are evolved using the HamiltonianGate, as there are no Hamiltonian terms to expand in Trotterization.
  • insert_barriers (bool) – Whether to insert barriers in between each evolution.
  • name (str) – The name of the circuit.
  • parameter_prefix (str | Sequence[str]) – Set the names of the circuit parameters. If a string, the same prefix will be used for each parameters. Can also be a list to specify a prefix per operator.
  • remove_identities (bool) – If True, ignore identity operators (note that we do not check Operator inputs). This will also remove parameters associated with identities.
  • flatten (bool | None) – If True, a flat circuit is returned instead of nesting it inside multiple layers of gate objects. Setting this to False is significantly less performant, especially for parameter binding, but can be desirable for a cleaner visualization.

Return type

QuantumCircuit

Was this page helpful?
Report a bug or request content on GitHub.