pow(base, z=1, lazy=True, do_queue=True, id=None)¶
Raise an Operator to a power.
base (Operator) – the operator to be raised to a power
z=1 (float) – the exponent
- Keyword Arguments
lazy=True (bool) – In lazy mode, all operations are wrapped in a
Powclass and handled later. If
lazy=False, operation-specific simplifications are first attempted.
do_queue (bool) – indicates whether the operator should be recorded when created in a tape context
id (str) – custom label given to an operator instance, can be useful for some applications where the instance has to be identified
>>> qml.pow(qml.PauliX(0), 0.5) PauliX(wires=)**0.5 >>> qml.pow(qml.PauliX(0), 0.5, lazy=False) SX(wires=) >>> qml.pow(qml.PauliX(0), 0.1, lazy=False) PauliX(wires=)**0.1 >>> qml.pow(qml.PauliX(0), 2, lazy=False) Identity(wires=)
Lazy behavior can also be accessed via
op ** z.
- What is PennyLane?
- Quantum circuits
- Gradients and training
- Quantum operators
- Inspecting circuits
- Compiling circuits
- Quantum Chemistry