PauliEvolutionGate#
- class qiskit.circuit.library.PauliEvolutionGate(operator, time=1.0, label=None, synthesis=None)[Quellcode]#
Bases:
Gate
Time-evolution of an operator consisting of Paulis.
For an operator \(H\) consisting of Pauli terms and (real) evolution time \(t\) this gate implements
\[U(t) = e^{-itH}.\]This gate serves as a high-level definition of the evolution and can be synthesized into a circuit using different algorithms.
The evolution gates are related to the Pauli rotation gates by a factor of 2. For example the time evolution of the Pauli \(X\) operator is connected to the Pauli \(X\) rotation \(R_X\) by
\[U(t) = e^{-itX} = R_X(2t).\]Examples:
from qiskit.circuit import QuantumCircuit from qiskit.circuit.library import PauliEvolutionGate from qiskit.opflow import I, Z, X # build the evolution gate operator = (Z ^ Z) - 0.1 * (X ^ I) evo = PauliEvolutionGate(operator, time=0.2) # plug it into a circuit circuit = QuantumCircuit(2) circuit.append(evo, range(2)) print(circuit.draw())
The above will print (note that the
-0.1
coefficient is not printed!):ββββββββββββββββββββββββββββ q_0: β€0 β β exp(-it (ZZ + XI))(0.2) β q_1: β€1 β ββββββββββββββββββββββββββββ
References:
[1] G. Li et al. Paulihedral: A Generalized Block-Wise Compiler Optimization Framework For Quantum Simulation Kernels (2021). [arXiv:2109.03371]
- Parameter:
operator (Pauli | PauliOp | SparsePauliOp | PauliSumOp | list) β The operator to evolve. Can also be provided as list of non-commuting operators where the elements are sums of commuting operators. For example:
[XY + YX, ZZ + ZI + IZ, YY]
.time (Union[int, float, ParameterExpression]) β The evolution time.
label (Optional[str]) β A label for the gate to display in visualizations. Per default, the label is set to
exp(-it <operators>)
where<operators>
is the sum of the Paulis. Note that the label does not include any coefficients of the Paulis. See the class docstring for an example.synthesis (Optional[EvolutionSynthesis]) β A synthesis strategy. If None, the default synthesis is the Lie-Trotter product formula with a single repetition.
Attributes
- condition_bits#
Get Clbits in condition.
- decompositions#
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
- definition#
Return definition in terms of other basic gates.
- duration#
Get the duration.
- label#
Return instruction label
- name#
Return the name.
- num_clbits#
Return the number of clbits.
- num_qubits#
Return the number of qubits.
- params#
return instruction params.
- time#
Return the evolution time as stored in the gate parameters.
- RΓΌckgabe:
The evolution time.
- unit#
Get the time unit of duration.
Methods
- validate_parameter(parameter)[Quellcode]#
Gate parameters should be int, float, or ParameterExpression
- RΓΌckgabetyp: